Skip to content
Permalink
Browse files
Only set title on SVG documents
https://bugs.webkit.org/show_bug.cgi?id=133068

Patch by Prashant Hiremath <hiremathprashants@gmail.com> on 2014-05-20
Reviewed by Dirk Schulze.

Source/WebCore:
Test: svg/custom/html_document_set_title.html

* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::insertedInto):
(WebCore::SVGTitleElement::removedFrom):
(WebCore::SVGTitleElement::childrenChanged):

LayoutTests:
* svg/custom/html_document_set_title-expected.txt: Added.
* svg/custom/html_document_set_title.html: Added.

Canonical link: https://commits.webkit.org/151145@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169118 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
prashanth20 authored and webkit-commit-queue committed May 20, 2014
1 parent 63c7e9c commit 157146d2b1af8f1dcb4d03d566ef18a408b7bb8a
Showing 5 changed files with 51 additions and 4 deletions.
@@ -1,3 +1,13 @@
2014-05-20 Prashant Hiremath <hiremathprashants@gmail.com>

Only set title on SVG documents
https://bugs.webkit.org/show_bug.cgi?id=133068

Reviewed by Dirk Schulze.

* svg/custom/html_document_set_title-expected.txt: Added.
* svg/custom/html_document_set_title.html: Added.

2014-05-20 Alexey Proskuryakov <ap@apple.com>

REGRESSION(r169105): fast/regions/cssom/region-range-for-box-crash.html is more crashy than before
@@ -0,0 +1,5 @@
PASS successfullyParsed is true

TEST COMPLETE
PASS document.title is ""

@@ -0,0 +1,16 @@
<html>
<head>
<script src="../../resources/js-test.js"></script>
<script>
function runTest()
{
shouldBe('document.title', '""');
}
</script>
</head>
<body onload="runTest()">
<svg>
<title>Should not be set on HTML Document</title>
</svg>
</body>
</html>
@@ -1,3 +1,17 @@
2014-05-20 Prashant Hiremath <hiremathprashants@gmail.com>

Only set title on SVG documents
https://bugs.webkit.org/show_bug.cgi?id=133068

Reviewed by Dirk Schulze.

Test: svg/custom/html_document_set_title.html

* svg/SVGTitleElement.cpp:
(WebCore::SVGTitleElement::insertedInto):
(WebCore::SVGTitleElement::removedFrom):
(WebCore::SVGTitleElement::childrenChanged):

2014-05-20 peavo@outlook.com <peavo@outlook.com>

[Curl] Invalid content in cache file, causes broken rendering.
@@ -42,26 +42,28 @@ Node::InsertionNotificationRequest SVGTitleElement::insertedInto(ContainerNode&
SVGElement::insertedInto(rootParent);
if (!rootParent.inDocument())
return InsertionDone;
// FIXME: It's possible to register SVGTitleElement to an HTMLDocument.
if (firstChild())

if (firstChild() && document().isSVGDocument()) {
// FIXME: does SVG have a title text direction?
document().setTitleElement(StringWithDirection(textContent(), LTR), this);
}
return InsertionDone;
}

void SVGTitleElement::removedFrom(ContainerNode& rootParent)
{
SVGElement::removedFrom(rootParent);
if (rootParent.inDocument())
if (rootParent.inDocument() && document().isSVGDocument())
document().removeTitle(this);
}

void SVGTitleElement::childrenChanged(const ChildChange& change)
{
SVGElement::childrenChanged(change);
if (inDocument())
if (inDocument() && document().isSVGDocument()) {
// FIXME: does SVG have title text direction?
document().setTitleElement(StringWithDirection(textContent(), LTR), this);
}
}

}

0 comments on commit 157146d

Please sign in to comment.