Changeset 182743 in webkit


Ignore:
Timestamp:
Apr 13, 2015 10:55:07 AM (9 years ago)
Author:
Simon Fraser
Message:

Fixed position element is truncated if moved onscreen by a transform
https://bugs.webkit.org/show_bug.cgi?id=143655
Source/WebCore:

rdar://problem/15020044

Reviewed by Darin Adler.

Our "don't do layout if transform changes" code was too aggressive.
If an element changes between having a transform and not having one, we
really need to do a layout since so much else depends on transforms. In
this particular case, we clip position:fixed elements to the viewport if
they are not transformed, and were failing to re-evaluate this when a
transform was added. Doing a layout fixes this.

Test: compositing/geometry/fixed-transformed.html

  • rendering/style/RenderStyle.cpp:

(WebCore::RenderStyle::changeRequiresLayout):

  • rendering/style/StyleTransformData.h:

(WebCore::StyleTransformData::hasTransform):

LayoutTests:

Reviewed by Darin Adler.

Test that moves a position:fixed element on-screen using a transform.

  • compositing/geometry/fixed-transformed.html: Added.
Location:
trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r182741 r182743  
     12015-04-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fixed position element is truncated if moved onscreen by a transform
     4        https://bugs.webkit.org/show_bug.cgi?id=143655
     5
     6        Reviewed by Darin Adler.
     7       
     8        Test that moves a position:fixed element on-screen using a transform.
     9
     10        * compositing/geometry/fixed-transformed.html: Added.
     11
    1122015-04-13  Alexey Proskuryakov  <ap@apple.com>
    213
  • trunk/Source/WebCore/ChangeLog

    r182735 r182743  
     12015-04-13  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Fixed position element is truncated if moved onscreen by a transform
     4        https://bugs.webkit.org/show_bug.cgi?id=143655
     5        rdar://problem/15020044
     6
     7        Reviewed by Darin Adler.
     8       
     9        Our "don't do layout if transform changes" code was too aggressive.
     10        If an element changes between having a transform and not having one, we
     11        really need to do a layout since so much else depends on transforms. In
     12        this particular case, we clip position:fixed elements to the viewport if
     13        they are not transformed, and were failing to re-evaluate this when a
     14        transform was added. Doing a layout fixes this.
     15
     16        Test: compositing/geometry/fixed-transformed.html
     17
     18        * rendering/style/RenderStyle.cpp:
     19        (WebCore::RenderStyle::changeRequiresLayout):
     20        * rendering/style/StyleTransformData.h:
     21        (WebCore::StyleTransformData::hasTransform):
     22
    1232015-04-12  Darin Adler  <darin@apple.com>
    224
  • trunk/Source/WebCore/rendering/style/RenderStyle.cpp

    r182147 r182743  
    483483            return true;
    484484
    485         if (rareNonInheritedData->m_transform.get() != other.rareNonInheritedData->m_transform.get()
    486             && *rareNonInheritedData->m_transform.get() != *other.rareNonInheritedData->m_transform.get()) {
    487             changedContextSensitiveProperties |= ContextSensitivePropertyTransform;
    488             // Don't return; keep looking for another change
     485        if (rareNonInheritedData->m_transform != other.rareNonInheritedData->m_transform) {
     486            if (rareNonInheritedData->m_transform->hasTransform() != other.rareNonInheritedData->m_transform->hasTransform())
     487                return true;
     488            if (*rareNonInheritedData->m_transform != *other.rareNonInheritedData->m_transform) {
     489                changedContextSensitiveProperties |= ContextSensitivePropertyTransform;
     490                // Don't return; keep looking for another change
     491            }
    489492        }
    490493
  • trunk/Source/WebCore/rendering/style/StyleTransformData.h

    r177259 r182743  
    4343        return !(*this == o);
    4444    }
     45   
     46    bool hasTransform() const { return m_operations.size(); }
    4547
    4648    TransformOperations m_operations;
Note: See TracChangeset for help on using the changeset viewer.