Bug 53783

Summary: Dynamic changes to the lang attribute not seen by e.g. div:lang() selector
Product: WebKit Reporter: jag (Peter Annema) <jag-webkit>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, esprehn, falken
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 94092    
Bug Blocks: 76364    
Attachments:
Description Flags
Simple test case, courtesy of Boris Zbarsky none

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.