Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: third_party/WebKit/Source/core/dom/Element.cpp

Issue 1405993008: compositor-worker: plumb element id and mutable properties (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed layout test (and logged bug) Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Peter Kelly (pmk@post.com) 4 * (C) 2001 Peter Kelly (pmk@post.com)
5 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 * (C) 2001 Dirk Mueller (mueller@kde.org)
6 * (C) 2007 David Smith (catfish.man@gmail.com) 6 * (C) 2007 David Smith (catfish.man@gmail.com)
7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
8 * (C) 2007 Eric Seidel (eric@webkit.org) 8 * (C) 2007 Eric Seidel (eric@webkit.org)
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after
966 966
967 double scaledLeft = viewport->scrollPositionDouble().x(); 967 double scaledLeft = viewport->scrollPositionDouble().x();
968 double scaledTop = viewport->scrollPositionDouble().y(); 968 double scaledTop = viewport->scrollPositionDouble().y();
969 if (scrollToOptions.hasLeft()) 969 if (scrollToOptions.hasLeft())
970 scaledLeft = ScrollableArea::normalizeNonFiniteScroll(scrollToOptions.le ft()) * frame->pageZoomFactor(); 970 scaledLeft = ScrollableArea::normalizeNonFiniteScroll(scrollToOptions.le ft()) * frame->pageZoomFactor();
971 if (scrollToOptions.hasTop()) 971 if (scrollToOptions.hasTop())
972 scaledTop = ScrollableArea::normalizeNonFiniteScroll(scrollToOptions.top ()) * frame->pageZoomFactor(); 972 scaledTop = ScrollableArea::normalizeNonFiniteScroll(scrollToOptions.top ()) * frame->pageZoomFactor();
973 viewport->setScrollPosition(DoublePoint(scaledLeft, scaledTop), Programmatic Scroll, scrollBehavior); 973 viewport->setScrollPosition(DoublePoint(scaledLeft, scaledTop), Programmatic Scroll, scrollBehavior);
974 } 974 }
975 975
976 bool Element::hasCompositorProxy()
977 {
978 return hasRareData() && elementRareData()->proxyCount() > 0;
979 }
980
976 void Element::incrementProxyCount() 981 void Element::incrementProxyCount()
977 { 982 {
978 if (ensureElementRareData().incrementProxyCount() == 1) 983 if (ensureElementRareData().incrementProxyCount() == 1)
979 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy)); 984 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy));
980 } 985 }
981 986
982 void Element::decrementProxyCount() 987 void Element::decrementProxyCount()
983 { 988 {
984 if (ensureElementRareData().decrementProxyCount() == 0) 989 if (ensureElementRareData().decrementProxyCount() == 0)
985 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy)); 990 setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::creat e(StyleChangeReason::CompositorProxy));
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 if (ElementAnimations* elementAnimations = this->elementAnimations()) { 1684 if (ElementAnimations* elementAnimations = this->elementAnimations()) {
1680 elementAnimations->cssAnimations().maybeApplyPendingUpdate(this); 1685 elementAnimations->cssAnimations().maybeApplyPendingUpdate(this);
1681 elementAnimations->updateAnimationFlags(*style); 1686 elementAnimations->updateAnimationFlags(*style);
1682 } 1687 }
1683 1688
1684 if (style->hasTransform()) { 1689 if (style->hasTransform()) {
1685 if (const StylePropertySet* inlineStyle = this->inlineStyle()) 1690 if (const StylePropertySet* inlineStyle = this->inlineStyle())
1686 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform)); 1691 style->setHasInlineTransform(inlineStyle->hasProperty(CSSPropertyTra nsform));
1687 } 1692 }
1688 1693
1689 if (hasRareData() && elementRareData()->proxyCount() > 0)
1690 style->setHasCompositorProxy(true);
1691
1692 document().didRecalculateStyleForElement(); 1694 document().didRecalculateStyleForElement();
1693 return style.release(); 1695 return style.release();
1694 } 1696 }
1695 1697
1696 PassRefPtr<ComputedStyle> Element::originalStyleForLayoutObject() 1698 PassRefPtr<ComputedStyle> Element::originalStyleForLayoutObject()
1697 { 1699 {
1698 ASSERT(document().inStyleRecalc()); 1700 ASSERT(document().inStyleRecalc());
1699 return document().ensureStyleResolver().styleForElement(this); 1701 return document().ensureStyleResolver().styleForElement(this);
1700 } 1702 }
1701 1703
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after
3573 { 3575 {
3574 #if ENABLE(OILPAN) 3576 #if ENABLE(OILPAN)
3575 if (hasRareData()) 3577 if (hasRareData())
3576 visitor->trace(elementRareData()); 3578 visitor->trace(elementRareData());
3577 visitor->trace(m_elementData); 3579 visitor->trace(m_elementData);
3578 #endif 3580 #endif
3579 ContainerNode::trace(visitor); 3581 ContainerNode::trace(visitor);
3580 } 3582 }
3581 3583
3582 } // namespace blink 3584 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698