Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Issue 2733593002: Text control elements should contain all (shadow DOM) children. (Closed)

Created:
3 years, 9 months ago by mstensho (USE GERRIT)
Modified:
3 years, 9 months ago
Reviewers:
Xianzhu, eae
CC:
chromium-reviews, szager+layoutwatch_chromium.org, zoltan1, blink-reviews-layout_chromium.org, pdr+renderingwatchlist_chromium.org, eae+blinkwatch, leviw+renderwatch, jchaffraix+rendering, blink-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Text control elements should contain all (shadow DOM) children. For instance, INPUT type="search" elements allow styling of the cancel button, via a ::-webkit-search-cancel-button pseudo element selector. We don't want authors to be able to escape the containing INPUT element by styling the cancel button as position:absolute, etc. Force INPUT and other text control elements to be in the containing block chain of all its descendants. This should be a good idea in general (and at least harmless), and there's also C++ code [1] that essentially assumes that it is so. Since this change makes canContainFixedPositionObjects() in LayoutObject and ComputedStyle even more different than they used to be, we need to change some code from using the one in ComputedStyle to the one in LayoutObject. Two existing tests in fast/forms/ had to be updated, since they were adding together offsetLeft of an INPUT element and offsetLeft of something inside the INPUT element in a way that used to work by accident. Use getBoundingClientRect() instead, since the test ultimately wants absolute coordinates anyway. [1] See ThemePainterDefault::paintSearchFieldCancelButton() BUG=685527 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Review-Url: https://codereview.chromium.org/2733593002 Cr-Commit-Position: refs/heads/master@{#455644} Committed: https://chromium.googlesource.com/chromium/src/+/8f4b7a0506f076b26b76dd6aaf624860a6d3fda1

Patch Set 1 #

Patch Set 2 : rebase master #

Patch Set 3 : Element::userAgentShadowRoot() fails when the shadow root isn't user agent instead of returning nul… #

Patch Set 4 : See if this gets rid of all the assertion failures. #

Patch Set 5 : Use getBoundingClientRect() rather than trying to get it right by adding offsetLeft values. #

Patch Set 6 : Non-LayoutBlock transformed objects are not fixed-descendants containers. #

Patch Set 7 : Improve documentation. #

Messages

Total messages: 34 (27 generated)
mstensho (USE GERRIT)
3 years, 9 months ago (2017-03-08 17:55:12 UTC) #25
Xianzhu
I would ask some questions: 1. Should we apply such rule to all shadow DOM ...
3 years, 9 months ago (2017-03-08 18:20:06 UTC) #26
mstensho (USE GERRIT)
On 2017/03/08 18:20:06, Xianzhu wrote: > I would ask some questions: > 1. Should we ...
3 years, 9 months ago (2017-03-08 19:11:14 UTC) #27
Xianzhu
lgtm. Please also wait for eae@'s feedback. On 2017/03/08 19:11:14, mstensho wrote: > On 2017/03/08 ...
3 years, 9 months ago (2017-03-08 19:20:55 UTC) #28
eae
Good catch, I had assumed we already enforced this. Thank you. LGTM
3 years, 9 months ago (2017-03-09 01:30:10 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2733593002/120001
3 years, 9 months ago (2017-03-09 02:23:32 UTC) #31
commit-bot: I haz the power
3 years, 9 months ago (2017-03-09 02:29:41 UTC) #34
Message was sent while issue was closed.
Committed patchset #7 (id:120001) as
https://chromium.googlesource.com/chromium/src/+/8f4b7a0506f076b26b76dd6aaf62...

Powered by Google App Engine
This is Rietveld 408576698