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

Issue 1176013002: Move attributes and methods from HTMLDocument to Document (Closed)

Created:
5 years, 6 months ago by Habib Virji
Modified:
5 years, 5 months ago
Reviewers:
tkent, esprehn, philipj_slow
CC:
blink-reviews, blink-reviews-dom_chromium.org, blink-reviews-html_chromium.org, arv+blink, vivekg_samsung, sof, eae+blinkwatch, vivekg, dglazkov+blink, blink-reviews-bindings_chromium.org, Inactive, rwlbuis, Rick Byers
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Move attributes and methods from HTMLDocument to Document Move open, close, write, writeln from HTMLDocument to Document. Open method is defined as custom and was previously implemented for HTMLDocument, it is moved to V8DocumentCustom. Dynamic insertion, open/write/writeln/close is not supported for non-HTML document: https://html.spec.whatwg.org/#dynamic-markup-insertion. Code has been updated in Document::open, Document::write and Document::close to throw DOMException InvalidStateError. The LayoutTests which was previosuly throwing has been updated accordingly and it matches with Firefox functionality parseFromString uses Document::setContent and this internally calls Document::open and Document::close. Since open and close, now throw exception, parseString for the non-HTML document needs two internal function Document::open and Document::close. Old open method will be initiated via bindings and new functions are to be used for internal purpose. The new method does not pass any argument and that's how two functions are differentiated. The existing open and close function includes two DOM exceptions as listed here: http://w3c.github.io/webcomponents/spec/imports/#interface-document In write it throws an exception if it is not HTML document. It is inconsistent with specification but matches behavior of open and close. A bug has been raised to correct the spec: https://www.w3.org/Bugs/Public/show_bug.cgi?id=28864 BUG=496376 R=philipj Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198491

Patch Set 1 #

Patch Set 2 : Removed changes in window.idl #

Patch Set 3 : #

Patch Set 4 : Introduced open and close methods without arguments to handle internal calls. #

Total comments: 22

Patch Set 5 : Updated as per review comments #

Patch Set 6 : Switch importLoader check #

Total comments: 4

Patch Set 7 : Moved the order of open and close function #

Total comments: 6

Patch Set 8 : #

Total comments: 1

Patch Set 9 : Updated comment #

Patch Set 10 : Updated to latest master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+76 lines, -173 lines) Patch
D LayoutTests/imported/web-platform-tests/html/dom/dynamic-markup-insertion/closing-the-input-stream/document.close-01-expected.txt View 1 2 1 chunk +0 lines, -6 lines 0 comments Download
D LayoutTests/imported/web-platform-tests/html/dom/dynamic-markup-insertion/document-write/document.write-01-expected.txt View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
D LayoutTests/imported/web-platform-tests/html/dom/dynamic-markup-insertion/document-writeln/document.writeln-01-expected.txt View 1 2 1 chunk +0 lines, -5 lines 0 comments Download
D LayoutTests/imported/web-platform-tests/html/dom/dynamic-markup-insertion/opening-the-input-stream/document.open-01-expected.txt View 1 2 1 chunk +0 lines, -6 lines 0 comments Download
M LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -4 lines 0 comments Download
M LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 6 7 8 9 4 chunks +4 lines, -4 lines 0 comments Download
A + Source/bindings/core/v8/custom/V8DocumentCustom.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +6 lines, -7 lines 0 comments Download
D Source/bindings/core/v8/custom/V8HTMLDocumentCustom.cpp View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -97 lines 0 comments Download
M Source/bindings/core/v8/custom/custom.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -1 line 0 comments Download
M Source/core/dom/Document.h View 1 2 3 4 5 6 7 8 9 2 chunks +10 lines, -3 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 8 9 5 chunks +46 lines, -1 line 0 comments Download
M Source/core/dom/Document.idl View 1 2 3 4 5 6 7 8 9 1 chunk +5 lines, -1 line 0 comments Download
M Source/core/html/HTMLDocument.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -5 lines 0 comments Download
M Source/core/html/HTMLDocument.cpp View 1 2 3 4 1 chunk +0 lines, -18 lines 0 comments Download
M Source/core/html/HTMLDocument.idl View 1 chunk +0 lines, -10 lines 0 comments Download

Messages

Total messages: 50 (19 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1176013002/1
5 years, 6 months ago (2015-06-10 13:56:33 UTC) #2
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1176013002/20001
5 years, 6 months ago (2015-06-10 15:48:27 UTC) #5
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/65969)
5 years, 6 months ago (2015-06-10 17:21:30 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1176013002/40001
5 years, 6 months ago (2015-06-16 16:06:07 UTC) #9
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_blink_rel on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/66864)
5 years, 6 months ago (2015-06-16 17:53:32 UTC) #11
Habib Virji
@philip: This is not yet complete but I am kind of stuck and wanted your ...
5 years, 6 months ago (2015-06-17 16:52:13 UTC) #12
philipj_slow
On 2015/06/17 16:52:13, Habib Virji wrote: > @philip: > > This is not yet complete ...
5 years, 6 months ago (2015-06-17 19:58:04 UTC) #13
Habib Virji
Thanks Philip for the explanation it is quite clear, will work out the solution and ...
5 years, 6 months ago (2015-06-17 23:05:42 UTC) #14
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1176013002/60001
5 years, 6 months ago (2015-06-18 11:51:02 UTC) #16
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
5 years, 6 months ago (2015-06-18 13:10:13 UTC) #18
Habib Virji
@philip: Thanks updated with your proposal # 2. It also involved updating close.
5 years, 6 months ago (2015-06-18 14:15:36 UTC) #19
Rick Byers
Replacing myself with tkent who is specifically interested in DOM API conformance.
5 years, 6 months ago (2015-06-23 21:10:29 UTC) #23
tkent
https://codereview.chromium.org/1176013002/diff/60001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1176013002/diff/60001/Source/core/dom/Document.cpp#newcode2320 Source/core/dom/Document.cpp:2320: if (isXHTMLDocument()) { Why do you check isXHTMLDocument(), not ...
5 years, 6 months ago (2015-06-23 23:42:17 UTC) #24
tkent
> https://html.spec.whatwg.org/#dynamic-markup-insertion. Please avoid to link to the all-in-one version of the specification. It should ...
5 years, 6 months ago (2015-06-23 23:44:20 UTC) #25
philipj_slow
On 2015/06/23 23:44:20, tkent wrote: > > https://html.spec.whatwg.org/#dynamic-markup-insertion. > > Please avoid to link to ...
5 years, 6 months ago (2015-06-24 11:26:38 UTC) #26
philipj_slow
I think this will work out, just some questions. https://codereview.chromium.org/1176013002/diff/60001/LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support.html File LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support.html (right): https://codereview.chromium.org/1176013002/diff/60001/LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support.html#newcode158 LayoutTests/fast/dom/domparser-parsefromstring-mimetype-support.html:158: ...
5 years, 6 months ago (2015-06-24 11:52:19 UTC) #27
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1176013002/80001
5 years, 6 months ago (2015-06-25 13:08:52 UTC) #29
Habib Virji
Thanks philip and tkent, please find my comments inline. https://codereview.chromium.org/1176013002/diff/60001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1176013002/diff/60001/Source/core/dom/Document.cpp#newcode2316 Source/core/dom/Document.cpp:2316: ...
5 years, 6 months ago (2015-06-25 13:09:47 UTC) #30
philipj_slow
https://codereview.chromium.org/1176013002/diff/60001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1176013002/diff/60001/Source/core/dom/Document.cpp#newcode2316 Source/core/dom/Document.cpp:2316: exceptionState.throwDOMException(InvalidStateError, "Imported document doesn't support open()."); On 2015/06/25 13:09:46, ...
5 years, 5 months ago (2015-06-27 21:42:56 UTC) #32
philipj_slow
https://codereview.chromium.org/1176013002/diff/100001/Source/core/dom/Document.h File Source/core/dom/Document.h (right): https://codereview.chromium.org/1176013002/diff/100001/Source/core/dom/Document.h#newcode495 Source/core/dom/Document.h:495: // open() is the DOM API document.open() Maybe "This ...
5 years, 5 months ago (2015-06-27 21:49:24 UTC) #33
Habib Virji
PTAL. https://codereview.chromium.org/1176013002/diff/60001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1176013002/diff/60001/Source/core/dom/Document.cpp#newcode2316 Source/core/dom/Document.cpp:2316: exceptionState.throwDOMException(InvalidStateError, "Imported document doesn't support open()."); On 2015/06/27 ...
5 years, 5 months ago (2015-06-29 12:17:42 UTC) #34
philipj_slow
https://codereview.chromium.org/1176013002/diff/120001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1176013002/diff/120001/Source/core/dom/Document.cpp#newcode2727 Source/core/dom/Document.cpp:2727: exceptionState.throwDOMException(InvalidStateError, "XML document doesn't support write()."); I think this ...
5 years, 5 months ago (2015-06-29 15:02:39 UTC) #35
Habib Virji
PTAL. https://codereview.chromium.org/1176013002/diff/120001/Source/core/dom/Document.cpp File Source/core/dom/Document.cpp (right): https://codereview.chromium.org/1176013002/diff/120001/Source/core/dom/Document.cpp#newcode2727 Source/core/dom/Document.cpp:2727: exceptionState.throwDOMException(InvalidStateError, "XML document doesn't support write()."); Added in ...
5 years, 5 months ago (2015-06-29 15:25:21 UTC) #36
philipj_slow
This now LGTM, small and conservative change and the description is very helpful. It is ...
5 years, 5 months ago (2015-06-29 19:39:32 UTC) #38
tkent
lgtm
5 years, 5 months ago (2015-07-02 23:52:35 UTC) #40
philipj_slow
Thanks for taking a look, tkent! In my mind this CL is OK to land ...
5 years, 5 months ago (2015-07-03 21:09:18 UTC) #41
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1176013002/160001
5 years, 5 months ago (2015-07-08 08:49:59 UTC) #43
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: mac_blink_compile_dbg on tryserver.blink (JOB_FAILED, http://build.chromium.org/p/tryserver.blink/builders/mac_blink_compile_dbg/builds/49903) mac_blink_rel on ...
5 years, 5 months ago (2015-07-08 08:53:35 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1176013002/180001
5 years, 5 months ago (2015-07-08 09:46:53 UTC) #48
Habib Virji
Thanks tkent and philipj. philipj updated close API comments before commit.
5 years, 5 months ago (2015-07-08 09:47:11 UTC) #49
commit-bot: I haz the power
5 years, 5 months ago (2015-07-08 10:53:06 UTC) #50
Message was sent while issue was closed.
Committed patchset #10 (id:180001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=198491

Powered by Google App Engine
This is Rietveld 408576698