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

Issue 148223004: Improve support for :read-only and :read-write pseudoclasses. (Closed)

Created:
6 years, 11 months ago by andersr
Modified:
6 years, 10 months ago
Reviewers:
esprehn, rune
CC:
blink-reviews, zoltan1, bemjb+rendering_chromium.org, eae+blinkwatch, leviw+renderwatch, dglazkov+blink, adamk+blink_chromium.org, jchaffraix+rendering
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Improve support for :read-only and :read-write pseudoclasses. This change fixes these two issues: 1) The :read-write pseudoclass should apply to all elements which are editable, not just form elements. 2) The :read-only pseudoclass should match all elements which is not matched by the :read-write class, not just form elements which are non-editable. Case (1) is problematic because of the -webkit-user-modify property. When we try to match :read-write to an element, we may not yet have applied other rules which contain -webkit-user-modify and hence modify the editability of the element. So, we can not check the computed style for an element for a match against :read-write. Instead, I suggest checking the conteteditable attribute on the element. If this attribute is set, and contains an absolute value, then we have our answer. If the value is "inherit", then we check the computed style of parent elements (via rendererIsEditable()). Note that this fix only works for elements which specify "contenteditable", not for elements with -webkit-user-modify properties in their style. However, the CSS property was removed from the spec, and it doesn't appear to work in Firefox anymore either. It should probably be removed from Blink. The test-case fast/forms/select-live-pseudo-selectors.html failed with this change, because it incorrectly and probably accidentally depended on :read-only not being applied to <select> elements. Fixed by not applying :read-only to <select> elements. TEST=automated BUG=338309 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=167629

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix handling of ancestral changes in contenteditable attribute. #

Total comments: 2

Patch Set 3 : Rebase. #

Patch Set 4 : Remove html, head and body tags from test. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -9 lines) Patch
A LayoutTests/fast/css/readwrite-contenteditable.html View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/readwrite-contenteditable-expected.html View 1 2 3 1 chunk +17 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/readwrite-contenteditable-recalc.html View 1 1 chunk +53 lines, -0 lines 0 comments Download
A LayoutTests/fast/css/readwrite-contenteditable-recalc-expected.txt View 1 1 chunk +17 lines, -0 lines 0 comments Download
M LayoutTests/fast/forms/input-live-pseudo-selectors.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/forms/resources/input-live-pseudo-selectors.js View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/forms/resources/live-pseudo-selectors.css View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/forms/resources/select-live-pseudo-selectors.js View 1 chunk +0 lines, -1 line 0 comments Download
M LayoutTests/fast/forms/resources/textarea-live-pseudo-selectors.js View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/forms/select-live-pseudo-selectors.html View 1 chunk +1 line, -1 line 0 comments Download
M LayoutTests/fast/forms/textarea-live-pseudo-selectors.html View 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLElement.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M Source/core/html/HTMLElement.cpp View 1 2 1 chunk +20 lines, -0 lines 0 comments Download
M Source/core/rendering/RenderTheme.cpp View 1 2 2 chunks +4 lines, -2 lines 0 comments Download

Messages

Total messages: 20 (0 generated)
andersr
6 years, 11 months ago (2014-01-27 12:06:35 UTC) #1
rune
On 2014/01/27 12:06:35, andersr wrote: You should create a bug for this, or modify BUG= ...
6 years, 11 months ago (2014-01-27 12:12:43 UTC) #2
rune
https://codereview.chromium.org/148223004/diff/1/Source/core/html/HTMLElement.cpp File Source/core/html/HTMLElement.cpp (right): https://codereview.chromium.org/148223004/diff/1/Source/core/html/HTMLElement.cpp#newcode990 Source/core/html/HTMLElement.cpp:990: return rendererIsEditable(); rendererIsEditable() says that it should have an ...
6 years, 11 months ago (2014-01-27 12:36:44 UTC) #3
Mike West
Sorry, I'm not the right guy to review this. If darktears@ can't take it, ping ...
6 years, 10 months ago (2014-01-27 19:49:07 UTC) #4
andersr
https://codereview.chromium.org/148223004/diff/1/Source/core/html/HTMLElement.cpp File Source/core/html/HTMLElement.cpp (right): https://codereview.chromium.org/148223004/diff/1/Source/core/html/HTMLElement.cpp#newcode990 Source/core/html/HTMLElement.cpp:990: return rendererIsEditable(); > If you change the contenteditable attribute ...
6 years, 10 months ago (2014-01-30 12:27:58 UTC) #5
andersr
esprehn: Could you take a look at this?
6 years, 10 months ago (2014-02-07 13:33:05 UTC) #6
esprehn
https://codereview.chromium.org/148223004/diff/70001/LayoutTests/fast/css/readwrite-contenteditable-expected.html File LayoutTests/fast/css/readwrite-contenteditable-expected.html (right): https://codereview.chromium.org/148223004/diff/70001/LayoutTests/fast/css/readwrite-contenteditable-expected.html#newcode3 LayoutTests/fast/css/readwrite-contenteditable-expected.html:3: <head> I'd leave off the <html>, <head> and <body>. ...
6 years, 10 months ago (2014-02-18 07:18:40 UTC) #7
andersr
Patch updated, PTAL.
6 years, 10 months ago (2014-02-19 15:28:53 UTC) #8
esprehn
lgtm
6 years, 10 months ago (2014-02-21 04:26:37 UTC) #9
andersr
The CQ bit was checked by andersr@opera.com
6 years, 10 months ago (2014-02-21 09:02:18 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/andersr@opera.com/148223004/190001
6 years, 10 months ago (2014-02-21 09:02:40 UTC) #11
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-21 10:58:57 UTC) #12
commit-bot: I haz the power
Retried try job too often on mac_blink_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_blink_rel&number=19452
6 years, 10 months ago (2014-02-21 10:58:58 UTC) #13
andersr
The CQ bit was checked by andersr@opera.com
6 years, 10 months ago (2014-02-21 13:13:46 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/andersr@opera.com/148223004/190001
6 years, 10 months ago (2014-02-21 13:14:11 UTC) #15
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 10 months ago (2014-02-21 16:38:08 UTC) #16
commit-bot: I haz the power
Retried try job too often on linux_blink for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_blink&number=13561
6 years, 10 months ago (2014-02-21 16:38:08 UTC) #17
andersr
The CQ bit was checked by andersr@opera.com
6 years, 10 months ago (2014-02-22 01:05:27 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/andersr@opera.com/148223004/190001
6 years, 10 months ago (2014-02-22 01:05:40 UTC) #19
commit-bot: I haz the power
6 years, 10 months ago (2014-02-22 06:47:05 UTC) #20
Message was sent while issue was closed.
Change committed as 167629

Powered by Google App Engine
This is Rietveld 408576698