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

Issue 2669213002: Remove spelling markers in disabled and readonly form elements

Created:
3 years, 10 months ago by Manuel Rego
Modified:
3 years, 9 months ago
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, rlanday
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove spelling markers in disabled and readonly form elements If you mark as disabled or readonly a form element, any spelling marker that appears there should disappear. The spec is pretty clear on this [1]: "User agents must only consider the following pieces of text as checkable for the purposes of this feature: * The value of input elements whose type attributes are in the Text, Search, URL, or E-mail states and that are mutable (i.e. that do not have the readonly attribute specified and that are not disabled). * The value of textarea elements that do not have a readonly attribute and that are not disabled. * ..." Regarding test fast/css/invalidation/read-only-write-pseudo.html, it's updated as now updateStyleAndLayoutTreeForNode() is already called when the markers are removed. So when the test forces it with updateStyleAndReturnAffectedElementCount() the result is 0. BUG=687949 TEST=editing/spelling/spellcheck-remove-markers-disabled-readonly.html [1] https://html.spec.whatwg.org/multipage/interaction.html#spelling-and-grammar-checking CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Patch Set 1 #

Total comments: 2

Patch Set 2 : Apply suggested changes #

Patch Set 3 : Fix test fast/css/invalidation/read-only-write-pseudo.html #

Total comments: 2

Patch Set 4 : Use parseAttribute() instead of attributeChanged() #

Patch Set 5 : Use setNeedsWillValidateCheck() to avoid crashes #

Total comments: 5

Patch Set 6 : Same than previous Patch Set 5, but rebased against master #

Patch Set 7 : Using idle task to remove the markers #

Total comments: 3

Messages

Total messages: 27 (7 generated)
Manuel Rego
Following a similar approach to what was done for "contenteditable": https://codereview.chromium.org/2650183002/
3 years, 10 months ago (2017-02-02 13:37:19 UTC) #2
tkent
Please address test failures. https://codereview.chromium.org/2669213002/diff/1/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp File third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp (right): https://codereview.chromium.org/2669213002/diff/1/third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp#newcode148 third_party/WebKit/Source/core/html/HTMLFormControlElement.cpp:148: } else if (params.name == ...
3 years, 10 months ago (2017-02-03 00:09:59 UTC) #3
Xiaocheng
https://codereview.chromium.org/2669213002/diff/1/third_party/WebKit/Source/core/html/TextControlElement.cpp File third_party/WebKit/Source/core/html/TextControlElement.cpp (right): https://codereview.chromium.org/2669213002/diff/1/third_party/WebKit/Source/core/html/TextControlElement.cpp#newcode921 third_party/WebKit/Source/core/html/TextControlElement.cpp:921: void TextControlElement::removeSpellingAndGrammarMarkersOnInnerEditor() { This function seems unnecessary. I think ...
3 years, 10 months ago (2017-02-03 04:54:07 UTC) #4
Manuel Rego
Thanks for the reviews, uploaded a new version. Now everything is implemented on TextControlElement and ...
3 years, 10 months ago (2017-02-06 08:14:57 UTC) #7
tkent
> Regarding test fast/css/invalidation/read-only-write-pseudo.html, > it's updated as now updateStyleAndLayoutTreeForNode() is already > called when ...
3 years, 10 months ago (2017-02-06 23:28:07 UTC) #8
Manuel Rego
Thanks for the review, uploading new version using parseAttribute(). https://codereview.chromium.org/2669213002/diff/60001/third_party/WebKit/Source/core/html/TextControlElement.h File third_party/WebKit/Source/core/html/TextControlElement.h (right): https://codereview.chromium.org/2669213002/diff/60001/third_party/WebKit/Source/core/html/TextControlElement.h#newcode159 third_party/WebKit/Source/core/html/TextControlElement.h:159: ...
3 years, 10 months ago (2017-02-07 10:26:25 UTC) #9
Xiaocheng
Removing myself. I can't review in these days.
3 years, 10 months ago (2017-02-07 11:23:02 UTC) #11
tkent
https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp File third_party/WebKit/Source/core/html/TextControlElement.cpp (right): https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp#newcode721 third_party/WebKit/Source/core/html/TextControlElement.cpp:721: setNeedsWillValidateCheck(); Why do we need setNeedsWillValidateCheck()?
3 years, 10 months ago (2017-02-07 14:17:06 UTC) #12
Manuel Rego
https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp File third_party/WebKit/Source/core/html/TextControlElement.cpp (right): https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp#newcode721 third_party/WebKit/Source/core/html/TextControlElement.cpp:721: setNeedsWillValidateCheck(); On 2017/02/07 14:17:06, tkent wrote: > Why do ...
3 years, 10 months ago (2017-02-07 15:06:03 UTC) #13
yosin_UTC9
https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp File third_party/WebKit/Source/core/html/TextControlElement.cpp (right): https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp#newcode721 third_party/WebKit/Source/core/html/TextControlElement.cpp:721: setNeedsWillValidateCheck(); On 2017/02/07 at 15:06:03, Manuel Rego wrote: > ...
3 years, 10 months ago (2017-02-08 02:07:44 UTC) #14
tkent
https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp File third_party/WebKit/Source/core/html/TextControlElement.cpp (right): https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp#newcode721 third_party/WebKit/Source/core/html/TextControlElement.cpp:721: setNeedsWillValidateCheck(); On 2017/02/07 at 15:06:03, Manuel Rego wrote: > ...
3 years, 10 months ago (2017-02-08 02:12:14 UTC) #15
Manuel Rego
https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp File third_party/WebKit/Source/core/html/TextControlElement.cpp (right): https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp#newcode721 third_party/WebKit/Source/core/html/TextControlElement.cpp:721: setNeedsWillValidateCheck(); On 2017/02/08 02:07:44, yosin_BlinkOn_slow wrote: > On 2017/02/07 ...
3 years, 10 months ago (2017-02-08 09:00:34 UTC) #16
yosin_UTC9
On 2017/02/08 at 09:00:34, rego wrote: > https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp > File third_party/WebKit/Source/core/html/TextControlElement.cpp (right): > > https://codereview.chromium.org/2669213002/diff/100001/third_party/WebKit/Source/core/html/TextControlElement.cpp#newcode721 ...
3 years, 10 months ago (2017-02-08 09:52:02 UTC) #17
Manuel Rego
Sorry for the delay on coming back to this. On 2017/02/08 09:52:02, yosin_UTC9 wrote: > ...
3 years, 9 months ago (2017-03-03 12:44:06 UTC) #20
Xiaocheng
Thanks for the update. Unfortunately, both options that yosin gave might involve quite some low-level ...
3 years, 9 months ago (2017-03-03 18:24:06 UTC) #21
Manuel Rego
Thanks @Xiaocheng for the feedback. Reading that, I'm not sure what's the best thing to ...
3 years, 9 months ago (2017-03-24 10:14:46 UTC) #22
Xiaocheng
+wangxianzhu Hi Xianzhu, This patch tries to stop painting spelling and grammar markers in non-editable ...
3 years, 9 months ago (2017-03-24 17:44:45 UTC) #24
Xianzhu
On 2017/03/24 17:44:45, Xiaocheng wrote: > +wangxianzhu > > Hi Xianzhu, > > This patch ...
3 years, 9 months ago (2017-03-24 18:28:56 UTC) #25
Xianzhu
On 2017/03/24 18:28:56, Xianzhu wrote: > On 2017/03/24 17:44:45, Xiaocheng wrote: > > +wangxianzhu > ...
3 years, 9 months ago (2017-03-24 18:35:44 UTC) #26
Xiaocheng
3 years, 9 months ago (2017-03-24 19:50:18 UTC) #27
On 2017/03/24 at 18:35:44, wangxianzhu wrote:
> On 2017/03/24 18:28:56, Xianzhu wrote:
> > On 2017/03/24 17:44:45, Xiaocheng wrote:
> > > +wangxianzhu
> > > 
> > > Hi Xianzhu,
> > > 
> > > This patch tries to stop painting spelling and grammar markers in
non-editable
> > /
> > > disabled / readonly / ... elements.
> > > 
> > > How hard is it if we want to enhance Internals to inspect whether a
> > > DocumentMarker is actually painted or not?
> > > 
> > > Thanks!
> > 
> > I would use a pixel test instead of checking through the internals API.
> 
> Or you can create a unit test which checks the painted output in
PaintController. See PaintControllerPaintTest for example.

Pixel test is something we tried very hard to avoid...

I'll take a look at PaintControllerPaintTest. Thanks!

Powered by Google App Engine
This is Rietveld 408576698