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

Issue 840223006: Don't queue mutation records when attributes don't change value. (Closed)

Created:
5 years, 11 months ago by esprehn
Modified:
5 years, 11 months ago
Reviewers:
adamk, rafaelw, ojan
CC:
rafaelw, abarth-chromium, adamk, mojo-reviews_chromium.org, ojan
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Don't queue mutation records when attributes don't change value. There's no reason to queue records when an attribute didn't really change value. R=ojan@chromium.org Committed: https://chromium.googlesource.com/external/mojo/+/089b8f46de8985d4389ad3a06a74ab7f43212882

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -13 lines) Patch
M sky/engine/core/dom/Element.cpp View 2 chunks +9 lines, -10 lines 0 comments Download
M sky/tests/mutation-observer/observe-options-attributes.sky View 1 chunk +3 lines, -3 lines 0 comments Download

Messages

Total messages: 7 (2 generated)
ojan
lgtm This makes sense to me, but I vaguely remember there was a reason this ...
5 years, 11 months ago (2015-01-17 03:21:21 UTC) #1
esprehn
Committed patchset #1 (id:1) manually as 089b8f46de8985d4389ad3a06a74ab7f43212882 (presubmit successful).
5 years, 11 months ago (2015-01-17 03:21:32 UTC) #2
adamk
I don't think there was any big reason not to do this, though in the ...
5 years, 11 months ago (2015-01-20 19:55:52 UTC) #4
rafaelw
Yup. This was largely about style not always being stored as a serialized string. If ...
5 years, 11 months ago (2015-01-21 02:25:48 UTC) #6
esprehn
5 years, 11 months ago (2015-01-21 02:55:28 UTC) #7
Message was sent while issue was closed.
On 2015/01/21 at 02:25:48, rafaelw wrote:
> Yup. This was largely about style not always being stored as a serialized
string. If it's not, you'd prefer not to have to serialize the old state and the
new state just to compare whether they are identical and not emit a mutation
record. Also, given that style is parsed, the attribute string values could be
different and the parsed representation be equivalent.
> 
> I'm curious what practical win this change accomplishes.

Less code, and less complexity inside frameworks. I would not expect that
calling setAttribute() with identical values would malloc a new MutationRecord,
queue a micro task, and run all the code related to it. Note that
attributeChangedCallback already compares the old/new values and doesn't fire if
they're the same. We always create the serialized style value in blink inside
setAttribute(), so this wasn't actually saving any work.

Do you mean there's a theoretical optimization that this avoids having to
serialize the style attr?

Powered by Google App Engine
This is Rietveld 408576698