Changeset 181665 in webkit


Ignore:
Timestamp:
Mar 17, 2015 2:29:21 PM (9 years ago)
Author:
peavo@outlook.com
Message:

[WinCairo] Video position is incorrect when located inside a frame.
https://bugs.webkit.org/show_bug.cgi?id=142784

Reviewed by Brent Fulgham.

We need to take the enclosing frame's position into account, when finding the video position.

  • platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:

(WebCore::MediaPlayerPrivateMediaFoundation::setSize):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r181663 r181665  
     12015-03-17  Per Arne Vollan  <peavo@outlook.com>
     2
     3        [WinCairo] Video position is incorrect when located inside a frame.
     4        https://bugs.webkit.org/show_bug.cgi?id=142784
     5
     6        Reviewed by Brent Fulgham.
     7
     8        We need to take the enclosing frame's position into account, when finding the video position.
     9
     10        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
     11        (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
     12
    1132015-03-17  Benjamin Poulain  <bpoulain@apple.com>
    214
  • trunk/Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp

    r180839 r181665  
    205205
    206206    LayoutSize scrollOffset;
     207    IntPoint positionInWindow(m_lastPaintRect.location());
    207208
    208209    FrameView* view = nullptr;
    209210    if (m_player && m_player->cachedResourceLoader() && m_player->cachedResourceLoader()->document())
    210211        view = m_player->cachedResourceLoader()->document()->view();
    211     if (view)
     212
     213    if (view) {
    212214        scrollOffset = view->scrollOffsetForFixedPosition();
    213 
    214     int xPos = -scrollOffset.width().toInt() + m_lastPaintRect.x();
    215     int yPos = -scrollOffset.height().toInt() + m_lastPaintRect.y();
     215        positionInWindow = view->convertToContainingWindow(m_lastPaintRect.location());
     216    }
     217
     218    positionInWindow.move(-scrollOffset.width().toInt(), -scrollOffset.height().toInt());
    216219
    217220    if (m_hwndVideo && !m_lastPaintRect.isEmpty())
    218         ::MoveWindow(m_hwndVideo, xPos, yPos, m_size.width(), m_size.height(), FALSE);
     221        ::MoveWindow(m_hwndVideo, positionInWindow.x(), positionInWindow.y(), m_size.width(), m_size.height(), FALSE);
    219222
    220223    RECT rc = { 0, 0, m_size.width(), m_size.height() };
Note: See TracChangeset for help on using the changeset viewer.