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

Review URL: https://codereview.chromium.org/371833004

git-svn-id: svn://svn.chromium.org/blink/trunk@177728 bbb929c8-8fbe-4397-9dbb-9b2b20218538
11 files changed
tree: 6ab609b5c2a3764fa6a11102f1c7a82664a7ba1c
  1. third_party/