Bug 92991 - itemType.add should treat \t as a space
Summary: itemType.add should treat \t as a space
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Arko Saha
URL:
Keywords:
Depends on:
Blocks: 92986
  Show dependency treegraph
 
Reported: 2012-08-02 07:35 PDT by Arko Saha
Modified: 2012-08-10 00:42 PDT (History)
3 users (show)

See Also:


Attachments
Patch (8.86 KB, patch)
2012-08-09 09:01 PDT, Arko Saha
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from gce-cr-linux-06 (371.54 KB, application/zip)
2012-08-09 09:56 PDT, WebKit Review Bot
no flags Details
Patch for review (11.14 KB, patch)
2012-08-09 11:05 PDT, Arko Saha
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Arko Saha 2012-08-02 07:35:54 PDT
Fail- itemType.add should treat \t as a space assert_equals: expected "a\tb" but got "a\t b"

Sample test:
test(function () {
        var elem = makeEl('div',{itemtype:'a\t'});
        elem.itemType.add('b');
        assert_equals(elem.itemType.toString(),'a\tb');
}, 'itemType.add should treat \\t as a space');

Expected result: itemType.toString() should return "a\tb"
Actual: Returns "a\t b".

Please note that we have same issue in case of \r, \n and \f

Above can also be observed with following attributes:
itemref,
itemprop
Comment 1 Arko Saha 2012-08-09 09:01:15 PDT
Created attachment 157463 [details]
Patch
Comment 2 WebKit Review Bot 2012-08-09 09:56:06 PDT
Comment on attachment 157463 [details]
Patch

Attachment 157463 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/13458705

New failing tests:
fast/dom/HTMLElement/class-list.html
fast/dom/HTMLElement/class-list-quirks.html
fast/dom/HTMLOutputElement/dom-settable-token-list.html
Comment 3 WebKit Review Bot 2012-08-09 09:56:08 PDT
Created attachment 157473 [details]
Archive of layout-test-results from gce-cr-linux-06

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: gce-cr-linux-06  Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'>  Platform: Linux-2.6.39-gcg-201203291735-x86_64-with-Ubuntu-10.04-lucid
Comment 4 Arko Saha 2012-08-09 11:05:42 PDT
Created attachment 157492 [details]
Patch for review
Comment 5 Ryosuke Niwa 2012-08-09 12:44:01 PDT
Comment on attachment 157492 [details]
Patch for review

View in context: https://bugs.webkit.org/attachment.cgi?id=157492&action=review

> Source/WebCore/html/DOMTokenList.cpp:59
> +    if (!isHTMLSpace(input[input.length()-1]))

I know this was also true in the old code but there should be a space around -.

> LayoutTests/fast/dom/MicroData/domsettabletokenlist-attributes-add-token.html:21
> +        debug("PASS: " + description);

You can use testPassed.

> LayoutTests/fast/dom/MicroData/domsettabletokenlist-attributes-add-token.html:23
> +        debug("FAIL: " + description + " expected '" + expected + "' but got " + actual);

and testFailed.

> LayoutTests/fast/dom/MicroData/domsettabletokenlist-attributes-add-token.html:27
> +createElement('itemref', 'a ');

It looks as if itemref is an element name. Probably better to rename createElement to createDivWithAttribute.
Comment 6 Arko Saha 2012-08-10 00:42:28 PDT
Committed r125257: <http://trac.webkit.org/changeset/125257>