Changeset 195491 in webkit
- Timestamp:
- Jan 22, 2016 3:43:13 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r195485 r195491 1 2016-01-22 Chris Dumez <cdumez@apple.com> 2 3 DOMImplementation.createHTMLDocument("") should append an empty Text Node to the title Element 4 https://bugs.webkit.org/show_bug.cgi?id=153374 5 6 Reviewed by Ryosuke Niwa. 7 8 Rebaseline existing W3C DOM tests now that more checks are passing. 9 10 * web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt: 11 * web-platform-tests/dom/ranges/Range-selectNode-expected.txt: 12 1 13 2016-01-22 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/DOMImplementation-createHTMLDocument-expected.txt
r195485 r195491 1 1 2 FAIL createHTMLDocument test 0: "","","" assert_equals: expected 1 but got 0 2 PASS createHTMLDocument test 0: "","","" 3 3 PASS createHTMLDocument test 1: null,"null","null" 4 4 PASS createHTMLDocument test 2: undefined,undefined,"" -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/ranges/Range-selectNode-expected.txt
r190174 r195491 152 152 PASS ****** foreign doc: title node, XML doc's range, type 1 153 153 PASS ****** foreign doc: title node, detached range, type 1 154 PASS ******** foreign doc: #text node, current doc's range, type 3 155 PASS ******** foreign doc: #text node, foreign doc's range, type 3 156 PASS ******** foreign doc: #text node, XML doc's range, type 3 157 PASS ******** foreign doc: #text node, detached range, type 3 154 158 PASS **** foreign doc: body node, current doc's range, type 1 155 159 PASS **** foreign doc: body node, foreign doc's range, type 1 -
trunk/Source/WebCore/ChangeLog
r195487 r195491 1 2016-01-22 Chris Dumez <cdumez@apple.com> 2 3 DOMImplementation.createHTMLDocument("") should append an empty Text Node to the title Element 4 https://bugs.webkit.org/show_bug.cgi?id=153374 5 6 Reviewed by Ryosuke Niwa. 7 8 DOMImplementation.createHTMLDocument("") should append an empty Text 9 Node to the title Element as per the steps at: 10 - https://dom.spec.whatwg.org/#dom-domimplementation-createhtmldocument (step 6) 11 12 Firefox and Chrome follow the specification here. 13 14 Previously, WebKit would rely on HTMLTitleElement.text setter which 15 does not create a Text Node if the title is the empty string, as per: 16 - https://html.spec.whatwg.org/multipage/semantics.html#dom-title-text 17 - https://dom.spec.whatwg.org/#dom-node-textcontent 18 19 No new tests, already covered by existing test. 20 21 * dom/DOMImplementation.cpp: 22 (WebCore::DOMImplementation::createHTMLDocument): 23 1 24 2016-01-17 Ada Chan <adachan@apple.com> 2 25 -
trunk/Source/WebCore/dom/DOMImplementation.cpp
r194819 r195491 36 36 #include "FTPDirectoryDocument.h" 37 37 #include "HTMLDocument.h" 38 #include "HTMLHeadElement.h" 39 #include "HTMLTitleElement.h" 38 40 #include "Image.h" 39 41 #include "ImageDocument.h" … … 52 54 #include "StyleSheetContents.h" 53 55 #include "SubframeLoader.h" 56 #include "Text.h" 54 57 #include "TextDocument.h" 55 58 #include "XMLNames.h" … … 58 61 59 62 namespace WebCore { 63 64 using namespace HTMLNames; 60 65 61 66 typedef HashSet<String, CaseFoldingHash> FeatureSet; … … 297 302 Ref<HTMLDocument> DOMImplementation::createHTMLDocument(const String& title) 298 303 { 299 Ref<HTMLDocument> doc = HTMLDocument::create(nullptr, URL()); 300 doc->open(); 301 doc->write("<!doctype html><html><body></body></html>"); 302 if (!title.isNull()) 303 doc->setTitle(title); 304 doc->setSecurityOriginPolicy(m_document.securityOriginPolicy()); 305 return doc; 304 auto document = HTMLDocument::create(nullptr, URL()); 305 document->open(); 306 document->write("<!doctype html><html><head></head><body></body></html>"); 307 if (!title.isNull()) { 308 auto titleElement = HTMLTitleElement::create(titleTag, document); 309 titleElement->appendChild(document->createTextNode(title)); 310 ASSERT(document->head()); 311 document->head()->appendChild(WTFMove(titleElement)); 312 } 313 document->setSecurityOriginPolicy(m_document.securityOriginPolicy()); 314 return document; 306 315 } 307 316
Note: See TracChangeset
for help on using the changeset viewer.