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

Issue 200763006: Node::setTextContent should avoid work when nothing changes (Closed)

Created:
6 years, 9 months ago by eseidel
Modified:
6 years, 9 months ago
CC:
blink-reviews, sof, eae+blinkwatch, dglazkov+blink, adamk+blink_chromium.org, Inactive, rwlbuis
Visibility:
Public.

Description

Node::setTextContent should avoid work when nothing changes We already had code to handle this case, which is shared by editing as well as HTMLElement::setInnerText. However that code (replaceChildrenWithText) appears to be both wrong and unsafe (modifies existing text nodes without checking if they're shared or not), so I chose not to re-use it for now. This was originally committed as: https://src.chromium.org/viewvc/blink?view=rev&revision=169394 using replaceChildrenWithText, but was rolled out for breaking a zillion tests. This version does not use replaceChildrenWithText. BUG=352836 R=jchaffraix@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=169805

Patch Set 1 #

Total comments: 1

Patch Set 2 : Updated to actually wokr #

Total comments: 1

Patch Set 3 : Add longer comment about the benchmark hack #

Patch Set 4 : Updated beforeload-set-text-crash to not timeout #

Unified diffs Side-by-side diffs Delta from patch set Stats (+35 lines, -1 line) Patch
M LayoutTests/fast/dom/HTMLObjectElement/beforeload-set-text-crash.xhtml View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
A LayoutTests/fast/repaint/set-text-content-same.html View 1 1 chunk +10 lines, -0 lines 0 comments Download
A LayoutTests/fast/repaint/set-text-content-same-expected.txt View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Node.cpp View 1 2 3 2 chunks +7 lines, -0 lines 0 comments Download
M Source/core/editing/markup.cpp View 1 2 2 chunks +14 lines, -0 lines 0 comments Download

Messages

Total messages: 31 (0 generated)
eseidel
I verified that the test does print repaint rects before my change.
6 years, 9 months ago (2014-03-15 00:00:02 UTC) #1
Julien - ping for review
lgtm! https://codereview.chromium.org/200763006/diff/1/LayoutTests/fast/repaint/set-text-content-same.html File LayoutTests/fast/repaint/set-text-content-same.html (right): https://codereview.chromium.org/200763006/diff/1/LayoutTests/fast/repaint/set-text-content-same.html#newcode5 LayoutTests/fast/repaint/set-text-content-same.html:5: <script type="text/javascript"> I usually tell people to remove ...
6 years, 9 months ago (2014-03-15 01:12:50 UTC) #2
eseidel
The CQ bit was checked by eseidel@chromium.org
6 years, 9 months ago (2014-03-15 01:13:53 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/200763006/1
6 years, 9 months ago (2014-03-15 01:13:59 UTC) #4
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-15 02:00:43 UTC) #5
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_rel
6 years, 9 months ago (2014-03-15 02:00:43 UTC) #6
eseidel
The CQ bit was checked by eseidel@chromium.org
6 years, 9 months ago (2014-03-15 07:15:41 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/200763006/1
6 years, 9 months ago (2014-03-15 07:15:44 UTC) #8
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-15 08:02:50 UTC) #9
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on mac_blink_rel
6 years, 9 months ago (2014-03-15 08:02:51 UTC) #10
eseidel
The CQ bit was checked by eseidel@chromium.org
6 years, 9 months ago (2014-03-17 21:54:10 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/200763006/1
6 years, 9 months ago (2014-03-17 21:54:27 UTC) #12
eseidel
Committed patchset #1 manually as r169394 (presubmit successful).
6 years, 9 months ago (2014-03-17 21:54:50 UTC) #13
Julien - ping for review
lgtm https://codereview.chromium.org/200763006/diff/20001/Source/core/editing/markup.cpp File Source/core/editing/markup.cpp (right): https://codereview.chromium.org/200763006/diff/20001/Source/core/editing/markup.cpp#newcode1009 Source/core/editing/markup.cpp:1009: // FIXME: This is wrong if containerNode->firstChild() has ...
6 years, 9 months ago (2014-03-18 22:55:54 UTC) #14
eseidel
Changing the data on the text-node is visible from JS. <div>foo</div> <script> var oldText = ...
6 years, 9 months ago (2014-03-18 23:10:11 UTC) #15
Julien - ping for review
On 2014/03/18 23:10:11, eseidel wrote: > Changing the data on the text-node is visible from ...
6 years, 9 months ago (2014-03-20 17:12:00 UTC) #16
eseidel
The CQ bit was checked by eseidel@chromium.org
6 years, 9 months ago (2014-03-20 20:45:59 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/200763006/40001
6 years, 9 months ago (2014-03-20 20:46:04 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-20 20:47:43 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_rel
6 years, 9 months ago (2014-03-20 20:47:49 UTC) #20
eseidel
The CQ bit was checked by eseidel@chromium.org
6 years, 9 months ago (2014-03-22 19:56:55 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/200763006/60001
6 years, 9 months ago (2014-03-22 19:56:58 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-22 19:58:27 UTC) #23
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_compile_dbg
6 years, 9 months ago (2014-03-22 19:58:28 UTC) #24
eseidel
The CQ bit was checked by eseidel@chromium.org
6 years, 9 months ago (2014-03-22 20:00:40 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/200763006/60001
6 years, 9 months ago (2014-03-22 20:00:48 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 9 months ago (2014-03-22 20:54:32 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.blink on win_blink_rel
6 years, 9 months ago (2014-03-22 20:54:33 UTC) #28
eseidel
The CQ bit was checked by eseidel@chromium.org
6 years, 9 months ago (2014-03-22 22:38:10 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/eseidel@chromium.org/200763006/60001
6 years, 9 months ago (2014-03-22 22:38:13 UTC) #30
commit-bot: I haz the power
6 years, 9 months ago (2014-03-22 23:08:25 UTC) #31
Message was sent while issue was closed.
Change committed as 169805

Powered by Google App Engine
This is Rietveld 408576698