querySelectorAll does not work correctly with editable styles |
|||||
Issue descriptionLayout 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.
,
Nov 25 2016
,
Nov 25 2016
,
Nov 25 2016
Using computed style for editability is the root cause here. We should not have querySelector rely on clean style.
,
Nov 25 2016
,
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
,
Nov 26 2016
Correction. Option 3 doesn't work since we need to check "webkit-user-modify" CSS property.
,
Mar 23 2017
We want to remove -webkit-user-modify, but we can't since it usage is still high.
,
Apr 28 2017
WontFix as we are going to deprecate -webkit-use-modify instead. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by xiaoche...@chromium.org
, Nov 25 2016Owner: yosin@chromium.org
Status: Started (was: Untriaged)