Changeset 238377 in webkit
- Timestamp:
- Nov 19, 2018 12:42:53 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r238365 r238377 1 2018-11-19 Rob Buis <rbuis@igalia.com> 2 3 Setting document.title should have no effect for non SVG/HTML documents 4 https://bugs.webkit.org/show_bug.cgi?id=191643 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg-expected.txt: Added. 9 * web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html: Added. 10 1 11 2018-11-18 Yusuke Suzuki <yusukesuzuki@slowstart.org> 2 12 -
trunk/Source/WebCore/ChangeLog
r238375 r238377 1 2018-11-19 Rob Buis <rbuis@igalia.com> 2 3 Setting document.title should have no effect for non SVG/HTML documents 4 https://bugs.webkit.org/show_bug.cgi?id=191643 5 6 Reviewed by Chris Dumez. 7 8 Setting document.title should have no effect for non SVG/HTML documents, 9 see https://html.spec.whatwg.org/multipage/dom.html#document.title. 10 11 Behavior matches Firefox and Chrome. 12 13 Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html 14 15 * dom/Document.cpp: 16 (WebCore::Document::setTitle): 17 1 18 2018-11-19 Wenson Hsieh <wenson_hsieh@apple.com> 2 19 -
trunk/Source/WebCore/dom/Document.cpp
r238322 r238377 1581 1581 void Document::setTitle(const String& title) 1582 1582 { 1583 if (!m_titleElement) { 1584 if (isHTMLDocument() || isXHTMLDocument()) { 1583 auto* element = documentElement(); 1584 if (is<SVGSVGElement>(element)) { 1585 if (!m_titleElement) { 1586 m_titleElement = SVGTitleElement::create(SVGNames::titleTag, *this); 1587 element->insertBefore(*m_titleElement, element->firstChild()); 1588 } 1589 m_titleElement->setTextContent(title); 1590 } else if (is<HTMLElement>(element)) { 1591 if (!m_titleElement) { 1585 1592 auto* headElement = head(); 1586 1593 if (!headElement) … … 1588 1595 m_titleElement = HTMLTitleElement::create(HTMLNames::titleTag, *this); 1589 1596 headElement->appendChild(*m_titleElement); 1590 } else if (isSVGDocument()) {1591 auto* element = documentElement();1592 if (!is<SVGSVGElement>(element))1593 return;1594 m_titleElement = SVGTitleElement::create(SVGNames::titleTag, *this);1595 element->insertBefore(*m_titleElement, element->firstChild());1596 1597 } 1597 } else if (!isHTMLDocument() && !isXHTMLDocument() && !isSVGDocument()) { 1598 // FIXME: What exactly is the point of this? This seems like a strange moment 1599 // in time to demote something from being m_titleElement, when setting the 1600 // value of the title attribute. Do we have test coverage for this? 1601 m_titleElement = nullptr; 1602 } 1603 1604 if (is<HTMLTitleElement>(m_titleElement.get())) 1605 downcast<HTMLTitleElement>(*m_titleElement).setTextContent(title); 1606 else if (is<SVGTitleElement>(m_titleElement.get())) 1607 downcast<SVGTitleElement>(*m_titleElement).setTextContent(title); 1608 else 1609 updateTitle({ title, TextDirection::LTR }); 1598 m_titleElement->setTextContent(title); 1599 } 1610 1600 } 1611 1601
Note: See TracChangeset
for help on using the changeset viewer.