Changeset 140749 in webkit


Ignore:
Timestamp:
Jan 24, 2013 4:44:18 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

resize property doesn't work on iframes
https://bugs.webkit.org/show_bug.cgi?id=9221

Patch by Christian Biesinger <cbiesinger@chromium.org> on 2013-01-24
Reviewed by Eric Seidel.

Source/WebCore:

Test: fast/css/resize-corner-tracking-transformed-iframe.html
and fast/css/resize-corner-tracking.html

  • rendering/RenderIFrame.cpp:

(WebCore::RenderIFrame::requiresLayer):
(WebCore):

  • rendering/RenderIFrame.h:

<iframe>s need a layer to be resizable, so make requiresLayer return
true if the css property is set.

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::canResize):
(WebCore):
(WebCore::RenderLayer::resize):
(WebCore::RenderLayer::positionOverflowControls):
(WebCore::RenderLayer::isPointInResizeControl):
(WebCore::RenderLayer::hitTestOverflowControls):
(WebCore::RenderLayer::hitTestLayer):

  • rendering/RenderLayer.h:

(RenderLayer):
Add a new canResize() function and use it instead of hasOverflowClip()
to check whether resizing should be allowed (there's still the
additional check of style()->resize() != RESIZE_NONE, of course)

Make hitTestLayer return |this| when the point is inside the
resizer rectangle.

  • rendering/RenderWidget.cpp:

(WebCore::RenderWidget::paint):
Call layer()->paintResizer() to actually paint the resizer.

LayoutTests:

  • fast/css/resize-corner-tracking-transformed-iframe.html: Added.

New test for testing resize of transformed <iframe>

  • fast/css/resize-corner-tracking.html:

Add a testcase for resizing an <iframe>

  • platform/chromium-linux/fast/css/resize-corner-tracking-expected.png:
  • platform/chromium-linux/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
  • platform/chromium-mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
  • platform/chromium-win/fast/css/resize-corner-tracking-expected.txt:
  • platform/chromium/compositing/iframes/resizer-expected.txt:
  • platform/chromium/fast/css/resize-corner-tracking-expected.txt:
  • platform/chromium/fast/css/resize-corner-tracking-transformed-expected.txt:
  • platform/chromium/fast/css/resize-corner-tracking-transformed-iframe-expected.txt: Added.
  • platform/mac/fast/css/resize-corner-tracking-expected.txt:
  • platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
  • platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.txt: Added.

Update/add generic, mac and linux reference files for the test

  • platform/chromium/TestExpectations:
  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/qt/TestExpectations:
  • platform/win/TestExpectations:

Add expected failures for the tests until they can be rebaselined.

Location:
trunk
Files:
6 added
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r140748 r140749  
     12013-01-24  Christian Biesinger  <cbiesinger@chromium.org>
     2
     3        resize property doesn't work on iframes
     4        https://bugs.webkit.org/show_bug.cgi?id=9221
     5
     6        Reviewed by Eric Seidel.
     7
     8        * fast/css/resize-corner-tracking-transformed-iframe.html: Added.
     9        New test for testing resize of transformed <iframe>
     10
     11        * fast/css/resize-corner-tracking.html:
     12        Add a testcase for resizing an <iframe>
     13
     14        * platform/chromium-linux/fast/css/resize-corner-tracking-expected.png:
     15        * platform/chromium-linux/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
     16        * platform/chromium-mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
     17        * platform/chromium-win/fast/css/resize-corner-tracking-expected.txt:
     18        * platform/chromium/compositing/iframes/resizer-expected.txt:
     19        * platform/chromium/fast/css/resize-corner-tracking-expected.txt:
     20        * platform/chromium/fast/css/resize-corner-tracking-transformed-expected.txt:
     21        * platform/chromium/fast/css/resize-corner-tracking-transformed-iframe-expected.txt: Added.
     22        * platform/mac/fast/css/resize-corner-tracking-expected.txt:
     23        * platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.png: Added.
     24        * platform/mac/fast/css/resize-corner-tracking-transformed-iframe-expected.txt: Added.
     25        Update/add generic, mac and linux reference files for the test
     26
     27        * platform/chromium/TestExpectations:
     28        * platform/efl/TestExpectations:
     29        * platform/gtk/TestExpectations:
     30        * platform/qt/TestExpectations:
     31        * platform/win/TestExpectations:
     32        Add expected failures for the tests until they can be rebaselined.
     33
    1342013-01-24  Kentaro Hara  <haraken@chromium.org>
    235
  • trunk/LayoutTests/fast/css/resize-corner-tracking.html

    r120683 r140749  
    2020            resize("textarea1");
    2121            resize("textarea2");
     22            resize("iframe1");
    2223        }
    2324    </script>
     
    4041    <br>
    4142    <textarea id="textarea2"></textarea>
     43    <br>
     44    <iframe id="iframe1" style="resize:both;"></iframe>
    4245</body>
  • trunk/LayoutTests/platform/chromium-win/fast/css/resize-corner-tracking-expected.txt

    r69281 r140749  
    1818          text run at (726,0) width 4: "."
    1919      RenderBlock {HR} at (0,54) size 784x2 [border: (1px inset #000000)]
    20       RenderBlock (anonymous) at (0,189) size 784x187
     20      RenderBlock (anonymous) at (0,189) size 784x367
    2121        RenderText {#text} at (169,106) size 4x19
    2222          text run at (169,106) width 4: " "
     23        RenderBR {BR} at (0,0) size 0x0
     24        RenderText {#text} at (202,172) size 4x19
     25          text run at (202,172) width 4: " "
    2326        RenderBR {BR} at (0,0) size 0x0
    2427        RenderText {#text} at (0,0) size 0x0
     
    3134  RenderTextControl {TEXTAREA} at (2,128) size 198x57 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    3235    RenderBlock {DIV} at (3,3) size 194x16
     36layer at (8,389) size 323x175
     37  RenderPartObject {IFRAME} at (0,192) size 323x175 [border: (2px inset #000000)]
     38    layer at (0,0) size 319x171
     39      RenderView at (0,0) size 319x171
     40    layer at (0,0) size 319x171
     41      RenderBlock {HTML} at (0,0) size 319x171
     42        RenderBody {BODY} at (8,8) size 303x155
  • trunk/LayoutTests/platform/chromium/TestExpectations

    r140728 r140749  
    46694669webkit.org/b/107567 editing/selection/extend-by-sentence-001.html [ Failure ]
    46704670webkit.org/b/107567 svg/carto.net/combobox.svg [ Failure ]
     4671
     4672# Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=9221
     4673webkit.org/b/9221 [ Win ] fast/css/resize-corner-tracking.html [ Failure ]
     4674webkit.org/b/9221 [ Win ] fast/css/resize-corner-tracking-transformed-iframe.html [ Missing ]
  • trunk/LayoutTests/platform/chromium/compositing/iframes/resizer-expected.txt

    r100329 r140749  
    4747            )
    4848            (GraphicsLayer
     49              (position 287.00 137.00)
     50              (bounds 15.00 15.00)
     51              (drawsContent 1)
    4952            )
    5053          )
  • trunk/LayoutTests/platform/chromium/fast/css/resize-corner-tracking-expected.txt

    r131694 r140749  
    55    RenderBody {BODY} at (8,8) size 784x584
    66      RenderBlock {HR} at (0,0) size 784x2 [border: (1px inset #000000)]
    7       RenderBlock {P} at (0,18) size 784x18
    8         RenderText {#text} at (0,0) size 53x18
    9           text run at (0,0) width 53: "Test for "
    10         RenderInline {I} at (0,0) size 669x18
    11           RenderInline {A} at (0,0) size 348x18 [color=#0000EE]
    12             RenderText {#text} at (53,0) size 348x18
    13               text run at (53,0) width 348: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9547"
    14           RenderText {#text} at (401,0) size 321x18
     7      RenderBlock {P} at (0,18) size 784x20
     8        RenderText {#text} at (0,0) size 51x19
     9          text run at (0,0) width 51: "Test for "
     10        RenderInline {I} at (0,0) size 675x19
     11          RenderInline {A} at (0,0) size 350x19 [color=#0000EE]
     12            RenderText {#text} at (51,0) size 350x19
     13              text run at (51,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9547"
     14          RenderText {#text} at (401,0) size 325x19
    1515            text run at (401,0) width 4: " "
    16             text run at (405,0) width 317: "Resize corner does not track the mouse accurately"
    17         RenderText {#text} at (722,0) size 4x18
    18           text run at (722,0) width 4: "."
    19       RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
    20       RenderBlock (anonymous) at (0,187) size 784x182
    21         RenderText {#text} at (169,107) size 4x18
    22           text run at (169,107) width 4: " "
     16            text run at (405,0) width 321: "Resize corner does not track the mouse accurately"
     17        RenderText {#text} at (726,0) size 4x19
     18          text run at (726,0) width 4: "."
     19      RenderBlock {HR} at (0,54) size 784x2 [border: (1px inset #000000)]
     20      RenderBlock (anonymous) at (0,189) size 784x367
     21        RenderText {#text} at (169,106) size 4x19
     22          text run at (169,106) width 4: " "
     23        RenderBR {BR} at (0,0) size 0x0
     24        RenderText {#text} at (202,172) size 4x19
     25          text run at (202,172) width 4: " "
    2326        RenderBR {BR} at (0,0) size 0x0
    2427        RenderText {#text} at (0,0) size 0x0
    25 layer at (8,70) size 173x125 clip at (10,72) size 169x121
    26   RenderBlock {DIV} at (0,62) size 173x125 [border: (2px solid #0000FF)]
    27 layer at (8,195) size 169x121 clip at (10,197) size 165x117
     28layer at (8,72) size 173x125 clip at (10,74) size 169x121
     29  RenderBlock {DIV} at (0,64) size 173x125 [border: (2px solid #0000FF)]
     30layer at (8,197) size 169x121 clip at (10,199) size 165x117
    2831  RenderTextControl {TEXTAREA} at (0,0) size 169x121 [bgcolor=#FFFFFF] [border: (2px solid #0000FF)]
    29     RenderBlock {DIV} at (4,4) size 161x13
    30 layer at (10,322) size 180x53 clip at (11,323) size 178x51
    31   RenderTextControl {TEXTAREA} at (2,127) size 180x53 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    32     RenderBlock {DIV} at (3,3) size 174x13
     32    RenderBlock {DIV} at (4,4) size 163x16
     33layer at (10,325) size 198x57 clip at (11,326) size 196x55
     34  RenderTextControl {TEXTAREA} at (2,128) size 198x57 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
     35    RenderBlock {DIV} at (3,3) size 194x16
     36layer at (8,389) size 323x175
     37  RenderPartObject {IFRAME} at (0,192) size 323x175 [border: (2px inset #000000)]
     38    layer at (0,0) size 319x171
     39      RenderView at (0,0) size 319x171
     40    layer at (0,0) size 319x171
     41      RenderBlock {HTML} at (0,0) size 319x171
     42        RenderBody {BODY} at (8,8) size 303x155
  • trunk/LayoutTests/platform/chromium/fast/css/resize-corner-tracking-transformed-expected.txt

    r131694 r140749  
    55    RenderBody {BODY} at (8,8) size 784x542
    66      RenderBlock {HR} at (0,0) size 784x2 [border: (1px inset #000000)]
    7       RenderBlock {P} at (0,18) size 784x18
    8         RenderText {#text} at (0,0) size 53x18
    9           text run at (0,0) width 53: "Test for "
    10         RenderInline {I} at (0,0) size 646x18
    11           RenderInline {A} at (0,0) size 307x18 [color=#0000EE]
    12             RenderText {#text} at (53,0) size 307x18
    13               text run at (53,0) width 307: "https://bugs.webkit.org/show_bug.cgi?id=22118"
    14           RenderText {#text} at (360,0) size 339x18
    15             text run at (360,0) width 4: " "
    16             text run at (364,0) width 335: "Resize corner does not track in transformed elements"
    17         RenderText {#text} at (699,0) size 4x18
    18           text run at (699,0) width 4: "."
    19       RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
    20 layer at (58,112) size 163x129 clip at (60,114) size 159x125
    21   RenderBlock {DIV} at (50,104) size 163x129 [border: (2px solid #0000FF)]
     7      RenderBlock {P} at (0,18) size 784x20
     8        RenderText {#text} at (0,0) size 51x19
     9          text run at (0,0) width 51: "Test for "
     10        RenderInline {I} at (0,0) size 655x19
     11          RenderInline {A} at (0,0) size 311x19 [color=#0000EE]
     12            RenderText {#text} at (51,0) size 311x19
     13              text run at (51,0) width 311: "https://bugs.webkit.org/show_bug.cgi?id=22118"
     14          RenderText {#text} at (362,0) size 344x19
     15            text run at (362,0) width 4: " "
     16            text run at (366,0) width 340: "Resize corner does not track in transformed elements"
     17        RenderText {#text} at (706,0) size 4x19
     18          text run at (706,0) width 4: "."
     19      RenderBlock {HR} at (0,54) size 784x2 [border: (1px inset #000000)]
     20layer at (58,114) size 163x129 clip at (60,116) size 159x125
     21  RenderBlock {DIV} at (50,106) size 163x129 [border: (2px solid #0000FF)]
  • trunk/LayoutTests/platform/efl/TestExpectations

    r140715 r140749  
    12591259
    12601260# Tracking corner not being painted for TextArea.
     1261webkit.org/b/9221 fast/css/resize-corner-tracking-transformed-iframe.html [ Missing ]
    12611262webkit.org/b/85484 fast/css/resize-corner-tracking-transformed.html [ Failure ]
    12621263webkit.org/b/85484 fast/css/resize-corner-tracking.html [ Failure ]
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r140715 r140749  
    5353
    5454webkit.org/b/103955 fast/repaint/caret-with-transformation.html [ Missing ]
     55
     56# Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=9221
     57webkit.org/b/9221 fast/css/resize-corner-tracking.html [ Failure ]
     58webkit.org/b/9221 fast/css/resize-corner-tracking-transformed-iframe.html [ Missing ]
    5559
    5660# Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=14664
  • trunk/LayoutTests/platform/mac/fast/css/resize-corner-tracking-expected.txt

    r63403 r140749  
    1818          text run at (722,0) width 4: "."
    1919      RenderBlock {HR} at (0,52) size 784x2 [border: (1px inset #000000)]
    20       RenderBlock (anonymous) at (0,187) size 784x182
     20      RenderBlock (anonymous) at (0,187) size 784x361
    2121        RenderText {#text} at (169,107) size 4x18
    2222          text run at (169,107) width 4: " "
     23        RenderBR {BR} at (0,0) size 0x0
     24        RenderText {#text} at (184,168) size 4x18
     25          text run at (184,168) width 4: " "
    2326        RenderBR {BR} at (0,0) size 0x0
    2427        RenderText {#text} at (0,0) size 0x0
     
    3134  RenderTextControl {TEXTAREA} at (2,127) size 180x53 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
    3235    RenderBlock {DIV} at (3,3) size 174x13
     36layer at (8,381) size 323x175
     37  RenderPartObject {IFRAME} at (0,186) size 323x175 [border: (2px inset #000000)]
     38    layer at (0,0) size 319x171
     39      RenderView at (0,0) size 319x171
     40    layer at (0,0) size 319x171
     41      RenderBlock {HTML} at (0,0) size 319x171
     42        RenderBody {BODY} at (8,8) size 303x155
  • trunk/LayoutTests/platform/qt/TestExpectations

    r140693 r140749  
    19691969css2.1/20110323/inline-non-replaced-height-003.htm
    19701970css2.1/20110323/inline-non-replaced-height-002.htm
    1971 
     1971fast/css/resize-corner-tracking-transformed-iframe.html
     1972fast/css/resize-corner-tracking.html
    19721973
    19731974# ============================================================================= #
  • trunk/LayoutTests/platform/win/TestExpectations

    r140679 r140749  
    25292529proximity/updates.html
    25302530proximity/window-property.html
     2531
     2532# Needs rebaseline after https://bugs.webkit.org/show_bug.cgi?id=9221
     2533webkit.org/b/9221 fast/css/resize-corner-tracking.html [ Failure ]
     2534webkit.org/b/9221 fast/css/resize-corner-tracking-transformed-iframe.html [ Missing ]
  • trunk/Source/WebCore/ChangeLog

    r140748 r140749  
     12013-01-24  Christian Biesinger  <cbiesinger@chromium.org>
     2
     3        resize property doesn't work on iframes
     4        https://bugs.webkit.org/show_bug.cgi?id=9221
     5
     6        Reviewed by Eric Seidel.
     7
     8        Test: fast/css/resize-corner-tracking-transformed-iframe.html
     9        and fast/css/resize-corner-tracking.html
     10
     11        * rendering/RenderIFrame.cpp:
     12        (WebCore::RenderIFrame::requiresLayer):
     13        (WebCore):
     14        * rendering/RenderIFrame.h:
     15        <iframe>s need a layer to be resizable, so make requiresLayer return
     16        true if the css property is set.
     17
     18        * rendering/RenderLayer.cpp:
     19        (WebCore::RenderLayer::canResize):
     20        (WebCore):
     21        (WebCore::RenderLayer::resize):
     22        (WebCore::RenderLayer::positionOverflowControls):
     23        (WebCore::RenderLayer::isPointInResizeControl):
     24        (WebCore::RenderLayer::hitTestOverflowControls):
     25        (WebCore::RenderLayer::hitTestLayer):
     26        * rendering/RenderLayer.h:
     27        (RenderLayer):
     28        Add a new canResize() function and use it instead of hasOverflowClip()
     29        to check whether resizing should be allowed (there's still the
     30        additional check of style()->resize() != RESIZE_NONE, of course)
     31
     32        Make hitTestLayer return |this| when the point is inside the
     33        resizer rectangle.
     34
     35        * rendering/RenderWidget.cpp:
     36        (WebCore::RenderWidget::paint):
     37        Call layer()->paintResizer() to actually paint the resizer.
     38
    1392013-01-24  Kentaro Hara  <haraken@chromium.org>
    240
  • trunk/Source/WebCore/rendering/RenderIFrame.cpp

    r138917 r140749  
    8282{
    8383    return node() && node()->hasTagName(iframeTag) && static_cast<HTMLIFrameElement*>(node())->shouldDisplaySeamlessly();
     84}
     85
     86bool RenderIFrame::requiresLayer() const
     87{
     88    return RenderFrameBase::requiresLayer() || style()->resize() != RESIZE_NONE;
    8489}
    8590
  • trunk/Source/WebCore/rendering/RenderIFrame.h

    r140640 r140749  
    5353    virtual const char* renderName() const OVERRIDE { return "RenderPartObject"; } // Lying for now to avoid breaking tests
    5454
     55    virtual bool requiresLayer() const OVERRIDE;
     56
    5557    void layoutSeamlessly();
    5658
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r140702 r140749  
    23272327}
    23282328
     2329bool RenderLayer::canResize() const
     2330{
     2331    if (!renderer())
     2332        return false;
     2333    // We need a special case for <iframe> because they never have
     2334    // hasOverflowClip(). However, they do "implicitly" clip their contents, so
     2335    // we want to allow resizing them also.
     2336    return (renderer()->hasOverflowClip() || renderer()->isRenderIFrame()) && renderer()->style()->resize() != RESIZE_NONE;
     2337}
     2338
    23292339void RenderLayer::resize(const PlatformMouseEvent& evt, const LayoutSize& oldOffset)
    23302340{
    23312341    // FIXME: This should be possible on generated content but is not right now.
    2332     if (!inResizeMode() || !renderer()->hasOverflowClip() || !renderer()->node())
     2342    if (!inResizeMode() || !canResize() || !renderer()->node())
    23332343        return;
    23342344
     
    23362346    Element* element = static_cast<Element*>(renderer()->node());
    23372347    RenderBox* renderer = toRenderBox(element->renderer());
    2338 
    2339     EResize resize = renderer->style()->resize();
    2340     if (resize == RESIZE_NONE)
    2341         return;
    23422348
    23432349    Document* document = element->document();
     
    23672373    bool isBoxSizingBorder = renderer->style()->boxSizing() == BORDER_BOX;
    23682374
     2375    EResize resize = renderer->style()->resize();
    23692376    if (resize != RESIZE_VERTICAL && difference.width()) {
    23702377        if (element->isFormControlElement()) {
     
    28542861void RenderLayer::positionOverflowControls(const IntSize& offsetFromRoot)
    28552862{
    2856     if (!m_hBar && !m_vBar && (!renderer()->hasOverflowClip() || renderer()->style()->resize() == RESIZE_NONE))
     2863    if (!m_hBar && !m_vBar && !canResize())
    28572864        return;
    28582865   
     
    32683275bool RenderLayer::isPointInResizeControl(const IntPoint& absolutePoint) const
    32693276{
    3270     if (!renderer()->hasOverflowClip() || renderer()->style()->resize() == RESIZE_NONE)
     3277    if (!canResize())
    32713278        return false;
    32723279   
     
    32793286    return resizerCornerRect(this, localBounds).contains(localPoint);
    32803287}
    3281    
     3288
    32823289bool RenderLayer::hitTestOverflowControls(HitTestResult& result, const IntPoint& localPoint)
    32833290{
    3284     if (!m_hBar && !m_vBar && (!renderer()->hasOverflowClip() || renderer()->style()->resize() == RESIZE_NONE))
     3291    if (!m_hBar && !m_vBar && !canResize())
    32853292        return false;
    32863293
     
    42444251            return hitLayer;
    42454252        candidateLayer = hitLayer;
     4253    }
     4254
     4255    // Check for the resizer
     4256    if (canResize() && resizerCornerRect(this, pixelSnappedIntRect(layerBounds)).contains(hitTestLocation.roundedPoint())) {
     4257        renderer()->updateHitTestResult(result, hitTestLocation.point());
     4258        return this;
    42464259    }
    42474260
  • trunk/Source/WebCore/rendering/RenderLayer.h

    r140620 r140749  
    376376    void autoscroll(const IntPoint&);
    377377
     378    bool canResize() const;
    378379    void resize(const PlatformMouseEvent&, const LayoutSize&);
    379380    bool inResizeMode() const { return m_inResizeMode; }
  • trunk/Source/WebCore/rendering/RenderWidget.cpp

    r140244 r140749  
    312312        paintInfo.context->fillRect(pixelSnappedIntRect(selectionRect()), selectionBackgroundColor(), style()->colorSpace());
    313313    }
     314
     315    if (style()->resize() != RESIZE_NONE)
     316        layer()->paintResizer(paintInfo.context, roundedIntPoint(adjustedPaintOffset), paintInfo.rect);
    314317}
    315318
Note: See TracChangeset for help on using the changeset viewer.