Bug 53783 - Dynamic changes to the lang attribute not seen by e.g. div:lang() selector
Summary: Dynamic changes to the lang attribute not seen by e.g. div:lang() selector
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 94092
Blocks: 76364
  Show dependency treegraph
 
Reported: 2011-02-04 10:00 PST by jag (Peter Annema)
Modified: 2012-08-17 00:13 PDT (History)
3 users (show)

See Also:


Attachments
Simple test case, courtesy of Boris Zbarsky (245 bytes, text/html)
2011-02-04 10:00 PST, jag (Peter Annema)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description jag (Peter Annema) 2011-02-04 10:00:44 PST
Created attachment 81239 [details]
Simple test case, courtesy of Boris Zbarsky

Dynamically setting the lang attribute doesn't trigger a style update for selectors that (now / no longer) match.
Comment 1 Alexey Proskuryakov 2012-08-14 09:34:42 PDT
I think that this has need fixed already. Bug 76364 tracks adding tests.
Comment 2 Matt Falkenhagen 2012-08-15 02:51:14 PDT
Yes, this was fixed in the patch that added lang to -webkit-locale mapping, which also added a style recalc for when lang is set (http://trac.webkit.org/changeset/103608). In the current code, the style recalc occurs because lang is one of the attributes in HTMLElement::isPresentationAttribute.

Some tests for dynamic changes have landed as part of bug 76364, but technically they only test the mapping to -webkit-locale, and not the CSS :lang selector.

I think it'd be good to add a new test specifically for the :lang selector. I'll upload a patch.
Comment 3 Matt Falkenhagen 2012-08-17 00:13:15 PDT
Closing bug as the test in bug 94092 landed.