Changeset 189677 in webkit
- Timestamp:
- Sep 13, 2015 8:04:47 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r189676 r189677 1 2015-09-13 Chris Dumez <cdumez@apple.com> 2 3 Node.baseURI should not return null for detached nodes 4 https://bugs.webkit.org/show_bug.cgi?id=149104 5 <rdar://problem/22559535> 6 7 Reviewed by Sam Weinig. 8 9 * dom/xhtml/level3/core/nodegetbaseuri03-expected.txt: 10 Rebaseline outdated DOM3 test. 11 12 * svg/custom/image-base-uri-expected.txt: Removed. 13 * svg/custom/image-base-uri.svg: Removed. 14 Drop outdated SVG test. SVG2 no longer support xml:base. 15 1 16 2015-09-13 Chris Dumez <cdumez@apple.com> 2 17 -
trunk/LayoutTests/dom/xhtml/level3/core/nodegetbaseuri03-expected.txt
r21687 r189677 1 1 Test http://www.w3.org/2001/DOM-Test-Suite/level3/core/nodegetbaseuri03 2 Status Success 2 Status failure 3 Message nodegetbaseuri03: assertTrue failed -
trunk/LayoutTests/dom/xhtml/level3/core/nodegetbaseuri03.js
r41145 r189677 100 100 baseURI = docType.baseURI; 101 101 102 assert Null("nodegetbaseuri03",baseURI);102 assertTrue("nodegetbaseuri03", baseURI == null); 103 103 104 104 } -
trunk/LayoutTests/imported/w3c/ChangeLog
r189676 r189677 1 2015-09-13 Chris Dumez <cdumez@apple.com> 2 3 Node.baseURI should not return null for detached nodes 4 https://bugs.webkit.org/show_bug.cgi?id=149104 5 <rdar://problem/22559535> 6 7 Reviewed by Sam Weinig. 8 9 Rebaseline W3C test now that more checks are passing. 10 11 * web-platform-tests/dom/nodes/Node-baseURI-expected.txt: 12 1 13 2015-09-13 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Node-baseURI-expected.txt
r189471 r189677 1 1 2 2 PASS For elements belonging to document, baseURI should be document url 3 FAIL For elements unassigned to document, baseURI should be document url assert_equals: expected (string) "http://localhost:8800/dom/nodes/Node-baseURI.html" but got (object) null 4 FAIL For elements belonging to document fragments, baseURI should be document url assert_equals: expected (string) "http://localhost:8800/dom/nodes/Node-baseURI.html" but got (object) null 3 PASS For elements unassigned to document, baseURI should be document url 4 PASS For elements belonging to document fragments, baseURI should be document url 5 5 PASS After inserting fragment into document, element baseURI should be document url 6 6 -
trunk/Source/WebCore/ChangeLog
r189676 r189677 1 2015-09-13 Chris Dumez <cdumez@apple.com> 2 3 Node.baseURI should not return null for detached nodes 4 https://bugs.webkit.org/show_bug.cgi?id=149104 5 <rdar://problem/22559535> 6 7 Reviewed by Sam Weinig. 8 9 Node.baseURI should not return null for detached nodes. It should return 10 the node document's base URL. The node document is set when the node is 11 created so it is valid even if the node is detached [1]: 12 https://dom.spec.whatwg.org/#dom-node-baseuri 13 14 WebKit was traversing the ancestors to find the base URL, which only 15 works if the node is attached. Also, WebKit was taking into account 16 the xml:base attribute when computing the baseURI. 17 18 Both Chrome and Firefox already dropped support for xml:base: 19 https://code.google.com/p/chromium/issues/detail?id=341854 20 https://bugzilla.mozilla.org/show_bug.cgi?id=903372 21 22 Firefox complies with the specification. Chrome's baseURI still only 23 works for attached Nodes as their implementation still traverses the 24 DOM tree, despite dropping support for xml:base. 25 26 This patch drops support xml:base when computing Node.baseURI, as 27 Firefox, Chrome and the latest DOM specification do. It also makes 28 Node.baseURI work for detached Nodes by returning the base URL of the 29 node Document. This means we no longer have to traverse the Node's 30 ancestors in the DOM tree. This is consistent with the behavior of 31 Firefox and the latest DOM specification. 32 33 This patch does not drop the SVGElement.xmlbase attribute yet. However, 34 we should probably consider making this change as well given that: 35 - The SVG2 specification dropped it 36 - Chrome dropped it. 37 - It no longers impacts Node.baseURI 38 39 [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976 40 41 No new tests, already covered by existing test. 42 43 * dom/Document.cpp: 44 (WebCore::Document::setContent): Deleted. 45 * dom/Document.h: 46 (WebCore::Document::inputCursor): Deleted. 47 * dom/DocumentType.cpp: 48 (WebCore::DocumentType::nodeName): Deleted. 49 * dom/DocumentType.h: 50 * dom/Element.cpp: 51 (WebCore::Element::imageSourceURL): Deleted. 52 (WebCore::Element::rendererIsNeeded): Deleted. 53 (WebCore::Element::createElementRenderer): Deleted. 54 (WebCore::Element::insertedInto): Deleted. 55 * dom/Element.h: 56 * dom/Node.cpp: 57 (WebCore::Node::baseURI): 58 * dom/Node.h: 59 * svg/SVGElement.idl: 60 1 61 2015-09-13 Chris Dumez <cdumez@apple.com> 2 62 -
trunk/Source/WebCore/dom/Document.cpp
r189576 r189677 1320 1320 } 1321 1321 1322 URL Document::baseURI() const1323 {1324 return m_baseURL;1325 }1326 1327 1322 void Document::setContent(const String& content) 1328 1323 { -
trunk/Source/WebCore/dom/Document.h
r189576 r189677 433 433 void setDocumentURI(const String&); 434 434 435 virtual URL baseURI() const override final;436 437 435 #if ENABLE(WEB_REPLAY) 438 436 JSC::InputCursor& inputCursor() const { return *m_inputCursor; } -
trunk/Source/WebCore/dom/DocumentType.cpp
r189576 r189677 37 37 } 38 38 39 URL DocumentType::baseURI() const40 {41 return URL();42 }43 44 39 String DocumentType::nodeName() const 45 40 { -
trunk/Source/WebCore/dom/DocumentType.h
r189576 r189677 50 50 DocumentType(Document&, const String& name, const String& publicId, const String& systemId); 51 51 52 virtual URL baseURI() const override;53 52 virtual String nodeName() const override; 54 53 virtual NodeType nodeType() const override; -
trunk/Source/WebCore/dom/Element.cpp
r189676 r189677 1469 1469 } 1470 1470 1471 URL Element::baseURI() const1472 {1473 const AtomicString& baseAttribute = getAttribute(baseAttr);1474 URL base(URL(), baseAttribute);1475 if (!base.protocol().isEmpty())1476 return base;1477 1478 ContainerNode* parent = parentNode();1479 if (!parent)1480 return base;1481 1482 const URL& parentBase = parent->baseURI();1483 if (parentBase.isNull())1484 return base;1485 1486 return URL(parentBase, baseAttribute);1487 }1488 1489 1471 const AtomicString& Element::imageSourceURL() const 1490 1472 { -
trunk/Source/WebCore/dom/Element.h
r189576 r189677 198 198 virtual const AtomicString& namespaceURI() const override final { return m_tagName.namespaceURI(); } 199 199 200 virtual URL baseURI() const override final;201 202 200 virtual String nodeName() const override; 203 201 -
trunk/Source/WebCore/dom/Node.cpp
r189676 r189677 1166 1166 URL Node::baseURI() const 1167 1167 { 1168 return parentNode() ? parentNode()->baseURI() :URL();1168 return document().baseURL(); 1169 1169 } 1170 1170 -
trunk/Source/WebCore/dom/Node.h
r189576 r189677 183 183 Node* pseudoAwareLastChild() const; 184 184 185 virtualURL baseURI() const;185 URL baseURI() const; 186 186 187 187 void getSubresourceURLs(ListHashSet<URL>&) const; -
trunk/Source/WebCore/svg/SVGElement.idl
r168313 r189677 24 24 JSGenerateToNativeObject, 25 25 ] interface SVGElement : Element { 26 // FIXME: the xmlbase attribute is no longer part of SVG2 and Chrome already dropped it. 26 27 [TreatNullAs=NullString, SetterRaisesException] attribute DOMString xmlbase; 28 27 29 readonly attribute SVGSVGElement ownerSVGElement; 28 30 readonly attribute SVGElement viewportElement;
Note: See TracChangeset
for help on using the changeset viewer.