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

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

Issue 2126973004: [Layout API] Use layoutViewItem() in Document (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/api/LayoutBlockItem.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2011, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 9 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 10 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after
1110 1110
1111 String mimeType = suggestedMIMEType(); 1111 String mimeType = suggestedMIMEType();
1112 if (!mimeType.isEmpty()) 1112 if (!mimeType.isEmpty())
1113 return AtomicString(mimeType); 1113 return AtomicString(mimeType);
1114 1114
1115 return AtomicString("application/xml"); 1115 return AtomicString("application/xml");
1116 } 1116 }
1117 1117
1118 Element* Document::elementFromPoint(int x, int y) const 1118 Element* Document::elementFromPoint(int x, int y) const
1119 { 1119 {
1120 if (!layoutView()) 1120 if (layoutViewItem().isNull())
1121 return 0; 1121 return 0;
1122 1122
1123 return TreeScope::elementFromPoint(x, y); 1123 return TreeScope::elementFromPoint(x, y);
1124 } 1124 }
1125 1125
1126 HeapVector<Member<Element>> Document::elementsFromPoint(int x, int y) const 1126 HeapVector<Member<Element>> Document::elementsFromPoint(int x, int y) const
1127 { 1127 {
1128 if (!layoutView()) 1128 if (layoutViewItem().isNull())
1129 return HeapVector<Member<Element>>(); 1129 return HeapVector<Member<Element>>();
1130 return TreeScope::elementsFromPoint(x, y); 1130 return TreeScope::elementsFromPoint(x, y);
1131 } 1131 }
1132 1132
1133 Range* Document::caretRangeFromPoint(int x, int y) 1133 Range* Document::caretRangeFromPoint(int x, int y)
1134 { 1134 {
1135 if (!layoutView()) 1135 if (layoutViewItem().isNull())
1136 return nullptr; 1136 return nullptr;
1137 1137
1138 HitTestResult result = hitTestInDocument(this, x, y); 1138 HitTestResult result = hitTestInDocument(this, x, y);
1139 PositionWithAffinity positionWithAffinity = result.position(); 1139 PositionWithAffinity positionWithAffinity = result.position();
1140 if (positionWithAffinity.position().isNull()) 1140 if (positionWithAffinity.position().isNull())
1141 return nullptr; 1141 return nullptr;
1142 1142
1143 Position rangeCompliantPosition = positionWithAffinity.position().parentAnch oredEquivalent(); 1143 Position rangeCompliantPosition = positionWithAffinity.position().parentAnch oredEquivalent();
1144 return Range::createAdjustedToTreeScope(*this, rangeCompliantPosition); 1144 return Range::createAdjustedToTreeScope(*this, rangeCompliantPosition);
1145 } 1145 }
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1421 bool Document::needsLayoutTreeUpdate() const 1421 bool Document::needsLayoutTreeUpdate() const
1422 { 1422 {
1423 if (!isActive() || !view()) 1423 if (!isActive() || !view())
1424 return false; 1424 return false;
1425 if (needsFullLayoutTreeUpdate()) 1425 if (needsFullLayoutTreeUpdate())
1426 return true; 1426 return true;
1427 if (childNeedsStyleRecalc()) 1427 if (childNeedsStyleRecalc())
1428 return true; 1428 return true;
1429 if (childNeedsStyleInvalidation()) 1429 if (childNeedsStyleInvalidation())
1430 return true; 1430 return true;
1431 if (layoutView()->wasNotifiedOfSubtreeChange()) 1431 if (layoutViewItem().wasNotifiedOfSubtreeChange())
1432 return true; 1432 return true;
1433 return false; 1433 return false;
1434 } 1434 }
1435 1435
1436 bool Document::needsFullLayoutTreeUpdate() const 1436 bool Document::needsFullLayoutTreeUpdate() const
1437 { 1437 {
1438 if (!isActive() || !view()) 1438 if (!isActive() || !view())
1439 return false; 1439 return false;
1440 if (!m_useElementsNeedingUpdate.isEmpty()) 1440 if (!m_useElementsNeedingUpdate.isEmpty())
1441 return true; 1441 return true;
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 if (overflowY == OverflowVisible) 1598 if (overflowY == OverflowVisible)
1599 overflowY = OverflowAuto; 1599 overflowY = OverflowAuto;
1600 // Column-gap is (ab)used by the current paged overflow implementation ( in lack of other 1600 // Column-gap is (ab)used by the current paged overflow implementation ( in lack of other
1601 // ways to specify gaps between pages), so we have to propagate it too. 1601 // ways to specify gaps between pages), so we have to propagate it too.
1602 columnGap = overflowStyle->columnGap(); 1602 columnGap = overflowStyle->columnGap();
1603 } 1603 }
1604 1604
1605 ScrollSnapType snapType = overflowStyle->getScrollSnapType(); 1605 ScrollSnapType snapType = overflowStyle->getScrollSnapType();
1606 const LengthPoint& snapDestination = overflowStyle->scrollSnapDestination(); 1606 const LengthPoint& snapDestination = overflowStyle->scrollSnapDestination();
1607 1607
1608 RefPtr<ComputedStyle> documentStyle = layoutView()->mutableStyle(); 1608 RefPtr<ComputedStyle> documentStyle = layoutViewItem().mutableStyle();
1609 if (documentStyle->getWritingMode() != rootWritingMode 1609 if (documentStyle->getWritingMode() != rootWritingMode
1610 || documentStyle->direction() != rootDirection 1610 || documentStyle->direction() != rootDirection
1611 || documentStyle->visitedDependentColor(CSSPropertyBackgroundColor) != b ackgroundColor 1611 || documentStyle->visitedDependentColor(CSSPropertyBackgroundColor) != b ackgroundColor
1612 || documentStyle->backgroundLayers() != backgroundLayers 1612 || documentStyle->backgroundLayers() != backgroundLayers
1613 || documentStyle->imageRendering() != imageRendering 1613 || documentStyle->imageRendering() != imageRendering
1614 || documentStyle->overflowX() != overflowX 1614 || documentStyle->overflowX() != overflowX
1615 || documentStyle->overflowY() != overflowY 1615 || documentStyle->overflowY() != overflowY
1616 || documentStyle->columnGap() != columnGap 1616 || documentStyle->columnGap() != columnGap
1617 || documentStyle->getScrollSnapType() != snapType 1617 || documentStyle->getScrollSnapType() != snapType
1618 || documentStyle->scrollSnapDestination() != snapDestination) { 1618 || documentStyle->scrollSnapDestination() != snapDestination) {
1619 RefPtr<ComputedStyle> newStyle = ComputedStyle::clone(*documentStyle); 1619 RefPtr<ComputedStyle> newStyle = ComputedStyle::clone(*documentStyle);
1620 newStyle->setWritingMode(rootWritingMode); 1620 newStyle->setWritingMode(rootWritingMode);
1621 newStyle->setDirection(rootDirection); 1621 newStyle->setDirection(rootDirection);
1622 newStyle->setBackgroundColor(backgroundColor); 1622 newStyle->setBackgroundColor(backgroundColor);
1623 newStyle->accessBackgroundLayers() = backgroundLayers; 1623 newStyle->accessBackgroundLayers() = backgroundLayers;
1624 newStyle->setImageRendering(imageRendering); 1624 newStyle->setImageRendering(imageRendering);
1625 newStyle->setOverflowX(overflowX); 1625 newStyle->setOverflowX(overflowX);
1626 newStyle->setOverflowY(overflowY); 1626 newStyle->setOverflowY(overflowY);
1627 newStyle->setColumnGap(columnGap); 1627 newStyle->setColumnGap(columnGap);
1628 newStyle->setScrollSnapType(snapType); 1628 newStyle->setScrollSnapType(snapType);
1629 newStyle->setScrollSnapDestination(snapDestination); 1629 newStyle->setScrollSnapDestination(snapDestination);
1630 layoutView()->setStyle(newStyle); 1630 layoutViewItem().setStyle(newStyle);
1631 setupFontBuilder(*newStyle); 1631 setupFontBuilder(*newStyle);
1632 } 1632 }
1633 1633
1634 if (body) { 1634 if (body) {
1635 if (const ComputedStyle* style = body->computedStyle()) { 1635 if (const ComputedStyle* style = body->computedStyle()) {
1636 if (style->direction() != rootDirection || style->getWritingMode() ! = rootWritingMode) 1636 if (style->direction() != rootDirection || style->getWritingMode() ! = rootWritingMode)
1637 body->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonF orTracing::create(StyleChangeReason::WritingModeChange)); 1637 body->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonF orTracing::create(StyleChangeReason::WritingModeChange));
1638 } 1638 }
1639 } 1639 }
1640 1640
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 notifyLayoutTreeOfSubtreeChanges(); 1728 notifyLayoutTreeOfSubtreeChanges();
1729 1729
1730 // As a result of the style recalculation, the currently hovered element mig ht have been 1730 // As a result of the style recalculation, the currently hovered element mig ht have been
1731 // detached (for example, by setting display:none in the :hover style), sche dule another mouseMove event 1731 // detached (for example, by setting display:none in the :hover style), sche dule another mouseMove event
1732 // to check if any other elements ended up under the mouse pointer due to re -layout. 1732 // to check if any other elements ended up under the mouse pointer due to re -layout.
1733 if (hoverNode() && !hoverNode()->layoutObject() && frame()) 1733 if (hoverNode() && !hoverNode()->layoutObject() && frame())
1734 frame()->eventHandler().dispatchFakeMouseMoveEventSoon(); 1734 frame()->eventHandler().dispatchFakeMouseMoveEventSoon();
1735 1735
1736 if (m_focusedElement && !m_focusedElement->isFocusable()) 1736 if (m_focusedElement && !m_focusedElement->isFocusable())
1737 clearFocusedElementSoon(); 1737 clearFocusedElementSoon();
1738 layoutView()->clearHitTestCache(); 1738 layoutViewItem().clearHitTestCache();
1739 1739
1740 DCHECK(!DocumentAnimations::needsAnimationTimingUpdate(*this)); 1740 DCHECK(!DocumentAnimations::needsAnimationTimingUpdate(*this));
1741 1741
1742 unsigned elementCount = styleEngine().styleForElementCount() - startElementC ount; 1742 unsigned elementCount = styleEngine().styleForElementCount() - startElementC ount;
1743 1743
1744 TRACE_EVENT_END1("blink,devtools.timeline", "UpdateLayoutTree", "elementCoun t", elementCount); 1744 TRACE_EVENT_END1("blink,devtools.timeline", "UpdateLayoutTree", "elementCoun t", elementCount);
1745 1745
1746 #if DCHECK_IS_ON() 1746 #if DCHECK_IS_ON()
1747 assertLayoutTreeUpdated(*this); 1747 assertLayoutTreeUpdated(*this);
1748 #endif 1748 #endif
(...skipping 15 matching lines...) Expand all
1764 NthIndexCache nthIndexCache(*this); 1764 NthIndexCache nthIndexCache(*this);
1765 1765
1766 // FIXME: Cannot access the ensureStyleResolver() before calling styleForDoc ument below because 1766 // FIXME: Cannot access the ensureStyleResolver() before calling styleForDoc ument below because
1767 // apparently the StyleResolver's constructor has side effects. We should fi x it. 1767 // apparently the StyleResolver's constructor has side effects. We should fi x it.
1768 // See printing/setPrinting.html, printing/width-overflow.html though they o nly fail on 1768 // See printing/setPrinting.html, printing/width-overflow.html though they o nly fail on
1769 // mac when accessing the resolver by what appears to be a viewport size dif ference. 1769 // mac when accessing the resolver by what appears to be a viewport size dif ference.
1770 1770
1771 if (change == Force) { 1771 if (change == Force) {
1772 m_hasNodesWithPlaceholderStyle = false; 1772 m_hasNodesWithPlaceholderStyle = false;
1773 RefPtr<ComputedStyle> documentStyle = StyleResolver::styleForDocument(*t his); 1773 RefPtr<ComputedStyle> documentStyle = StyleResolver::styleForDocument(*t his);
1774 StyleRecalcChange localChange = ComputedStyle::stylePropagationDiff(docu mentStyle.get(), layoutView()->style()); 1774 StyleRecalcChange localChange = ComputedStyle::stylePropagationDiff(docu mentStyle.get(), layoutViewItem().style());
1775 if (localChange != NoChange) 1775 if (localChange != NoChange)
1776 layoutView()->setStyle(documentStyle.release()); 1776 layoutViewItem().setStyle(documentStyle.release());
1777 } 1777 }
1778 1778
1779 clearNeedsStyleRecalc(); 1779 clearNeedsStyleRecalc();
1780 1780
1781 StyleResolver& resolver = ensureStyleResolver(); 1781 StyleResolver& resolver = ensureStyleResolver();
1782 1782
1783 bool shouldRecordStats; 1783 bool shouldRecordStats;
1784 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats); 1784 TRACE_EVENT_CATEGORY_GROUP_ENABLED("blink,blink_style", &shouldRecordStats);
1785 styleEngine().setStatsEnabled(shouldRecordStats); 1785 styleEngine().setStatsEnabled(shouldRecordStats);
1786 1786
(...skipping 24 matching lines...) Expand all
1811 "resolverAccessCount", styleEngine().styleForElementCount() - initia lElementCount, 1811 "resolverAccessCount", styleEngine().styleForElementCount() - initia lElementCount,
1812 "counters", styleEngine().stats()->toTracedValue()); 1812 "counters", styleEngine().stats()->toTracedValue());
1813 } else { 1813 } else {
1814 TRACE_EVENT_END1("blink,blink_style", "Document::updateStyle", 1814 TRACE_EVENT_END1("blink,blink_style", "Document::updateStyle",
1815 "resolverAccessCount", styleEngine().styleForElementCount() - initia lElementCount); 1815 "resolverAccessCount", styleEngine().styleForElementCount() - initia lElementCount);
1816 } 1816 }
1817 } 1817 }
1818 1818
1819 void Document::notifyLayoutTreeOfSubtreeChanges() 1819 void Document::notifyLayoutTreeOfSubtreeChanges()
1820 { 1820 {
1821 if (!layoutView()->wasNotifiedOfSubtreeChange()) 1821 if (!layoutViewItem().wasNotifiedOfSubtreeChange())
1822 return; 1822 return;
1823 1823
1824 m_lifecycle.advanceTo(DocumentLifecycle::InLayoutSubtreeChange); 1824 m_lifecycle.advanceTo(DocumentLifecycle::InLayoutSubtreeChange);
1825 1825
1826 layoutView()->handleSubtreeModifications(); 1826 layoutViewItem().handleSubtreeModifications();
1827 DCHECK(!layoutView()->wasNotifiedOfSubtreeChange()); 1827 DCHECK(!layoutViewItem().wasNotifiedOfSubtreeChange());
1828 1828
1829 m_lifecycle.advanceTo(DocumentLifecycle::LayoutSubtreeChangeClean); 1829 m_lifecycle.advanceTo(DocumentLifecycle::LayoutSubtreeChangeClean);
1830 } 1830 }
1831 1831
1832 bool Document::needsLayoutTreeUpdateForNode(const Node& node) const 1832 bool Document::needsLayoutTreeUpdateForNode(const Node& node) const
1833 { 1833 {
1834 if (!node.canParticipateInFlatTree()) 1834 if (!node.canParticipateInFlatTree())
1835 return false; 1835 return false;
1836 if (!needsLayoutTreeUpdate()) 1836 if (!needsLayoutTreeUpdate())
1837 return false; 1837 return false;
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after
2634 return; 2634 return;
2635 } 2635 }
2636 2636
2637 // We used to force a synchronous display and flush here. This really isn't 2637 // We used to force a synchronous display and flush here. This really isn't
2638 // necessary and can in fact be actively harmful if pages are loading at a r ate of > 60fps 2638 // necessary and can in fact be actively harmful if pages are loading at a r ate of > 60fps
2639 // (if your platform is syncing flushes and limiting them to 60fps). 2639 // (if your platform is syncing flushes and limiting them to 60fps).
2640 if (!localOwner() || (localOwner()->layoutObject() && !localOwner()->layoutO bject()->needsLayout())) { 2640 if (!localOwner() || (localOwner()->layoutObject() && !localOwner()->layoutO bject()->needsLayout())) {
2641 updateStyleAndLayoutTree(); 2641 updateStyleAndLayoutTree();
2642 2642
2643 // Always do a layout after loading if needed. 2643 // Always do a layout after loading if needed.
2644 if (view() && layoutView() && (!layoutView()->firstChild() || layoutView ()->needsLayout())) 2644 if (view() && !layoutViewItem().isNull() && (!layoutViewItem().firstChil d() || layoutViewItem().needsLayout()))
2645 view()->layout(); 2645 view()->layout();
2646 } 2646 }
2647 2647
2648 m_loadEventProgress = LoadEventCompleted; 2648 m_loadEventProgress = LoadEventCompleted;
2649 2649
2650 if (frame() && layoutView() && settings()->accessibilityEnabled()) { 2650 if (frame() && !layoutViewItem().isNull() && settings()->accessibilityEnable d()) {
2651 if (AXObjectCache* cache = axObjectCache()) { 2651 if (AXObjectCache* cache = axObjectCache()) {
2652 if (this == &axObjectCacheOwner()) 2652 if (this == &axObjectCacheOwner())
2653 cache->handleLoadComplete(this); 2653 cache->handleLoadComplete(this);
2654 else 2654 else
2655 cache->handleLayoutComplete(this); 2655 cache->handleLayoutComplete(this);
2656 } 2656 }
2657 } 2657 }
2658 2658
2659 if (svgExtensions()) 2659 if (svgExtensions())
2660 accessSVGExtensions().startAnimations(); 2660 accessSVGExtensions().startAnimations();
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
3150 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& r equest, const LayoutPoint& documentPoint, const PlatformMouseEvent& event) 3150 MouseEventWithHitTestResults Document::prepareMouseEvent(const HitTestRequest& r equest, const LayoutPoint& documentPoint, const PlatformMouseEvent& event)
3151 { 3151 {
3152 DCHECK(!layoutView() || layoutView()->isLayoutView()); 3152 DCHECK(!layoutView() || layoutView()->isLayoutView());
3153 3153
3154 // LayoutView::hitTest causes a layout, and we don't want to hit that until the first 3154 // LayoutView::hitTest causes a layout, and we don't want to hit that until the first
3155 // layout because until then, there is nothing shown on the screen - the use r can't 3155 // layout because until then, there is nothing shown on the screen - the use r can't
3156 // have intentionally clicked on something belonging to this page. Furthermo re, 3156 // have intentionally clicked on something belonging to this page. Furthermo re,
3157 // mousemove events before the first layout should not lead to a premature l ayout() 3157 // mousemove events before the first layout should not lead to a premature l ayout()
3158 // happening, which could show a flash of white. 3158 // happening, which could show a flash of white.
3159 // See also the similar code in EventHandler::hitTestResultAtPoint. 3159 // See also the similar code in EventHandler::hitTestResultAtPoint.
3160 if (!layoutView() || !view() || !view()->didFirstLayout()) 3160 if (layoutViewItem().isNull() || !view() || !view()->didFirstLayout())
3161 return MouseEventWithHitTestResults(event, HitTestResult(request, Layout Point())); 3161 return MouseEventWithHitTestResults(event, HitTestResult(request, Layout Point()));
3162 3162
3163 HitTestResult result(request, documentPoint); 3163 HitTestResult result(request, documentPoint);
3164 layoutView()->hitTest(result); 3164 layoutViewItem().hitTest(result);
3165 3165
3166 if (!request.readOnly()) 3166 if (!request.readOnly())
3167 updateHoverActiveState(request, result.innerElement()); 3167 updateHoverActiveState(request, result.innerElement());
3168 3168
3169 if (isHTMLCanvasElement(result.innerNode())) { 3169 if (isHTMLCanvasElement(result.innerNode())) {
3170 PlatformMouseEvent eventWithRegion = event; 3170 PlatformMouseEvent eventWithRegion = event;
3171 std::pair<Element*, String> regionInfo = toHTMLCanvasElement(result.inne rNode())->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame()); 3171 std::pair<Element*, String> regionInfo = toHTMLCanvasElement(result.inne rNode())->getControlAndIdIfHitRegionExists(result.pointInInnerNodeFrame());
3172 if (regionInfo.first) 3172 if (regionInfo.first)
3173 result.setInnerNode(regionInfo.first); 3173 result.setInnerNode(regionInfo.first);
3174 eventWithRegion.setRegion(regionInfo.second); 3174 eventWithRegion.setRegion(regionInfo.second);
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
3411 3411
3412 void Document::styleResolverMayHaveChanged() 3412 void Document::styleResolverMayHaveChanged()
3413 { 3413 {
3414 styleEngine().resolverChanged(hasNodesWithPlaceholderStyle() ? FullStyleUpda te : AnalyzedStyleUpdate); 3414 styleEngine().resolverChanged(hasNodesWithPlaceholderStyle() ? FullStyleUpda te : AnalyzedStyleUpdate);
3415 3415
3416 if (didLayoutWithPendingStylesheets() && !styleEngine().hasPendingScriptBloc kingSheets()) { 3416 if (didLayoutWithPendingStylesheets() && !styleEngine().hasPendingScriptBloc kingSheets()) {
3417 // We need to manually repaint because we avoid doing all repaints in la yout or style 3417 // We need to manually repaint because we avoid doing all repaints in la yout or style
3418 // recalc while sheets are still loading to avoid FOUC. 3418 // recalc while sheets are still loading to avoid FOUC.
3419 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; 3419 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
3420 3420
3421 DCHECK(layoutView() || importsController()); 3421 DCHECK(!layoutViewItem().isNull() || importsController());
3422 if (layoutView()) 3422 if (!layoutViewItem().isNull())
3423 layoutView()->invalidatePaintForViewAndCompositedLayers(); 3423 layoutViewItem().invalidatePaintForViewAndCompositedLayers();
3424 } 3424 }
3425 } 3425 }
3426 3426
3427 void Document::setHoverNode(Node* newHoverNode) 3427 void Document::setHoverNode(Node* newHoverNode)
3428 { 3428 {
3429 m_hoverNode = newHoverNode; 3429 m_hoverNode = newHoverNode;
3430 } 3430 }
3431 3431
3432 void Document::setActiveHoverElement(Element* newActiveElement) 3432 void Document::setActiveHoverElement(Element* newActiveElement)
3433 { 3433 {
(...skipping 962 matching lines...) Expand 10 before | Expand all | Expand 10 after
4396 } 4396 }
4397 4397
4398 DCHECK(newData.encoding().isValid()); 4398 DCHECK(newData.encoding().isValid());
4399 m_encodingData = newData; 4399 m_encodingData = newData;
4400 4400
4401 // FIXME: Should be removed as part of https://code.google.com/p/chromium/is sues/detail?id=319643 4401 // FIXME: Should be removed as part of https://code.google.com/p/chromium/is sues/detail?id=319643
4402 bool shouldUseVisualOrdering = m_encodingData.encoding().usesVisualOrdering( ); 4402 bool shouldUseVisualOrdering = m_encodingData.encoding().usesVisualOrdering( );
4403 if (shouldUseVisualOrdering != m_visuallyOrdered) { 4403 if (shouldUseVisualOrdering != m_visuallyOrdered) {
4404 m_visuallyOrdered = shouldUseVisualOrdering; 4404 m_visuallyOrdered = shouldUseVisualOrdering;
4405 // FIXME: How is possible to not have a layoutObject here? 4405 // FIXME: How is possible to not have a layoutObject here?
4406 if (layoutView()) 4406 if (!layoutViewItem().isNull())
4407 layoutView()->mutableStyleRef().setRTLOrdering(m_visuallyOrdered ? V isualOrder : LogicalOrder); 4407 layoutViewItem().mutableStyleRef().setRTLOrdering(m_visuallyOrdered ? VisualOrder : LogicalOrder);
4408 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre ate(StyleChangeReason::VisuallyOrdered)); 4408 setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::cre ate(StyleChangeReason::VisuallyOrdered));
4409 } 4409 }
4410 } 4410 }
4411 4411
4412 KURL Document::completeURL(const String& url) const 4412 KURL Document::completeURL(const String& url) const
4413 { 4413 {
4414 return completeURLWithOverride(url, m_baseURL); 4414 return completeURLWithOverride(url, m_baseURL);
4415 } 4415 }
4416 4416
4417 KURL Document::completeURLWithOverride(const String& url, const KURL& baseURLOve rride) const 4417 KURL Document::completeURLWithOverride(const String& url, const KURL& baseURLOve rride) const
(...skipping 1617 matching lines...) Expand 10 before | Expand all | Expand 10 after
6035 } 6035 }
6036 6036
6037 void showLiveDocumentInstances() 6037 void showLiveDocumentInstances()
6038 { 6038 {
6039 WeakDocumentSet& set = liveDocumentSet(); 6039 WeakDocumentSet& set = liveDocumentSet();
6040 fprintf(stderr, "There are %u documents currently alive:\n", set.size()); 6040 fprintf(stderr, "There are %u documents currently alive:\n", set.size());
6041 for (Document* document : set) 6041 for (Document* document : set)
6042 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data()); 6042 fprintf(stderr, "- Document %p URL: %s\n", document, document->url().get String().utf8().data());
6043 } 6043 }
6044 #endif 6044 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/api/LayoutBlockItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698