Changeset 66095 in webkit


Ignore:
Timestamp:
Aug 26, 2010 4:56:40 AM (14 years ago)
Author:
Girish Ramakrishnan
Message:

[Qt] Set the clipRect correctly in windowed and windowless mode.
In Windowed mode, the values are in page coordinates. In Windowless
mode the values are in drawable coordinates. Setting these values is
purely academic since they are not used by Flash. However, there is a
possibility that plugins might infer a 'null' clipRect to mean 'invisible'.

https://bugs.webkit.org/show_bug.cgi?id=44594

Reviewed by Simon Hausmann.

  • plugins/qt/PluginViewQt.cpp:

(WebCore::PluginView::setNPWindowIfNeeded):

Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r66094 r66095  
     12010-08-26  Girish Ramakrishnan  <girish@forwardbias.in>
     2
     3        Reviewed by Simon Hausmann.
     4
     5        [Qt] Set the clipRect correctly in windowed and windowless mode.
     6        In Windowed mode, the values are in page coordinates. In Windowless
     7        mode the values are in drawable coordinates. Setting these values is
     8        purely academic since they are not used by Flash. However, there is a
     9        possibility that plugins might infer a 'null' clipRect to mean 'invisible'.
     10
     11        https://bugs.webkit.org/show_bug.cgi?id=44594
     12
     13        * plugins/qt/PluginViewQt.cpp:
     14        (WebCore::PluginView::setNPWindowIfNeeded):
     15
    1162010-08-26  Pavel Podivilov  <podivilov@chromium.org>
    217
  • trunk/WebCore/plugins/qt/PluginViewQt.cpp

    r66084 r66095  
    579579        m_npWindow.x = m_windowRect.x();
    580580        m_npWindow.y = m_windowRect.y();
    581 
    582         m_npWindow.clipRect.left = max(0, m_clipRect.x());
    583         m_npWindow.clipRect.top = max(0, m_clipRect.y());
    584         m_npWindow.clipRect.right = m_clipRect.x() + m_clipRect.width();
    585         m_npWindow.clipRect.bottom = m_clipRect.y() + m_clipRect.height();
    586581    } else {
    587582        m_npWindow.x = 0;
    588583        m_npWindow.y = 0;
    589 
     584    }
     585
     586    // If the width or height are null, set the clipRect to null, indicating that
     587    // the plugin is not visible/scrolled out.
     588    if (!m_clipRect.width() || !m_clipRect.height()) {
    590589        m_npWindow.clipRect.left = 0;
     590        m_npWindow.clipRect.right = 0;
    591591        m_npWindow.clipRect.top = 0;
    592         m_npWindow.clipRect.right = 0;
    593592        m_npWindow.clipRect.bottom = 0;
     593    } else {
     594        // Clipping rectangle of the plug-in; the origin is the top left corner of the drawable or window.
     595        m_npWindow.clipRect.left = m_npWindow.x + m_clipRect.x();
     596        m_npWindow.clipRect.top = m_npWindow.y + m_clipRect.y();
     597        m_npWindow.clipRect.right = m_npWindow.x + m_clipRect.x() + m_clipRect.width();
     598        m_npWindow.clipRect.bottom = m_npWindow.y + m_clipRect.y() + m_clipRect.height();
    594599    }
    595600
Note: See TracChangeset for help on using the changeset viewer.