| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 735 bool allowVisitedStyle = true; | 735 bool allowVisitedStyle = true; |
| 736 return CSSComputedStyleDeclaration::create(node, allowVisitedStyle); | 736 return CSSComputedStyleDeclaration::create(node, allowVisitedStyle); |
| 737 } | 737 } |
| 738 | 738 |
| 739 ShadowRoot* Internals::createUserAgentShadowRoot(Element* host) { | 739 ShadowRoot* Internals::createUserAgentShadowRoot(Element* host) { |
| 740 ASSERT(host); | 740 ASSERT(host); |
| 741 return &host->ensureUserAgentShadowRoot(); | 741 return &host->ensureUserAgentShadowRoot(); |
| 742 } | 742 } |
| 743 | 743 |
| 744 ShadowRoot* Internals::shadowRoot(Element* host) { | 744 ShadowRoot* Internals::shadowRoot(Element* host) { |
| 745 // FIXME: Internals::shadowRoot() in tests should be converted to youngestShad
owRoot() or oldestShadowRoot(). | 745 // FIXME: Internals::shadowRoot() in tests should be converted to |
| 746 // youngestShadowRoot() or oldestShadowRoot(). |
| 746 // https://bugs.webkit.org/show_bug.cgi?id=78465 | 747 // https://bugs.webkit.org/show_bug.cgi?id=78465 |
| 747 return youngestShadowRoot(host); | 748 return youngestShadowRoot(host); |
| 748 } | 749 } |
| 749 | 750 |
| 750 ShadowRoot* Internals::youngestShadowRoot(Element* host) { | 751 ShadowRoot* Internals::youngestShadowRoot(Element* host) { |
| 751 ASSERT(host); | 752 ASSERT(host); |
| 752 if (ElementShadow* shadow = host->shadow()) | 753 if (ElementShadow* shadow = host->shadow()) |
| 753 return &shadow->youngestShadowRoot(); | 754 return &shadow->youngestShadowRoot(); |
| 754 return 0; | 755 return 0; |
| 755 } | 756 } |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 | 1193 |
| 1193 // TextIterator depends on Layout information, make sure layout it up to date. | 1194 // TextIterator depends on Layout information, make sure layout it up to date. |
| 1194 scope->document().updateStyleAndLayoutIgnorePendingStylesheets(); | 1195 scope->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 1195 | 1196 |
| 1196 return createRange(PlainTextRange(rangeLocation, rangeLocation + rangeLength) | 1197 return createRange(PlainTextRange(rangeLocation, rangeLocation + rangeLength) |
| 1197 .createRange(*scope)); | 1198 .createRange(*scope)); |
| 1198 } | 1199 } |
| 1199 | 1200 |
| 1200 unsigned Internals::locationFromRange(Element* scope, const Range* range) { | 1201 unsigned Internals::locationFromRange(Element* scope, const Range* range) { |
| 1201 ASSERT(scope && range); | 1202 ASSERT(scope && range); |
| 1202 // PlainTextRange depends on Layout information, make sure layout it up to dat
e. | 1203 // PlainTextRange depends on Layout information, make sure layout it up to |
| 1204 // date. |
| 1203 scope->document().updateStyleAndLayoutIgnorePendingStylesheets(); | 1205 scope->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 1204 | 1206 |
| 1205 return PlainTextRange::create(*scope, *range).start(); | 1207 return PlainTextRange::create(*scope, *range).start(); |
| 1206 } | 1208 } |
| 1207 | 1209 |
| 1208 unsigned Internals::lengthFromRange(Element* scope, const Range* range) { | 1210 unsigned Internals::lengthFromRange(Element* scope, const Range* range) { |
| 1209 ASSERT(scope && range); | 1211 ASSERT(scope && range); |
| 1210 // PlainTextRange depends on Layout information, make sure layout it up to dat
e. | 1212 // PlainTextRange depends on Layout information, make sure layout it up to |
| 1213 // date. |
| 1211 scope->document().updateStyleAndLayoutIgnorePendingStylesheets(); | 1214 scope->document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| 1212 | 1215 |
| 1213 return PlainTextRange::create(*scope, *range).length(); | 1216 return PlainTextRange::create(*scope, *range).length(); |
| 1214 } | 1217 } |
| 1215 | 1218 |
| 1216 String Internals::rangeAsText(const Range* range) { | 1219 String Internals::rangeAsText(const Range* range) { |
| 1217 ASSERT(range); | 1220 ASSERT(range); |
| 1218 return range->text(); | 1221 return range->text(); |
| 1219 } | 1222 } |
| 1220 | 1223 |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1566 | 1569 |
| 1567 GraphicsLayer* layerForScrollCorner = | 1570 GraphicsLayer* layerForScrollCorner = |
| 1568 searchRoot->getScrollableArea() | 1571 searchRoot->getScrollableArea() |
| 1569 ? searchRoot->getScrollableArea()->layerForScrollCorner() | 1572 ? searchRoot->getScrollableArea()->layerForScrollCorner() |
| 1570 : 0; | 1573 : 0; |
| 1571 if (graphicsLayer == layerForScrollCorner) { | 1574 if (graphicsLayer == layerForScrollCorner) { |
| 1572 *layerType = "scrollCorner"; | 1575 *layerType = "scrollCorner"; |
| 1573 return searchRoot; | 1576 return searchRoot; |
| 1574 } | 1577 } |
| 1575 | 1578 |
| 1576 // Search right to left to increase the chances that we'll choose the top-most
layers in a | 1579 // Search right to left to increase the chances that we'll choose the top-most |
| 1577 // grouped mapping for squashing. | 1580 // layers in a grouped mapping for squashing. |
| 1578 for (PaintLayer* child = searchRoot->lastChild(); child; | 1581 for (PaintLayer* child = searchRoot->lastChild(); child; |
| 1579 child = child->previousSibling()) { | 1582 child = child->previousSibling()) { |
| 1580 PaintLayer* foundLayer = | 1583 PaintLayer* foundLayer = |
| 1581 findLayerForGraphicsLayer(child, graphicsLayer, layerOffset, layerType); | 1584 findLayerForGraphicsLayer(child, graphicsLayer, layerOffset, layerType); |
| 1582 if (foundLayer) | 1585 if (foundLayer) |
| 1583 return foundLayer; | 1586 return foundLayer; |
| 1584 } | 1587 } |
| 1585 | 1588 |
| 1586 return 0; | 1589 return 0; |
| 1587 } | 1590 } |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1758 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | | 1761 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | |
| 1759 HitTestRequest::Active | | 1762 HitTestRequest::Active | |
| 1760 HitTestRequest::ListBased; | 1763 HitTestRequest::ListBased; |
| 1761 if (ignoreClipping) | 1764 if (ignoreClipping) |
| 1762 hitType |= HitTestRequest::IgnoreClipping; | 1765 hitType |= HitTestRequest::IgnoreClipping; |
| 1763 if (allowChildFrameContent) | 1766 if (allowChildFrameContent) |
| 1764 hitType |= HitTestRequest::AllowChildFrameContent; | 1767 hitType |= HitTestRequest::AllowChildFrameContent; |
| 1765 | 1768 |
| 1766 HitTestRequest request(hitType); | 1769 HitTestRequest request(hitType); |
| 1767 | 1770 |
| 1768 // When ignoreClipping is false, this method returns null for coordinates outs
ide of the viewport. | 1771 // When ignoreClipping is false, this method returns null for coordinates |
| 1772 // outside of the viewport. |
| 1769 if (!request.ignoreClipping() && | 1773 if (!request.ignoreClipping() && |
| 1770 !frameView->visibleContentRect().intersects(HitTestLocation::rectForPoint( | 1774 !frameView->visibleContentRect().intersects(HitTestLocation::rectForPoint( |
| 1771 point, topPadding, rightPadding, bottomPadding, leftPadding))) | 1775 point, topPadding, rightPadding, bottomPadding, leftPadding))) |
| 1772 return nullptr; | 1776 return nullptr; |
| 1773 | 1777 |
| 1774 HeapVector<Member<Node>> matches; | 1778 HeapVector<Member<Node>> matches; |
| 1775 HitTestResult result(request, point, topPadding, rightPadding, bottomPadding, | 1779 HitTestResult result(request, point, topPadding, rightPadding, bottomPadding, |
| 1776 leftPadding); | 1780 leftPadding); |
| 1777 layoutViewItem.hitTest(result); | 1781 layoutViewItem.hitTest(result); |
| 1778 copyToVector(result.listBasedTestResult(), matches); | 1782 copyToVector(result.listBasedTestResult(), matches); |
| (...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3007 return ClientRect::create(); | 3011 return ClientRect::create(); |
| 3008 | 3012 |
| 3009 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); | 3013 return ClientRect::create(FloatRect(node->layoutObject()->visualRect())); |
| 3010 } | 3014 } |
| 3011 | 3015 |
| 3012 void Internals::crash() { | 3016 void Internals::crash() { |
| 3013 CHECK(false) << "Intentional crash"; | 3017 CHECK(false) << "Intentional crash"; |
| 3014 } | 3018 } |
| 3015 | 3019 |
| 3016 } // namespace blink | 3020 } // namespace blink |
| OLD | NEW |