Bug 92991

Summary: itemType.add should treat \t as a space
Product: WebKit Reporter: Arko Saha <arko>
Component: DOMAssignee: Arko Saha <arko>
Status: RESOLVED FIXED    
Severity: Normal CC: dglazkov, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 92986    
Attachments:
Description Flags
Patch
webkit.review.bot: commit-queue-
Archive of layout-test-results from gce-cr-linux-06
none
Patch for review rniwa: review+

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>