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

Issue 371833004: Use [TreatNullAs=EmptyString] for DOMString attributes with [Reflect] (Closed)

Created:
6 years, 5 months ago by Jens Widell
Modified:
6 years, 5 months ago
CC:
blink-reviews, dglazkov+blink, blink-reviews-html_chromium.org, arv+blink, Inactive
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Project:
blink
Visibility:
Public.

Description

Use [TreatNullAs=EmptyString] for DOMString attributes with [Reflect] In cases where the HTML specification uses [TreatNullAs=EmptyString] on an IDL attribute that reflects a content attribute, use the same in our IDL files to get correct behavior when assigning null. Previous incorrect behavior when assigning null was to remove the reflected content attribute, if present, and otherwise do nothing. The new behavior matches Firefox and Opera/Presto. IE11 behaves the same when the content attribute is present, but doesn't create the content attribute if it's missing and null is assigned to the IDL attribute. This change impacts performance significantly (~4x slowdown) in the case of assigning null to the IDL attribute when the reflected content attribute is not present, i.e. the previous "do nothing" case. This ought to be considered an irrelevant micro-benchmark, and the reason it slows down is that the incorrect (web-facing) behavior is a no-op while the correct behavior is not. Performance in other cases, in particular the case of assigning null to the IDL attribute when the reflected content attribute is present, show no significant change. BUG=391194 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=177728

Patch Set 1 : add testcase #

Patch Set 2 : the fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+586 lines, -20 lines) Patch
M LayoutTests/fast/dom/domstring-attribute-reflection.html View 3 chunks +29 lines, -3 lines 0 comments Download
M LayoutTests/fast/dom/domstring-attribute-reflection-expected.txt View 1 1 chunk +540 lines, -0 lines 0 comments Download
M Source/core/html/HTMLBodyElement.idl View 1 1 chunk +5 lines, -5 lines 0 comments Download
M Source/core/html/HTMLFontElement.idl View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLFrameElement.idl View 1 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLIFrameElement.idl View 1 1 chunk +2 lines, -2 lines 0 comments Download
M Source/core/html/HTMLImageElement.idl View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLObjectElement.idl View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTableCellElement.idl View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/html/HTMLTableElement.idl View 1 1 chunk +3 lines, -3 lines 0 comments Download
M Source/core/html/HTMLTableRowElement.idl View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 8 (0 generated)
Jens Widell
PTAL The modified (and tested) attributes are all those that have [TreatNullAs=EmptyString] in the current ...
6 years, 5 months ago (2014-07-07 09:59:02 UTC) #1
haraken
LGTM Let's land this CL and see what benchmarks regress in perf bots. Overall, I ...
6 years, 5 months ago (2014-07-07 10:42:06 UTC) #2
tkent
lgtm
6 years, 5 months ago (2014-07-07 23:58:20 UTC) #3
philipj_slow
LGTM, getting these and other IDL files in lines with the spec was really the ...
6 years, 5 months ago (2014-07-08 19:57:25 UTC) #4
Jens Widell
On 2014/07/08 19:57:25, philipj wrote: > LGTM, getting these and other IDL files in lines ...
6 years, 5 months ago (2014-07-09 09:09:04 UTC) #5
Jens Widell
The CQ bit was checked by jl@opera.com
6 years, 5 months ago (2014-07-09 09:09:08 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jl@opera.com/371833004/20001
6 years, 5 months ago (2014-07-09 09:09:27 UTC) #7
commit-bot: I haz the power
6 years, 5 months ago (2014-07-09 09:14:08 UTC) #8
Message was sent while issue was closed.
Change committed as 177728

Powered by Google App Engine
This is Rietveld 408576698