Bug 141944 - Always serialize :lang()'s arguments to strings
Summary: Always serialize :lang()'s arguments to strings
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dhi Aurrahman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-23 18:19 PST by Dhi Aurrahman
Modified: 2015-02-24 06:21 PST (History)
2 users (show)

See Also:


Attachments
Patch (50.80 KB, patch)
2015-02-23 18:31 PST, Dhi Aurrahman
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews104 for mac-mavericks-wk2 (884.00 KB, application/zip)
2015-02-23 19:15 PST, Build Bot
no flags Details
Patch (69.26 KB, patch)
2015-02-23 19:39 PST, Dhi Aurrahman
no flags Details | Formatted Diff | Diff
Patch (69.26 KB, patch)
2015-02-23 22:18 PST, Dhi Aurrahman
no flags Details | Formatted Diff | Diff
Patch (69.30 KB, patch)
2015-02-24 04:35 PST, Dhi Aurrahman
no flags Details | Formatted Diff | Diff
Patch for landing (69.31 KB, patch)
2015-02-24 05:17 PST, Dhi Aurrahman
no flags Details | Formatted Diff | Diff
Patch for landing (69.31 KB, patch)
2015-02-24 05:36 PST, Dhi Aurrahman
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dhi Aurrahman 2015-02-23 18:19:00 PST
Always serialize :lang()'s arguments to strings
Comment 1 Dhi Aurrahman 2015-02-23 18:31:42 PST
Created attachment 247181 [details]
Patch
Comment 2 Build Bot 2015-02-23 19:15:04 PST
Comment on attachment 247181 [details]
Patch

Attachment 247181 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/5735819260198912

New failing tests:
fast/css/parsing-css-lang.html
fast/dom/css-selectorText.html
Comment 3 Build Bot 2015-02-23 19:15:06 PST
Created attachment 247184 [details]
Archive of layout-test-results from ews104 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews104  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 4 Dhi Aurrahman 2015-02-23 19:39:12 PST
Created attachment 247190 [details]
Patch
Comment 5 Dhi Aurrahman 2015-02-23 22:18:19 PST
Created attachment 247204 [details]
Patch
Comment 6 Benjamin Poulain 2015-02-23 23:27:59 PST
Comment on attachment 247204 [details]
Patch

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

> LayoutTests/fast/css/css-lang-selector-with-string-arguments-text.html:32
> +    args = args[1].split(/\s*,\s*/);

Neat! I never thought of using split() this way.

> LayoutTests/fast/css/css-selector-text.html:28
> +    var args = /\(([^)]+)/.exec(selector);

This is a bit fragile for css-selector-text.html

You could have ":matches(foo, bar):lang(foo, bar):lang(foo)".

Ideally you should have matching group over ":lang(...)", go over each one and do the conversion below.
It would probably be fine to just change /\(([^)]+)/ to /:lang\(([^)]+)/, cases with multiple :lang() can be handled outside this file.

> LayoutTests/fast/css/css-set-selector-text.html:31
> +function expectedSerializedLangSelector(selector)

ditto.
Comment 7 Dhi Aurrahman 2015-02-24 04:35:29 PST
Created attachment 247223 [details]
Patch
Comment 8 Dhi Aurrahman 2015-02-24 05:08:54 PST
(In reply to comment #6)
> Comment on attachment 247204 [details]
> Patch
> 
> View in context:

> Ideally you should have matching group over ":lang(...)", go over each one
> and do the conversion below.
> It would probably be fine to just change /\(([^)]+)/ to /:lang\(([^)]+)/,
> cases with multiple :lang() can be handled outside this file.
> 
> > LayoutTests/fast/css/css-set-selector-text.html:31
> > +function expectedSerializedLangSelector(selector)
> 
> ditto.

I will add tests for multiple (pseudo) selectors after this patch. The current patch guards the arguments `parser` with suggested /:lang\(([^)]+)/ expression.
Comment 9 Dhi Aurrahman 2015-02-24 05:17:31 PST
Created attachment 247226 [details]
Patch for landing
Comment 10 WebKit Commit Bot 2015-02-24 05:19:36 PST
Comment on attachment 247226 [details]
Patch for landing

Rejecting attachment 247226 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-01', 'validate-changelog', '--check-oops', '--non-interactive', 247226, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in LayoutTests/ChangeLog contains OOPS!.

Full output: http://webkit-queues.appspot.com/results/5754843817836544
Comment 11 Dhi Aurrahman 2015-02-24 05:36:36 PST
Created attachment 247228 [details]
Patch for landing
Comment 12 WebKit Commit Bot 2015-02-24 06:21:45 PST
Comment on attachment 247228 [details]
Patch for landing

Clearing flags on attachment: 247228

Committed r180558: <http://trac.webkit.org/changeset/180558>
Comment 13 WebKit Commit Bot 2015-02-24 06:21:50 PST
All reviewed patches have been landed.  Closing bug.