Changeset 207280 in webkit


Ignore:
Timestamp:
Oct 13, 2016 2:22:38 AM (8 years ago)
Author:
Antti Koivisto
Message:

Support scoped style for user agent shadow trees
https://bugs.webkit.org/show_bug.cgi?id=163212
<rdar://problem/28715318>

Reviewed by Ryosuke Niwa and Andreas Kling.

Source/WebCore:

This patch adds support for user agent shadow trees that have scoped style. This means
that the shadows can be styled via <style> elements contained in the tree instead of
using pseudo elements on the global UA sheet. Since the style is scoped it can use
normal id and class selectors.

Elements in the shadow tree can still be exposed for author styling if needed by giving
them pseudo ids

The patch also uses the new mechanism for the <meter> element.

The mechanism is not optimized yet, each shadow tree gets its own copy of style-related data
structures. This can be improved later.

  • CMakeLists.txt:
  • DerivedSources.make:
  • WebCore.xcodeproj/project.pbxproj:
  • css/ElementRuleCollector.cpp:

(WebCore::MatchRequest::MatchRequest):
(WebCore::ElementRuleCollector::addMatchedRule):
(WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):

Make treeContextOrdinal an int so we can use negative ordinals. This is used to allow author pseudo
elements from earlier tree context to win over the shadow tree (matching CSS scoping spec language).

  • css/ElementRuleCollector.h:
  • css/StyleResolver.cpp:

(WebCore::StyleResolver::MatchResult::addMatchedProperties):
(WebCore::StyleResolver::CascadedProperties::addImportantMatches):

  • css/StyleResolver.h:
  • css/html.css:

(meter::-webkit-meter-inner-element): Deleted.
(meter::-webkit-meter-bar): Deleted.
(meter::-webkit-meter-optimum-value): Deleted.
(meter::-webkit-meter-suboptimum-value): Deleted.
(meter::-webkit-meter-even-less-good-value): Deleted.

Remove meter pseudo elements from the UA sheet.

  • html/HTMLMeterElement.cpp:

(WebCore::HTMLMeterElement::childShouldCreateRenderer):

Don't create shadow renderers when we have appearance (are using RenderMeter).

(WebCore::setValueClass):

Move this logic here from MeterShadowElement.cpp.
Set both class and pseudo id. The latter is needed to keep author styling working.

(WebCore::HTMLMeterElement::didElementStateChange):
(WebCore::HTMLMeterElement::renderMeter):

RenderMeter is now only instantiated when appearance is enabled.

(WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):

Build the shadow tree out of <div>s instead of special shadow elements.

  • html/HTMLMeterElement.h:
  • html/shadow/MeterShadowElement.cpp: Removed.
  • html/shadow/MeterShadowElement.h: Removed.

Not needed anymore.

  • html/shadow/meterElementShadow.css: Added.

(div#inner):
(div#bar):
(div#value):
(div#value.optimum):
(div#value.suboptimum):
(div#value.even-less-good):

Stylesheet for meter element shadow tree using normal id and class selectors.

  • style/StyleScope.cpp:

(WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):

Switch to per-scope style resolver for UA shadow trees if there is stylesheets in the tree.

(WebCore::Style::Scope::resolver):
(WebCore::Style::Scope::resolverIfExists):

  • style/StyleScope.h:

LayoutTests:

  • fast/dom/HTMLMeterElement/meter-clone-expected.txt:
  • fast/dom/HTMLMeterElement/meter-clone.html:
  • fast/dom/HTMLMeterElement/meter-element-markup-expected.txt:
  • platform/mac/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt:
  • platform/mac/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt:
  • platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.txt:
Location:
trunk
Files:
2 added
3 deleted
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r207277 r207280  
     12016-10-13  Antti Koivisto  <antti@apple.com>
     2
     3        Support scoped style for user agent shadow trees
     4        https://bugs.webkit.org/show_bug.cgi?id=163212
     5        <rdar://problem/28715318>
     6
     7        Reviewed by Ryosuke Niwa and Andreas Kling.
     8
     9        * fast/dom/HTMLMeterElement/meter-clone-expected.txt:
     10        * fast/dom/HTMLMeterElement/meter-clone.html:
     11        * fast/dom/HTMLMeterElement/meter-element-markup-expected.txt:
     12        * platform/mac/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt:
     13        * platform/mac/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt:
     14        * platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.txt:
     15
    1162016-10-12  Chris Dumez  <cdumez@apple.com>
    217
  • trunk/LayoutTests/fast/dom/HTMLMeterElement/meter-clone-expected.txt

    r125659 r207280  
    11PASS cloned.value is target.value
    2 PASS internals.shadowPseudoId(clonedShadowRoot.firstChild) is internals.shadowPseudoId(targetShadowRoot.firstChild)
    3 PASS internals.shadowPseudoId(clonedShadowRoot.firstChild.firstChild) is internals.shadowPseudoId(targetShadowRoot.firstChild.firstChild)
    4 PASS internals.shadowPseudoId(clonedShadowRoot.firstChild.firstChild.firstChild) is internals.shadowPseudoId(targetShadowRoot.firstChild.firstChild.firstChild)
    5 PASS clonedShadowRoot.firstChild.firstChild.firstChild.style.width is "70%"
    6 PASS targetShadowRoot.firstChild.firstChild.firstChild.style.width is "50%"
     2PASS internals.shadowPseudoId(clonedInnerElement) is internals.shadowPseudoId(targetInnerElement)
     3PASS internals.shadowPseudoId(clonedInnerElement.firstChild) is internals.shadowPseudoId(targetInnerElement.firstChild)
     4PASS internals.shadowPseudoId(clonedInnerElement.firstChild.firstChild) is internals.shadowPseudoId(targetInnerElement.firstChild.firstChild)
     5PASS clonedInnerElement.firstChild.firstChild.style.width is "70%"
     6PASS targetInnerElement.firstChild.firstChild.style.width is "50%"
    77PASS successfullyParsed is true
    88
  • trunk/LayoutTests/fast/dom/HTMLMeterElement/meter-clone.html

    r155265 r207280  
    1818    targetShadowRoot = internals.shadowRoot(target);
    1919    clonedShadowRoot = internals.shadowRoot(cloned);
    20    
     20    targetInnerElement = targetShadowRoot.querySelector("#inner");
     21    clonedInnerElement = clonedShadowRoot.querySelector("#inner");
     22
    2123    shouldBe("cloned.value", "target.value");
    22     shouldBe("internals.shadowPseudoId(clonedShadowRoot.firstChild)", "internals.shadowPseudoId(targetShadowRoot.firstChild)");
    23     shouldBe("internals.shadowPseudoId(clonedShadowRoot.firstChild.firstChild)", "internals.shadowPseudoId(targetShadowRoot.firstChild.firstChild)");
    24     shouldBe("internals.shadowPseudoId(clonedShadowRoot.firstChild.firstChild.firstChild)", "internals.shadowPseudoId(targetShadowRoot.firstChild.firstChild.firstChild)");
     24    shouldBe("internals.shadowPseudoId(clonedInnerElement)", "internals.shadowPseudoId(targetInnerElement)");
     25    shouldBe("internals.shadowPseudoId(clonedInnerElement.firstChild)", "internals.shadowPseudoId(targetInnerElement.firstChild)");
     26    shouldBe("internals.shadowPseudoId(clonedInnerElement.firstChild.firstChild)", "internals.shadowPseudoId(targetInnerElement.firstChild.firstChild)");
    2527
    2628    cloned.value = 70;
    27     shouldBe("clonedShadowRoot.firstChild.firstChild.firstChild.style.width", '"70%"');
    28     shouldBe("targetShadowRoot.firstChild.firstChild.firstChild.style.width", '"50%"');
     29    shouldBe("clonedInnerElement.firstChild.firstChild.style.width", '"70%"');
     30    shouldBe("targetInnerElement.firstChild.firstChild.style.width", '"50%"');
    2931})();
    3032</script>
  • trunk/LayoutTests/fast/dom/HTMLMeterElement/meter-element-markup-expected.txt

    r134420 r207280  
    77|   value="70"
    88|   <shadow:root>
     9|     <style>
     10|       "div#inner { -webkit-appearance: inherit; box-sizing: inherit; height: 100%; width: 100%; } div#bar { background: -webkit-gradient(linear, left top, left bottom, from(#ddd), to(#ddd), color-stop(0.20, #eee), color-stop(0.45, #ccc), color-stop(0.55, #ccc)); height: 100%; width: 100%; box-sizing: border-box; } div#value { height: 100%; box-sizing: border-box; } div#value.optimum { background: -webkit-gradient(linear, left top, left bottom, from(#ad7), to(#ad7), color-stop(0.20, #cea), color-stop(0.45, #7a3), color-stop(0.55, #7a3)); } div#value.suboptimum { background: -webkit-gradient(linear, left top, left bottom, from(#fe7), to(#fe7), color-stop(0.20, #ffc), color-stop(0.45, #db3), color-stop(0.55, #db3)); height: 100%; box-sizing: border-box; } div#value.even-less-good { background: -webkit-gradient(linear, left top, left bottom, from(#f77), to(#f77), color-stop(0.20, #fcc), color-stop(0.45, #d44), color-stop(0.55, #d44)); height: 100%; box-sizing: border-box; "
    911|     <div>
     12|       id="inner"
    1013|       pseudo="-webkit-meter-inner-element"
    1114|       shadow:pseudoId="-webkit-meter-inner-element"
    1215|       <div>
     16|         id="bar"
    1317|         pseudo="-webkit-meter-bar"
    1418|         shadow:pseudoId="-webkit-meter-bar"
    1519|         <div>
     20|           class="optimum"
     21|           id="value"
    1622|           pseudo="-webkit-meter-optimum-value"
    1723|           style="width: 70%;"
     
    2733|   value="10"
    2834|   <shadow:root>
     35|     <style>
     36|       "div#inner { -webkit-appearance: inherit; box-sizing: inherit; height: 100%; width: 100%; } div#bar { background: -webkit-gradient(linear, left top, left bottom, from(#ddd), to(#ddd), color-stop(0.20, #eee), color-stop(0.45, #ccc), color-stop(0.55, #ccc)); height: 100%; width: 100%; box-sizing: border-box; } div#value { height: 100%; box-sizing: border-box; } div#value.optimum { background: -webkit-gradient(linear, left top, left bottom, from(#ad7), to(#ad7), color-stop(0.20, #cea), color-stop(0.45, #7a3), color-stop(0.55, #7a3)); } div#value.suboptimum { background: -webkit-gradient(linear, left top, left bottom, from(#fe7), to(#fe7), color-stop(0.20, #ffc), color-stop(0.45, #db3), color-stop(0.55, #db3)); height: 100%; box-sizing: border-box; } div#value.even-less-good { background: -webkit-gradient(linear, left top, left bottom, from(#f77), to(#f77), color-stop(0.20, #fcc), color-stop(0.45, #d44), color-stop(0.55, #d44)); height: 100%; box-sizing: border-box; "
    2937|     <div>
     38|       id="inner"
    3039|       pseudo="-webkit-meter-inner-element"
    3140|       shadow:pseudoId="-webkit-meter-inner-element"
    3241|       <div>
     42|         id="bar"
    3343|         pseudo="-webkit-meter-bar"
    3444|         shadow:pseudoId="-webkit-meter-bar"
    3545|         <div>
     46|           class="suboptimum"
     47|           id="value"
    3648|           pseudo="-webkit-meter-suboptimum-value"
    3749|           style="width: 100%;"
     
    4759|   value="10"
    4860|   <shadow:root>
     61|     <style>
     62|       "div#inner { -webkit-appearance: inherit; box-sizing: inherit; height: 100%; width: 100%; } div#bar { background: -webkit-gradient(linear, left top, left bottom, from(#ddd), to(#ddd), color-stop(0.20, #eee), color-stop(0.45, #ccc), color-stop(0.55, #ccc)); height: 100%; width: 100%; box-sizing: border-box; } div#value { height: 100%; box-sizing: border-box; } div#value.optimum { background: -webkit-gradient(linear, left top, left bottom, from(#ad7), to(#ad7), color-stop(0.20, #cea), color-stop(0.45, #7a3), color-stop(0.55, #7a3)); } div#value.suboptimum { background: -webkit-gradient(linear, left top, left bottom, from(#fe7), to(#fe7), color-stop(0.20, #ffc), color-stop(0.45, #db3), color-stop(0.55, #db3)); height: 100%; box-sizing: border-box; } div#value.even-less-good { background: -webkit-gradient(linear, left top, left bottom, from(#f77), to(#f77), color-stop(0.20, #fcc), color-stop(0.45, #d44), color-stop(0.55, #d44)); height: 100%; box-sizing: border-box; "
    4963|     <div>
     64|       id="inner"
    5065|       pseudo="-webkit-meter-inner-element"
    5166|       shadow:pseudoId="-webkit-meter-inner-element"
    5267|       <div>
     68|         id="bar"
    5369|         pseudo="-webkit-meter-bar"
    5470|         shadow:pseudoId="-webkit-meter-bar"
    5571|         <div>
     72|           class="even-less-good"
     73|           id="value"
    5674|           pseudo="-webkit-meter-even-less-good-value"
    5775|           style="width: 100%;"
  • trunk/LayoutTests/platform/ios-simulator/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt

    r205579 r207280  
    1717              text run at (0,0) width 88: "value=10/10:"
    1818            RenderBlock (floating) {METER} at (664,0) size 80x16
    19               RenderMeter {DIV} at (0,0) size 80x16
     19              RenderBlock {DIV} at (0,0) size 80x16
    2020                RenderBlock {DIV} at (0,0) size 80x16
    2121                  RenderBlock {DIV} at (0,0) size 80x16
     
    2525              text run at (0,0) width 80: "value=8/10:"
    2626            RenderBlock (floating) {METER} at (664,0) size 80x16
    27               RenderMeter {DIV} at (0,0) size 80x16
     27              RenderBlock {DIV} at (0,0) size 80x16
    2828                RenderBlock {DIV} at (0,0) size 80x16
    2929                  RenderBlock {DIV} at (0,0) size 64x16
     
    3333              text run at (0,0) width 80: "value=5/10:"
    3434            RenderBlock (floating) {METER} at (664,0) size 80x16
    35               RenderMeter {DIV} at (0,0) size 80x16
     35              RenderBlock {DIV} at (0,0) size 80x16
    3636                RenderBlock {DIV} at (0,0) size 80x16
    3737                  RenderBlock {DIV} at (0,0) size 40x16
     
    4141              text run at (0,0) width 80: "value=2/10:"
    4242            RenderBlock (floating) {METER} at (664,0) size 80x16
    43               RenderMeter {DIV} at (0,0) size 80x16
     43              RenderBlock {DIV} at (0,0) size 80x16
    4444                RenderBlock {DIV} at (0,0) size 80x16
    4545                  RenderBlock {DIV} at (0,0) size 16x16
     
    4949              text run at (0,0) width 80: "value=0/10:"
    5050            RenderBlock (floating) {METER} at (664,0) size 80x16
    51               RenderMeter {DIV} at (0,0) size 80x16
     51              RenderBlock {DIV} at (0,0) size 80x16
    5252                RenderBlock {DIV} at (0,0) size 80x16
    5353                  RenderBlock {DIV} at (0,0) size 0x16
     
    5757              text run at (0,0) width 38: "RTL:"
    5858            RenderBlock (floating) {METER} at (664,0) size 80x16
    59               RenderMeter {DIV} at (0,0) size 80x16
     59              RenderBlock {DIV} at (0,0) size 80x16
    6060                RenderBlock {DIV} at (0,0) size 80x16
    6161                  RenderBlock {DIV} at (40,0) size 40x16
     
    6565              text run at (0,0) width 32: "Tall:"
    6666            RenderBlock (floating) {METER} at (664,0) size 80x50
    67               RenderMeter {DIV} at (0,0) size 80x50
     67              RenderBlock {DIV} at (0,0) size 80x50
    6868                RenderBlock {DIV} at (0,0) size 80x50
    6969                  RenderBlock {DIV} at (0,0) size 40x50
     
    7373              text run at (0,0) width 44: "Short:"
    7474            RenderBlock (floating) {METER} at (664,0) size 80x5
    75               RenderMeter {DIV} at (0,0) size 80x5
     75              RenderBlock {DIV} at (0,0) size 80x5
    7676                RenderBlock {DIV} at (0,0) size 80x5
    7777                  RenderBlock {DIV} at (0,0) size 24x5
     
    8181              text run at (0,0) width 42: "Wide:"
    8282            RenderBlock (floating) {METER} at (444,0) size 300x16
    83               RenderMeter {DIV} at (0,0) size 300x16
     83              RenderBlock {DIV} at (0,0) size 300x16
    8484                RenderBlock {DIV} at (0,0) size 300x16
    8585                  RenderBlock {DIV} at (0,0) size 150x16
     
    8989              text run at (0,0) width 59: "Narrow:"
    9090            RenderBlock (floating) {METER} at (714,0) size 30x16
    91               RenderMeter {DIV} at (0,0) size 30x16
     91              RenderBlock {DIV} at (0,0) size 30x16
    9292                RenderBlock {DIV} at (0,0) size 30x16
    9393                  RenderBlock {DIV} at (0,0) size 15x16
     
    102102              text run at (0,0) width 88: "value=10/10:"
    103103            RenderBlock (floating) {METER} at (664,0) size 80x16
    104               RenderMeter {DIV} at (0,0) size 80x16
     104              RenderBlock {DIV} at (0,0) size 80x16
    105105                RenderBlock {DIV} at (0,0) size 80x16
    106106                  RenderBlock {DIV} at (0,0) size 80x16
     
    110110              text run at (0,0) width 80: "value=8/10:"
    111111            RenderBlock (floating) {METER} at (664,0) size 80x16
    112               RenderMeter {DIV} at (0,0) size 80x16
     112              RenderBlock {DIV} at (0,0) size 80x16
    113113                RenderBlock {DIV} at (0,0) size 80x16
    114114                  RenderBlock {DIV} at (0,0) size 64x16
     
    118118              text run at (0,0) width 80: "value=5/10:"
    119119            RenderBlock (floating) {METER} at (664,0) size 80x16
    120               RenderMeter {DIV} at (0,0) size 80x16
     120              RenderBlock {DIV} at (0,0) size 80x16
    121121                RenderBlock {DIV} at (0,0) size 80x16
    122122                  RenderBlock {DIV} at (0,0) size 40x16
     
    126126              text run at (0,0) width 80: "value=2/10:"
    127127            RenderBlock (floating) {METER} at (664,0) size 80x16
    128               RenderMeter {DIV} at (0,0) size 80x16
     128              RenderBlock {DIV} at (0,0) size 80x16
    129129                RenderBlock {DIV} at (0,0) size 80x16
    130130                  RenderBlock {DIV} at (0,0) size 16x16
     
    134134              text run at (0,0) width 80: "value=0/10:"
    135135            RenderBlock (floating) {METER} at (664,0) size 80x16
    136               RenderMeter {DIV} at (0,0) size 80x16
     136              RenderBlock {DIV} at (0,0) size 80x16
    137137                RenderBlock {DIV} at (0,0) size 80x16
    138138                  RenderBlock {DIV} at (0,0) size 0x16
     
    142142              text run at (0,0) width 38: "RTL:"
    143143            RenderBlock (floating) {METER} at (664,0) size 80x16
    144               RenderMeter {DIV} at (0,0) size 80x16
     144              RenderBlock {DIV} at (0,0) size 80x16
    145145                RenderBlock {DIV} at (0,0) size 80x16
    146146                  RenderBlock {DIV} at (40,0) size 40x16
     
    150150              text run at (0,0) width 32: "Tall:"
    151151            RenderBlock (floating) {METER} at (664,0) size 80x50
    152               RenderMeter {DIV} at (0,0) size 80x50
     152              RenderBlock {DIV} at (0,0) size 80x50
    153153                RenderBlock {DIV} at (0,0) size 80x50
    154154                  RenderBlock {DIV} at (0,0) size 40x50
     
    158158              text run at (0,0) width 44: "Short:"
    159159            RenderBlock (floating) {METER} at (664,0) size 80x5
    160               RenderMeter {DIV} at (0,0) size 80x5
     160              RenderBlock {DIV} at (0,0) size 80x5
    161161                RenderBlock {DIV} at (0,0) size 80x5
    162162                  RenderBlock {DIV} at (0,0) size 24x5
     
    166166              text run at (0,0) width 42: "Wide:"
    167167            RenderBlock (floating) {METER} at (444,0) size 300x16
    168               RenderMeter {DIV} at (0,0) size 300x16
     168              RenderBlock {DIV} at (0,0) size 300x16
    169169                RenderBlock {DIV} at (0,0) size 300x16
    170170                  RenderBlock {DIV} at (0,0) size 150x16
     
    174174              text run at (0,0) width 59: "Narrow:"
    175175            RenderBlock (floating) {METER} at (714,0) size 30x16
    176               RenderMeter {DIV} at (0,0) size 30x16
     176              RenderBlock {DIV} at (0,0) size 30x16
    177177                RenderBlock {DIV} at (0,0) size 30x16
    178178                  RenderBlock {DIV} at (0,0) size 15x16
  • trunk/LayoutTests/platform/ios-simulator/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt

    r205579 r207280  
    1717              text run at (0,0) width 88: "value=10/10:"
    1818            RenderBlock (floating) {METER} at (664,0) size 80x16
    19               RenderMeter {DIV} at (0,0) size 80x16
     19              RenderBlock {DIV} at (0,0) size 80x16
    2020                RenderBlock {DIV} at (0,0) size 80x16
    2121                  RenderBlock {DIV} at (0,0) size 80x16
     
    2525              text run at (0,0) width 80: "value=8/10:"
    2626            RenderBlock (floating) {METER} at (664,0) size 80x16
    27               RenderMeter {DIV} at (0,0) size 80x16
     27              RenderBlock {DIV} at (0,0) size 80x16
    2828                RenderBlock {DIV} at (0,0) size 80x16
    2929                  RenderBlock {DIV} at (0,0) size 64x16
     
    3333              text run at (0,0) width 80: "value=5/10:"
    3434            RenderBlock (floating) {METER} at (664,0) size 80x16
    35               RenderMeter {DIV} at (0,0) size 80x16
     35              RenderBlock {DIV} at (0,0) size 80x16
    3636                RenderBlock {DIV} at (0,0) size 80x16
    3737                  RenderBlock {DIV} at (0,0) size 40x16
     
    4141              text run at (0,0) width 80: "value=2/10:"
    4242            RenderBlock (floating) {METER} at (664,0) size 80x16
    43               RenderMeter {DIV} at (0,0) size 80x16
     43              RenderBlock {DIV} at (0,0) size 80x16
    4444                RenderBlock {DIV} at (0,0) size 80x16
    4545                  RenderBlock {DIV} at (0,0) size 16x16
     
    4949              text run at (0,0) width 80: "value=0/10:"
    5050            RenderBlock (floating) {METER} at (664,0) size 80x16
    51               RenderMeter {DIV} at (0,0) size 80x16
     51              RenderBlock {DIV} at (0,0) size 80x16
    5252                RenderBlock {DIV} at (0,0) size 80x16
    5353                  RenderBlock {DIV} at (0,0) size 0x16
     
    5757              text run at (0,0) width 38: "RTL:"
    5858            RenderBlock (floating) {METER} at (664,0) size 80x16
    59               RenderMeter {DIV} at (0,0) size 80x16
     59              RenderBlock {DIV} at (0,0) size 80x16
    6060                RenderBlock {DIV} at (0,0) size 80x16
    6161                  RenderBlock {DIV} at (40,0) size 40x16
     
    6565              text run at (0,0) width 32: "Tall:"
    6666            RenderBlock (floating) {METER} at (664,0) size 80x50
    67               RenderMeter {DIV} at (0,0) size 80x50
     67              RenderBlock {DIV} at (0,0) size 80x50
    6868                RenderBlock {DIV} at (0,0) size 80x50
    6969                  RenderBlock {DIV} at (0,0) size 40x50
     
    7373              text run at (0,0) width 44: "Short:"
    7474            RenderBlock (floating) {METER} at (664,0) size 80x5
    75               RenderMeter {DIV} at (0,0) size 80x5
     75              RenderBlock {DIV} at (0,0) size 80x5
    7676                RenderBlock {DIV} at (0,0) size 80x5
    7777                  RenderBlock {DIV} at (0,0) size 24x5
     
    8181              text run at (0,0) width 42: "Wide:"
    8282            RenderBlock (floating) {METER} at (444,0) size 300x16
    83               RenderMeter {DIV} at (0,0) size 300x16
     83              RenderBlock {DIV} at (0,0) size 300x16
    8484                RenderBlock {DIV} at (0,0) size 300x16
    8585                  RenderBlock {DIV} at (0,0) size 150x16
     
    8989              text run at (0,0) width 59: "Narrow:"
    9090            RenderBlock (floating) {METER} at (714,0) size 30x16
    91               RenderMeter {DIV} at (0,0) size 30x16
     91              RenderBlock {DIV} at (0,0) size 30x16
    9292                RenderBlock {DIV} at (0,0) size 30x16
    9393                  RenderBlock {DIV} at (0,0) size 15x16
     
    102102              text run at (0,0) width 88: "value=10/10:"
    103103            RenderBlock (floating) {METER} at (664,0) size 80x16
    104               RenderMeter {DIV} at (0,0) size 80x16
     104              RenderBlock {DIV} at (0,0) size 80x16
    105105                RenderBlock {DIV} at (0,0) size 80x16
    106106                  RenderBlock {DIV} at (0,0) size 80x16
     
    110110              text run at (0,0) width 80: "value=8/10:"
    111111            RenderBlock (floating) {METER} at (664,0) size 80x16
    112               RenderMeter {DIV} at (0,0) size 80x16
     112              RenderBlock {DIV} at (0,0) size 80x16
    113113                RenderBlock {DIV} at (0,0) size 80x16
    114114                  RenderBlock {DIV} at (0,0) size 64x16
     
    118118              text run at (0,0) width 80: "value=5/10:"
    119119            RenderBlock (floating) {METER} at (664,0) size 80x16
    120               RenderMeter {DIV} at (0,0) size 80x16
     120              RenderBlock {DIV} at (0,0) size 80x16
    121121                RenderBlock {DIV} at (0,0) size 80x16
    122122                  RenderBlock {DIV} at (0,0) size 40x16
     
    126126              text run at (0,0) width 80: "value=2/10:"
    127127            RenderBlock (floating) {METER} at (664,0) size 80x16
    128               RenderMeter {DIV} at (0,0) size 80x16
     128              RenderBlock {DIV} at (0,0) size 80x16
    129129                RenderBlock {DIV} at (0,0) size 80x16
    130130                  RenderBlock {DIV} at (0,0) size 16x16
     
    134134              text run at (0,0) width 80: "value=0/10:"
    135135            RenderBlock (floating) {METER} at (664,0) size 80x16
    136               RenderMeter {DIV} at (0,0) size 80x16
     136              RenderBlock {DIV} at (0,0) size 80x16
    137137                RenderBlock {DIV} at (0,0) size 80x16
    138138                  RenderBlock {DIV} at (0,0) size 0x16
     
    142142              text run at (0,0) width 38: "RTL:"
    143143            RenderBlock (floating) {METER} at (664,0) size 80x16
    144               RenderMeter {DIV} at (0,0) size 80x16
     144              RenderBlock {DIV} at (0,0) size 80x16
    145145                RenderBlock {DIV} at (0,0) size 80x16
    146146                  RenderBlock {DIV} at (40,0) size 40x16
     
    150150              text run at (0,0) width 32: "Tall:"
    151151            RenderBlock (floating) {METER} at (664,0) size 80x50
    152               RenderMeter {DIV} at (0,0) size 80x50
     152              RenderBlock {DIV} at (0,0) size 80x50
    153153                RenderBlock {DIV} at (0,0) size 80x50
    154154                  RenderBlock {DIV} at (0,0) size 40x50
     
    158158              text run at (0,0) width 44: "Short:"
    159159            RenderBlock (floating) {METER} at (664,0) size 80x5
    160               RenderMeter {DIV} at (0,0) size 80x5
     160              RenderBlock {DIV} at (0,0) size 80x5
    161161                RenderBlock {DIV} at (0,0) size 80x5
    162162                  RenderBlock {DIV} at (0,0) size 24x5
     
    166166              text run at (0,0) width 42: "Wide:"
    167167            RenderBlock (floating) {METER} at (444,0) size 300x16
    168               RenderMeter {DIV} at (0,0) size 300x16
     168              RenderBlock {DIV} at (0,0) size 300x16
    169169                RenderBlock {DIV} at (0,0) size 300x16
    170170                  RenderBlock {DIV} at (0,0) size 150x16
     
    174174              text run at (0,0) width 59: "Narrow:"
    175175            RenderBlock (floating) {METER} at (714,0) size 30x16
    176               RenderMeter {DIV} at (0,0) size 30x16
     176              RenderBlock {DIV} at (0,0) size 30x16
    177177                RenderBlock {DIV} at (0,0) size 30x16
    178178                  RenderBlock {DIV} at (0,0) size 15x16
  • trunk/LayoutTests/platform/ios-simulator/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt

    r205579 r207280  
    2020            text run at (8,0) width 108: "|10,20,30,40,50: "
    2121          RenderBlock {METER} at (115,2) size 81x17
    22             RenderMeter {DIV} at (0,0) size 80x16
     22            RenderBlock {DIV} at (0,0) size 80x16
    2323              RenderBlock {DIV} at (0,0) size 80x16
    2424                RenderBlock {DIV} at (0,0) size 0x16
     
    3131            text run at (16,0) width 89: ",20,30,40,50: "
    3232          RenderBlock {METER} at (104,2) size 81x17
    33             RenderMeter {DIV} at (0,0) size 80x16
     33            RenderBlock {DIV} at (0,0) size 80x16
    3434              RenderBlock {DIV} at (0,0) size 80x16
    3535                RenderBlock {DIV} at (0,0) size 0x16
     
    4444            text run at (36,0) width 69: ",30,40,50: "
    4545          RenderBlock {METER} at (104,2) size 81x17
    46             RenderMeter {DIV} at (0,0) size 80x16
     46            RenderBlock {DIV} at (0,0) size 80x16
    4747              RenderBlock {DIV} at (0,0) size 80x16
    4848                RenderBlock {DIV} at (0,0) size 20x16
     
    5959            text run at (56,0) width 49: ",40,50: "
    6060          RenderBlock {METER} at (104,2) size 81x17
    61             RenderMeter {DIV} at (0,0) size 80x16
     61            RenderBlock {DIV} at (0,0) size 80x16
    6262              RenderBlock {DIV} at (0,0) size 80x16
    6363                RenderBlock {DIV} at (0,0) size 40x16
     
    7474            text run at (76,0) width 29: ",50: "
    7575          RenderBlock {METER} at (104,2) size 81x17
    76             RenderMeter {DIV} at (0,0) size 80x16
     76            RenderBlock {DIV} at (0,0) size 80x16
    7777              RenderBlock {DIV} at (0,0) size 80x16
    7878                RenderBlock {DIV} at (0,0) size 60x16
     
    8989            text run at (96,0) width 9: ": "
    9090          RenderBlock {METER} at (104,2) size 81x17
    91             RenderMeter {DIV} at (0,0) size 80x16
     91            RenderBlock {DIV} at (0,0) size 80x16
    9292              RenderBlock {DIV} at (0,0) size 80x16
    9393                RenderBlock {DIV} at (0,0) size 80x16
     
    104104            text run at (115,0) width 9: ": "
    105105          RenderBlock {METER} at (123,2) size 81x17
    106             RenderMeter {DIV} at (0,0) size 80x16
     106            RenderBlock {DIV} at (0,0) size 80x16
    107107              RenderBlock {DIV} at (0,0) size 80x16
    108108                RenderBlock {DIV} at (0,0) size 80x16
     
    119119            text run at (36,0) width 69: ",30,40,50: "
    120120          RenderBlock {METER} at (104,2) size 81x17
    121             RenderMeter {DIV} at (0,0) size 80x16
     121            RenderBlock {DIV} at (0,0) size 80x16
    122122              RenderBlock {DIV} at (0,0) size 80x16
    123123                RenderBlock {DIV} at (0,0) size 0x16
     
    132132            text run at (76,0) width 29: ",40: "
    133133          RenderBlock {METER} at (104,2) size 81x17
    134             RenderMeter {DIV} at (0,0) size 80x16
     134            RenderBlock {DIV} at (0,0) size 80x16
    135135              RenderBlock {DIV} at (0,0) size 80x16
    136136                RenderBlock {DIV} at (0,0) size 80x16
     
    145145            text run at (8,0) width 108: "|10,10,10,20,30: "
    146146          RenderBlock {METER} at (115,2) size 81x17
    147             RenderMeter {DIV} at (0,0) size 80x16
     147            RenderBlock {DIV} at (0,0) size 80x16
    148148              RenderBlock {DIV} at (0,0) size 80x16
    149149                RenderBlock {DIV} at (0,0) size 0x16
     
    158158            text run at (56,0) width 49: ",20,30: "
    159159          RenderBlock {METER} at (104,2) size 81x17
    160             RenderMeter {DIV} at (0,0) size 80x16
     160            RenderBlock {DIV} at (0,0) size 80x16
    161161              RenderBlock {DIV} at (0,0) size 80x16
    162162                RenderBlock {DIV} at (0,0) size 0x16
     
    171171            text run at (56,0) width 49: ",30,30: "
    172172          RenderBlock {METER} at (104,2) size 81x17
    173             RenderMeter {DIV} at (0,0) size 80x16
     173            RenderBlock {DIV} at (0,0) size 80x16
    174174              RenderBlock {DIV} at (0,0) size 80x16
    175175                RenderBlock {DIV} at (0,0) size 80x16
     
    186186            text run at (115,0) width 9: ": "
    187187          RenderBlock {METER} at (123,2) size 81x17
    188             RenderMeter {DIV} at (0,0) size 80x16
     188            RenderBlock {DIV} at (0,0) size 80x16
    189189              RenderBlock {DIV} at (0,0) size 80x16
    190190                RenderBlock {DIV} at (0,0) size 80x16
     
    201201            text run at (56,0) width 49: ",20,30: "
    202202          RenderBlock {METER} at (104,2) size 81x17
    203             RenderMeter {DIV} at (0,0) size 80x16
     203            RenderBlock {DIV} at (0,0) size 80x16
    204204              RenderBlock {DIV} at (0,0) size 80x16
    205205                RenderBlock {DIV} at (0,0) size 40x16
  • trunk/LayoutTests/platform/ios-simulator/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt

    r205579 r207280  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderBlock {METER} at (0,2) size 80x17
    7         RenderMeter {DIV} at (0,0) size 80x16
     7        RenderBlock {DIV} at (0,0) size 80x16
    88          RenderBlock {DIV} at (0,0) size 80x16
    99            RenderBlock {DIV} at (0,0) size 40x16
     
    1111        text run at (80,0) width 4: " "
    1212      RenderBlock {METER} at (84,2) size 80x17
    13         RenderMeter {DIV} at (0,0) size 80x16
     13        RenderBlock {DIV} at (0,0) size 80x16
    1414          RenderBlock {DIV} at (0,0) size 80x16
    1515            RenderBlock {DIV} at (0,0) size 40x16
  • trunk/LayoutTests/platform/ios-simulator/fast/dom/HTMLMeterElement/meter-optimums-expected.txt

    r205579 r207280  
    1919            text run at (0,0) width 77: "value=150: "
    2020          RenderBlock {METER} at (76,2) size 81x17
    21             RenderMeter {DIV} at (0,0) size 80x16
     21            RenderBlock {DIV} at (0,0) size 80x16
    2222              RenderBlock {DIV} at (0,0) size 80x16
    2323                RenderBlock {DIV} at (0,0) size 20x16
     
    2727            text run at (0,0) width 77: "value=450: "
    2828          RenderBlock {METER} at (76,2) size 81x17
    29             RenderMeter {DIV} at (0,0) size 80x16
     29            RenderBlock {DIV} at (0,0) size 80x16
    3030              RenderBlock {DIV} at (0,0) size 80x16
    3131                RenderBlock {DIV} at (0,0) size 36x16
     
    3535            text run at (0,0) width 77: "value=750: "
    3636          RenderBlock {METER} at (76,2) size 81x17
    37             RenderMeter {DIV} at (0,0) size 80x16
     37            RenderBlock {DIV} at (0,0) size 80x16
    3838              RenderBlock {DIV} at (0,0) size 80x16
    3939                RenderBlock {DIV} at (0,0) size 60x16
     
    4343            text run at (0,0) width 61: "value=0: "
    4444          RenderBlock {METER} at (60,2) size 81x17
    45             RenderMeter {DIV} at (0,0) size 80x16
     45            RenderBlock {DIV} at (0,0) size 80x16
    4646              RenderBlock {DIV} at (0,0) size 80x16
    4747                RenderBlock {DIV} at (0,0) size 0x16
     
    5151            text run at (0,0) width 85: "value=1000: "
    5252          RenderBlock {METER} at (84,2) size 81x17
    53             RenderMeter {DIV} at (0,0) size 80x16
     53            RenderBlock {DIV} at (0,0) size 80x16
    5454              RenderBlock {DIV} at (0,0) size 80x16
    5555                RenderBlock {DIV} at (0,0) size 80x16
     
    6363            text run at (0,0) width 77: "value=150: "
    6464          RenderBlock {METER} at (76,2) size 81x17
    65             RenderMeter {DIV} at (0,0) size 80x16
     65            RenderBlock {DIV} at (0,0) size 80x16
    6666              RenderBlock {DIV} at (0,0) size 80x16
    6767                RenderBlock {DIV} at (0,0) size 20x16
     
    7171            text run at (0,0) width 77: "value=450: "
    7272          RenderBlock {METER} at (76,2) size 81x17
    73             RenderMeter {DIV} at (0,0) size 80x16
     73            RenderBlock {DIV} at (0,0) size 80x16
    7474              RenderBlock {DIV} at (0,0) size 80x16
    7575                RenderBlock {DIV} at (0,0) size 36x16
     
    7979            text run at (0,0) width 77: "value=750: "
    8080          RenderBlock {METER} at (76,2) size 81x17
    81             RenderMeter {DIV} at (0,0) size 80x16
     81            RenderBlock {DIV} at (0,0) size 80x16
    8282              RenderBlock {DIV} at (0,0) size 80x16
    8383                RenderBlock {DIV} at (0,0) size 60x16
     
    8787            text run at (0,0) width 61: "value=0: "
    8888          RenderBlock {METER} at (60,2) size 81x17
    89             RenderMeter {DIV} at (0,0) size 80x16
     89            RenderBlock {DIV} at (0,0) size 80x16
    9090              RenderBlock {DIV} at (0,0) size 80x16
    9191                RenderBlock {DIV} at (0,0) size 0x16
     
    9595            text run at (0,0) width 85: "value=1000: "
    9696          RenderBlock {METER} at (84,2) size 81x17
    97             RenderMeter {DIV} at (0,0) size 80x16
     97            RenderBlock {DIV} at (0,0) size 80x16
    9898              RenderBlock {DIV} at (0,0) size 80x16
    9999                RenderBlock {DIV} at (0,0) size 80x16
     
    107107            text run at (0,0) width 77: "value=150: "
    108108          RenderBlock {METER} at (76,2) size 81x17
    109             RenderMeter {DIV} at (0,0) size 80x16
     109            RenderBlock {DIV} at (0,0) size 80x16
    110110              RenderBlock {DIV} at (0,0) size 80x16
    111111                RenderBlock {DIV} at (0,0) size 20x16
     
    115115            text run at (0,0) width 77: "value=450: "
    116116          RenderBlock {METER} at (76,2) size 81x17
    117             RenderMeter {DIV} at (0,0) size 80x16
     117            RenderBlock {DIV} at (0,0) size 80x16
    118118              RenderBlock {DIV} at (0,0) size 80x16
    119119                RenderBlock {DIV} at (0,0) size 36x16
     
    123123            text run at (0,0) width 77: "value=750: "
    124124          RenderBlock {METER} at (76,2) size 81x17
    125             RenderMeter {DIV} at (0,0) size 80x16
     125            RenderBlock {DIV} at (0,0) size 80x16
    126126              RenderBlock {DIV} at (0,0) size 80x16
    127127                RenderBlock {DIV} at (0,0) size 60x16
     
    131131            text run at (0,0) width 61: "value=0: "
    132132          RenderBlock {METER} at (60,2) size 81x17
    133             RenderMeter {DIV} at (0,0) size 80x16
     133            RenderBlock {DIV} at (0,0) size 80x16
    134134              RenderBlock {DIV} at (0,0) size 80x16
    135135                RenderBlock {DIV} at (0,0) size 0x16
     
    139139            text run at (0,0) width 85: "value=1000: "
    140140          RenderBlock {METER} at (84,2) size 81x17
    141             RenderMeter {DIV} at (0,0) size 80x16
     141            RenderBlock {DIV} at (0,0) size 80x16
    142142              RenderBlock {DIV} at (0,0) size 80x16
    143143                RenderBlock {DIV} at (0,0) size 80x16
  • trunk/LayoutTests/platform/ios-simulator/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt

    r205579 r207280  
    1212      RenderBlock (anonymous) at (0,95) size 784x16
    1313        RenderBlock {METER} at (0,-1) size 80x17
    14           RenderMeter {DIV} at (0,0) size 80x16
     14          RenderBlock {DIV} at (0,0) size 80x16
    1515            RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080]
    1616              RenderBlock {DIV} at (0,0) size 72x16 [bgcolor=#008000]
  • trunk/LayoutTests/platform/ios-simulator/fast/dom/HTMLMeterElement/meter-styles-expected.txt

    r205579 r207280  
    1010        RenderListItem {LI} at (43,0) size 732x20
    1111          RenderBlock {METER} at (0,2) size 80x17
    12             RenderMeter {DIV} at (0,0) size 80x16
     12            RenderBlock {DIV} at (0,0) size 80x16
    1313              RenderBlock {DIV} at (0,0) size 80x16
    1414                RenderBlock {DIV} at (0,0) size 20x16
     
    1616            text run at (80,0) width 4: " "
    1717          RenderBlock {METER} at (84,2) size 80x17
    18             RenderMeter {DIV} at (0,0) size 80x16
     18            RenderBlock {DIV} at (0,0) size 80x16
    1919              RenderBlock {DIV} at (0,0) size 80x16
    2020                RenderBlock {DIV} at (0,0) size 36x16
     
    2222            text run at (164,0) width 4: " "
    2323          RenderBlock {METER} at (168,2) size 80x17
    24             RenderMeter {DIV} at (0,0) size 80x16
     24            RenderBlock {DIV} at (0,0) size 80x16
    2525              RenderBlock {DIV} at (0,0) size 80x16
    2626                RenderBlock {DIV} at (0,0) size 60x16
    2727        RenderListItem {LI} at (43,23) size 732x42
    2828          RenderBlock {METER} at (0,-1) size 30x41
    29             RenderMeter {DIV} at (0,0) size 30x40
     29            RenderBlock {DIV} at (0,0) size 30x40
    3030              RenderBlock {DIV} at (0,0) size 30x40
    3131                RenderBlock {DIV} at (0,0) size 8x40
     
    3333            text run at (30,21) width 4: " "
    3434          RenderBlock {METER} at (34,-1) size 30x41
    35             RenderMeter {DIV} at (0,0) size 30x40
     35            RenderBlock {DIV} at (0,0) size 30x40
    3636              RenderBlock {DIV} at (0,0) size 30x40
    3737                RenderBlock {DIV} at (0,0) size 14x40
     
    3939            text run at (64,21) width 4: " "
    4040          RenderBlock {METER} at (68,-1) size 30x41
    41             RenderMeter {DIV} at (0,0) size 30x40
     41            RenderBlock {DIV} at (0,0) size 30x40
    4242              RenderBlock {DIV} at (0,0) size 30x40
    4343                RenderBlock {DIV} at (0,0) size 23x40
     
    4949          RenderListItem {LI} at (43,0) size 732x20
    5050            RenderBlock {METER} at (0,2) size 80x17 [bgcolor=#AAAACC] [border: (5px solid #222244) (20px solid #222244) (5px solid #222244) (10px solid #222244)]
    51               RenderMeter {DIV} at (10,5) size 50x6
     51              RenderBlock {DIV} at (10,5) size 50x6
    5252                RenderBlock {DIV} at (0,0) size 50x6
    5353                  RenderBlock {DIV} at (0,0) size 40x6
     
    5656          RenderListItem {LI} at (43,23) size 732x21
    5757            RenderBlock {METER} at (0,2) size 80x17 [bgcolor=#AAAACC]
    58               RenderMeter {DIV} at (10,5) size 50x6
     58              RenderBlock {DIV} at (10,5) size 50x6
    5959                RenderBlock {DIV} at (0,0) size 50x6
    6060                  RenderBlock {DIV} at (0,0) size 40x6
     
    6363          RenderListItem {LI} at (43,46) size 732x28
    6464            RenderBlock {METER} at (10,4) size 80x17 [bgcolor=#AAAACC]
    65               RenderMeter {DIV} at (0,0) size 80x16
     65              RenderBlock {DIV} at (0,0) size 80x16
    6666                RenderBlock {DIV} at (0,0) size 80x16
    6767                  RenderBlock {DIV} at (0,0) size 64x16
     
    7878          RenderListItem {LI} at (43,23) size 732x21
    7979            RenderBlock {METER} at (0,2) size 80x17
    80               RenderMeter {DIV} at (0,0) size 80x16
     80              RenderBlock {DIV} at (0,0) size 80x16
    8181                RenderBlock {DIV} at (0,0) size 80x16
    8282                  RenderBlock {DIV} at (0,0) size 64x16 [bgcolor=#008000] [border: (2px solid #77CC77)]
     
    8585          RenderListItem {LI} at (43,46) size 732x21
    8686            RenderBlock {METER} at (0,2) size 80x17
    87               RenderMeter {DIV} at (0,0) size 80x16
     87              RenderBlock {DIV} at (0,0) size 80x16
    8888                RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080] [border: (2px solid #222222)]
    8989                  RenderBlock {DIV} at (2,2) size 61x12
     
    9292          RenderListItem {LI} at (43,69) size 732x21
    9393            RenderBlock {METER} at (0,2) size 80x17
    94               RenderMeter {DIV} at (0,0) size 80x16
     94              RenderBlock {DIV} at (0,0) size 80x16
    9595                RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080] [border: (2px solid #222222)]
    9696                  RenderBlock {DIV} at (2,2) size 61x12 [bgcolor=#008000] [border: (2px solid #77CC77)]
     
    103103          RenderListItem {LI} at (43,23) size 732x21
    104104            RenderBlock {METER} at (0,2) size 80x17
    105               RenderMeter {DIV} at (0,0) size 80x16
     105              RenderBlock {DIV} at (0,0) size 80x16
    106106                RenderBlock {DIV} at (0,0) size 80x16
    107107                  RenderBlock {DIV} at (0,0) size 64x16 [bgcolor=#008000] [border: (2px solid #77CC77)]
     
    110110          RenderListItem {LI} at (43,46) size 732x21
    111111            RenderBlock {METER} at (0,2) size 80x17
    112               RenderMeter {DIV} at (0,0) size 80x16
     112              RenderBlock {DIV} at (0,0) size 80x16
    113113                RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080] [border: (2px solid #222222)]
    114114                  RenderBlock {DIV} at (2,2) size 61x12
     
    117117          RenderListItem {LI} at (43,69) size 732x21
    118118            RenderBlock {METER} at (0,2) size 80x17
    119               RenderMeter {DIV} at (0,0) size 80x16
     119              RenderBlock {DIV} at (0,0) size 80x16
    120120                RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080] [border: (2px solid #222222)]
    121121                  RenderBlock {DIV} at (2,2) size 61x12 [bgcolor=#008000] [border: (2px solid #77CC77)]
     
    129129          RenderListItem {LI} at (43,0) size 732x20
    130130            RenderBlock {METER} at (0,2) size 80x17
    131               RenderMeter {DIV} at (0,0) size 80x16
     131              RenderBlock {DIV} at (0,0) size 80x16
    132132                RenderBlock {DIV} at (0,0) size 80x16
    133133                  RenderBlock {DIV} at (0,0) size 64x16
     
    136136          RenderListItem {LI} at (43,23) size 732x21
    137137            RenderBlock {METER} at (0,2) size 80x17
    138               RenderMeter {DIV} at (0,0) size 80x16
     138              RenderBlock {DIV} at (0,0) size 80x16
    139139                RenderBlock {DIV} at (0,0) size 80x16
    140140                  RenderBlock {DIV} at (0,0) size 64x16
     
    146146      RenderBlock {DIV} at (0,491) size 784x21 [bgcolor=#EEEEEE]
    147147        RenderBlock {METER} at (0,2) size 80x17
    148           RenderMeter {DIV} at (0,0) size 80x16
     148          RenderBlock {DIV} at (0,0) size 80x16
    149149            RenderBlock {DIV} at (0,0) size 80x16
    150150              RenderBlock {DIV} at (5,5) size 35x6
  • trunk/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.txt

    r161884 r207280  
    88        text run at (80,0) width 4: " "
    99      RenderBlock {METER} at (84,1) size 80x17
    10         RenderMeter {DIV} at (0,0) size 80x16
     10        RenderBlock {DIV} at (0,0) size 80x16
    1111          RenderBlock {DIV} at (0,0) size 80x16
    1212            RenderBlock {DIV} at (0,0) size 40x16
  • trunk/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt

    r177774 r207280  
    1212      RenderBlock (anonymous) at (0,92) size 784x16
    1313        RenderBlock {METER} at (0,-1) size 80x17
    14           RenderMeter {DIV} at (0,0) size 80x16
     14          RenderBlock {DIV} at (0,0) size 80x16
    1515            RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080]
    1616              RenderBlock {DIV} at (0,0) size 72x16 [bgcolor=#008000]
  • trunk/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.txt

    r177774 r207280  
    1010        RenderListItem {LI} at (43,0) size 732x18
    1111          RenderBlock {METER} at (0,1) size 80x17
    12             RenderMeter {DIV} at (0,0) size 80x16
     12            RenderBlock {DIV} at (0,0) size 80x16
    1313              RenderBlock {DIV} at (0,0) size 80x16
    1414                RenderBlock {DIV} at (0,0) size 20x16
     
    1616            text run at (80,0) width 4: " "
    1717          RenderBlock {METER} at (84,1) size 80x17
    18             RenderMeter {DIV} at (0,0) size 80x16
     18            RenderBlock {DIV} at (0,0) size 80x16
    1919              RenderBlock {DIV} at (0,0) size 80x16
    2020                RenderBlock {DIV} at (0,0) size 36x16
     
    2222            text run at (164,0) width 4: " "
    2323          RenderBlock {METER} at (168,1) size 80x17
    24             RenderMeter {DIV} at (0,0) size 80x16
     24            RenderBlock {DIV} at (0,0) size 80x16
    2525              RenderBlock {DIV} at (0,0) size 80x16
    2626                RenderBlock {DIV} at (0,0) size 60x16
    2727        RenderListItem {LI} at (43,21) size 732x41
    2828          RenderBlock {METER} at (0,-1) size 30x41
    29             RenderMeter {DIV} at (0,0) size 30x40
     29            RenderBlock {DIV} at (0,0) size 30x40
    3030              RenderBlock {DIV} at (0,0) size 30x40
    3131                RenderBlock {DIV} at (0,0) size 8x40
     
    3333            text run at (30,22) width 4: " "
    3434          RenderBlock {METER} at (34,-1) size 30x41
    35             RenderMeter {DIV} at (0,0) size 30x40
     35            RenderBlock {DIV} at (0,0) size 30x40
    3636              RenderBlock {DIV} at (0,0) size 30x40
    3737                RenderBlock {DIV} at (0,0) size 14x40
     
    3939            text run at (64,22) width 4: " "
    4040          RenderBlock {METER} at (68,-1) size 30x41
    41             RenderMeter {DIV} at (0,0) size 30x40
     41            RenderBlock {DIV} at (0,0) size 30x40
    4242              RenderBlock {DIV} at (0,0) size 30x40
    4343                RenderBlock {DIV} at (0,0) size 23x40
     
    4949          RenderListItem {LI} at (43,0) size 732x18
    5050            RenderBlock {METER} at (0,1) size 80x17 [bgcolor=#AAAACC] [border: (5px solid #222244) (20px solid #222244) (5px solid #222244) (10px solid #222244)]
    51               RenderMeter {DIV} at (10,5) size 50x6
     51              RenderBlock {DIV} at (10,5) size 50x6
    5252                RenderBlock {DIV} at (0,0) size 50x6
    5353                  RenderBlock {DIV} at (0,0) size 40x6
     
    5656          RenderListItem {LI} at (43,21) size 732x19
    5757            RenderBlock {METER} at (0,1) size 80x17 [bgcolor=#AAAACC]
    58               RenderMeter {DIV} at (10,5) size 50x6
     58              RenderBlock {DIV} at (10,5) size 50x6
    5959                RenderBlock {DIV} at (0,0) size 50x6
    6060                  RenderBlock {DIV} at (0,0) size 40x6
     
    6363          RenderListItem {LI} at (43,42) size 732x27
    6464            RenderBlock {METER} at (10,4) size 80x17 [bgcolor=#AAAACC]
    65               RenderMeter {DIV} at (0,0) size 80x16
     65              RenderBlock {DIV} at (0,0) size 80x16
    6666                RenderBlock {DIV} at (0,0) size 80x16
    6767                  RenderBlock {DIV} at (0,0) size 64x16
     
    9494          RenderListItem {LI} at (43,21) size 732x19
    9595            RenderBlock {METER} at (0,1) size 80x17
    96               RenderMeter {DIV} at (0,0) size 80x16
     96              RenderBlock {DIV} at (0,0) size 80x16
    9797                RenderBlock {DIV} at (0,0) size 80x16
    9898                  RenderBlock {DIV} at (0,0) size 64x16 [bgcolor=#008000] [border: (2px solid #77CC77)]
     
    101101          RenderListItem {LI} at (43,42) size 732x19
    102102            RenderBlock {METER} at (0,1) size 80x17
    103               RenderMeter {DIV} at (0,0) size 80x16
     103              RenderBlock {DIV} at (0,0) size 80x16
    104104                RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080] [border: (2px solid #222222)]
    105105                  RenderBlock {DIV} at (2,2) size 61x12
     
    108108          RenderListItem {LI} at (43,63) size 732x19
    109109            RenderBlock {METER} at (0,1) size 80x17
    110               RenderMeter {DIV} at (0,0) size 80x16
     110              RenderBlock {DIV} at (0,0) size 80x16
    111111                RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080] [border: (2px solid #222222)]
    112112                  RenderBlock {DIV} at (2,2) size 61x12 [bgcolor=#008000] [border: (2px solid #77CC77)]
     
    120120          RenderListItem {LI} at (43,0) size 732x18
    121121            RenderBlock {METER} at (0,1) size 80x17
    122               RenderMeter {DIV} at (0,0) size 80x16
     122              RenderBlock {DIV} at (0,0) size 80x16
    123123                RenderBlock {DIV} at (0,0) size 80x16
    124124                  RenderBlock {DIV} at (0,0) size 64x16
     
    134134      RenderBlock {DIV} at (0,453) size 784x19 [bgcolor=#EEEEEE]
    135135        RenderBlock {METER} at (0,1) size 80x17
    136           RenderMeter {DIV} at (0,0) size 80x16
     136          RenderBlock {DIV} at (0,0) size 80x16
    137137            RenderBlock {DIV} at (0,0) size 80x16
    138138              RenderBlock {DIV} at (5,5) size 35x6
  • trunk/Source/WebCore/CMakeLists.txt

    r207265 r207280  
    18501850    html/shadow/MediaControlElements.cpp
    18511851    html/shadow/MediaControls.cpp
    1852     html/shadow/MeterShadowElement.cpp
    18531852    html/shadow/ProgressShadowElement.cpp
    18541853    html/shadow/SliderThumbElement.cpp
     
    29882987    ${WEBCORE_DIR}/css/quirks.css
    29892988    ${WEBCORE_DIR}/css/svg.css
     2989    ${WEBCORE_DIR}/html/shadow/meterElementShadow.css
    29902990)
    29912991
  • trunk/Source/WebCore/ChangeLog

    r207279 r207280  
     12016-10-13  Antti Koivisto  <antti@apple.com>
     2
     3        Support scoped style for user agent shadow trees
     4        https://bugs.webkit.org/show_bug.cgi?id=163212
     5        <rdar://problem/28715318>
     6
     7        Reviewed by Ryosuke Niwa and Andreas Kling.
     8
     9        This patch adds support for user agent shadow trees that have scoped style. This means
     10        that the shadows can be styled via <style> elements contained in the tree instead of
     11        using pseudo elements on the global UA sheet. Since the style is scoped it can use
     12        normal id and class selectors.
     13
     14        Elements in the shadow tree can still be exposed for author styling if needed by giving
     15        them pseudo ids
     16
     17        The patch also uses the new mechanism for the <meter> element.
     18
     19        The mechanism is not optimized yet, each shadow tree gets its own copy of style-related data
     20        structures. This can be improved later.
     21
     22        * CMakeLists.txt:
     23        * DerivedSources.make:
     24        * WebCore.xcodeproj/project.pbxproj:
     25        * css/ElementRuleCollector.cpp:
     26        (WebCore::MatchRequest::MatchRequest):
     27        (WebCore::ElementRuleCollector::addMatchedRule):
     28        (WebCore::ElementRuleCollector::matchAuthorShadowPseudoElementRules):
     29
     30            Make treeContextOrdinal an int so we can use negative ordinals. This is used to allow author pseudo
     31            elements from earlier tree context to win over the shadow tree (matching CSS scoping spec language).
     32
     33        * css/ElementRuleCollector.h:
     34        * css/StyleResolver.cpp:
     35        (WebCore::StyleResolver::MatchResult::addMatchedProperties):
     36        (WebCore::StyleResolver::CascadedProperties::addImportantMatches):
     37        * css/StyleResolver.h:
     38        * css/html.css:
     39        (meter::-webkit-meter-inner-element): Deleted.
     40        (meter::-webkit-meter-bar): Deleted.
     41        (meter::-webkit-meter-optimum-value): Deleted.
     42        (meter::-webkit-meter-suboptimum-value): Deleted.
     43        (meter::-webkit-meter-even-less-good-value): Deleted.
     44
     45            Remove meter pseudo elements from the UA sheet.
     46
     47        * html/HTMLMeterElement.cpp:
     48        (WebCore::HTMLMeterElement::childShouldCreateRenderer):
     49
     50            Don't create shadow renderers when we have appearance (are using RenderMeter).
     51
     52        (WebCore::setValueClass):
     53
     54            Move this logic here from MeterShadowElement.cpp.
     55            Set both class and pseudo id. The latter is needed to keep author styling working.
     56
     57        (WebCore::HTMLMeterElement::didElementStateChange):
     58        (WebCore::HTMLMeterElement::renderMeter):
     59
     60            RenderMeter is now only instantiated when appearance is enabled.
     61
     62        (WebCore::HTMLMeterElement::didAddUserAgentShadowRoot):
     63
     64            Build the shadow tree out of <div>s instead of special shadow elements.
     65
     66        * html/HTMLMeterElement.h:
     67        * html/shadow/MeterShadowElement.cpp: Removed.
     68        * html/shadow/MeterShadowElement.h: Removed.
     69
     70            Not needed anymore.
     71
     72        * html/shadow/meterElementShadow.css: Added.
     73        (div#inner):
     74        (div#bar):
     75        (div#value):
     76        (div#value.optimum):
     77        (div#value.suboptimum):
     78        (div#value.even-less-good):
     79
     80            Stylesheet for meter element shadow tree using normal id and class selectors.
     81
     82        * style/StyleScope.cpp:
     83        (WebCore::Style::Scope::shouldUseSharedUserAgentShadowTreeStyleResolver):
     84
     85            Switch to per-scope style resolver for UA shadow trees if there is stylesheets in the tree.
     86
     87        (WebCore::Style::Scope::resolver):
     88        (WebCore::Style::Scope::resolverIfExists):
     89        * style/StyleScope.h:
     90
    1912016-10-12  Chris Dumez  <cdumez@apple.com>
    292
  • trunk/Source/WebCore/DerivedSources.make

    r207054 r207280  
    10191019endif
    10201020
     1021ifeq ($(findstring ENABLE_METER_ELEMENT,$(FEATURE_DEFINES)), ENABLE_METER_ELEMENT)
     1022        USER_AGENT_STYLE_SHEETS := $(USER_AGENT_STYLE_SHEETS) $(WebCore)/html/shadow/meterElementShadow.css
     1023endif
     1024
    10211025UserAgentStyleSheets.h : css/make-css-file-arrays.pl bindings/scripts/preprocessor.pm $(USER_AGENT_STYLE_SHEETS) $(PLATFORM_FEATURE_DEFINES)
    10221026        $(PERL) $< --defines "$(FEATURE_DEFINES)" $@ UserAgentStyleSheetsData.cpp $(USER_AGENT_STYLE_SHEETS)
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r207265 r207280  
    39163916                A781C6A713828B5D0012A62A /* DocumentMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A781C6A613828B5D0012A62A /* DocumentMarker.cpp */; };
    39173917                A784941B0B5FE507001E237A /* DataTransfer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A784941A0B5FE507001E237A /* DataTransfer.cpp */; };
    3918                 A78E526F1346BD1700AD9C31 /* MeterShadowElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78E526D1346BD1700AD9C31 /* MeterShadowElement.cpp */; };
    3919                 A78E52701346BD1700AD9C31 /* MeterShadowElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A78E526E1346BD1700AD9C31 /* MeterShadowElement.h */; };
    39203918                A78FE13B12366B1000ACE8D0 /* SpellChecker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A78FE13912366B1000ACE8D0 /* SpellChecker.cpp */; };
    39213919                A78FE13C12366B1000ACE8D0 /* SpellChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = A78FE13A12366B1000ACE8D0 /* SpellChecker.h */; settings = {ATTRIBUTES = (Private, ); }; };
     
    62946292                E4DEAA1717A93DC3000E0430 /* StyleTreeResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E4DEAA1517A93DC3000E0430 /* StyleTreeResolver.cpp */; };
    62956293                E4DEAA1817A93DC3000E0430 /* StyleTreeResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E4DEAA1617A93DC3000E0430 /* StyleTreeResolver.h */; settings = {ATTRIBUTES = (Private, ); }; };
     6294                E4E243831DAB953E00C26E4B /* meterElementShadow.css in Resources */ = {isa = PBXBuildFile; fileRef = E4E243821DAB953E00C26E4B /* meterElementShadow.css */; };
    62966295                E4E39AFB1330EFA8003AB274 /* LegacyTileLayerPool.h in Headers */ = {isa = PBXBuildFile; fileRef = E4E39AFA1330EFA8003AB274 /* LegacyTileLayerPool.h */; };
    62976296                E4E39AFD1330EFC6003AB274 /* LegacyTileLayerPool.mm in Sources */ = {isa = PBXBuildFile; fileRef = E4E39AFC1330EFC5003AB274 /* LegacyTileLayerPool.mm */; };
     
    1121611215                A781C6A613828B5D0012A62A /* DocumentMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentMarker.cpp; sourceTree = "<group>"; };
    1121711216                A784941A0B5FE507001E237A /* DataTransfer.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DataTransfer.cpp; sourceTree = "<group>"; };
    11218                 A78E526D1346BD1700AD9C31 /* MeterShadowElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MeterShadowElement.cpp; sourceTree = "<group>"; };
    11219                 A78E526E1346BD1700AD9C31 /* MeterShadowElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MeterShadowElement.h; sourceTree = "<group>"; };
    1122011217                A78FE13912366B1000ACE8D0 /* SpellChecker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpellChecker.cpp; sourceTree = "<group>"; };
    1122111218                A78FE13A12366B1000ACE8D0 /* SpellChecker.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = SpellChecker.h; sourceTree = "<group>"; };
     
    1394313940                E4DEAA1517A93DC3000E0430 /* StyleTreeResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleTreeResolver.cpp; sourceTree = "<group>"; };
    1394413941                E4DEAA1617A93DC3000E0430 /* StyleTreeResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleTreeResolver.h; sourceTree = "<group>"; };
     13942                E4E243821DAB953E00C26E4B /* meterElementShadow.css */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.css; path = meterElementShadow.css; sourceTree = "<group>"; };
    1394513943                E4E39AFA1330EFA8003AB274 /* LegacyTileLayerPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LegacyTileLayerPool.h; sourceTree = "<group>"; };
    1394613944                E4E39AFC1330EFC5003AB274 /* LegacyTileLayerPool.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LegacyTileLayerPool.mm; sourceTree = "<group>"; };
     
    1598715985                                4157AF7F12F1FB0400A8C6F5 /* MediaControlsApple.cpp */,
    1598815986                                4157AF7E12F1FB0400A8C6F5 /* MediaControlsApple.h */,
    15989                                 A78E526D1346BD1700AD9C31 /* MeterShadowElement.cpp */,
    15990                                 A78E526E1346BD1700AD9C31 /* MeterShadowElement.h */,
     15987                                E4E243821DAB953E00C26E4B /* meterElementShadow.css */,
    1599115988                                A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */,
    1599215989                                A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */,
     
    2584525842                                E1ADECBF0E76ACF1004A1A5E /* MessagePort.h in Headers */,
    2584625843                                41BF700C0FE86F49005E8DEC /* MessagePortChannel.h in Headers */,
    25847                                 A78E52701346BD1700AD9C31 /* MeterShadowElement.h in Headers */,
    2584825844                                37DDCDA51384501C0008B793 /* MHTMLArchive.h in Headers */,
    2584925845                                37DDCDA71384501C0008B793 /* MHTMLParser.h in Headers */,
     
    2749527491                                01E6C2E41194B2820050821C /* SpellingDot@2x.png in Resources */,
    2749627492                                1C2417BA1992C04100EF9938 /* SpellingDot@3x.png in Resources */,
     27493                                E4E243831DAB953E00C26E4B /* meterElementShadow.css in Resources */,
    2749727494                                93153BDC141959BC00FCF5BE /* textAreaResizeCorner.png in Resources */,
    2749827495                                9370918D1416D86B00477333 /* textAreaResizeCorner@2x.png in Resources */,
     
    2957729574                                75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */,
    2957829575                                E1ADECC00E76ACF1004A1A5E /* MessagePort.cpp in Sources */,
    29579                                 A78E526F1346BD1700AD9C31 /* MeterShadowElement.cpp in Sources */,
    2958029576                                CB8CF0181A9358D4000D510B /* Microtasks.cpp in Sources */,
    2958129577                                37DDCD9413844FD50008B793 /* MIMEHeader.cpp in Sources */,
  • trunk/Source/WebCore/css/ElementRuleCollector.cpp

    r207077 r207280  
    7171class MatchRequest {
    7272public:
    73     MatchRequest(const RuleSet* ruleSet, bool includeEmptyRules = false, unsigned treeContextOrdinal = 0)
     73    MatchRequest(const RuleSet* ruleSet, bool includeEmptyRules = false, int treeContextOrdinal = 0)
    7474        : ruleSet(ruleSet)
    7575        , includeEmptyRules(includeEmptyRules)
     
    7979    const RuleSet* ruleSet;
    8080    const bool includeEmptyRules;
    81     unsigned treeContextOrdinal;
     81    int treeContextOrdinal;
    8282};
    8383
     
    111111}
    112112
    113 inline void ElementRuleCollector::addMatchedRule(const RuleData& ruleData, unsigned specificity, unsigned treeContextOrdinal, StyleResolver::RuleRange& ruleRange)
     113inline void ElementRuleCollector::addMatchedRule(const RuleData& ruleData, unsigned specificity, int treeContextOrdinal, StyleResolver::RuleRange& ruleRange)
    114114{
    115115    // Update our first/last rule indices in the matched rules array.
     
    233233    // Look up shadow pseudo elements also from the host scope author style as they are web-exposed.
    234234    auto& hostAuthorRules = Style::Scope::forNode(*shadowRoot.host()).resolver().ruleSets().authorStyle();
    235     MatchRequest hostAuthorRequest { &hostAuthorRules, matchRequest.includeEmptyRules };
     235    MatchRequest hostAuthorRequest { &hostAuthorRules, matchRequest.includeEmptyRules, matchRequest.treeContextOrdinal - 1 };
    236236    collectMatchingShadowPseudoElementRules(hostAuthorRequest, ruleRange);
    237237}
  • trunk/Source/WebCore/css/ElementRuleCollector.h

    r207077 r207280  
    4242    const RuleData* ruleData;
    4343    unsigned specificity;   
    44     unsigned treeContextOrdinal;
     44    int treeContextOrdinal;
    4545};
    4646
     
    9292    void sortAndTransferMatchedRules();
    9393
    94     void addMatchedRule(const RuleData&, unsigned specificity, unsigned treeContextOrdinal, StyleResolver::RuleRange&);
     94    void addMatchedRule(const RuleData&, unsigned specificity, int treeContextOrdinal, StyleResolver::RuleRange&);
    9595
    9696    const Element& m_element;
  • trunk/Source/WebCore/css/StyleResolver.cpp

    r206395 r207280  
    193193}
    194194
    195 void StyleResolver::MatchResult::addMatchedProperties(const StyleProperties& properties, StyleRule* rule, unsigned linkMatchType, PropertyWhitelistType propertyWhitelistType, unsigned treeContextOrdinal)
     195void StyleResolver::MatchResult::addMatchedProperties(const StyleProperties& properties, StyleRule* rule, unsigned linkMatchType, PropertyWhitelistType propertyWhitelistType, int treeContextOrdinal)
    196196{
    197197    m_matchedProperties.grow(m_matchedProperties.size() + 1);
     
    20332033
    20342034inline StyleResolver::MatchedProperties::MatchedProperties()
    2035     : possiblyPaddedMember(nullptr)
    20362035{
    20372036}
     
    21972196    struct IndexAndOrdinal {
    21982197        int index;
    2199         unsigned ordinal;
     2198        int ordinal;
    22002199    };
    22012200    Vector<IndexAndOrdinal> shadowTreeMatches;
  • trunk/Source/WebCore/css/StyleResolver.h

    r206538 r207280  
    246246       
    247247        RefPtr<StyleProperties> properties;
    248         union {
    249             struct {
    250                 unsigned linkMatchType : 2;
    251                 unsigned whitelistType : 2;
    252                 unsigned treeContextOrdinal : 28;
    253             };
    254             // Used to make sure all memory is zero-initialized since we compute the hash over the bytes of this object.
    255             void* possiblyPaddedMember;
    256         };
     248        uint16_t linkMatchType;
     249        uint16_t whitelistType;
     250        int treeContextOrdinal;
    257251    };
    258252
     
    265259        const Vector<MatchedProperties, 64>& matchedProperties() const { return m_matchedProperties; }
    266260
    267         void addMatchedProperties(const StyleProperties&, StyleRule* = nullptr, unsigned linkMatchType = SelectorChecker::MatchAll, PropertyWhitelistType = PropertyWhitelistNone, unsigned treeContextOrdinal = 0);
     261        void addMatchedProperties(const StyleProperties&, StyleRule* = nullptr, unsigned linkMatchType = SelectorChecker::MatchAll, PropertyWhitelistType = PropertyWhitelistNone, int treeContextOrdinal = 0);
    268262    private:
    269263        Vector<MatchedProperties, 64> m_matchedProperties;
  • trunk/Source/WebCore/css/html.css

    r205858 r207280  
    10001000}
    10011001
    1002 meter::-webkit-meter-inner-element {
    1003     -webkit-appearance: inherit;
    1004     box-sizing: inherit;
    1005     height: 100%;
    1006     width: 100%;
    1007 }
    1008 
    1009 meter::-webkit-meter-bar {
    1010     background: -webkit-gradient(linear, left top, left bottom, from(#ddd), to(#ddd), color-stop(0.20, #eee), color-stop(0.45, #ccc), color-stop(0.55, #ccc));
    1011     height: 100%;
    1012     width: 100%;
    1013     box-sizing: border-box;
    1014 }
    1015 
    1016 meter::-webkit-meter-optimum-value {
    1017     background: -webkit-gradient(linear, left top, left bottom, from(#ad7), to(#ad7), color-stop(0.20, #cea), color-stop(0.45, #7a3), color-stop(0.55, #7a3));
    1018     height: 100%;
    1019     box-sizing: border-box;
    1020 }
    1021 
    1022 meter::-webkit-meter-suboptimum-value {
    1023     background: -webkit-gradient(linear, left top, left bottom, from(#fe7), to(#fe7), color-stop(0.20, #ffc), color-stop(0.45, #db3), color-stop(0.55, #db3));
    1024     height: 100%;
    1025     box-sizing: border-box;
    1026 }
    1027 
    1028 meter::-webkit-meter-even-less-good-value {
    1029     background: -webkit-gradient(linear, left top, left bottom, from(#f77), to(#f77), color-stop(0.20, #fcc), color-stop(0.45, #d44), color-stop(0.55, #d44));
    1030     height: 100%;
    1031     box-sizing: border-box;
    1032 }
    10331002#endif
    10341003
  • trunk/Source/WebCore/html/HTMLMeterElement.cpp

    r206243 r207280  
    2828#include "ExceptionCode.h"
    2929#include "FormDataList.h"
     30#include "HTMLDivElement.h"
    3031#include "HTMLFormElement.h"
    3132#include "HTMLNames.h"
    3233#include "HTMLParserIdioms.h"
    33 #include "MeterShadowElement.h"
     34#include "HTMLStyleElement.h"
    3435#include "Page.h"
    3536#include "RenderMeter.h"
    3637#include "RenderTheme.h"
    3738#include "ShadowRoot.h"
     39#include "UserAgentStyleSheets.h"
    3840
    3941namespace WebCore {
     
    6870bool HTMLMeterElement::childShouldCreateRenderer(const Node& child) const
    6971{
    70     return hasShadowRootParent(child) && HTMLElement::childShouldCreateRenderer(child);
     72    return !is<RenderMeter>(renderer()) && HTMLElement::childShouldCreateRenderer(child);
    7173}
    7274
     
    187189}
    188190
     191static void setValueClass(HTMLElement& element, HTMLMeterElement::GaugeRegion gaugeRegion)
     192{
     193    switch (gaugeRegion) {
     194    case HTMLMeterElement::GaugeRegionOptimum:
     195        element.setAttribute(HTMLNames::classAttr, "optimum");
     196        element.setPseudo("-webkit-meter-optimum-value");
     197        return;
     198    case HTMLMeterElement::GaugeRegionSuboptimal:
     199        element.setAttribute(HTMLNames::classAttr, "suboptimum");
     200        element.setPseudo("-webkit-meter-suboptimum-value");
     201        return;
     202    case HTMLMeterElement::GaugeRegionEvenLessGood:
     203        element.setAttribute(HTMLNames::classAttr, "even-less-good");
     204        element.setPseudo("-webkit-meter-even-less-good-value");
     205        return;
     206    default:
     207        ASSERT_NOT_REACHED();
     208    }
     209}
     210
    189211void HTMLMeterElement::didElementStateChange()
    190212{
    191     m_value->setWidthPercentage(valueRatio()*100);
    192     m_value->updatePseudo();
     213    m_value->setInlineStyleProperty(CSSPropertyWidth, valueRatio()*100, CSSPrimitiveValue::CSS_PERCENTAGE);
     214    setValueClass(*m_value, gaugeRegion());
     215
    193216    if (RenderMeter* render = renderMeter())
    194217        render->updateFromElement();
     
    199222    if (is<RenderMeter>(renderer()))
    200223        return downcast<RenderMeter>(renderer());
    201     return downcast<RenderMeter>(descendantsOfType<Element>(*userAgentShadowRoot()).first()->renderer());
     224    return nullptr;
    202225}
    203226
     
    206229    ASSERT(!m_value);
    207230
    208     auto inner = MeterInnerElement::create(document());
     231    static NeverDestroyed<String> shadowStyle(meterElementShadowUserAgentStyleSheet, String::ConstructFromLiteral);
     232
     233    auto style = HTMLStyleElement::create(HTMLNames::styleTag, document(), false);
     234    style->setTextContent(shadowStyle, IGNORE_EXCEPTION);
     235    root->appendChild(style);
     236
     237    // Pseudos are set to allow author styling.
     238    auto inner = HTMLDivElement::create(document());
     239    inner->setIdAttribute("inner");
     240    inner->setPseudo("-webkit-meter-inner-element");
    209241    root->appendChild(inner);
    210242
    211     auto bar = MeterBarElement::create(document());
    212     m_value = MeterValueElement::create(document());
    213     m_value->setWidthPercentage(0);
    214     m_value->updatePseudo();
     243    auto bar = HTMLDivElement::create(document());
     244    bar->setIdAttribute("bar");
     245    bar->setPseudo("-webkit-meter-bar");
     246    inner->appendChild(bar, ASSERT_NO_EXCEPTION);
     247
     248    m_value = HTMLDivElement::create(document());
     249    m_value->setIdAttribute("value");
    215250    bar->appendChild(*m_value, ASSERT_NO_EXCEPTION);
    216251
    217     inner->appendChild(bar, ASSERT_NO_EXCEPTION);
     252    didElementStateChange();
    218253}
    219254
  • trunk/Source/WebCore/html/HTMLMeterElement.h

    r206243 r207280  
    7878    void didAddUserAgentShadowRoot(ShadowRoot*) final;
    7979
    80     RefPtr<MeterValueElement> m_value;
     80    RefPtr<HTMLElement> m_value;
    8181};
    8282
  • trunk/Source/WebCore/style/StyleScope.cpp

    r207077 r207280  
    7272}
    7373
     74bool Scope::shouldUseSharedUserAgentShadowTreeStyleResolver() const
     75{
     76    if (!m_shadowRoot)
     77        return false;
     78    if (m_shadowRoot->mode() != ShadowRoot::Mode::UserAgent)
     79        return false;
     80    // If we have stylesheets in the user agent shadow tree use per-scope resolver.
     81    if (!m_styleSheetCandidateNodes.isEmpty())
     82        return false;
     83    return true;
     84}
     85
    7486StyleResolver& Scope::resolver()
    7587{
    76     if (m_shadowRoot && m_shadowRoot->mode() == ShadowRoot::Mode::UserAgent)
     88    if (shouldUseSharedUserAgentShadowTreeStyleResolver())
    7789        return m_document.userAgentShadowTreeStyleResolver();
    7890
     
    8698StyleResolver* Scope::resolverIfExists()
    8799{
    88     if (m_shadowRoot && m_shadowRoot->mode() == ShadowRoot::Mode::UserAgent)
     100    if (shouldUseSharedUserAgentShadowTreeStyleResolver())
    89101        return &m_document.userAgentShadowTreeStyleResolver();
    90102
  • trunk/Source/WebCore/style/StyleScope.h

    r206951 r207280  
    9797
    9898private:
     99    bool shouldUseSharedUserAgentShadowTreeStyleResolver() const;
     100
    99101    enum class UpdateType { ActiveSet, ContentsOrInterpretation };
    100102    void updateActiveStyleSheets(UpdateType);
Note: See TracChangeset for help on using the changeset viewer.