Changeset 29974 in webkit


Ignore:
Timestamp:
Feb 4, 2008 1:32:12 PM (16 years ago)
Author:
jhoneycutt@apple.com
Message:

2008-02-04 Jon Honeycutt <jhoneycutt@apple.com>

Reviewed by Steve, Anders.

<rdar://problem/5211187> QuickTime and Flash plug-ins draw outside of
content area when inside an iframe or div with overflow when playing a
movie and scrolling the iframe/div area

Clip the update region to the zero rect when scrolling. Don't do this
for Java, because it results in repaint problems.

  • plugins/PluginQuirkSet.h: Added the DontClipToZeroRectWhenScrolling quirk (WebCore::):
  • plugins/win/PluginViewWin.cpp: (WebCore::PluginViewWin::updateWindow): Readded the old behavior of clipping to the zero rect when updating the window during a scroll. Added plug-in quirk to ignore this behavior for Java. Swapped order of the SetWindowRgn() and MoveWindow() calls to prevent Java from painting outside of its container during a scroll. (WebCore::PluginViewWin::determineQuirks): If this is Java, add the DontClipToZeroRectWhenScrolling quirk.
Location:
trunk/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r29973 r29974  
     12008-02-04  Jon Honeycutt  <jhoneycutt@apple.com>
     2
     3        Reviewed by Steve, Anders.
     4
     5        <rdar://problem/5211187> QuickTime and Flash plug-ins draw outside of
     6        content area when inside an iframe or div with overflow when playing a
     7        movie and scrolling the iframe/div area
     8
     9        Clip the update region to the zero rect when scrolling. Don't do this
     10        for Java, because it results in repaint problems.
     11
     12        * plugins/PluginQuirkSet.h: Added the DontClipToZeroRectWhenScrolling
     13        quirk
     14        (WebCore::):
     15        * plugins/win/PluginViewWin.cpp:
     16        (WebCore::PluginViewWin::updateWindow): Readded the old behavior of
     17        clipping to the zero rect when updating the window during a scroll.
     18        Added plug-in quirk to ignore this behavior for Java. Swapped order of
     19        the SetWindowRgn() and MoveWindow() calls to prevent Java from painting
     20        outside of its container during a scroll.
     21        (WebCore::PluginViewWin::determineQuirks): If this is Java, add the
     22        DontClipToZeroRectWhenScrolling quirk.
     23
    1242008-02-04  Timothy Hatcher  <timothy@apple.com>
    225
  • trunk/WebCore/plugins/PluginQuirkSet.h

    r29778 r29974  
    4343        PluginQuirkHasModalMessageLoop = 1 << 7,
    4444        PluginQuirkFlashURLNotifyBug = 1 << 8,
     45        PluginQuirkDontClipToZeroRectWhenScrolling = 1 << 9,
    4546    };
    4647
  • trunk/WebCore/plugins/win/PluginViewWin.cpp

    r29871 r29974  
    354354        HRGN rgn;
    355355
     356        setCallingPlugin(true);
     357
    356358        // To prevent flashes while scrolling, we disable drawing during the window
    357359        // update process by clipping the window to the zero rect.
    358360
    359         // FIXME: Setting the window region to an empty region causes bad scrolling
    360         // repaint problems with at least the WMP and Java plugins.
    361         // <rdar://problem/5211187> Come up with a better way of handling plug-in scrolling
    362         // is the bug that tracks the work of fixing this.
    363         //rgn = ::CreateRectRgn(0, 0, 0, 0);
    364         //::SetWindowRgn(m_window, rgn, false);
    365 
    366         setCallingPlugin(true);
     361        bool clipToZeroRect = !m_quirks.contains(PluginQuirkDontClipToZeroRectWhenScrolling);
     362
     363        if (clipToZeroRect) {
     364            rgn = ::CreateRectRgn(0, 0, 0, 0);
     365            ::SetWindowRgn(m_window, rgn, FALSE);
     366        } else {
     367            rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
     368            ::SetWindowRgn(m_window, rgn, TRUE);
     369        }
     370
    367371        if (m_windowRect != oldWindowRect)
    368             ::MoveWindow(m_window, m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), true);
    369 
    370         // Re-enable drawing. (This serves the double purpose of updating the clip rect if it has changed.)
    371         rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
    372         ::SetWindowRgn(m_window, rgn, true);
    373         ::UpdateWindow(m_window);
     372            ::MoveWindow(m_window, m_windowRect.x(), m_windowRect.y(), m_windowRect.width(), m_windowRect.height(), TRUE);
     373
     374        if (clipToZeroRect) {
     375            rgn = ::CreateRectRgn(m_clipRect.x(), m_clipRect.y(), m_clipRect.right(), m_clipRect.bottom());
     376            ::SetWindowRgn(m_window, rgn, TRUE);
     377        }
     378
    374379        setCallingPlugin(false);
    375380    }
     
    15051510        m_quirks.add(PluginQuirkDontUnloadPlugin);
    15061511
    1507     // Because a single process cannot create multiple VMs, and we cannot reliably unload a
    1508     // Java VM, we cannot unload the Java plugin, or we'll lose reference to our only VM
    1509     if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType))
     1512    if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) {
     1513        // Because a single process cannot create multiple VMs, and we cannot reliably unload a
     1514        // Java VM, we cannot unload the Java plugin, or we'll lose reference to our only VM
    15101515        m_quirks.add(PluginQuirkDontUnloadPlugin);
     1516
     1517        // Setting the window region to an empty region causes bad scrolling repaint problems
     1518        // with the Java plug-in.
     1519        m_quirks.add(PluginQuirkDontClipToZeroRectWhenScrolling);
     1520    }
    15111521
    15121522    if (mimeType == "audio/x-pn-realaudio-plugin") {
Note: See TracChangeset for help on using the changeset viewer.