[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

morrita at google.com morrita at google.com
Wed Dec 22 18:09:37 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit b172c47a19720c7129d7f008674da7a46d46332a
Author: morrita at google.com <morrita at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 8 04:21:20 2010 +0000

    2010-12-05  MORITA Hajime  <morrita at google.com>
    
            Reviewed by Dimitri Glazkov.
    
            - Added a test case
            - Updated expectations to follow the change on the shadow structure.
    
            RenderIndicator subclasses should not change the render tree during layout.
            https://bugs.webkit.org/show_bug.cgi?id=50026
    
            * fast/dom/HTMLMeterElement/meter-element-crash-expected.txt: Added.
            * fast/dom/HTMLMeterElement/meter-element-crash.html: Added.
            * platform/mac/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt:
            * platform/mac/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt:
            * platform/mac/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt:
            * platform/mac/fast/dom/HTMLMeterElement/meter-element-expected.txt:
            * platform/mac/fast/dom/HTMLMeterElement/meter-optimums-expected.txt:
            * platform/mac/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt:
            * platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.txt:
    2010-12-06  MORITA Hajime  <morrita at google.com>
    
            Reviewed by Dimitri Glazkov.
    
            RenderIndicator subclasses should not change the render tree during layout.
            https://bugs.webkit.org/show_bug.cgi?id=50026
    
            The old code created shadow elements during a layout computation,
            that makes the layout state inconsisntent and cause an assertion failure.
            This change created shadow elements before the layout to avoid
            state inconsistencies.
    
            Instead of creating shadows on demand, RenderMeter and
            RenderProgress now create all necessary shadows before layouts,
            and change its visibilities during the layout: Changing
            visibilities doesn't trigger relayout and keep the state
            consistent.
    
            RenderMeter uses new HidablePartElement for shadow elements,
            which can toggle visibiliby between hidden and original value.
    
            Test: fast/dom/HTMLMeterElement/meter-element-crash.html
    
            * html/HTMLMeterElement.cpp:
            (WebCore::HTMLMeterElement::attach): Calling updateFromElement()
            * html/HTMLMeterElement.h:
            * html/HTMLProgressElement.cpp:
            (WebCore::HTMLProgressElement::attach): Calling updateFromElement()
            * html/HTMLProgressElement.h:
            * rendering/RenderIndicator.cpp:
            * rendering/RenderIndicator.h:
            * rendering/RenderMeter.cpp:
            (WebCore::MeterPartElement::MeterPartElement): Added to hold a restorable visibility.
            (WebCore::MeterPartElement::createForPart):
            (WebCore::MeterPartElement::hide):
            (WebCore::MeterPartElement::restoreVisibility):
            (WebCore::MeterPartElement::updateStyleForPart):
            (WebCore::MeterPartElement::saveVisibility):
            (WebCore::RenderMeter::~RenderMeter):
            (WebCore::RenderMeter::createPart): Extracted
            (WebCore::RenderMeter::updateFromElement): Had a shadow generation.
            (WebCore::RenderMeter::layoutParts): Removed shadow generation code.
            (WebCore::RenderMeter::shouldHaveParts):
            (WebCore::RenderMeter::valuePartRect): Adopted orientation.
            (WebCore::RenderMeter::orientation): Morphed from isHorizontal()
            (WebCore::RenderMeter::valuePseudoId): Adoptedn orientation
            (WebCore::RenderMeter::barPseudoId): Adopted orientation.
            * rendering/RenderMeter.h:
            (WebCore::RenderMeter::shadowAttached):
            * rendering/RenderProgress.cpp:
            (WebCore::RenderProgress::updateFromElement): Had a shadow generation.
            (WebCore::RenderProgress::layoutParts):
            * rendering/RenderProgress.h:
            * rendering/ShadowElement.cpp:
            (WebCore::ShadowBlockElement::createForPart): Extracted initAsPart().
            (WebCore::ShadowBlockElement::initAsPart): Extracted from createForPart().
            * rendering/ShadowElement.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73488 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 59b6378..66b8860 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,23 @@
+2010-12-05  MORITA Hajime  <morrita at google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        - Added a test case
+        - Updated expectations to follow the change on the shadow structure.
+        
+        RenderIndicator subclasses should not change the render tree during layout.
+        https://bugs.webkit.org/show_bug.cgi?id=50026
+        
+        * fast/dom/HTMLMeterElement/meter-element-crash-expected.txt: Added.
+        * fast/dom/HTMLMeterElement/meter-element-crash.html: Added.
+        * platform/mac/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt:
+        * platform/mac/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt:
+        * platform/mac/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt:
+        * platform/mac/fast/dom/HTMLMeterElement/meter-element-expected.txt:
+        * platform/mac/fast/dom/HTMLMeterElement/meter-optimums-expected.txt:
+        * platform/mac/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt:
+        * platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.txt:
+
 2010-12-07  Simon Fraser  <simon.fraser at apple.com>
 
         Relax the matching tolerance to reduce flakiness.
diff --git a/LayoutTests/fast/dom/HTMLMeterElement/meter-element-crash-expected.txt b/LayoutTests/fast/dom/HTMLMeterElement/meter-element-crash-expected.txt
new file mode 100644
index 0000000..bac9c71
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLMeterElement/meter-element-crash-expected.txt
@@ -0,0 +1 @@
+   
diff --git a/LayoutTests/fast/dom/HTMLMeterElement/meter-element-crash.html b/LayoutTests/fast/dom/HTMLMeterElement/meter-element-crash.html
new file mode 100644
index 0000000..87a23fc
--- /dev/null
+++ b/LayoutTests/fast/dom/HTMLMeterElement/meter-element-crash.html
@@ -0,0 +1,19 @@
+<!-- Test for Bug 50026. PASS unless crash. -->
+<style>
+ meter {
+   -webkit-appearance: none;
+ }  
+</style>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+    setTimeout(function() { document.body.offsetTop; document.getElementById('test').innerHTML=1 }, 0);
+</script>
+<span id="test">
+    <script>
+    document.body.offsetTop;
+    </script>
+    <input type="text">
+    <meter>
+    </meter>
+</span>
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt
index d99e3c1..2c1df51 100644
--- a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt
+++ b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-appearances-capacity-expected.txt
@@ -16,51 +16,91 @@ layer at (0,0) size 800x600
             RenderText {#text} at (0,0) size 86x18
               text run at (0,0) width 86: "value=10/10:"
             RenderMeter {METER} at (664,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
           RenderListItem {LI} at (40,18) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=8/10:"
             RenderMeter {METER} at (664,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 64x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,4) size 80x14
           RenderListItem {LI} at (40,36) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=5/10:"
             RenderMeter {METER} at (664,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 40x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,9) size 80x9
           RenderListItem {LI} at (40,54) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=2/10:"
             RenderMeter {METER} at (664,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 16x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,15) size 80x3
           RenderListItem {LI} at (40,72) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=0/10:"
             RenderMeter {METER} at (664,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 0x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,18) size 80x0
           RenderListItem {LI} at (40,90) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 39x18
               text run at (0,0) width 39: "RTL:"
             RenderMeter {METER} at (664,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (40,0) size 40x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,9) size 80x9
           RenderListItem {LI} at (40,108) size 744x50 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 32x18
               text run at (0,0) width 32: "Tall:"
             RenderMeter {METER} at (664,0) size 80x50
+              RenderBlock {DIV} at (0,0) size 80x50
+              RenderBlock {DIV} at (0,0) size 40x50
+              RenderBlock {DIV} at (0,0) size 80x50
+              RenderBlock {DIV} at (0,25) size 80x25
           RenderListItem {LI} at (40,158) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 43x18
               text run at (0,0) width 43: "Short:"
             RenderMeter {METER} at (664,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,0) size 24x18
+              RenderBlock {DIV} at (0,0) size 80x18
+              RenderBlock {DIV} at (0,13) size 80x5
           RenderListItem {LI} at (40,176) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 41x18
               text run at (0,0) width 41: "Wide:"
             RenderMeter {METER} at (444,0) size 300x18
+              RenderBlock {DIV} at (0,0) size 300x18
+              RenderBlock {DIV} at (0,0) size 150x18
+              RenderBlock {DIV} at (0,0) size 300x18
+              RenderBlock {DIV} at (0,9) size 300x9
           RenderListItem {LI} at (40,194) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 59x18
               text run at (0,0) width 59: "Narrow:"
             RenderMeter {METER} at (714,0) size 30x18
+              RenderBlock {DIV} at (0,0) size 30x18
+              RenderBlock {DIV} at (0,0) size 15x18
+              RenderBlock {DIV} at (0,0) size 30x18
+              RenderBlock {DIV} at (0,9) size 30x9
       RenderBlock {H2} at (0,293) size 784x18
         RenderText {#text} at (0,0) size 236x18
           text run at (0,0) width 236: "continuous-capacity-level-indicator"
@@ -71,48 +111,88 @@ layer at (0,0) size 800x600
             RenderText {#text} at (0,0) size 86x18
               text run at (0,0) width 86: "value=10/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
           RenderListItem {LI} at (40,18) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=8/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 64x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,4) size 80x12
           RenderListItem {LI} at (40,36) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=5/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 40x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,8) size 80x8
           RenderListItem {LI} at (40,54) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=2/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 16x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,13) size 80x3
           RenderListItem {LI} at (40,72) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=0/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 0x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,16) size 80x0
           RenderListItem {LI} at (40,90) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 39x18
               text run at (0,0) width 39: "RTL:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (40,0) size 40x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,8) size 80x8
           RenderListItem {LI} at (40,108) size 744x50 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 32x18
               text run at (0,0) width 32: "Tall:"
             RenderMeter {METER} at (664,0) size 80x50
+              RenderBlock {DIV} at (0,0) size 80x50
+              RenderBlock {DIV} at (0,0) size 40x50
+              RenderBlock {DIV} at (0,0) size 80x50
+              RenderBlock {DIV} at (0,25) size 80x25
           RenderListItem {LI} at (40,158) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 43x18
               text run at (0,0) width 43: "Short:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 24x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,12) size 80x4
           RenderListItem {LI} at (40,176) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 41x18
               text run at (0,0) width 41: "Wide:"
             RenderMeter {METER} at (444,0) size 300x16
+              RenderBlock {DIV} at (0,0) size 300x16
+              RenderBlock {DIV} at (0,0) size 150x16
+              RenderBlock {DIV} at (0,0) size 300x16
+              RenderBlock {DIV} at (0,8) size 300x8
           RenderListItem {LI} at (40,194) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 59x18
               text run at (0,0) width 59: "Narrow:"
             RenderMeter {METER} at (714,0) size 30x16
+              RenderBlock {DIV} at (0,0) size 30x16
+              RenderBlock {DIV} at (0,0) size 15x16
+              RenderBlock {DIV} at (0,0) size 30x16
+              RenderBlock {DIV} at (0,8) size 30x8
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt
index 6ff10ee..5dea874 100644
--- a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt
+++ b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-appearances-rating-relevancy-expected.txt
@@ -16,51 +16,91 @@ layer at (0,0) size 800x600
             RenderText {#text} at (0,0) size 86x18
               text run at (0,0) width 86: "value=10/10:"
             RenderMeter {METER} at (614,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
           RenderListItem {LI} at (40,18) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=8/10:"
             RenderMeter {METER} at (614,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 104x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,4) size 130x12
           RenderListItem {LI} at (40,36) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=5/10:"
             RenderMeter {METER} at (614,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 65x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,8) size 130x8
           RenderListItem {LI} at (40,54) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=2/10:"
             RenderMeter {METER} at (614,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 26x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,13) size 130x3
           RenderListItem {LI} at (40,72) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=0/10:"
             RenderMeter {METER} at (614,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 0x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,16) size 130x0
           RenderListItem {LI} at (40,90) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 39x18
               text run at (0,0) width 39: "RTL:"
             RenderMeter {METER} at (614,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (65,0) size 65x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,8) size 130x8
           RenderListItem {LI} at (40,108) size 744x50 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 32x18
               text run at (0,0) width 32: "Tall:"
             RenderMeter {METER} at (614,0) size 130x50
+              RenderBlock {DIV} at (0,0) size 130x50
+              RenderBlock {DIV} at (0,0) size 65x50
+              RenderBlock {DIV} at (0,0) size 130x50
+              RenderBlock {DIV} at (0,25) size 130x25
           RenderListItem {LI} at (40,158) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 43x18
               text run at (0,0) width 43: "Short:"
             RenderMeter {METER} at (614,0) size 130x13
+              RenderBlock {DIV} at (0,0) size 130x13
+              RenderBlock {DIV} at (0,0) size 39x13
+              RenderBlock {DIV} at (0,0) size 130x13
+              RenderBlock {DIV} at (0,10) size 130x3
           RenderListItem {LI} at (40,176) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 41x18
               text run at (0,0) width 41: "Wide:"
             RenderMeter {METER} at (444,0) size 300x16
+              RenderBlock {DIV} at (0,0) size 300x16
+              RenderBlock {DIV} at (0,0) size 150x16
+              RenderBlock {DIV} at (0,0) size 300x16
+              RenderBlock {DIV} at (0,8) size 300x8
           RenderListItem {LI} at (40,194) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 59x18
               text run at (0,0) width 59: "Narrow:"
             RenderMeter {METER} at (614,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,0) size 65x16
+              RenderBlock {DIV} at (0,0) size 130x16
+              RenderBlock {DIV} at (0,8) size 130x8
       RenderBlock {H2} at (0,293) size 784x18
         RenderText {#text} at (0,0) size 166x18
           text run at (0,0) width 166: "relevancy-level-indicator"
@@ -71,48 +111,88 @@ layer at (0,0) size 800x600
             RenderText {#text} at (0,0) size 86x18
               text run at (0,0) width 86: "value=10/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
           RenderListItem {LI} at (40,18) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=8/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 64x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,4) size 80x12
           RenderListItem {LI} at (40,36) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=5/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 40x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,8) size 80x8
           RenderListItem {LI} at (40,54) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=2/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 16x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,13) size 80x3
           RenderListItem {LI} at (40,72) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 78x18
               text run at (0,0) width 78: "value=0/10:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 0x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,16) size 80x0
           RenderListItem {LI} at (40,90) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 39x18
               text run at (0,0) width 39: "RTL:"
             RenderMeter {METER} at (664,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (40,0) size 40x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,8) size 80x8
           RenderListItem {LI} at (40,108) size 744x50 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 32x18
               text run at (0,0) width 32: "Tall:"
             RenderMeter {METER} at (664,0) size 80x50
+              RenderBlock {DIV} at (0,0) size 80x50
+              RenderBlock {DIV} at (0,0) size 40x50
+              RenderBlock {DIV} at (0,0) size 80x50
+              RenderBlock {DIV} at (0,25) size 80x25
           RenderListItem {LI} at (40,158) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 43x18
               text run at (0,0) width 43: "Short:"
             RenderMeter {METER} at (664,0) size 80x12
+              RenderBlock {DIV} at (0,0) size 80x12
+              RenderBlock {DIV} at (0,0) size 24x12
+              RenderBlock {DIV} at (0,0) size 80x12
+              RenderBlock {DIV} at (0,9) size 80x3
           RenderListItem {LI} at (40,176) size 744x18 [bgcolor=#EEEEEE]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 41x18
               text run at (0,0) width 41: "Wide:"
             RenderMeter {METER} at (444,0) size 300x16
+              RenderBlock {DIV} at (0,0) size 300x16
+              RenderBlock {DIV} at (0,0) size 150x16
+              RenderBlock {DIV} at (0,0) size 300x16
+              RenderBlock {DIV} at (0,8) size 300x8
           RenderListItem {LI} at (40,194) size 744x18 [bgcolor=#CCCCCC]
             RenderListMarker at (-17,0) size 7x18: bullet
             RenderText {#text} at (0,0) size 59x18
               text run at (0,0) width 59: "Narrow:"
             RenderMeter {METER} at (714,0) size 30x16
+              RenderBlock {DIV} at (0,0) size 30x16
+              RenderBlock {DIV} at (0,0) size 15x16
+              RenderBlock {DIV} at (0,0) size 30x16
+              RenderBlock {DIV} at (0,8) size 30x8
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt
index a09df68..a9b2a00 100644
--- a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt
+++ b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-boundary-values-expected.txt
@@ -19,6 +19,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (8,0) size 107x18
             text run at (8,0) width 107: "|10,20,30,40,50: "
           RenderMeter {METER} at (115,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 0x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,16) size 80x0
         RenderListItem {LI} at (40,36) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderInline {B} at (0,0) size 16x18
@@ -27,6 +31,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (16,0) size 88x18
             text run at (16,0) width 88: ",20,30,40,50: "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 0x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,16) size 80x0
         RenderListItem {LI} at (40,54) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 20x18
@@ -37,6 +45,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (36,0) size 68x18
             text run at (36,0) width 68: ",30,40,50: "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 20x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,12) size 80x4
           RenderText {#text} at (184,0) size 110x18
             text run at (184,0) width 110: "(should be green)"
         RenderListItem {LI} at (40,72) size 744x18
@@ -49,6 +61,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (56,0) size 48x18
             text run at (56,0) width 48: ",40,50: "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 40x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,8) size 80x8
           RenderText {#text} at (184,0) size 110x18
             text run at (184,0) width 110: "(should be green)"
         RenderListItem {LI} at (40,90) size 744x18
@@ -61,6 +77,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (76,0) size 28x18
             text run at (76,0) width 28: ",50: "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 60x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,4) size 80x12
           RenderText {#text} at (184,0) size 110x18
             text run at (184,0) width 110: "(should be green)"
         RenderListItem {LI} at (40,108) size 744x18
@@ -73,6 +93,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (96,0) size 8x18
             text run at (96,0) width 8: ": "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
           RenderText {#text} at (184,0) size 118x18
             text run at (184,0) width 118: "(should be yellow)"
         RenderListItem {LI} at (40,126) size 744x18
@@ -85,6 +109,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (115,0) size 8x18
             text run at (115,0) width 8: ": "
           RenderMeter {METER} at (123,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
           RenderText {#text} at (203,0) size 118x18
             text run at (203,0) width 118: "(should be yellow)"
         RenderListItem {LI} at (40,144) size 744x18
@@ -97,6 +125,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (36,0) size 68x18
             text run at (36,0) width 68: ",30,40,50: "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 0x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,16) size 80x0
         RenderListItem {LI} at (40,162) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 60x18
@@ -107,6 +139,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (76,0) size 28x18
             text run at (76,0) width 28: ",40: "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
           RenderText {#text} at (184,0) size 110x18
             text run at (184,0) width 110: "(should be green)"
         RenderListItem {LI} at (40,180) size 744x18
@@ -117,6 +153,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (8,0) size 107x18
             text run at (8,0) width 107: "|10,10,10,20,30: "
           RenderMeter {METER} at (115,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 0x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,16) size 80x0
         RenderListItem {LI} at (40,198) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 40x18
@@ -127,6 +167,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (56,0) size 48x18
             text run at (56,0) width 48: ",20,30: "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 0x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,16) size 80x0
         RenderListItem {LI} at (40,216) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 40x18
@@ -137,6 +181,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (56,0) size 48x18
             text run at (56,0) width 48: ",30,30: "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
           RenderText {#text} at (184,0) size 110x18
             text run at (184,0) width 110: "(should be green)"
         RenderListItem {LI} at (40,234) size 744x18
@@ -149,6 +197,10 @@ layer at (0,0) size 800x600
           RenderText {#text} at (115,0) size 8x18
             text run at (115,0) width 8: ": "
           RenderMeter {METER} at (123,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
           RenderText {#text} at (203,0) size 110x18
             text run at (203,0) width 110: "(should be green)"
         RenderListItem {LI} at (40,252) size 744x18
@@ -161,5 +213,9 @@ layer at (0,0) size 800x600
           RenderText {#text} at (56,0) size 48x18
             text run at (56,0) width 48: ",20,30: "
           RenderMeter {METER} at (104,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 40x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,8) size 80x8
           RenderText {#text} at (184,0) size 110x18
             text run at (184,0) width 110: "(should be green)"
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-element-expected.txt b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-element-expected.txt
index 6fcad6f..d9a7209 100644
--- a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-element-expected.txt
+++ b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-element-expected.txt
@@ -4,7 +4,13 @@ layer at (0,0) size 800x600
   RenderBlock {HTML} at (0,0) size 800x600
     RenderBody {BODY} at (8,8) size 784x584
       RenderMeter {METER} at (0,44) size 80x16
+        RenderBlock {DIV} at (0,0) size 80x16
+        RenderBlock {DIV} at (0,0) size 17x16
+        RenderBlock {DIV} at (0,0) size 80x16
+        RenderBlock {DIV} at (0,13) size 80x3
       RenderMeter {METER} at (80,0) size 10x60
         RenderBlock {DIV} at (0,0) size 10x60
+        RenderBlock {DIV} at (0,0) size 7x60
+        RenderBlock {DIV} at (0,0) size 10x60
         RenderBlock {DIV} at (0,18) size 10x42
       RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-optimums-expected.txt b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-optimums-expected.txt
index 7371c09..74e24f5 100644
--- a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-optimums-expected.txt
+++ b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-optimums-expected.txt
@@ -18,26 +18,46 @@ layer at (0,0) size 800x600
           RenderText {#text} at (0,0) size 75x18
             text run at (0,0) width 75: "value=150: "
           RenderMeter {METER} at (75,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 20x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,12) size 80x4
         RenderListItem {LI} at (40,18) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 75x18
             text run at (0,0) width 75: "value=450: "
           RenderMeter {METER} at (75,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 36x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,9) size 80x7
         RenderListItem {LI} at (40,36) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 75x18
             text run at (0,0) width 75: "value=750: "
           RenderMeter {METER} at (75,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 60x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,4) size 80x12
         RenderListItem {LI} at (40,54) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 59x18
             text run at (0,0) width 59: "value=0: "
           RenderMeter {METER} at (59,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 0x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,16) size 80x0
         RenderListItem {LI} at (40,72) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 83x18
             text run at (0,0) width 83: "value=1000: "
           RenderMeter {METER} at (83,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
       RenderBlock {H2} at (0,251) size 784x28
         RenderText {#text} at (0,0) size 143x28
           text run at (0,0) width 143: "optimum=150"
@@ -47,26 +67,46 @@ layer at (0,0) size 800x600
           RenderText {#text} at (0,0) size 75x18
             text run at (0,0) width 75: "value=150: "
           RenderMeter {METER} at (75,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 20x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,12) size 80x4
         RenderListItem {LI} at (40,18) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 75x18
             text run at (0,0) width 75: "value=450: "
           RenderMeter {METER} at (75,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 36x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,9) size 80x7
         RenderListItem {LI} at (40,36) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 75x18
             text run at (0,0) width 75: "value=750: "
           RenderMeter {METER} at (75,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 60x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,4) size 80x12
         RenderListItem {LI} at (40,54) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 59x18
             text run at (0,0) width 59: "value=0: "
           RenderMeter {METER} at (59,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 0x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,16) size 80x0
         RenderListItem {LI} at (40,72) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 83x18
             text run at (0,0) width 83: "value=1000: "
           RenderMeter {METER} at (83,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
       RenderBlock {H2} at (0,407) size 784x28
         RenderText {#text} at (0,0) size 143x28
           text run at (0,0) width 143: "optimum=750"
@@ -76,23 +116,43 @@ layer at (0,0) size 800x600
           RenderText {#text} at (0,0) size 75x18
             text run at (0,0) width 75: "value=150: "
           RenderMeter {METER} at (75,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 20x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,12) size 80x4
         RenderListItem {LI} at (40,18) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 75x18
             text run at (0,0) width 75: "value=450: "
           RenderMeter {METER} at (75,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 36x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,9) size 80x7
         RenderListItem {LI} at (40,36) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 75x18
             text run at (0,0) width 75: "value=750: "
           RenderMeter {METER} at (75,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 60x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,4) size 80x12
         RenderListItem {LI} at (40,54) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 59x18
             text run at (0,0) width 59: "value=0: "
           RenderMeter {METER} at (59,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 0x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,16) size 80x0
         RenderListItem {LI} at (40,72) size 744x18
           RenderListMarker at (-17,0) size 7x18: bullet
           RenderText {#text} at (0,0) size 83x18
             text run at (0,0) width 83: "value=1000: "
           RenderMeter {METER} at (83,1) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,0) size 80x16
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt
index 97428d8..11e65bc 100644
--- a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt
+++ b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-changing-pseudo-expected.txt
@@ -13,12 +13,16 @@ layer at (0,0) size 800x600
         RenderMeter {METER} at (0,0) size 80x16
           RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080]
           RenderBlock {DIV} at (0,0) size 72x16 [bgcolor=#008000]
+          RenderBlock {DIV} at (0,0) size 80x16
+          RenderBlock {DIV} at (0,2) size 80x14
         RenderText {#text} at (0,0) size 0x0
       RenderBlock {P} at (0,124) size 784x18
         RenderText {#text} at (0,0) size 735x18
           text run at (0,0) width 735: "Following meter gauge should be blue - Changing the pseudo class by changing direction from horizontal to vertical."
       RenderBlock (anonymous) at (0,158) size 784x100
         RenderMeter {METER} at (0,0) size 80x100
+          RenderBlock {DIV} at (0,0) size 80x100
+          RenderBlock {DIV} at (0,0) size 72x100
           RenderBlock {DIV} at (0,0) size 80x100 [bgcolor=#808080]
           RenderBlock {DIV} at (0,10) size 80x90 [bgcolor=#0000FF]
         RenderText {#text} at (0,0) size 0x0
@@ -28,4 +32,8 @@ layer at (0,0) size 800x600
           text run at (0,18) width 67: "horizontal."
       RenderBlock (anonymous) at (0,326) size 784x20
         RenderMeter {METER} at (0,0) size 80x20
+          RenderBlock {DIV} at (0,0) size 80x20
+          RenderBlock {DIV} at (0,0) size 72x20
+          RenderBlock {DIV} at (0,0) size 80x20 [bgcolor=#808080]
+          RenderBlock {DIV} at (0,2) size 80x18 [bgcolor=#0000FF]
         RenderText {#text} at (0,0) size 0x0
diff --git a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.txt b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.txt
index 0853c85..bc38290 100644
--- a/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.txt
+++ b/LayoutTests/platform/mac/fast/dom/HTMLMeterElement/meter-styles-expected.txt
@@ -11,14 +11,20 @@ layer at (0,0) size 800x600
           RenderMeter {METER} at (0,1) size 80x16
             RenderBlock {DIV} at (0,0) size 80x16
             RenderBlock {DIV} at (0,0) size 20x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,12) size 80x4
         RenderListItem {LI} at (43,21) size 732x18
           RenderMeter {METER} at (0,1) size 80x16
             RenderBlock {DIV} at (0,0) size 80x16
             RenderBlock {DIV} at (0,0) size 36x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,9) size 80x7
         RenderListItem {LI} at (43,42) size 732x18
           RenderMeter {METER} at (0,1) size 80x16
             RenderBlock {DIV} at (0,0) size 80x16
             RenderBlock {DIV} at (0,0) size 60x16
+            RenderBlock {DIV} at (0,0) size 80x16
+            RenderBlock {DIV} at (0,4) size 80x12
       RenderBlock {H2} at (3,84) size 778x18
         RenderText {#text} at (0,0) size 332x18
           text run at (0,0) width 332: "Vertical meters with the non-themed default style"
@@ -26,14 +32,20 @@ layer at (0,0) size 800x600
         RenderListItem {LI} at (43,0) size 732x41
           RenderMeter {METER} at (0,0) size 30x40
             RenderBlock {DIV} at (0,0) size 30x40
+            RenderBlock {DIV} at (0,0) size 7x40
+            RenderBlock {DIV} at (0,0) size 30x40
             RenderBlock {DIV} at (0,30) size 30x10
         RenderListItem {LI} at (43,44) size 732x41
           RenderMeter {METER} at (0,0) size 30x40
             RenderBlock {DIV} at (0,0) size 30x40
+            RenderBlock {DIV} at (0,0) size 13x40
+            RenderBlock {DIV} at (0,0) size 30x40
             RenderBlock {DIV} at (0,22) size 30x18
         RenderListItem {LI} at (43,88) size 732x41
           RenderMeter {METER} at (0,0) size 30x40
             RenderBlock {DIV} at (0,0) size 30x40
+            RenderBlock {DIV} at (0,0) size 22x40
+            RenderBlock {DIV} at (0,0) size 30x40
             RenderBlock {DIV} at (0,10) size 30x30
       RenderBlock {H2} at (3,237) size 778x18
         RenderText {#text} at (0,0) size 150x18
@@ -44,18 +56,24 @@ layer at (0,0) size 800x600
             RenderMeter {METER} at (0,0) size 230x31 [bgcolor=#AAAACC] [border: (10px solid #222244) (50px solid #222244) (5px solid #222244) (100px solid #222244)]
               RenderBlock {DIV} at (100,10) size 80x16
               RenderBlock {DIV} at (100,10) size 64x16
+              RenderBlock {DIV} at (100,10) size 80x16
+              RenderBlock {DIV} at (100,14) size 80x12
             RenderText {#text} at (230,14) size 70x18
               text run at (230,14) width 70: " has border"
           RenderListItem {LI} at (43,35) size 732x32
             RenderMeter {METER} at (0,0) size 230x31 [bgcolor=#AAAACC]
               RenderBlock {DIV} at (100,10) size 80x16
               RenderBlock {DIV} at (100,10) size 64x16
+              RenderBlock {DIV} at (100,10) size 80x16
+              RenderBlock {DIV} at (100,14) size 80x12
             RenderText {#text} at (230,14) size 80x18
               text run at (230,14) width 80: " has padding"
           RenderListItem {LI} at (43,70) size 732x32
             RenderMeter {METER} at (100,10) size 80x16 [bgcolor=#AAAACC]
               RenderBlock {DIV} at (0,0) size 80x16
               RenderBlock {DIV} at (0,0) size 64x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,4) size 80x12
             RenderText {#text} at (230,14) size 73x18
               text run at (230,14) width 73: " has margin"
       RenderBlock {H2} at (3,363) size 778x18
@@ -67,18 +85,24 @@ layer at (0,0) size 800x600
             RenderMeter {METER} at (0,1) size 80x16
               RenderBlock {DIV} at (0,0) size 80x16
               RenderBlock {DIV} at (0,0) size 64x16 [bgcolor=#008000] [border: (2px solid #77CC77)]
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,4) size 80x12
             RenderText {#text} at (80,0) size 250x18
               text run at (80,0) width 250: " has bar style, should be styled as it has."
           RenderListItem {LI} at (43,21) size 732x18
             RenderMeter {METER} at (0,1) size 80x16
               RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080] [border: (2px solid #222222)]
               RenderBlock {DIV} at (0,0) size 64x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,4) size 80x12
             RenderText {#text} at (80,0) size 264x18
               text run at (80,0) width 264: " has value style, should be styled as it has."
           RenderListItem {LI} at (43,42) size 732x18
             RenderMeter {METER} at (0,1) size 80x16
               RenderBlock {DIV} at (0,0) size 80x16 [bgcolor=#808080] [border: (2px solid #222222)]
               RenderBlock {DIV} at (0,0) size 64x16 [bgcolor=#008000] [border: (2px solid #77CC77)]
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,4) size 80x12
             RenderText {#text} at (80,0) size 264x18
               text run at (80,0) width 264: " has both styles, should be styled as it has."
       RenderBlock {H2} at (3,447) size 778x18
@@ -90,9 +114,15 @@ layer at (0,0) size 800x600
             RenderMeter {METER} at (0,1) size 80x16
               RenderBlock {DIV} at (0,0) size 80x16
               RenderBlock {DIV} at (0,0) size 64x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,4) size 80x12
             RenderText {#text} at (80,0) size 375x18
               text run at (80,0) width 375: " has \"none\" appearance, should be styled with default style."
           RenderListItem {LI} at (43,21) size 732x18
             RenderMeter {METER} at (0,1) size 80x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,0) size 64x16
+              RenderBlock {DIV} at (0,0) size 80x16
+              RenderBlock {DIV} at (0,4) size 80x12
             RenderText {#text} at (80,0) size 276x18
               text run at (80,0) width 276: " has \"meter\" appearance, should be themed."
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 48995bb..f946a54 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,61 @@
+2010-12-06  MORITA Hajime  <morrita at google.com>
+
+        Reviewed by Dimitri Glazkov.
+
+        RenderIndicator subclasses should not change the render tree during layout.
+        https://bugs.webkit.org/show_bug.cgi?id=50026
+
+        The old code created shadow elements during a layout computation,
+        that makes the layout state inconsisntent and cause an assertion failure. 
+        This change created shadow elements before the layout to avoid  
+        state inconsistencies.
+        
+        Instead of creating shadows on demand, RenderMeter and
+        RenderProgress now create all necessary shadows before layouts,
+        and change its visibilities during the layout: Changing
+        visibilities doesn't trigger relayout and keep the state
+        consistent.
+        
+        RenderMeter uses new HidablePartElement for shadow elements,
+        which can toggle visibiliby between hidden and original value.
+
+        Test: fast/dom/HTMLMeterElement/meter-element-crash.html
+
+        * html/HTMLMeterElement.cpp:
+        (WebCore::HTMLMeterElement::attach): Calling updateFromElement()
+        * html/HTMLMeterElement.h:
+        * html/HTMLProgressElement.cpp:
+        (WebCore::HTMLProgressElement::attach): Calling updateFromElement()
+        * html/HTMLProgressElement.h:
+        * rendering/RenderIndicator.cpp:
+        * rendering/RenderIndicator.h:
+        * rendering/RenderMeter.cpp:
+        (WebCore::MeterPartElement::MeterPartElement): Added to hold a restorable visibility.
+        (WebCore::MeterPartElement::createForPart):
+        (WebCore::MeterPartElement::hide):
+        (WebCore::MeterPartElement::restoreVisibility):
+        (WebCore::MeterPartElement::updateStyleForPart):
+        (WebCore::MeterPartElement::saveVisibility):
+        (WebCore::RenderMeter::~RenderMeter):
+        (WebCore::RenderMeter::createPart): Extracted
+        (WebCore::RenderMeter::updateFromElement): Had a shadow generation.
+        (WebCore::RenderMeter::layoutParts): Removed shadow generation code.
+        (WebCore::RenderMeter::shouldHaveParts):
+        (WebCore::RenderMeter::valuePartRect): Adopted orientation.
+        (WebCore::RenderMeter::orientation): Morphed from isHorizontal()
+        (WebCore::RenderMeter::valuePseudoId): Adoptedn orientation
+        (WebCore::RenderMeter::barPseudoId): Adopted orientation.
+        * rendering/RenderMeter.h:
+        (WebCore::RenderMeter::shadowAttached):
+        * rendering/RenderProgress.cpp:
+        (WebCore::RenderProgress::updateFromElement): Had a shadow generation.
+        (WebCore::RenderProgress::layoutParts):
+        * rendering/RenderProgress.h:
+        * rendering/ShadowElement.cpp:
+        (WebCore::ShadowBlockElement::createForPart): Extracted initAsPart().
+        (WebCore::ShadowBlockElement::initAsPart): Extracted from createForPart().
+        * rendering/ShadowElement.h:
+
 2010-11-29  Mihai Parparita  <mihaip at chromium.org>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/html/HTMLMeterElement.cpp b/WebCore/html/HTMLMeterElement.cpp
index 09c5210..2ebf57e 100644
--- a/WebCore/html/HTMLMeterElement.cpp
+++ b/WebCore/html/HTMLMeterElement.cpp
@@ -67,6 +67,13 @@ void HTMLMeterElement::parseMappedAttribute(Attribute* attribute)
         HTMLFormControlElement::parseMappedAttribute(attribute);
 }
 
+void HTMLMeterElement::attach()
+{
+    HTMLFormControlElement::attach();
+    if (renderer())
+        renderer()->updateFromElement();
+}
+
 double HTMLMeterElement::min() const
 {
     double min = 0;
diff --git a/WebCore/html/HTMLMeterElement.h b/WebCore/html/HTMLMeterElement.h
index dedad6a..d5038e0 100644
--- a/WebCore/html/HTMLMeterElement.h
+++ b/WebCore/html/HTMLMeterElement.h
@@ -65,6 +65,8 @@ private:
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
     virtual void parseMappedAttribute(Attribute*);
+
+    virtual void attach();
 };
 
 } // namespace
diff --git a/WebCore/html/HTMLProgressElement.cpp b/WebCore/html/HTMLProgressElement.cpp
index e707592..4a55a1e 100644
--- a/WebCore/html/HTMLProgressElement.cpp
+++ b/WebCore/html/HTMLProgressElement.cpp
@@ -70,6 +70,13 @@ void HTMLProgressElement::parseMappedAttribute(Attribute* attribute)
         HTMLFormControlElement::parseMappedAttribute(attribute);
 }
 
+void HTMLProgressElement::attach()
+{
+    HTMLFormControlElement::attach();
+    if (renderer())
+        renderer()->updateFromElement();
+}
+
 double HTMLProgressElement::value() const
 {
     const AtomicString& valueString = getAttribute(valueAttr);
diff --git a/WebCore/html/HTMLProgressElement.h b/WebCore/html/HTMLProgressElement.h
index 429e9c0..c80f50f 100644
--- a/WebCore/html/HTMLProgressElement.h
+++ b/WebCore/html/HTMLProgressElement.h
@@ -48,6 +48,8 @@ private:
     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
 
     virtual void parseMappedAttribute(Attribute*);
+
+    virtual void attach();
 };
 
 } // namespace
diff --git a/WebCore/rendering/RenderIndicator.cpp b/WebCore/rendering/RenderIndicator.cpp
index cd7be36..b03dfba 100644
--- a/WebCore/rendering/RenderIndicator.cpp
+++ b/WebCore/rendering/RenderIndicator.cpp
@@ -25,6 +25,7 @@
 #include "RenderIndicator.h"
 
 #include "RenderTheme.h"
+#include "ShadowElement.h"
 
 using namespace std;
 
diff --git a/WebCore/rendering/RenderIndicator.h b/WebCore/rendering/RenderIndicator.h
index 15741dc..50d819d 100644
--- a/WebCore/rendering/RenderIndicator.h
+++ b/WebCore/rendering/RenderIndicator.h
@@ -38,7 +38,6 @@ protected:
     virtual bool canHaveChildren() const { return false; }
 
     virtual void layoutParts() = 0;
-    virtual bool shouldHaveParts() const = 0;
 };
 
 } // namespace WebCore
diff --git a/WebCore/rendering/RenderMeter.cpp b/WebCore/rendering/RenderMeter.cpp
index f60e350..6439651 100644
--- a/WebCore/rendering/RenderMeter.cpp
+++ b/WebCore/rendering/RenderMeter.cpp
@@ -35,6 +35,61 @@ namespace WebCore {
 
 using namespace HTMLNames;
 
+class MeterPartElement : public ShadowBlockElement {
+public:
+    static PassRefPtr<MeterPartElement> createForPart(HTMLElement*, PseudoId);
+
+    void hide();
+    void restoreVisibility();
+
+    virtual void updateStyleForPart(PseudoId);
+
+private:
+    MeterPartElement(HTMLElement*);
+    void saveVisibility();
+
+    EVisibility m_originalVisibility;
+};
+
+MeterPartElement::MeterPartElement(HTMLElement* shadowParent)
+    : ShadowBlockElement(shadowParent)
+{
+}
+
+PassRefPtr<MeterPartElement> MeterPartElement::createForPart(HTMLElement* shadowParent, PseudoId pseudoId)
+{
+    RefPtr<MeterPartElement> ret = adoptRef(new MeterPartElement(shadowParent));
+    ret->initAsPart(pseudoId);
+    ret->saveVisibility();
+    return ret;
+}
+
+void MeterPartElement::hide()
+{
+    if (renderer())
+        renderer()->style()->setVisibility(HIDDEN);
+}
+
+void MeterPartElement::restoreVisibility()
+{
+    if (renderer())
+        renderer()->style()->setVisibility(m_originalVisibility);
+}
+
+void MeterPartElement::updateStyleForPart(PseudoId pseudoId)
+{
+    if (renderer()->style()->styleType() == pseudoId)
+        return;
+
+    ShadowBlockElement::updateStyleForPart(pseudoId);
+    saveVisibility();
+}
+
+void MeterPartElement::saveVisibility()
+{
+    m_originalVisibility = renderer()->style()->visibility();
+}
+
 RenderMeter::RenderMeter(HTMLMeterElement* element)
     : RenderIndicator(element)
 {
@@ -42,10 +97,36 @@ RenderMeter::RenderMeter(HTMLMeterElement* element)
 
 RenderMeter::~RenderMeter()
 {
-    if (m_valuePart)
-        m_valuePart->detach();
-    if (m_barPart)
-        m_barPart->detach();
+    if (shadowAttached()) {
+        m_verticalValuePart->detach();
+        m_verticalBarPart->detach();
+        m_horizontalValuePart->detach();
+        m_horizontalBarPart->detach();
+    }
+}
+
+PassRefPtr<MeterPartElement> RenderMeter::createPart(PseudoId pseudoId)
+{
+    RefPtr<MeterPartElement> element = MeterPartElement::createForPart(static_cast<HTMLElement*>(node()), pseudoId);
+    if (element->renderer())
+        addChild(element->renderer());
+    return element;
+}
+
+void RenderMeter::updateFromElement()
+{
+    if (!shadowAttached()) {
+        m_horizontalBarPart = createPart(barPseudoId(HORIZONTAL));
+        m_horizontalValuePart = createPart(valuePseudoId(HORIZONTAL));
+        m_verticalBarPart = createPart(barPseudoId(VERTICAL));
+        m_verticalValuePart = createPart(valuePseudoId(VERTICAL));
+    }
+
+    m_horizontalBarPart->updateStyleForPart(barPseudoId(HORIZONTAL));
+    m_horizontalValuePart->updateStyleForPart(valuePseudoId(HORIZONTAL));
+    m_verticalBarPart->updateStyleForPart(barPseudoId(VERTICAL));
+    m_verticalValuePart->updateStyleForPart(valuePseudoId(VERTICAL));
+    RenderIndicator::updateFromElement();
 }
 
 void RenderMeter::computeLogicalWidth()
@@ -62,21 +143,38 @@ void RenderMeter::computeLogicalHeight()
 
 void RenderMeter::layoutParts()
 {
-    // We refresh shadow node here because the state can depend
-    // on the frame size of this render object.
-    updatePartsState();
-    if (m_valuePart)
-        m_valuePart->layoutAsPart(valuePartRect());
-    if (m_barPart)
-        m_barPart->layoutAsPart(barPartRect());
+    m_horizontalBarPart->layoutAsPart(barPartRect());
+    m_horizontalValuePart->layoutAsPart(valuePartRect(HORIZONTAL));
+    m_verticalBarPart->layoutAsPart(barPartRect());
+    m_verticalValuePart->layoutAsPart(valuePartRect(VERTICAL));
+
+    if (shouldHaveParts()) {
+        if (HORIZONTAL == orientation()) {
+            m_verticalBarPart->hide();
+            m_verticalValuePart->hide();
+            m_horizontalBarPart->restoreVisibility();
+            m_horizontalValuePart->restoreVisibility();
+        } else {
+            m_verticalBarPart->restoreVisibility();
+            m_verticalValuePart->restoreVisibility();
+            m_horizontalBarPart->hide();
+            m_horizontalValuePart->hide();
+        }
+    } else {
+        m_verticalBarPart->hide();
+        m_verticalValuePart->hide();
+        m_horizontalBarPart->hide();
+        m_horizontalValuePart->hide();
+    }
 }
 
 bool RenderMeter::shouldHaveParts() const
 {
-    bool hasTheme = theme()->supportsMeter(style()->appearance(), isHorizontal());
+    EBoxOrient currentOrientation = orientation();
+    bool hasTheme = theme()->supportsMeter(style()->appearance(), HORIZONTAL == currentOrientation);
     if (!hasTheme)
         return true;
-    bool shadowsHaveStyle = ShadowBlockElement::partShouldHaveStyle(this, barPseudoId()) || ShadowBlockElement::partShouldHaveStyle(this, valuePseudoId());
+    bool shadowsHaveStyle = ShadowBlockElement::partShouldHaveStyle(this, barPseudoId(currentOrientation)) || ShadowBlockElement::partShouldHaveStyle(this, valuePseudoId(currentOrientation));
     if (shadowsHaveStyle)
         return true;
     return false;
@@ -99,11 +197,11 @@ IntRect RenderMeter::barPartRect() const
     return IntRect(borderLeft() + paddingLeft(), borderTop() + paddingTop(), lround(width() - borderLeft() - paddingLeft() - borderRight() - paddingRight()), height()  - borderTop() - paddingTop() - borderBottom() - paddingBottom());
 }
 
-IntRect RenderMeter::valuePartRect() const
+IntRect RenderMeter::valuePartRect(EBoxOrient asOrientation) const
 {
     IntRect rect = barPartRect();
     
-    if (rect.height() <= rect.width()) {
+    if (HORIZONTAL == asOrientation) {
         int width = static_cast<int>(rect.width()*valueRatio());
         if (!style()->isLeftToRightDirection()) {
             rect.setX(rect.x() + (rect.width() - width));
@@ -119,17 +217,17 @@ IntRect RenderMeter::valuePartRect() const
     return rect;
 }
 
-bool RenderMeter::isHorizontal() const
+EBoxOrient RenderMeter::orientation() const
 {
     IntRect rect = barPartRect();
-    return rect.height() <= rect.width();
+    return rect.height() <= rect.width() ? HORIZONTAL : VERTICAL;
 }
 
-PseudoId RenderMeter::valuePseudoId() const
+PseudoId RenderMeter::valuePseudoId(EBoxOrient asOrientation) const
 {
     HTMLMeterElement* element = static_cast<HTMLMeterElement*>(node());
 
-    if (isHorizontal()) {
+    if (HORIZONTAL == asOrientation) {
         switch (element->gaugeRegion()) {
         case HTMLMeterElement::GaugeRegionOptimum:
             return METER_HORIZONTAL_OPTIMUM;
@@ -153,32 +251,9 @@ PseudoId RenderMeter::valuePseudoId() const
     return NOPSEUDO;
 }
 
-PseudoId RenderMeter::barPseudoId() const
-{
-    return isHorizontal() ? METER_HORIZONTAL_BAR : METER_VERTICAL_BAR;
-}
-
-void RenderMeter::updatePartsState()
+PseudoId RenderMeter::barPseudoId(EBoxOrient asOrientation) const
 {
-    if (shouldHaveParts() && !m_barPart) {
-        ASSERT(!m_valuePart);
-        m_barPart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), barPseudoId());
-        addChild(m_barPart->renderer());
-        m_valuePart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), valuePseudoId());
-        addChild(m_valuePart->renderer());
-    } else if (!shouldHaveParts() && m_barPart) {
-        ASSERT(m_valuePart);
-        m_barPart->detach();
-        m_barPart = 0;
-        m_valuePart->detach();
-        m_valuePart = 0;
-    }
-
-    if (m_barPart) {
-        ASSERT(m_valuePart);
-        m_barPart->updateStyleForPart(barPseudoId());
-        m_valuePart->updateStyleForPart(valuePseudoId());
-    }
+    return HORIZONTAL == asOrientation ? METER_HORIZONTAL_BAR : METER_VERTICAL_BAR;
 }
 
 } // namespace WebCore
diff --git a/WebCore/rendering/RenderMeter.h b/WebCore/rendering/RenderMeter.h
index e776186..2f5f5f5 100644
--- a/WebCore/rendering/RenderMeter.h
+++ b/WebCore/rendering/RenderMeter.h
@@ -30,7 +30,7 @@
 namespace WebCore {
 
 class HTMLMeterElement;
-class ShadowBlockElement;
+class MeterPartElement;
 
 class RenderMeter : public RenderIndicator {
 public:
@@ -40,22 +40,27 @@ public:
 private:
     virtual const char* renderName() const { return "RenderMeter"; }
     virtual bool isMeter() const { return true; }
+    virtual void updateFromElement();
     virtual void computeLogicalWidth();
     virtual void computeLogicalHeight();
 
     virtual void layoutParts();
-    virtual bool shouldHaveParts() const;
-
-    bool isHorizontal() const;
-    void updatePartsState();    
-    IntRect valuePartRect() const;
-    PseudoId valuePseudoId() const;
-    IntRect barPartRect() const;    
-    PseudoId barPseudoId() const;
+
+    bool shadowAttached() const { return m_horizontalBarPart; }
+    IntRect valuePartRect(EBoxOrient) const;
+    PseudoId valuePseudoId(EBoxOrient) const;
+    IntRect barPartRect() const;
+    PseudoId barPseudoId(EBoxOrient) const;
+    EBoxOrient orientation() const;
+
     double valueRatio() const;
+    bool shouldHaveParts() const;
+    PassRefPtr<MeterPartElement> createPart(PseudoId);
 
-    RefPtr<ShadowBlockElement> m_barPart;
-    RefPtr<ShadowBlockElement> m_valuePart;
+    RefPtr<MeterPartElement> m_horizontalBarPart;
+    RefPtr<MeterPartElement> m_horizontalValuePart;
+    RefPtr<MeterPartElement> m_verticalBarPart;
+    RefPtr<MeterPartElement> m_verticalValuePart;
 };
 
 inline RenderMeter* toRenderMeter(RenderObject* object)
diff --git a/WebCore/rendering/RenderProgress.cpp b/WebCore/rendering/RenderProgress.cpp
index d2e9424..84de6fb 100644
--- a/WebCore/rendering/RenderProgress.cpp
+++ b/WebCore/rendering/RenderProgress.cpp
@@ -54,6 +54,17 @@ RenderProgress::~RenderProgress()
 
 void RenderProgress::updateFromElement()
 {
+    if (!m_valuePart) {
+        m_valuePart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), PROGRESS_BAR_VALUE);
+        if (m_valuePart->renderer())
+            addChild(m_valuePart->renderer());
+    }
+
+    if (shouldHaveParts())
+        style()->setAppearance(NoControlPart);
+    else if (m_valuePart->renderer())
+        m_valuePart->renderer()->style()->setVisibility(HIDDEN);
+
     HTMLProgressElement* element = progressElement();
     if (m_position == element->position())
         return;
@@ -90,9 +101,7 @@ void RenderProgress::paint(PaintInfo& paintInfo, int tx, int ty)
 
 void RenderProgress::layoutParts()
 {
-    updatePartsState();
-    if (m_valuePart)
-        m_valuePart->layoutAsPart(valuePartRect());
+    m_valuePart->layoutAsPart(valuePartRect());
     updateAnimationState();
 }
 
@@ -105,18 +114,6 @@ bool RenderProgress::shouldHaveParts() const
     return false;
 }
 
-void RenderProgress::updatePartsState()
-{
-    if (shouldHaveParts() && !m_valuePart) {
-        style()->setAppearance(NoControlPart);
-        m_valuePart = ShadowBlockElement::createForPart(static_cast<HTMLElement*>(node()), PROGRESS_BAR_VALUE);
-        addChild(m_valuePart->renderer());
-    } else if (!shouldHaveParts() && m_valuePart) {
-        m_valuePart->detach();
-        m_valuePart = 0;
-    }
-}
-
 void RenderProgress::updateAnimationState()
 {
     m_animationDuration = theme()->animationDurationForProgressBar(this);
diff --git a/WebCore/rendering/RenderProgress.h b/WebCore/rendering/RenderProgress.h
index bd979e8..9ed5741 100644
--- a/WebCore/rendering/RenderProgress.h
+++ b/WebCore/rendering/RenderProgress.h
@@ -50,13 +50,12 @@ private:
     virtual void paint(PaintInfo&, int tx, int ty);
 
     virtual void layoutParts();
-    virtual bool shouldHaveParts() const;
 
     IntRect valuePartRect() const;
+    bool shouldHaveParts() const;
 
     void animationTimerFired(Timer<RenderProgress>*);
     void updateAnimationState();
-    void updatePartsState();
 
     double m_position;
     double m_animationStartTime;
diff --git a/WebCore/rendering/ShadowElement.cpp b/WebCore/rendering/ShadowElement.cpp
index cea3164..72f48e2 100644
--- a/WebCore/rendering/ShadowElement.cpp
+++ b/WebCore/rendering/ShadowElement.cpp
@@ -68,16 +68,21 @@ void ShadowBlockElement::updateStyleForPart(PseudoId pseudoId)
 
 PassRefPtr<ShadowBlockElement> ShadowBlockElement::createForPart(HTMLElement* shadowParent, PseudoId pseudoId)
 {
-    RenderObject* parentRenderer = shadowParent->renderer();
-    RefPtr<RenderStyle> styleForPart = createStyleForPart(parentRenderer, pseudoId);
     RefPtr<ShadowBlockElement> part = create(shadowParent);
-    part->setRenderer(part->createRenderer(parentRenderer->renderArena(), styleForPart.get()));
-    part->renderer()->setStyle(styleForPart.release());
-    part->setAttached();
-    part->setInDocument();
+    part->initAsPart(pseudoId);
     return part.release();
 }
 
+void ShadowBlockElement::initAsPart(PseudoId pseudoId)
+{
+    RenderObject* parentRenderer = shadowParent()->renderer();
+    RefPtr<RenderStyle> styleForPart = createStyleForPart(parentRenderer, pseudoId);
+    setRenderer(createRenderer(parentRenderer->renderArena(), styleForPart.get()));
+    renderer()->setStyle(styleForPart.release());
+    setAttached();
+    setInDocument();
+}
+
 PassRefPtr<RenderStyle> ShadowBlockElement::createStyleForPart(RenderObject* parentRenderer, PseudoId pseudoId)
 {
     RefPtr<RenderStyle> styleForPart;
diff --git a/WebCore/rendering/ShadowElement.h b/WebCore/rendering/ShadowElement.h
index f5668ef..72bc207 100644
--- a/WebCore/rendering/ShadowElement.h
+++ b/WebCore/rendering/ShadowElement.h
@@ -58,11 +58,11 @@ public:
     static PassRefPtr<ShadowBlockElement> createForPart(HTMLElement*, PseudoId);
     static bool partShouldHaveStyle(const RenderObject* parentRenderer, PseudoId pseudoId);
     void layoutAsPart(const IntRect& partRect);
-    void updateStyleForPart(PseudoId);
+    virtual void updateStyleForPart(PseudoId);
 
 protected:
     ShadowBlockElement(HTMLElement*);
-
+    void initAsPart(PseudoId pasuedId);
 private:
     static PassRefPtr<RenderStyle> createStyleForPart(RenderObject*, PseudoId);
 };

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list