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

Issue 128603002: Inhibit title update when removing children before setting new value (Closed)

Created:
6 years, 11 months ago by davve
Modified:
6 years, 11 months ago
CC:
blink-reviews, dglazkov+blink, sof, eae+blinkwatch, adamk+blink_chromium.org, Inactive
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Inhibit title updates when removing children before setting new value In <https://codereview.chromium.org/107513013>; children to <title> were removed before setting the new title child. This caused one extra title change notification to the empty string before the new value was set. Avoid the extra notification by ignoring title updates when children of HTMLTitleElement change until the final appendChild with the new text node. Also make sure to add a child list mutation scope for the update so that both the removal and addition ends up in the same mutation. Add test for this. BUG=331351 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=164789

Patch Set 1 #

Total comments: 3

Patch Set 2 : Address review comments #

Patch Set 3 : Rebased #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -21 lines) Patch
A LayoutTests/fast/dom/document-set-title-mutations.html View 1 1 chunk +28 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/document-set-title-mutations-expected.txt View 1 1 chunk +13 lines, -0 lines 0 comments Download
M LayoutTests/fast/dom/title-text-property-2-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
A LayoutTests/fast/dom/title-text-property-3.html View 1 chunk +9 lines, -0 lines 0 comments Download
A LayoutTests/fast/dom/title-text-property-3-expected.txt View 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 1 chunk +2 lines, -5 lines 0 comments Download
M Source/core/html/HTMLTitleElement.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/html/HTMLTitleElement.cpp View 1 4 chunks +9 lines, -15 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
davve
6 years, 11 months ago (2014-01-08 16:45:52 UTC) #1
jochen (gone - plz use gerrit)
https://codereview.chromium.org/128603002/diff/1/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/128603002/diff/1/Source/core/dom/Document.cpp#newcode1317 Source/core/dom/Document.cpp:1317: toHTMLTitleElement(m_titleElement)->setText(title); since setText() will also remove the children, what ...
6 years, 11 months ago (2014-01-09 12:17:33 UTC) #2
davve
https://codereview.chromium.org/128603002/diff/1/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/128603002/diff/1/Source/core/dom/Document.cpp#newcode1317 Source/core/dom/Document.cpp:1317: toHTMLTitleElement(m_titleElement)->setText(title); On 2014/01/09 12:17:33, jochen wrote: > since setText() ...
6 years, 11 months ago (2014-01-09 12:31:00 UTC) #3
davve
Setting <title>.text now aligned with setting document.title. Description updated. PTAL.
6 years, 11 months ago (2014-01-09 13:53:01 UTC) #4
jochen (gone - plz use gerrit)
lgtm
6 years, 11 months ago (2014-01-09 14:23:41 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/davve@opera.com/128603002/80002
6 years, 11 months ago (2014-01-09 14:36:09 UTC) #6
commit-bot: I haz the power
Failed to apply patch for Source/core/html/HTMLTitleElement.h: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 11 months ago (2014-01-09 14:36:14 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/davve@opera.com/128603002/110002
6 years, 11 months ago (2014-01-09 14:48:39 UTC) #8
commit-bot: I haz the power
6 years, 11 months ago (2014-01-09 16:40:09 UTC) #9
Message was sent while issue was closed.
Change committed as 164789

Powered by Google App Engine
This is Rietveld 408576698