Changeset 176213 in webkit


Ignore:
Timestamp:
Nov 17, 2014 11:24:52 AM (9 years ago)
Author:
commit-queue@webkit.org
Message:

Attribute text in HTMLAnchorElement should behave as per specification.
https://bugs.webkit.org/show_bug.cgi?id=138557

Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-11-17
Reviewed by Darin Adler.

Source/WebCore:

attribute text in HTMLAnchorElement should not be readonly as per specification
http://www.w3.org/TR/html/text-level-semantics.html#dom-a-text. It should behave as textContent attribute.
Also This matches the behavior of Chrome 38 and FireFox.

Test: fast/dom/HTMLAnchorElement/anchor-text-attribute.html

  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::text):
(WebCore::HTMLAnchorElement::setText):

  • html/HTMLAnchorElement.h:
  • html/HTMLAnchorElement.idl:

LayoutTests:

  • fast/dom/HTMLAnchorElement/anchor-text-attribute-expected.txt: Added.
  • fast/dom/HTMLAnchorElement/anchor-text-attribute.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r176209 r176213  
     12014-11-17  Shivakumar JM  <shiva.jm@samsung.com>
     2
     3        Attribute text in HTMLAnchorElement should behave as per specification.
     4        https://bugs.webkit.org/show_bug.cgi?id=138557
     5
     6        Reviewed by Darin Adler.
     7
     8        * fast/dom/HTMLAnchorElement/anchor-text-attribute-expected.txt: Added.
     9        * fast/dom/HTMLAnchorElement/anchor-text-attribute.html: Added.
     10
    1112014-11-17  Alexey Proskuryakov  <ap@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r176212 r176213  
     12014-11-17  Shivakumar JM  <shiva.jm@samsung.com>
     2
     3        Attribute text in HTMLAnchorElement should behave as per specification.
     4        https://bugs.webkit.org/show_bug.cgi?id=138557
     5
     6        Reviewed by Darin Adler.
     7
     8        attribute text in HTMLAnchorElement should not be readonly as per specification
     9        http://www.w3.org/TR/html/text-level-semantics.html#dom-a-text. It should behave as textContent attribute.
     10        Also This matches the behavior of Chrome 38 and FireFox.
     11
     12        Test: fast/dom/HTMLAnchorElement/anchor-text-attribute.html
     13
     14        * html/HTMLAnchorElement.cpp:
     15        (WebCore::HTMLAnchorElement::text):
     16        (WebCore::HTMLAnchorElement::setText):
     17        * html/HTMLAnchorElement.h:
     18        * html/HTMLAnchorElement.idl:
     19
    1202014-11-17  Chris Dumez  <cdumez@apple.com>
    221
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r176208 r176213  
    505505String HTMLAnchorElement::text()
    506506{
    507     return innerText();
     507    return textContent();
     508}
     509
     510void HTMLAnchorElement::setText(const String& text, ExceptionCode& ec)
     511{
     512    setTextContent(text, ec);
    508513}
    509514
  • trunk/Source/WebCore/html/HTMLAnchorElement.h

    r176208 r176213  
    9292
    9393    String text();
     94    void setText(const String&, ExceptionCode&);
    9495
    9596    String toString() const;
  • trunk/Source/WebCore/html/HTMLAnchorElement.idl

    r176208 r176213  
    4545    readonly attribute DOMString protocol;
    4646    readonly attribute DOMString search;
     47    readonly attribute DOMString text;
    4748#else
    4849    [TreatNullAs=NullString] attribute DOMString hash;
     
    5354    [TreatNullAs=NullString] attribute DOMString protocol;
    5455    [TreatNullAs=NullString] attribute DOMString search;
    55 
    5656    [TreatNullAs=NullString] readonly attribute DOMString origin;
     57    [SetterRaisesException]  attribute DOMString text;
    5758#endif
    58 
    59     readonly attribute DOMString text;
    6059
    6160#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
Note: See TracChangeset for help on using the changeset viewer.