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

Issue 2885633002: Style tag in an XHR's responseXML shouldn't make the responseXML be null. (Closed)

Created:
3 years, 7 months ago by Nate Chapin
Modified:
3 years, 7 months ago
Reviewers:
yhirano
CC:
chromium-reviews, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, blink-reviews, rwlbuis
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Style tag in an XHR's responseXML shouldn't make the responseXML be null. XMLHTTPRequest::response_document_ gets incorrectly cleared because Document::well_formed_ is incorrectly false. This is because well_formed_ is initialized in Document::ImplicitClose(). XMLHttpRequest used to call ImplicitClose() directly, but I changed it to call Document::CheckCompleted() (which may then call ImplicitClose) in https://chromium.googlesource.com/chromium/src/+/716a136332fbd8efc12a3892b6ae2a6c0be94ba7 I had thought that CheckCompleted() would always call ImplicitClose() for an XHR response document, but it's possible for CheckCompleted() to early-exit because the document is not complete if a style element has blocked load completion and won't un-block it until a timer is fired. There's no reason to wait until ImplicitClose() to set the well-formed bit, though. Document::FinishedParsing() is sufficient, and setting it there removes the need for XMLHttpRequest to manually call CheckCompleted(). BUG=721225 TEST=http/tests/xmlhttprequest/style-tag-in-responseXML.html Review-Url: https://codereview.chromium.org/2885633002 Cr-Commit-Position: refs/heads/master@{#473701} Committed: https://chromium.googlesource.com/chromium/src/+/25fa842cb11198a37ed0ae14a9618e20d2f97a02

Patch Set 1 #

Patch Set 2 : Move setting Document::well_formed_ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+27 lines, -5 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/resources/xml-with-style-tag.xml View 1 chunk +3 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/xmlhttprequest/style-tag-in-responseXML.html View 1 chunk +21 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/Document.cpp View 1 2 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.cpp View 1 1 chunk +0 lines, -2 lines 0 comments Download

Messages

Total messages: 25 (17 generated)
Nate Chapin
3 years, 7 months ago (2017-05-16 18:59:13 UTC) #9
yhirano
lgtm
3 years, 7 months ago (2017-05-17 05:04:15 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2885633002/20001
3 years, 7 months ago (2017-05-17 17:43:10 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/457667)
3 years, 7 months ago (2017-05-17 19:59:24 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2885633002/20001
3 years, 7 months ago (2017-05-17 20:06:56 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_rel_ng/builds/457988)
3 years, 7 months ago (2017-05-17 22:06:44 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2885633002/20001
3 years, 7 months ago (2017-05-22 19:31:34 UTC) #22
commit-bot: I haz the power
3 years, 7 months ago (2017-05-22 21:23:32 UTC) #25
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://chromium.googlesource.com/chromium/src/+/25fa842cb11198a37ed0ae14a961...

Powered by Google App Engine
This is Rietveld 408576698