Changeset 169118 in webkit


Ignore:
Timestamp:
May 20, 2014 10:13:35 AM (10 years ago)
Author:
commit-queue@webkit.org
Message:

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.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r169117 r169118  
     12014-05-20  Prashant Hiremath  <hiremathprashants@gmail.com>
     2
     3        Only set title on SVG documents
     4        https://bugs.webkit.org/show_bug.cgi?id=133068
     5
     6        Reviewed by Dirk Schulze.
     7
     8        * svg/custom/html_document_set_title-expected.txt: Added.
     9        * svg/custom/html_document_set_title.html: Added.
     10
    1112014-05-20  Alexey Proskuryakov  <ap@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r169115 r169118  
     12014-05-20  Prashant Hiremath  <hiremathprashants@gmail.com>
     2
     3        Only set title on SVG documents
     4        https://bugs.webkit.org/show_bug.cgi?id=133068
     5
     6        Reviewed by Dirk Schulze.
     7
     8        Test: svg/custom/html_document_set_title.html
     9
     10        * svg/SVGTitleElement.cpp:
     11        (WebCore::SVGTitleElement::insertedInto):
     12        (WebCore::SVGTitleElement::removedFrom):
     13        (WebCore::SVGTitleElement::childrenChanged):
     14
    1152014-05-20  peavo@outlook.com  <peavo@outlook.com>
    216
  • trunk/Source/WebCore/svg/SVGTitleElement.cpp

    r163440 r169118  
    4343    if (!rootParent.inDocument())
    4444        return InsertionDone;
    45     // FIXME: It's possible to register SVGTitleElement to an HTMLDocument.
    46     if (firstChild())
     45
     46    if (firstChild() && document().isSVGDocument()) {
    4747        // FIXME: does SVG have a title text direction?
    4848        document().setTitleElement(StringWithDirection(textContent(), LTR), this);
     49    }
    4950    return InsertionDone;
    5051}
     
    5354{
    5455    SVGElement::removedFrom(rootParent);
    55     if (rootParent.inDocument())
     56    if (rootParent.inDocument() && document().isSVGDocument())
    5657        document().removeTitle(this);
    5758}
     
    6061{
    6162    SVGElement::childrenChanged(change);
    62     if (inDocument())
     63    if (inDocument() && document().isSVGDocument()) {
    6364        // FIXME: does SVG have title text direction?
    6465        document().setTitleElement(StringWithDirection(textContent(), LTR), this);
     66    }
    6567}
    6668
Note: See TracChangeset for help on using the changeset viewer.