Store the language internally instead of using lang attribute for WebVTT nodes
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Feb 2013 23:33:15 +0000 (23:33 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 6 Feb 2013 23:33:15 +0000 (23:33 +0000)
commit43d4cffad18a1ce2221fc0486abd8498859e6426
treea909e9af7ea19b2ae07f091de576f5e6e2a52619
parentdbcc3132087c3f28abbb0faaece781e222ee36c4
Store the language internally instead of using lang attribute for WebVTT nodes
https://bugs.webkit.org/show_bug.cgi?id=108858

Patch by Dima Gorbik <dgorbik@apple.com> on 2013-02-06
Reviewed by Eric Carlson.

Source/WebCore:

Only language webvtt elements should have a lang attribute so we have to store
the language internally in the element. Refactored the code to make
computeInheritedLanguage virtual.

Existing tests were modified to cover this case.

* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* html/track/WebVTTElement.cpp:
(WebCore::WebVTTElement::WebVTTElement):
(WebCore::WebVTTElement::cloneElementWithoutAttributesAndChildren):
(WebCore::WebVTTElement::createEquivalentHTMLElement): clone the internal language property.
* html/track/WebVTTElement.h:
(WebCore::WebVTTElement::language):
(WebCore::WebVTTElement::setLanguage):
* html/track/WebVTTParser.cpp: only set the lang attribute for language objects.
(WebCore::WebVTTParser::constructTreeFromToken):

LayoutTests:

* media/track/captions-webvtt/styling-lang.vtt:
* media/track/track-css-matching-lang-expected.txt:
* media/track/track-css-matching-lang.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142043 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/track/captions-webvtt/styling-lang.vtt
LayoutTests/media/track/track-css-matching-lang-expected.txt
LayoutTests/media/track/track-css-matching-lang.html
Source/WebCore/ChangeLog
Source/WebCore/css/SelectorChecker.cpp
Source/WebCore/html/track/WebVTTElement.cpp
Source/WebCore/html/track/WebVTTElement.h
Source/WebCore/html/track/WebVTTParser.cpp