bar - Dave's Blog

Search
My timeline on Mastodon

Scrollbars in EdgeHtml WebView and Edge browser

2019 Aug 22, 5:35

The scrollbars in UWP WebView and in Edge have different default behavior leading to many emails to my team. (Everything I talk about here is for the EdgeHtml based WebView and Edge browser and does not apply to the Chromium based Edge browser and WebView2).

There is a Edge only -ms-overflow-style CSS property that controls scroll behavior. We have a different default for this in the WebView as compared to the Edge browser. If you want the appearance of the scrollbar in the WebView to match the browser then you must explicitly set that CSS property. The Edge browser default is scrollbar which gives us a Windows desktop styled non-auto-hiding scrollbar. The WebView default is -ms-autohiding-scrollbar which gives a sort of compromise between desktop and UWP app scrollbar behavior. In this configuration it is auto-hiding. When used with the mouse you'll get Windows desktop styled scrollbars and when used with touch you'll get the UWP styled scrollbars.

Since WebViews are intended to be used in apps this style is the default in order to better match the app's scrollbars. However this difference between the browser and WebView has led to confusion.

Here’s an -ms-overflow-style JSFiddle showing the difference between the two styles. Try it in the Edge browser and in WebView. An easy way to try it in the Edge WebView is using the JavaScript Browser.

PermalinkComments

Tweet from Jen Gentleman 🌺

2016 Oct 8, 2:19
In case you were wondering: Yes, the new address bar that was added to RegEdit supports Alt+D to set keyboard focus 😊
PermalinkComments

Retweet of rcallimachi

2016 Jan 7, 2:51
Wow: When is the last time a sitting American president penned an OpEd in the New York Times? Barack Obama just did http://mobile.nytimes.com/2016/01/08/opinion/president-barack-obama-guns-are-our-shared-responsibility.html?emc=edit_na_20160107&nlid=69115476&ref=cta&_r=0&referer= …
PermalinkComments

Retweet of tombkeeper

2015 Nov 11, 11:07
Another demo of our talk "BadBarcode" in PacSec 2015: start a shell by one single boarding pass.
PermalinkComments

Tweet from David_Risney

2015 Aug 4, 10:59
The song Don't You Want Me redone using the only non-titular line you can recall: "Workin' In A Cocktail Bar" https://www.youtube.com/watch?v=X58g1HKxXPo …
PermalinkComments

Retweet of lakey

2015 Aug 3, 2:26
@danbarker Lots more lovely 3D tube maps here: http://bit.ly/1P33Tws 
PermalinkComments

Retweet of paulcbetts

2015 Mar 15, 9:55
@DrPizza Holy shit, they finally caved and added the search bar to the ribbon
PermalinkComments

Retweet of stevefaulkner

2015 Mar 3, 2:49
browser support? "no clue" "I do not understand the point of this type. Neither do browsers." http://quirksmode.org/html5/inputs/mobile.html …
PermalinkComments

Retweet of ericlaw

2015 Feb 1, 6:02
http://www.theonion.com/articles/fingerprints-on-lombardi-trophy-to-be-used-in-doze,37899/ …
PermalinkComments

Debugging anecdote - the color transparent black breaks accessibility

2014 May 22, 10:36

Some time back while I was working on getting the Javascript Windows Store app platform running on Windows Phone (now available on the last Windows Phone release!) I had an interesting bug that in retrospect is amusing.

I had just finished a work item to get accessibility working for JS WinPhone apps when I got a new bug: With some set of JS apps, accessibility appeared to be totally broken. At that time in development the only mechanism we had to test accessibility was a test tool that runs on the PC, connects to the phone, and dumps out the accessibility tree of whatever app is running on the phone. In this bug, the tool would spin for a while and then timeout with an error and no accessibility information.

My first thought was this was an issue in my new accessibility code. However, debugging with breakpoints on my code I could see none of my code was run nor the code that should call it. The code that called that code was a more generic messaging system that hit my breakpoints constantly.

Rather than trying to work backward from the failure point, I decided to try and narrow down the repro and work forwards from there. One thing all the apps with the bug had in common was their usage of WinJS, but not all WinJS apps demonstrated the issue. Using a binary search approach on one such app I removed unrelated app code until all that was left was the app's usage of the WinJS AppBar and the bug still occurred. I replaced the WinJS AppBar usage with direct usage of the underlying AppBar WinRT APIs and continued.

Only some calls to the AppBar WinRT object produced the issue:

        var appBar = Windows.UI.WebUI.Core.WebUICommandBar.getForCurrentView(); 
// appBar.opacity = 1;
// appBar.closeDisplayMode = Windows.UI.WebUI.Core.WebUICommandBarClosedDisplayMode.default;
appBar.backgroundColor = Windows.UI.Colors.white; // Bug!
Just setting the background color appeared to cause the issue and I didn't even have to display the AppBar. Through additional trial and error I was blown away to discover that some colors I would set caused the issue and other colors did not. Black wouldn't cause the issue but transparent black would. So would aqua but not white.

I eventually realized that predefined WinRT color values like Windows.UI.Colors.aqua would cause the issue while JS literal based colors didn't cause the issue (Windows.UI.Color is a WinRT struct which projects in JS as a JS literal object with the struct members as JS object properties so its easy to write something like {r: 0, g: 0, b: 0, a: 0} to make a color) and I had been mixing both in my tests without realizing there would be a difference. I debugged into the backgroundColor property setter that consumed the WinRT color struct to see what was different between Windows.UI.Colors.black and {a: 1, r: 0, g: 0, b: 0} and found the two structs to be byte wise exactly the same.

On a hunch I tried my test app with only a reference to the color and otherwise no interaction with the AppBar and not doing anything with the actual reference to the color: Windows.UI.Colors.black;. This too caused the issue. I knew that the implementation for these WinRT const values live in a DLL and guessed that something in the code to create these predefined colors was causing the issue. I debugged in and no luck. Now I also have experienced crusty code that would do exciting things in its DllMain, the function that's called when a DLL is loaded into the process so I tried modifying my C++ code to simply LoadLibrary the DLL containing the WinRT color definition, windows.ui.xaml.dll and found the bug still occurred! A short lived moment of relief as the world seemed to make sense again.

Debugging into DllMain nothing interesting happened. There were interesting calls in there to be sure, but all of them behind conditions that were false. I was again stumped. On another hunch I tried renaming the DLL and only LoadLibrary'ing it and the bug went away. I took a different DLL renamed it windows.ui.xaml.dll and tried LoadLibrary'ing that and the bug came back. Just the name of the DLL was causing the issue.

I searched for the DLL name in our source code index and found hits in the accessibility tool. Grinning I opened the source to find that the accessibility tool's phone side service was trying to determine if a process belonged to a XAML app or not because XAML apps had a different accessibility contract. It did this by checking to see if windows.ui.xaml.dll was loaded in the target process.

At this point I got to fix my main issue and open several new bugs for the variety of problems I had just run into. This is a how to on writing software that is difficult to debug.

PermalinkCommentsbug debug javascript JS technical windows winrt

YouTube - Dead Man’s Bones (Dance) Nathan Barnatt has...

2014 May 19, 3:21


YouTube - Dead Man’s Bones (Dance)

Nathan Barnatt has some great videos

PermalinkCommentsNathan-barnatt video dance

URI functions in Windows Store Applications

2013 Jul 25, 1:00PermalinkCommentsc# c++ javascript technical uri windows windows-runtime windows-store

wilwheaton: cameron-stewart: My contribution in full to the...

2013 Apr 4, 5:34








wilwheaton:

cameron-stewart:

My contribution in full to the #bartkira project. This was tons of fun to do.

Holy shit.

Everything’s coming up Milhouse

PermalinkCommentshumor comic art mashup simpsons akira

Attention:!!!, Behold, you are reading a letter from your President Barack Obama.

2012 Sep 26, 2:43

Eric gets the most entertaining mail.

You have failed to comply with them after all the warning and instructions given to you, but since you are also among the terrorist we are facing in the country, I will personal make sure that I wipe away the crime in the state and I promise you that you will definitely pay with your life because I am here to protect the interest of my people and not to put them in shame, you suppose to support this government and not to spoil it.

PermalinkCommentshumor spam scam email eric-law

Nathan Barnatt makes awesome videos. This is a playlist of my...

2012 Sep 26, 2:21


Nathan Barnatt makes awesome videos. This is a playlist of my favorites of his. (via http://www.youtube.com/playlist?list=PLIjrVnNvXzb8N5tjV3fowJqYwuDM__WVf)

PermalinkCommentsNathan-barnatt video music dance humor

Stuxnet Explained - Obama Order Sped Up Wave of Cyberattacks Against Iran

2012 Jun 1, 4:57

From his first months in office, President Obamasecretly ordered increasingly sophisticated attacks on the computer systems that run Iran’s main nuclear enrichment facilities, significantly expanding America’s first sustained use of cyberweapons, according to participants in the program.

PermalinkCommentssecurity politics iran nuclear virus

Raising the bar on web uploads

2012 Apr 25, 5:00

Flickr’s new HTML5-ish photo upload feature technical overview.

PermalinkCommentstechnical html html5 javascript css3 css flickr file-upload

Slow Jam The News with Barack Obama: Late Night with Jimmy...

2012 Apr 25, 3:45


Slow Jam The News with Barack Obama: Late Night with Jimmy Fallon (by latenight)

PermalinkCommentshumor president jimmy-fallon barack-obama loan

The Dancebulance - Gov Ball 2012 Lineup (by...

2012 Apr 18, 6:10


The Dancebulance - Gov Ball 2012 Lineup (by nathanjbarnatt)

Another Nathan Barnatt video with awesome music and dance moves.  Also enjoying the music video for third song in this video “Barbara Streisand” by Duck Sauce: http://www.youtube.com/watch?v=uu_zwdmz0hE

PermalinkCommentshumor music dance nathan-barnatt video

Madeon - Pop Culture (Dance Video) (by nathanjbarnatt)

2012 Apr 17, 12:21


Madeon - Pop Culture (Dance Video) (by nathanjbarnatt)

PermalinkCommentshumor dance video nathan-barnatt madeon
Older Entries Creative Commons License Some rights reserved.