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

Issue 839303003: Adding stylesheet candidates should not crash when the parser reorders the tree (Closed)

Created:
5 years, 11 months ago by rwlbuis
Modified:
5 years, 11 months ago
Reviewers:
esprehn
CC:
blink-reviews, blink-reviews-dom_chromium.org, dglazkov+blink, eae+blinkwatch, rwlbuis, sof
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Adding stylesheet candidates should not crash when the parser reorders the tree The HTML parsing rules means nodes may get re-ordered. In the testcase the table element is being seen in "in table mode", but the link inside it defaults to "in body" mode. So the link ends up being inserted in the body and before the style element in the table. DocumentOrderedList::parserAdd expects a new node in the list to appear in the document after the last in the current list, so calling that will trigger the ASSERT. Instead only call parserAdd when the new node has no next sibling, if it has call DocumentOrderedList::add which will find the correct position in the list. BUG=334691 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=188181

Patch Set 1 #

Patch Set 2 : Add a test #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+12 lines, -2 lines) Patch
A LayoutTests/fast/dom/css-stylesheet-candidate-ordering.html View 1 1 chunk +10 lines, -0 lines 0 comments Download
A + LayoutTests/fast/dom/css-stylesheet-candidate-ordering-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/TreeScopeStyleSheetCollection.cpp View 1 chunk +1 line, -1 line 1 comment Download

Messages

Total messages: 6 (2 generated)
rwlbuis
PTAL
5 years, 11 months ago (2015-01-09 23:28:05 UTC) #2
esprehn
lgtm https://codereview.chromium.org/839303003/diff/20001/Source/core/dom/TreeScopeStyleSheetCollection.cpp File Source/core/dom/TreeScopeStyleSheetCollection.cpp (right): https://codereview.chromium.org/839303003/diff/20001/Source/core/dom/TreeScopeStyleSheetCollection.cpp#newcode58 Source/core/dom/TreeScopeStyleSheetCollection.cpp:58: if (createdByParser && document().body() && !node->nextSibling()) I suspect ...
5 years, 11 months ago (2015-01-10 01:50:44 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/839303003/20001
5 years, 11 months ago (2015-01-10 02:32:08 UTC) #5
commit-bot: I haz the power
5 years, 11 months ago (2015-01-10 05:47:43 UTC) #6
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=188181

Powered by Google App Engine
This is Rietveld 408576698