[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.2.2-27-g91dab87

Gustavo Noronha Silva gns at gnome.org
Thu Jul 15 21:13:35 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 5b8b9d44d1ef078189f9d1d486d4f10aa55352f5
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri May 21 00:37:06 2010 +0000

    <rdar://problem/8007953> Textarea using custom font appears blank
    
    Reviewed by Dave Hyatt.
    
    WebCore:
    
    Test: fast/css/font-face-in-shadow-DOM.html
    
    When a remote font is loaded, CSSFontSelector forces a style recalc, which replaces all
    RenderSyles that have FontFallbackLists referencing the placeholder font with fresh
    RenderStyles. However, it does not descend into shadow DOM trees, so those may end up with
    styles that still reference the placeholder font.
    
    The fix is to add RenderObject::requiresForcedStyleRecalcPropagation() and have it return
    true from renderers that maintain shadow DOM trees or otherwise keep their own RenderStyles.
    
    * dom/Element.cpp:
    (WebCore::Element::recalcStyle): Check if forced style recalc needs to propagated.
    * rendering/RenderButton.h:
    (WebCore::RenderButton::requiresForcedStyleRecalcPropagation):
    * rendering/RenderDataGrid.h:
    (WebCore::RenderDataGrid::requiresForcedStyleRecalcPropagation):
    * rendering/RenderFileUploadControl.h:
    (WebCore::RenderFileUploadControl::requiresForcedStyleRecalcPropagation):
    * rendering/RenderListItem.h:
    (WebCore::RenderListItem::requiresForcedStyleRecalcPropagation):
    * rendering/RenderMedia.h:
    (WebCore::RenderMedia::requiresForcedStyleRecalcPropagation):
    * rendering/RenderMenuList.h:
    (WebCore::RenderMenuList::RenderMenuList::requiresForcedStyleRecalcPropagation):
    * rendering/RenderObject.h:
    (WebCore::RenderObject::requiresForcedStyleRecalcPropagation):
    * rendering/RenderProgress.h:
    (WebCore::RenderProgress::requiresForcedStyleRecalcPropagation):
    * rendering/RenderSlider.h:
    (WebCore::RenderSlider::requiresForcedStyleRecalcPropagation):
    * rendering/RenderTextControl.h:
    (WebCore::RenderTextControl::requiresForcedStyleRecalcPropagation):
    
    LayoutTests:
    
    * fast/css/font-face-in-shadow-DOM.html: Added.
    * platform/mac/fast/css/font-face-in-shadow-DOM-expected.checksum: Added.
    * platform/mac/fast/css/font-face-in-shadow-DOM-expected.png: Added.
    * platform/mac/fast/css/font-face-in-shadow-DOM-expected.txt: Added.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59876 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index b552baa..3a87c20 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,14 @@
+2010-05-20  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        <rdar://problem/8007953> Textarea using custom font appears blank
+
+        * fast/css/font-face-in-shadow-DOM.html: Added.
+        * platform/mac/fast/css/font-face-in-shadow-DOM-expected.checksum: Added.
+        * platform/mac/fast/css/font-face-in-shadow-DOM-expected.png: Added.
+        * platform/mac/fast/css/font-face-in-shadow-DOM-expected.txt: Added.
+
 2010-05-19  Abhishek Arya  <inferno at chromium.org>
 
         Reviewed by David Hyatt.
diff --git a/LayoutTests/fast/css/font-face-in-shadow-DOM.html b/LayoutTests/fast/css/font-face-in-shadow-DOM.html
new file mode 100644
index 0000000..08fb10c
--- /dev/null
+++ b/LayoutTests/fast/css/font-face-in-shadow-DOM.html
@@ -0,0 +1,12 @@
+<style>
+    /* a descendant rule */
+    p > p { }
+    @font-face {
+        font-family: 'remote';
+        src: url(resources/Ahem.ttf);
+    }
+</style>
+<textarea style="width: 108px; height: 102px; font-family: remote; font-size: 100px; color: green; background-color: red; padding: 0;">A</textarea>
+<script>
+    document.body.offsetTop;
+</script>
diff --git a/LayoutTests/platform/mac/fast/css/font-face-in-shadow-DOM-expected.checksum b/LayoutTests/platform/mac/fast/css/font-face-in-shadow-DOM-expected.checksum
new file mode 100644
index 0000000..2b7fe2d
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/font-face-in-shadow-DOM-expected.checksum
@@ -0,0 +1 @@
+eca56f5962d9e54fd527a3eb684872b6
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/css/font-face-in-shadow-DOM-expected.png b/LayoutTests/platform/mac/fast/css/font-face-in-shadow-DOM-expected.png
new file mode 100644
index 0000000..05aa7d5
Binary files /dev/null and b/LayoutTests/platform/mac/fast/css/font-face-in-shadow-DOM-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/css/font-face-in-shadow-DOM-expected.txt b/LayoutTests/platform/mac/fast/css/font-face-in-shadow-DOM-expected.txt
new file mode 100644
index 0000000..076130b
--- /dev/null
+++ b/LayoutTests/platform/mac/fast/css/font-face-in-shadow-DOM-expected.txt
@@ -0,0 +1,12 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderText {#text} at (0,0) size 0x0
+      RenderText {#text} at (0,0) size 0x0
+layer at (8,8) size 108x102 clip at (9,9) size 91x100 scrollWidth 106
+  RenderTextControl {TEXTAREA} at (0,0) size 108x102 [color=#008000] [bgcolor=#FF0000] [border: (1px solid #008000)]
+    RenderBlock {DIV} at (1,1) size 106x100
+      RenderText {#text} at (0,0) size 100x100
+        text run at (0,0) width 100: "A"
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 81fdeb0..5de1684 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,42 @@
+2010-05-20  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Dave Hyatt.
+
+        <rdar://problem/8007953> Textarea using custom font appears blank
+
+        Test: fast/css/font-face-in-shadow-DOM.html
+
+        When a remote font is loaded, CSSFontSelector forces a style recalc, which replaces all
+        RenderSyles that have FontFallbackLists referencing the placeholder font with fresh
+        RenderStyles. However, it does not descend into shadow DOM trees, so those may end up with
+        styles that still reference the placeholder font.
+
+        The fix is to add RenderObject::requiresForcedStyleRecalcPropagation() and have it return
+        true from renderers that maintain shadow DOM trees or otherwise keep their own RenderStyles.
+
+        * dom/Element.cpp:
+        (WebCore::Element::recalcStyle): Check if forced style recalc needs to propagated.
+        * rendering/RenderButton.h:
+        (WebCore::RenderButton::requiresForcedStyleRecalcPropagation):
+        * rendering/RenderDataGrid.h:
+        (WebCore::RenderDataGrid::requiresForcedStyleRecalcPropagation):
+        * rendering/RenderFileUploadControl.h:
+        (WebCore::RenderFileUploadControl::requiresForcedStyleRecalcPropagation):
+        * rendering/RenderListItem.h:
+        (WebCore::RenderListItem::requiresForcedStyleRecalcPropagation):
+        * rendering/RenderMedia.h:
+        (WebCore::RenderMedia::requiresForcedStyleRecalcPropagation):
+        * rendering/RenderMenuList.h:
+        (WebCore::RenderMenuList::RenderMenuList::requiresForcedStyleRecalcPropagation):
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::requiresForcedStyleRecalcPropagation):
+        * rendering/RenderProgress.h:
+        (WebCore::RenderProgress::requiresForcedStyleRecalcPropagation):
+        * rendering/RenderSlider.h:
+        (WebCore::RenderSlider::requiresForcedStyleRecalcPropagation):
+        * rendering/RenderTextControl.h:
+        (WebCore::RenderTextControl::requiresForcedStyleRecalcPropagation):
+
 2010-05-19  Abhishek Arya  <inferno at chromium.org>
 
         Reviewed by David Hyatt.
diff --git a/WebCore/dom/Element.cpp b/WebCore/dom/Element.cpp
index c67119a..90fc535 100644
--- a/WebCore/dom/Element.cpp
+++ b/WebCore/dom/Element.cpp
@@ -938,7 +938,7 @@ void Element::recalcStyle(StyleChange change)
                 newStyle->setChildrenAffectedByDirectAdjacentRules();
         }
 
-        if (ch != NoChange || pseudoStyleCacheIsInvalid(currentStyle.get(), newStyle.get())) {
+        if (ch != NoChange || pseudoStyleCacheIsInvalid(currentStyle.get(), newStyle.get()) || change == Force && renderer() && renderer()->requiresForcedStyleRecalcPropagation()) {
             setRenderStyle(newStyle);
         } else if (needsStyleRecalc() && (styleChangeType() != SyntheticStyleChange) && (document()->usesSiblingRules() || document()->usesDescendantRules())) {
             // Although no change occurred, we use the new style so that the cousin style sharing code won't get
diff --git a/WebCore/rendering/RenderButton.h b/WebCore/rendering/RenderButton.h
index 7fd6ab0..1fc5eb6 100644
--- a/WebCore/rendering/RenderButton.h
+++ b/WebCore/rendering/RenderButton.h
@@ -57,12 +57,14 @@ public:
 
     virtual bool canHaveChildren() const;
 
-protected:
+private:
     virtual void styleWillChange(StyleDifference, const RenderStyle* newStyle);
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
     virtual bool hasLineIfEmpty() const { return true; }
 
+    virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+
     void timerFired(Timer<RenderButton>*);
 
     RenderTextFragment* m_buttonText;
diff --git a/WebCore/rendering/RenderDataGrid.h b/WebCore/rendering/RenderDataGrid.h
index 467edcc..ce221ea 100644
--- a/WebCore/rendering/RenderDataGrid.h
+++ b/WebCore/rendering/RenderDataGrid.h
@@ -53,6 +53,8 @@ public:
 private:
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
+    virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+
     RenderStyle* columnStyle(DataGridColumn*);
     RenderStyle* headerStyle(DataGridColumn*);
     void recalcStyleForColumns();
diff --git a/WebCore/rendering/RenderFileUploadControl.h b/WebCore/rendering/RenderFileUploadControl.h
index 454041a..d77eadc 100644
--- a/WebCore/rendering/RenderFileUploadControl.h
+++ b/WebCore/rendering/RenderFileUploadControl.h
@@ -56,6 +56,8 @@ private:
 
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
+    virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+
     // FileChooserClient methods.
     void valueChanged();
     void repaint() { RenderBlock::repaint(); }
diff --git a/WebCore/rendering/RenderListItem.h b/WebCore/rendering/RenderListItem.h
index c4c41dc..d140979 100644
--- a/WebCore/rendering/RenderListItem.h
+++ b/WebCore/rendering/RenderListItem.h
@@ -63,6 +63,8 @@ private:
 
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
+    virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+
     void updateMarkerLocation();
     inline int calcValue() const;
     void updateValueNow() const;
diff --git a/WebCore/rendering/RenderMedia.h b/WebCore/rendering/RenderMedia.h
index 0d24c4c..32d6d65 100644
--- a/WebCore/rendering/RenderMedia.h
+++ b/WebCore/rendering/RenderMedia.h
@@ -118,6 +118,8 @@ private:
 
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
+    virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+
     RefPtr<HTMLElement> m_controlsShadowRoot;
     RefPtr<MediaControlElement> m_panel;
     RefPtr<MediaControlMuteButtonElement> m_muteButton;
diff --git a/WebCore/rendering/RenderMenuList.h b/WebCore/rendering/RenderMenuList.h
index f3c1b55..7e80d35 100644
--- a/WebCore/rendering/RenderMenuList.h
+++ b/WebCore/rendering/RenderMenuList.h
@@ -72,6 +72,8 @@ private:
 
     virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
+    virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+
     // PopupMenuClient methods
     virtual String itemText(unsigned listIndex) const;
     virtual String itemToolTip(unsigned listIndex) const;
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index 46abfca..f5719db 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -322,6 +322,8 @@ public:
     bool cellWidthChanged() const { return m_cellWidthChanged; }
     void setCellWidthChanged(bool b = true) { m_cellWidthChanged = b; }
 
+    virtual bool requiresForcedStyleRecalcPropagation() const { return false; }
+
 #if ENABLE(MATHML)
     virtual bool isRenderMathMLBlock() const { return false; }
 #endif // ENABLE(MATHML)
@@ -412,7 +414,6 @@ public:
     void drawArcForBoxSide(GraphicsContext*, int x, int y, float thickness, IntSize radius, int angleStart,
                            int angleSpan, BoxSide, Color, EBorderStyle, bool firstCorner);
 
-public:
     // The pseudo element style can be cached or uncached.  Use the cached method if the pseudo element doesn't respect
     // any pseudo classes (and therefore has no concept of changing state).
     RenderStyle* getCachedPseudoStyle(PseudoId, RenderStyle* parentStyle = 0) const;
diff --git a/WebCore/rendering/RenderProgress.h b/WebCore/rendering/RenderProgress.h
index ee60d9d..02f1a92 100644
--- a/WebCore/rendering/RenderProgress.h
+++ b/WebCore/rendering/RenderProgress.h
@@ -39,7 +39,8 @@ private:
     virtual void calcPrefWidths();
     virtual void layout();
     virtual void updateFromElement();
-};
+
+    virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
 
 inline RenderProgress* toRenderProgress(RenderObject* object)
 {
diff --git a/WebCore/rendering/RenderSlider.h b/WebCore/rendering/RenderSlider.h
index 92ad73b..fc8ce24 100644
--- a/WebCore/rendering/RenderSlider.h
+++ b/WebCore/rendering/RenderSlider.h
@@ -58,6 +58,8 @@ namespace WebCore {
 
         virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle);
 
+        virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+
         PassRefPtr<RenderStyle> createThumbStyle(const RenderStyle* parentStyle);
 
         int trackSize();
diff --git a/WebCore/rendering/RenderTextControl.h b/WebCore/rendering/RenderTextControl.h
index 2fc8edc..984f41d 100644
--- a/WebCore/rendering/RenderTextControl.h
+++ b/WebCore/rendering/RenderTextControl.h
@@ -107,6 +107,8 @@ private:
 
     virtual bool canBeProgramaticallyScrolled(bool) const { return true; }
 
+    virtual bool requiresForcedStyleRecalcPropagation() const { return true; }
+
     String finishText(Vector<UChar>&) const;
 
     bool m_wasChangedSinceLastChangeEvent;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list