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

Issue 534583002: Implemented XMLSerializer in PrivateScript. (Closed)

Created:
6 years, 3 months ago by tasak
Modified:
5 years, 11 months ago
CC:
arv+blink, blink-reviews, Inactive
Project:
blink
Visibility:
Public.

Description

Implemented XMLSerializer in PrivateScript. Since Document.xmlVersion and Document.xmlStandalone will be removed, C++ XMLSerializer::serializeToString creates XML declaration and provides the string for JS serializeToString. Currently _SERIALIZATION_TYPE_AS_OWNER_DOCUMENT is not used, but it is important for XSLT in PrivateScript. BUG=

Patch Set 1 : Need to fix fast/dom/cross-frame-accessor-throw.html #

Patch Set 2 : Removed isHTMLDocument #

Total comments: 28

Patch Set 3 : Removed backdoors added to Document. #

Total comments: 16

Patch Set 4 : #

Total comments: 3

Patch Set 5 : #

Patch Set 6 : #

Total comments: 35

Patch Set 7 : #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+414 lines, -17 lines) Patch
M LayoutTests/fast/dom/xmlserializer-serialize-to-string-exception-expected.txt View 1 2 3 1 chunk +4 lines, -4 lines 0 comments Download
M Source/core/BUILD.gn View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/core_generated.gyp View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/xml/XMLSerializer.h View 1 2 3 4 5 6 2 chunks +8 lines, -3 lines 0 comments Download
M Source/core/xml/XMLSerializer.cpp View 1 2 3 4 5 6 1 chunk +21 lines, -8 lines 0 comments Download
M Source/core/xml/XMLSerializer.idl View 1 2 3 4 5 6 1 chunk +5 lines, -2 lines 0 comments Download
A Source/core/xml/XMLSerializer.js View 1 2 3 4 5 6 1 chunk +373 lines, -0 lines 1 comment Download
M public/blink_resources.grd View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 29 (9 generated)
tasak
On 2014/09/02 12:47:26, tasak wrote: > mailto:tasak@google.com changed reviewers: > + mailto:yosin@chromium.org WIP. Need to ...
6 years, 3 months ago (2014-09-02 13:15:48 UTC) #2
yosin_UTC9
https://codereview.chromium.org/534583002/diff/20001/Source/core/xml/DocumentXMLSerializer.idl File Source/core/xml/DocumentXMLSerializer.idl (right): https://codereview.chromium.org/534583002/diff/20001/Source/core/xml/DocumentXMLSerializer.idl#newcode6 Source/core/xml/DocumentXMLSerializer.idl:6: [OnlyExposedToPrivateScript] readonly attribute boolean hasXMLDeclaration; Can we pass them ...
6 years, 3 months ago (2014-09-03 03:35:02 UTC) #3
tasak
Thank you for reviewing. https://codereview.chromium.org/534583002/diff/20001/Source/core/xml/XMLSerializer.js File Source/core/xml/XMLSerializer.js (right): https://codereview.chromium.org/534583002/diff/20001/Source/core/xml/XMLSerializer.js#newcode5 Source/core/xml/XMLSerializer.js:5: "use strict"; On 2014/09/03 03:35:02, ...
6 years, 3 months ago (2014-09-03 09:38:01 UTC) #7
tasak
+jl@opera.com and haraken@chromium.org Would you review this CL?
6 years, 3 months ago (2014-09-03 09:38:42 UTC) #9
Jens Widell
This is a rather shallow review. Also note that I'm not a core/ OWNER. What's ...
6 years, 3 months ago (2014-09-03 10:29:34 UTC) #10
tasak
Thank you for reviewing. >Is it a conversion to JS of our existing C++ serializer, ...
6 years, 3 months ago (2014-09-03 11:40:47 UTC) #11
haraken
tasak@ has thoughts about backdoors. I think we should first discuss the backdoors with abarth@ ...
6 years, 3 months ago (2014-09-03 11:43:19 UTC) #13
tasak
+abarth@chromium.org. abarth, would you review this CL, mainly, XMLSerializer.idl? To serialize a document, we need ...
6 years, 3 months ago (2014-09-03 11:46:37 UTC) #14
yosin_UTC9
https://codereview.chromium.org/534583002/diff/20001/Source/core/xml/XMLSerializer.js File Source/core/xml/XMLSerializer.js (right): https://codereview.chromium.org/534583002/diff/20001/Source/core/xml/XMLSerializer.js#newcode138 Source/core/xml/XMLSerializer.js:138: XMLSerializerPrototype.serializeAsHTMLDocument = function(node) { On 2014/09/03 09:38:00, tasak wrote: ...
6 years, 3 months ago (2014-09-04 00:58:44 UTC) #15
yosin_UTC9
+arv@ for JS style review. https://codereview.chromium.org/534583002/diff/120001/Source/core/xml/XMLSerializer.idl File Source/core/xml/XMLSerializer.idl (right): https://codereview.chromium.org/534583002/diff/120001/Source/core/xml/XMLSerializer.idl#newcode28 Source/core/xml/XMLSerializer.idl:28: [OnlyExposedToPrivateScript, ImplementedInPrivateScript] DOMString serializeToStringInternal(Node ...
6 years, 3 months ago (2014-09-04 01:10:42 UTC) #17
tasak
On 2014/09/03 11:46:37, tasak wrote: > mailto:+abarth@chromium.org. > > abarth, would you review this CL, ...
6 years, 3 months ago (2014-09-04 04:04:08 UTC) #18
tasak
https://codereview.chromium.org/534583002/diff/120001/Source/core/xml/XMLSerializer.js File Source/core/xml/XMLSerializer.js (right): https://codereview.chromium.org/534583002/diff/120001/Source/core/xml/XMLSerializer.js#newcode299 Source/core/xml/XMLSerializer.js:299: } else if (node.nodeType == Node.COMMENT_NODE) { On 2014/09/04 ...
6 years, 3 months ago (2014-09-04 11:17:35 UTC) #19
tasak
On 2014/09/03 11:46:37, tasak wrote: > mailto:+abarth@chromium.org. > > abarth, would you review this CL, ...
6 years, 2 months ago (2014-10-06 07:56:13 UTC) #20
abarth-chromium
I'm sorry, but I don't have the bandwidth to review this CL. Looks like you've ...
6 years, 2 months ago (2014-10-07 01:15:02 UTC) #22
haraken
On 2014/10/07 01:15:02, abarth wrote: > I'm sorry, but I don't have the bandwidth to ...
6 years, 2 months ago (2014-10-07 01:31:20 UTC) #23
arv (Not doing code reviews)
This is great. https://codereview.chromium.org/534583002/diff/160001/Source/core/xml/XMLSerializer.js File Source/core/xml/XMLSerializer.js (right): https://codereview.chromium.org/534583002/diff/160001/Source/core/xml/XMLSerializer.js#newcode9 Source/core/xml/XMLSerializer.js:9: var _EMPTY = ''; No leading ...
6 years, 2 months ago (2014-10-07 15:37:12 UTC) #24
haraken
Nit: Let's rename XMLSerializer::serializeToStringInternal to XMLSerializer::serializeToStringForPrivateScript. I'll start a discussion in blink-dev@ about a decision-making ...
6 years, 2 months ago (2014-10-08 01:22:23 UTC) #25
tasak
Thank you for reviewing. https://codereview.chromium.org/534583002/diff/160001/Source/core/xml/XMLSerializer.js File Source/core/xml/XMLSerializer.js (right): https://codereview.chromium.org/534583002/diff/160001/Source/core/xml/XMLSerializer.js#newcode9 Source/core/xml/XMLSerializer.js:9: var _EMPTY = ''; On ...
6 years, 2 months ago (2014-10-08 12:04:26 UTC) #27
arv (Not doing code reviews)
https://codereview.chromium.org/534583002/diff/160001/Source/core/xml/XMLSerializer.js File Source/core/xml/XMLSerializer.js (right): https://codereview.chromium.org/534583002/diff/160001/Source/core/xml/XMLSerializer.js#newcode264 Source/core/xml/XMLSerializer.js:264: return '<!--' + node.nodeValue + '-->'; On 2014/10/08 12:04:25, ...
6 years, 2 months ago (2014-10-08 13:38:13 UTC) #28
tasak
6 years, 2 months ago (2014-10-14 12:17:57 UTC) #29
On 2014/10/08 13:38:13, arv wrote:

> This will definitely not round trip but I guess that has always been the case:
> 
> var x = new XMLSerializer;
> var c =  new Comment('-->');
> x.serializeToString(c);  // "<!---->-->"

I see.
However, before applying this patch, console.log(x.serializeToString(c)) shows:

CONSOLE MESSAGE: line 4: <!---->-->

and after applying this patch,

CONSOLE MESSAGE: line 4: <!---->-->

So this patch doesn't change XMLSerializer's behavior.

I also checked Firefox's behavior. It shows "<!---->-->".

I think, it is difficult to change public web API's behavior after shipping.

Powered by Google App Engine
This is Rietveld 408576698