Changeset 150234 in webkit


Ignore:
Timestamp:
May 16, 2013 8:14:09 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Source/WebCore: Frame flattening prevents <HTML> in <OBJECT> from having scrollbars
https://bugs.webkit.org/show_bug.cgi?id=115884

Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2013-05-16
Reviewed by Antonio Gomes.

Frame flattening should be applied when the frame owner is frame or iframe. But when
the frame owner is object element, frame flattening prevents it from having scrollbars.
In this situation, we can't scroll the html document in object element.

This patch adds two helper functions to verify flattening conditions.

Test: fast/frames/flattening/scrolling-in-object.html

  • page/FrameView.cpp:

(WebCore::frameFlatteningEnabled): Added. Helper to check whether flattening is enabled or not.
(WebCore::supportsFrameFlattening): Added. Helper to check whether the frame owner is <frame> or <iframe>.
(WebCore::FrameView::avoidScrollbarCreation):
(WebCore::FrameView::calculateScrollbarModesForLayout): Use frameFlatteningEnabled().
(WebCore::FrameView::layout): Use frameFlatteningEnabled().
(WebCore::FrameView::isInChildFrameWithFrameFlattening): Use frameFlatteningEnabled().

LayoutTests: Frame flattening prevents <HTML> in <OBJECT> from having scrollbars
https://bugs.webkit.org/show_bug.cgi?id=115884

Patch by Jaehun Lim <ljaehun.lim@samsung.com> on 2013-05-16
Reviewed by Antonio Gomes.

Frame flattening should be applied when the frame owner is frame or iframe. But when
the frame owner is object element, frame flattening prevents it from having scrollbars.
In this situation, we can't scroll the html document in object element.

This patch adds two helper functions to verify flattening conditions.

  • fast/frames/flattening/scrolling-in-object-expected.html: Added.
  • fast/frames/flattening/scrolling-in-object.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r150225 r150234  
     12013-05-16  Jaehun Lim  <ljaehun.lim@samsung.com>
     2
     3        Frame flattening prevents <HTML> in <OBJECT> from having scrollbars
     4        https://bugs.webkit.org/show_bug.cgi?id=115884
     5       
     6        Reviewed by Antonio Gomes.
     7       
     8        Frame flattening should be applied when the frame owner is frame or iframe. But when
     9        the frame owner is object element, frame flattening prevents it from having scrollbars.
     10        In this situation, we can't scroll the html document in object element.
     11       
     12        This patch adds two helper functions to verify flattening conditions.
     13
     14        * fast/frames/flattening/scrolling-in-object-expected.html: Added.
     15        * fast/frames/flattening/scrolling-in-object.html: Added.
     16
    1172013-05-16  Lamarque V. Souza  <Lamarque.Souza@basyskom.com>
    218
  • trunk/Source/WebCore/ChangeLog

    r150231 r150234  
     12013-05-16  Jaehun Lim  <ljaehun.lim@samsung.com>
     2
     3        Frame flattening prevents <HTML> in <OBJECT> from having scrollbars
     4        https://bugs.webkit.org/show_bug.cgi?id=115884
     5       
     6        Reviewed by Antonio Gomes.
     7
     8        Frame flattening should be applied when the frame owner is frame or iframe. But when
     9        the frame owner is object element, frame flattening prevents it from having scrollbars.
     10        In this situation, we can't scroll the html document in object element.
     11
     12        This patch adds two helper functions to verify flattening conditions.
     13       
     14        Test: fast/frames/flattening/scrolling-in-object.html
     15
     16        * page/FrameView.cpp:
     17        (WebCore::frameFlatteningEnabled): Added. Helper to check whether flattening is enabled or not.
     18        (WebCore::supportsFrameFlattening): Added. Helper to check whether the frame owner is <frame> or <iframe>.
     19        (WebCore::FrameView::avoidScrollbarCreation):
     20        (WebCore::FrameView::calculateScrollbarModesForLayout): Use frameFlatteningEnabled().
     21        (WebCore::FrameView::layout): Use frameFlatteningEnabled().
     22        (WebCore::FrameView::isInChildFrameWithFrameFlattening): Use frameFlatteningEnabled().
     23
    1242013-05-16  Patrick Gansterer  <paroga@webkit.org>
    225
  • trunk/Source/WebCore/page/FrameView.cpp

    r150214 r150234  
    512512}
    513513
     514static bool frameFlatteningEnabled(Frame* frame)
     515{
     516    return frame && frame->settings() && frame->settings()->frameFlatteningEnabled();
     517}
     518
     519static bool supportsFrameFlattening(Frame* frame)
     520{
     521    if (!frame)
     522        return false;
     523
     524    // Frame flattening is valid only for <frame> and <iframe>.
     525    HTMLFrameOwnerElement* owner = frame->ownerElement();
     526    return owner && (owner->hasTagName(frameTag) || owner->hasTagName(iframeTag));
     527}
     528
    514529bool FrameView::avoidScrollbarCreation() const
    515530{
     
    520535    // our flattening policy using that.
    521536
    522     if (!m_frame->ownerElement())
    523         return false;
    524 
    525     if (!m_frame->settings() || m_frame->settings()->frameFlatteningEnabled())
    526         return true;
    527 
    528     return false;
     537    return frameFlatteningEnabled(frame()) && supportsFrameFlattening(frame());
    529538}
    530539
     
    737746        Node* body = document->body();
    738747        if (body && body->renderer()) {
    739             if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame->settings()->frameFlatteningEnabled()) {
     748            if (body->hasTagName(framesetTag) && !frameFlatteningEnabled(frame())) {
    740749                vMode = ScrollbarAlwaysOff;
    741750                hMode = ScrollbarAlwaysOff;
     
    12321241            Node* body = document->body();
    12331242            if (body && body->renderer()) {
    1234                 if (body->hasTagName(framesetTag) && m_frame->settings() && !m_frame->settings()->frameFlatteningEnabled()) {
     1243                if (body->hasTagName(framesetTag) && !frameFlatteningEnabled(frame())) {
    12351244                    body->renderer()->setChildNeedsLayout(true);
    12361245                } else if (body->hasTagName(bodyTag)) {
     
    33953404    }
    33963405
    3397     if (!m_frame->settings() || !m_frame->settings()->frameFlatteningEnabled())
     3406    if (!frameFlatteningEnabled(frame()))
    33983407        return false;
    33993408
Note: See TracChangeset for help on using the changeset viewer.