Changeset 175688 in webkit


Ignore:
Timestamp:
Nov 5, 2014 11:53:01 PM (9 years ago)
Author:
commit-queue@webkit.org
Message:

splitText API does not match DOM specification.
https://bugs.webkit.org/show_bug.cgi?id=138405

Patch by Shivakumar JM <shiva.jm@samsung.com> on 2014-11-05
Reviewed by Chris Dumez.
Source/WebCore:

Make the offset argument for splitText API as mandatory (and thus throw if it is omitted) and stop throwing if the offset argument is
negative (and wraps to a valid index) as per specification: https://w3c.github.io/dom/#interface-text. Also This matches the behavior
of both Firefox 33 and Chrome 38.

Test: fast/dom/Text/splitText.html

  • dom/Text.idl:

LayoutTests:

  • fast/dom/Text/splitText-expected.txt: Added.
  • fast/dom/Text/splitText.html: Added.
  • fast/dom/non-numeric-values-numeric-parameters-expected.txt:
  • fast/dom/script-tests/non-numeric-values-numeric-parameters.js:
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r175687 r175688  
     12014-11-05  Shivakumar JM  <shiva.jm@samsung.com>
     2
     3        splitText API does not match DOM specification.
     4        https://bugs.webkit.org/show_bug.cgi?id=138405
     5
     6        Reviewed by Chris Dumez.
     7
     8        * fast/dom/Text/splitText-expected.txt: Added.
     9        * fast/dom/Text/splitText.html: Added.
     10        * fast/dom/non-numeric-values-numeric-parameters-expected.txt:
     11        * fast/dom/script-tests/non-numeric-values-numeric-parameters.js:
     12
    1132014-11-05  Commit Queue  <commit-queue@webkit.org>
    214
  • trunk/LayoutTests/fast/dom/non-numeric-values-numeric-parameters-expected.txt

    r171014 r175688  
    6363PASS nonNumericPolicy('getSelection().getRangeAt(x)') is 'any type allowed'
    6464PASS nonNumericPolicy('document.styleSheets.item(x)') is 'any type allowed'
    65 PASS nonNumericPolicy('document.createTextNode("a").splitText(x)') is 'any type allowed'
     65PASS nonNumericPolicy('document.createTextNode("a").splitText(x)') is 'any type allowed (but not omitted)'
    6666PASS nonNumericPolicy('document.createTreeWalker(document, x, null, false)') is 'any type allowed'
    6767PASS nonNumericPolicy('document.createEvent("UIEvent").initUIEvent("a", false, false, null, x)') is 'any type allowed'
  • trunk/LayoutTests/fast/dom/script-tests/non-numeric-values-numeric-parameters.js

    r171014 r175688  
    328328// Text
    329329
    330 shouldBe("nonNumericPolicy('document.createTextNode(\"a\").splitText(x)')", "'any type allowed'");
     330shouldBe("nonNumericPolicy('document.createTextNode(\"a\").splitText(x)')", "'any type allowed (but not omitted)'");
    331331
    332332// TimeRanges
  • trunk/Source/WebCore/ChangeLog

    r175687 r175688  
     12014-11-05  Shivakumar JM  <shiva.jm@samsung.com>
     2
     3        splitText API does not match DOM specification.
     4        https://bugs.webkit.org/show_bug.cgi?id=138405
     5
     6        Reviewed by Chris Dumez.
     7 
     8        Make the offset argument for splitText API as mandatory (and thus throw if it is omitted) and stop throwing if the offset argument is
     9        negative (and wraps to a valid index) as per specification: https://w3c.github.io/dom/#interface-text. Also This matches the behavior
     10        of both Firefox 33 and Chrome 38.
     11
     12        Test: fast/dom/Text/splitText.html
     13
     14        * dom/Text.idl:
     15
    1162014-11-05  Commit Queue  <commit-queue@webkit.org>
    217
  • trunk/Source/WebCore/dom/Text.idl

    r165676 r175688  
    2424    // DOM Level 1
    2525
    26     [RaisesException] Text splitText([IsIndex,Default=Undefined] optional unsigned long offset);
     26    [RaisesException] Text splitText(unsigned long offset);
    2727
    2828    // Introduced in DOM Level 3:
Note: See TracChangeset for help on using the changeset viewer.