Changeset 63633 in webkit


Ignore:
Timestamp:
Jul 18, 2010 2:55:49 PM (14 years ago)
Author:
dino@apple.com
Message:

2010-07-18 Dean Jackson <dino@apple.com>

Reviewed by Simon Fraser.

https://bugs.webkit.org/show_bug.cgi?id=41259
Interacting with a <select> element within a transformed and clipped
container scrolls the container

The Node::getRect and ContainerNode::getRect functions were not
transform-aware. This fixes both, and has a test to make sure
we're not breaking any existing scrollToView code. This means
that a <select> popup will appear in the correct place if it
is within a transformed and scrolled container.

The test makes sure that existing scrollToView
code doesn't break, but also checks that a <select> popup will appear
in the correct place.

Test: fast/transforms/scrollIntoView-transformed.html

  • dom/ContainerNode.cpp: (WebCore::ContainerNode::getUpperLeftCorner): (WebCore::ContainerNode::getLowerRightCorner):
  • make sure we call localToAbsolute in the right order (after we've done a local move) and pass in the flags to indicate it should look for transforms.
  • dom/Node.cpp: (WebCore::Node::getRect):
  • make sure localToAbsolute gets told to look for transforms.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r63625 r63633  
     12010-07-18  Dean Jackson  <dino@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41259
     6        Interacting with a <select> element within a transformed and clipped
     7        container scrolls the container
     8
     9        The Node::getRect and ContainerNode::getRect methods were not
     10        transform-aware. This test makes sure that existing scrollToView
     11        code doesn't break, but also checks that a <select> popup will appear
     12        in the correct place when inside a transformed, scrolled container.
     13
     14        * fast/transforms/scrollIntoView-transformed.html: Added.
     15        * fast/transforms/scrollIntoView-transformed-expected.txt: Added.
     16
    1172010-07-18  Pavel Feldman  <pfeldman@chromium.org>
    218
  • trunk/WebCore/ChangeLog

    r63631 r63633  
     12010-07-18  Dean Jackson  <dino@apple.com>
     2
     3        Reviewed by Simon Fraser.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=41259
     6        Interacting with a <select> element within a transformed and clipped
     7        container scrolls the container
     8
     9        The Node::getRect and ContainerNode::getRect functions were not
     10        transform-aware. This fixes both, and has a test to make sure
     11        we're not breaking any existing scrollToView code. This means
     12        that a <select> popup will appear in the correct place if it
     13        is within a transformed and scrolled container.
     14
     15        Test: fast/transforms/scrollIntoView-transformed.html
     16
     17        * dom/ContainerNode.cpp:
     18        (WebCore::ContainerNode::getUpperLeftCorner):
     19        (WebCore::ContainerNode::getLowerRightCorner):
     20        - make sure we call localToAbsolute in the right order
     21        (after we've done a local move) and pass in the flags to
     22        indicate it should look for transforms.
     23        * dom/Node.cpp:
     24        (WebCore::Node::getRect):
     25        - make sure localToAbsolute gets told to look for transforms.
     26
    1272010-07-18  Anders Carlsson  <andersca@apple.com>
    228
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r63417 r63633  
    1987119871                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
    1987219872                        compatibilityVersion = "Xcode 2.4";
     19873                        developmentRegion = English;
    1987319874                        hasScannedForEncodings = 1;
    1987419875                        knownRegions = (
  • trunk/WebCore/dom/ContainerNode.cpp

    r63190 r63633  
    704704}
    705705
    706 // FIXME: This doesn't work correctly with transforms.
    707706bool ContainerNode::getUpperLeftCorner(FloatPoint& point) const
    708707{
     
    714713
    715714    if (!o->isInline() || o->isReplaced()) {
    716         point = o->localToAbsolute();
     715        point = o->localToAbsolute(FloatPoint(), false, true);
    717716        return true;
    718717    }
     
    739738
    740739        if (!o->isInline() || o->isReplaced()) {
    741             point = o->localToAbsolute();
     740            point = o->localToAbsolute(FloatPoint(), false, true);
    742741            return true;
    743742        }
     
    746745                // do nothing - skip unrendered whitespace that is a child or next sibling of the anchor
    747746        } else if ((o->isText() && !o->isBR()) || o->isReplaced()) {
    748             point = o->container()->localToAbsolute();
     747            point = FloatPoint();
    749748            if (o->isText() && toRenderText(o)->firstTextBox()) {
    750749                point.move(toRenderText(o)->linesBoundingBox().x(),
     
    754753                point.move(box->x(), box->y());
    755754            }
     755            point = o->container()->localToAbsolute(point, false, true);
    756756            return true;
    757757        }
     
    776776    if (!o->isInline() || o->isReplaced()) {
    777777        RenderBox* box = toRenderBox(o);
    778         point = o->localToAbsolute();
     778        point = o->localToAbsolute(FloatPoint(), false, true);
    779779        point.move(box->width(), box->height());
    780780        return true;
     
    799799        ASSERT(o);
    800800        if (o->isText() || o->isReplaced()) {
    801             point = o->container()->localToAbsolute();
     801            point = FloatPoint();
    802802            if (o->isText()) {
    803803                RenderText* text = toRenderText(o);
     
    808808                point.move(box->x() + box->width(), box->y() + box->height());
    809809            }
     810            point = o->container()->localToAbsolute(point, false, true);
    810811            return true;
    811812        }
  • trunk/WebCore/dom/Node.cpp

    r63051 r63633  
    679679IntRect Node::getRect() const
    680680{
    681     // FIXME: broken with transforms
    682681    if (renderer())
    683         return renderer()->absoluteBoundingBoxRect();
     682        return renderer()->absoluteBoundingBoxRect(true);
    684683    return IntRect();
    685684}
Note: See TracChangeset for help on using the changeset viewer.