Changeset 116794 in webkit


Ignore:
Timestamp:
May 11, 2012 12:40:30 PM (12 years ago)
Author:
andersca@apple.com
Message:

REGRESSION(r116687): [Chromium] plugins/embed-attributes-style.html shows a garbled string
https://bugs.webkit.org/show_bug.cgi?id=86170

Reviewed by Andreas Kling.

The string we are passing to the TextRun constructor needs to stay alive for longer so revert back to the old
behavior where we store it as a member variable.

  • rendering/RenderEmbeddedObject.cpp:

(WebCore::unavailablePluginReplacementText):
(WebCore):
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason):
(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):

  • rendering/RenderEmbeddedObject.h:

(RenderEmbeddedObject):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116792 r116794  
     12012-05-11  Anders Carlsson  <andersca@apple.com>
     2
     3        REGRESSION(r116687): [Chromium] plugins/embed-attributes-style.html shows a garbled string
     4        https://bugs.webkit.org/show_bug.cgi?id=86170
     5
     6        Reviewed by Andreas Kling.
     7
     8        The string we are passing to the TextRun constructor needs to stay alive for longer so revert back to the old
     9        behavior where we store it as a member variable.
     10
     11        * rendering/RenderEmbeddedObject.cpp:
     12        (WebCore::unavailablePluginReplacementText):
     13        (WebCore):
     14        (WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason):
     15        (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
     16        * rendering/RenderEmbeddedObject.h:
     17        (RenderEmbeddedObject):
     18
    1192012-05-11  Simon Fraser  <simon.fraser@apple.com>
    220
  • trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp

    r116695 r116794  
    103103#endif
    104104
     105static String unavailablePluginReplacementText(RenderEmbeddedObject::PluginUnavailabilityReason pluginUnavailabilityReason)
     106{
     107    switch (pluginUnavailabilityReason) {
     108    case RenderEmbeddedObject::PluginMissing:
     109        return missingPluginText();
     110    case RenderEmbeddedObject::PluginCrashed:
     111        return crashedPluginText();
     112    case RenderEmbeddedObject::InsecurePluginVersion:
     113        return insecurePluginVersionText();
     114    }
     115
     116    ASSERT_NOT_REACHED();
     117    return String();
     118}
     119
    105120void RenderEmbeddedObject::setPluginUnavailabilityReason(PluginUnavailabilityReason pluginUnavailabilityReason)
    106121{
     
    108123    m_showsUnavailablePluginIndicator = true;
    109124    m_pluginUnavailabilityReason = pluginUnavailabilityReason;
     125
     126    m_unavailablePluginReplacementText = unavailablePluginReplacementText(pluginUnavailabilityReason);
    110127}
    111128
     
    194211    font = Font(fontDescription, 0, 0);
    195212    font.update(0);
    196    
    197     run = TextRun(unavailablePluginReplacementText());
     213
     214    run = TextRun(m_unavailablePluginReplacementText);
    198215    textWidth = font.width(run);
    199216   
     
    206223
    207224    return true;
    208 }
    209 
    210 String RenderEmbeddedObject::unavailablePluginReplacementText() const
    211 {
    212     switch (m_pluginUnavailabilityReason) {
    213     case PluginMissing:
    214         return missingPluginText();
    215     case PluginCrashed:
    216         return crashedPluginText();
    217     case InsecurePluginVersion:
    218         return insecurePluginVersionText();
    219     }
    220 
    221     ASSERT_NOT_REACHED();
    222     return String();
    223225}
    224226
  • trunk/Source/WebCore/rendering/RenderEmbeddedObject.h

    r116695 r116794  
    7979    bool isInUnavailablePluginIndicator(const LayoutPoint&) const;
    8080    bool getReplacementTextGeometry(const LayoutPoint& accumulatedOffset, FloatRect& contentRect, Path&, FloatRect& replacementTextRect, Font&, TextRun&, float& textWidth) const;
    81     String unavailablePluginReplacementText() const;
    8281
    8382    bool m_hasFallbackContent; // FIXME: This belongs on HTMLObjectElement.
     
    8584    bool m_showsUnavailablePluginIndicator;
    8685    PluginUnavailabilityReason m_pluginUnavailabilityReason;
     86    String m_unavailablePluginReplacementText;
    8787    bool m_unavailablePluginIndicatorIsPressed;
    8888    bool m_mouseDownWasInUnavailablePluginIndicator;
Note: See TracChangeset for help on using the changeset viewer.