New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 668050 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 3
Type: Feature



Sign in to add a comment

horizontal scrollbar appears on input textfield when browser default stylesheet contain ::-webkit-scrollbar

Reported by santosh....@canonical.com, Nov 23 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36

Example URL:
www.google.com

Steps to reproduce the problem:
1. Add following style  in third_party/WebKit/Source/core/css/themeChromiumLinux.css
::-webkit-scrollbar {                                                           
    width: 15px;                                                                
    height: 15px;                                                               
    border-color: transparent;                                                  
    background-color : red                                                      
}                                                                               

2. Build chromium/chrome

3. Launch chromium and load www.google.com

4 keep typing characters in input field

5 once text overflows input field, horizontal scrollbar appears.

What is the expected behavior?
input field should not show scrollbar

What went wrong?
Rendering of pseudo element ::-webkit-scrollbar specified in 
browser default stylesheet is wrong with input text field.

In attachment red color shows is scrollbar(styled red)

Does it occur on multiple sites: N/A

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 52.0.2743.82  Channel: stable
OS Version: 
Flash Version: Shockwave Flash 23.0 r0

Its not specific to google but applies to input text field.
 
scroll_input_bug.png
54.0 KB View Download
This scrolbar painting is getting triggred by 
0 0x7fa35572256e base::debug::StackTrace::StackTrace()                                                            
#1 0x7fa348b4f96c blink::LayoutScrollbar::createCustomScrollbar()                                                  
#2 0x7fa348d4ba21 blink::PaintLayerScrollableArea::ScrollbarManager::createScrollbar()                             
#3 0x7fa348d4b343 blink::PaintLayerScrollableArea::ScrollbarManager::setHasHorizontalScrollbar()                   
#4 0x7fa348d4b3d2 blink::PaintLayerScrollableArea::setHasHorizontalScrollbar()                                     
#5 0x7fa348d4bfa7 blink::PaintLayerScrollableArea::updateAfterStyleChange()                                        
#6 0x7fa348d384d3 blink::PaintLayer::styleDidChange()                                                              
#7 0x7fa348ac8f46 blink::LayoutBoxModelObject::styleDidChange()                                                    
#8 0x7fa348ac1f39 blink::LayoutBox::styleDidChange()                                                               
#9 0x7fa348a8d305 blink::LayoutBlock::styleDidChange()                                                             
#10 0x7fa348a9d65b blink::LayoutBlockFlow::styleDidChange()                                                        
#11 0x7fa348b4406c blink::LayoutObject::setStyle()                                                                 
#12 0x7fa3485adf43 blink::LayoutTreeBuilderForElement::createLayoutObject()                                        
#13 0x7fa348584ff8 blink::Element::attachLayoutTree()                                                              
#14 0x7fa34852be67 blink::ContainerNode::attachLayoutTree()                                                        
#15 0x7fa34864a74c blink::ShadowRoot::attachLayoutTree()                                                           
#16 0x7fa34864410e blink::ElementShadow::attach()                                                                  
#17 0x7fa348584eb3 blink::Element::attachLayoutTree()                                                              
#18 0x7fa3488285ee blink::HTMLFormControlElement::attachLayoutTree()                                               
#19 0x7fa34884c259 blink::HTMLInputElement::attachLayoutTree()                                                     
#20 0x7fa34852be67 blink::ContainerNode::attachLayoutTree()                                                        
#21 0x7fa348584ebe blink::Element::attachLayoutTree()        

Comment 2 by ajha@chromium.org, Nov 24 2016

Components: Blink
Labels: M-57
Targetting this for M-57.


Comment 3 by hdodda@chromium.org, Nov 28 2016

Cc: hdodda@chromium.org
Labels: Needs-Feedback
Could you please provide the sample html file to reproduce the issue , and also please upgradee the chrome browser to the latest stable and check if you are still able to reproduce the issue .

Thanks!

Comment 4 by rbyers@chromium.org, Nov 28 2016

Cc: bokan@chromium.org
Components: -Blink Blink>Layout>Scrollbars
Labels: -Needs-Feedback -M-57
Re #3: This is a developer building chromium themselves, so no sample/upgrade possible.

I tested something similar at http://jsbin.com/xaqizi/edit and don't see the issue, so this is probably specific to modifying the user-agent stylesheet (perhaps it pierces shadowDom). Note that <input> is a ScrollableArea so it makes sense that it could be coaxed into displaying scrollbars due to custom theming.

This is probably pretty low priority for scrollbar folks since this doesn't pertain to code actually landed in the trunk of chromium.  But maybe someone will have a tip for what else you'd need to modify to do what you want, or how there might actually be a bug lurking here that does impact official chromium somehow.


Comment 5 by bokan@chromium.org, Nov 28 2016

rbyers@'s probably right, I think the UA style sheet pierces through shadow DOM so your custom scrollbar style is being applied to the input box. That said, I don't see any -webkit-scrollbar selectors applied to input boxes so I'm not sure how the scrollbars are prevented in the first place. You could try adding a scrollbar selector to html.css (https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/css/html.css?q=webkit-appearance+file:third_party/WebKit/.*.css&sq=package:chromium&dr=C&l=417) for input fields that |display: none|'s the scrollbars and see if that works.

Alternatively, if you want to figure out where they're coming from, breaking/logging from PaintLayerScrollableArea::computeScrollarExistence if the layoutBox()->element() is the <input> to determine why they get created with your CSS selector vs without would be where to look.
I did some initial inverstigation and feels might help you guys in fixing that.

So computeScrollarExistence tells it should have horizontal scrollbar and it does so because https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.h?rcl=0&l=107   return true.

It feels that above check is not complete for overflow and 
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/LayoutBox.h?rcl=1480378899&l=1027    looks better check.
if I implement LayoutTextControlSingleLine is same way as 
https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/LayoutBox.h?rcl=1480378899&l=1027 , Bug is not happening.

But I am not sure of other side effect but using a complete check from LayoutBox fixes the issue
 
and yes this bug happens only in case when default browser stylesheet is changed(html.css ot themeChxxx.css).

Comment 8 by bokan@chromium.org, Nov 29 2016

Hmm, I'm not sure what's happening in that case, the textBlock always has `overflow: scroll` set on its style so it shouldn't make a difference. These methods were different on purpose because scrollsOverflowX|Y used to depend on having a scrollbar. I think this code has changed since those days so we're probably fine to remove the override in LayoutTextControlSingleLine (at least for the X direction).

I did find https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp?rcl=1480407415&l=339 which is how scrollbars are usually hidden here. This is applying a `::-webkit-scrollbar { display: none; }` style to the textBlock so that scrollbars are invisible, I believe the style you added to the UA style sheet overrides this.

There is probably a way to modify your UA style selector to not match elements in a shadow tree but I don't know enough about CSS and ShadowDOM to know off-hand how to do this. If you don't know about shadow DOM, this link is probably useful: https://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201/ but I haven't read it in detail myself so I don't know if the answer is in there.

Comment 9 by e...@chromium.org, Dec 2 2016

Labels: -Pri-2 -Type-Compat Pri-3 Type-Feature
Status: Available (was: Unconfirmed)
Project Member

Comment 10 by sheriffbot@chromium.org, Dec 11 2017

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 11 by e...@chromium.org, Dec 13 2017

Status: WontFix (was: Untriaged)

Sign in to add a comment