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

Issue 668592 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 667575



Sign in to add a comment

querySelectorAll does not work correctly with editable styles

Project Member Reported by xiaoche...@chromium.org, Nov 25 2016

Issue description

Layout test imported/wpt/html/semantics/selectors/pseudo-classes/readwrite-readonly.html inspects hasEditableStyle from querySelectorAll, but the inspection is done in dirty style. It fails if we update style in hasEditableStyles.

The cause is that both querySelectorAll and updateStyleAndLayoutTree try to setup Document::nthIndexCache, resulting in a conflict.
 
Labels: -Pri-3 Pri-2
Owner: yosin@chromium.org
Status: Started (was: Untriaged)
Stack trace:

#9 0x7f67faa29f57 blink::hasEditableStyle()
#10 0x7f67fad4d433 blink::HTMLElement::matchesReadWritePseudoClass()
#11 0x7f67fa6c421e blink::SelectorChecker::checkPseudoClass()
#12 0x7f67fa6c1415 blink::SelectorChecker::checkOne()
#13 0x7f67fa6c0e66 blink::SelectorChecker::matchSelector()
#14 0x7f67fa65eed0 blink::SelectorChecker::match()
#15 0x7f67fa6c7745 blink::SelectorChecker::match()
#16 0x7f67fa9776a1 blink::SelectorDataList::selectorMatches()
#17 0x7f67fa9799f6 blink::SelectorDataList::executeForTraverseRoot<>()
#18 0x7f67fa979237 blink::SelectorDataList::findTraverseRootsAndExecute<>()
#19 0x7f67fa977da0 blink::SelectorDataList::execute<>()
#20 0x7f67fa9767f5 blink::SelectorDataList::queryAll()
#21 0x7f67fa9769ad blink::SelectorQuery::queryAll()
#22 0x7f67fa7dc3a6 blink::ContainerNode::querySelectorAll()
#23 0x7f67fb8e7d45 blink::ParentNode::querySelectorAll()

Comment 2 by yosin@chromium.org, Nov 25 2016

Components: -Blink>DOM Blink>Editing
In review: http://crrev.com/2531763002

Comment 3 by yosin@chromium.org, Nov 25 2016

Components: -Blink>Editing Blink>DOM

Comment 4 by r...@opera.com, Nov 25 2016

Using computed style for editability is the root cause here. We should not have querySelector rely on clean style.

Comment 5 by r...@opera.com, Nov 25 2016

Cc: r...@opera.com

Comment 6 by yosin@chromium.org, Nov 26 2016

querySelector()/queryAllSelectors() requires "clean style" only if specified selector contains ":read-write" or ":read-only" rather than all cases. qS() and qAS() don't cause update style in most case, e.g. "#id", "tagName", ".class".

From historical reason, editability is defined in "-webkit-user-modify", CSSWG rejected to "user-modify" proposal, but Firefox, WebKit/Blink implemented.

Current usage of "webkit-user-modify" is 1.6393%[1], so we need year long time to deprecate it.

We can have editability cache to propagate "contenteditable" attribute for tree like style propagation. Firefox has it but Firefox will move contentEditable cache to style system since their mechanism is identical to reduce cost of maintaining contenteditable cache.

There are three options here:
 1. Use dirty style for ":read-write" and ":read-only" query; results are sometimes wrong
 2. Ensure clean style for ":read-write" and ":read-only" case.
 3. If style isn't clean, visit ancestors to check contenteditable attribute
  Use temporary/on-stack ContentEditableCache like NthIndexCache

If we choose option 1, we should do:
 - Start deprecating "webkit-user-modify"
 - Once "webkit-user-modify" removed, we use contenteditable attribute cache.


[1] https://www.chromestatus.com/metrics/css/popularity#webkit-user-modify



Comment 7 by yosin@chromium.org, Nov 26 2016

Correction. Option 3 doesn't work since we need to check "webkit-user-modify" CSS property.

Comment 8 by yosin@chromium.org, Mar 23 2017

Cc: xiaoche...@chromium.org
Owner: ----
Status: Available (was: Started)
We want to remove -webkit-user-modify, but we can't since it usage is still high.
Status: WontFix (was: Available)
WontFix as we are going to deprecate -webkit-use-modify instead.

Sign in to add a comment