DescriptionUse [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 #Messages
Total messages: 8 (0 generated)
|