Bug 213167 - [WPT] dom/nodes/Document-createCDATASection-xhtml.xhtml fails due to missing exception in Document.createCDATASection()
Summary: [WPT] dom/nodes/Document-createCDATASection-xhtml.xhtml fails due to missing ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Sam Weinig
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-06-13 09:47 PDT by Sam Weinig
Modified: 2020-06-13 15:49 PDT (History)
8 users (show)

See Also:


Attachments
Patch (3.05 KB, patch)
2020-06-13 09:52 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff
Patch (5.97 KB, patch)
2020-06-13 11:11 PDT, Sam Weinig
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Weinig 2020-06-13 09:47:26 PDT
WPT: dom/nodes/Document-createCDATASection-xhtml.xhtml fails due to missing exception in Document.createCDATASection()

Test: https://wpt.fyi/results/dom/nodes/Document-createCDATASection-xhtml.xhtml?run_id=586650004&run_id=579020002&run_id=594530003&run_id=583030005
Spec: https://dom.spec.whatwg.org/#dom-document-createcdatasection

Issue: We don't implement step 2 of "createCDATASection(data)".
Comment 1 Sam Weinig 2020-06-13 09:52:37 PDT
Created attachment 401841 [details]
Patch
Comment 2 Yusuke Suzuki 2020-06-13 09:55:18 PDT
Comment on attachment 401841 [details]
Patch

r=me
Comment 3 Sam Weinig 2020-06-13 11:11:35 PDT
Created attachment 401843 [details]
Patch
Comment 4 EWS 2020-06-13 11:35:44 PDT
Committed r263003: <https://trac.webkit.org/changeset/263003>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 401843 [details].
Comment 5 Radar WebKit Bug Importer 2020-06-13 11:36:16 PDT
<rdar://problem/64330801>
Comment 6 Radar WebKit Bug Importer 2020-06-13 11:36:16 PDT
<rdar://problem/64330800>
Comment 7 Alexey Proskuryakov 2020-06-13 13:50:15 PDT
Comment on attachment 401843 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=401843&action=review

> Source/WebCore/dom/Document.cpp:1031
> +    if (data.contains("]]>"))

Does cdatasection::create not need the check?

Performance implications seem non-trivial here.
Comment 8 Sam Weinig 2020-06-13 15:40:24 PDT
(In reply to Alexey Proskuryakov from comment #7)
> Comment on attachment 401843 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=401843&action=review
> 
> > Source/WebCore/dom/Document.cpp:1031
> > +    if (data.contains("]]>"))
> 
> Does cdatasection::create not need the check?

I don't believe it does. The only other caller of CDATASection::create (other than right after this check) is XMLDocumentParser::cdataBlock, and I don't think the parser can get into this issue.

> 
> Performance implications seem non-trivial here.

Really? I don't think of something like document.createCDATASection() getting called all that much from the DOM. We now match the other major browsers and the spec, so it does turn out to a perf issue, we should also raise it with the standards folks.
Comment 9 Chris Dumez 2020-06-13 15:49:09 PDT
(In reply to Sam Weinig from comment #8)
> (In reply to Alexey Proskuryakov from comment #7)
> > Comment on attachment 401843 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=401843&action=review
> > 
> > > Source/WebCore/dom/Document.cpp:1031
> > > +    if (data.contains("]]>"))
> > 
> > Does cdatasection::create not need the check?
> 
> I don't believe it does. The only other caller of CDATASection::create
> (other than right after this check) is XMLDocumentParser::cdataBlock, and I
> don't think the parser can get into this issue.
> 
> > 
> > Performance implications seem non-trivial here.
> 
> Really? I don't think of something like document.createCDATASection()
> getting called all that much from the DOM. We now match the other major
> browsers and the spec, so it does turn out to a perf issue, we should also
> raise it with the standards folks.

I agree with Sam here.