| OLD | NEW |
| 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 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 if (!renderer()) | 474 if (!renderer()) |
| 475 return; | 475 return; |
| 476 | 476 |
| 477 LayoutRect bounds = boundingBox(); | 477 LayoutRect bounds = boundingBox(); |
| 478 if (centerIfNeeded) | 478 if (centerIfNeeded) |
| 479 renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignCenterIfNe
eded, ScrollAlignment::alignCenterIfNeeded); | 479 renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignCenterIfNe
eded, ScrollAlignment::alignCenterIfNeeded); |
| 480 else | 480 else |
| 481 renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignToEdgeIfNe
eded, ScrollAlignment::alignToEdgeIfNeeded); | 481 renderer()->scrollRectToVisible(bounds, ScrollAlignment::alignToEdgeIfNe
eded, ScrollAlignment::alignToEdgeIfNeeded); |
| 482 } | 482 } |
| 483 | 483 |
| 484 static float localZoomForRenderer(RenderObject& renderer) | 484 static float localZoomForRenderer(LayoutObject& renderer) |
| 485 { | 485 { |
| 486 // FIXME: This does the wrong thing if two opposing zooms are in effect and
canceled each | 486 // FIXME: This does the wrong thing if two opposing zooms are in effect and
canceled each |
| 487 // other out, but the alternative is that we'd have to crawl up the whole re
nder tree every | 487 // other out, but the alternative is that we'd have to crawl up the whole re
nder tree every |
| 488 // time (or store an additional bit in the RenderStyle to indicate that a zo
om was specified). | 488 // time (or store an additional bit in the RenderStyle to indicate that a zo
om was specified). |
| 489 float zoomFactor = 1; | 489 float zoomFactor = 1; |
| 490 if (renderer.style()->effectiveZoom() != 1) { | 490 if (renderer.style()->effectiveZoom() != 1) { |
| 491 // Need to find the nearest enclosing RenderObject that set up | 491 // Need to find the nearest enclosing LayoutObject that set up |
| 492 // a differing zoom, and then we divide our result by it to eliminate th
e zoom. | 492 // a differing zoom, and then we divide our result by it to eliminate th
e zoom. |
| 493 RenderObject* prev = &renderer; | 493 LayoutObject* prev = &renderer; |
| 494 for (RenderObject* curr = prev->parent(); curr; curr = curr->parent()) { | 494 for (LayoutObject* curr = prev->parent(); curr; curr = curr->parent()) { |
| 495 if (curr->style()->effectiveZoom() != prev->style()->effectiveZoom()
) { | 495 if (curr->style()->effectiveZoom() != prev->style()->effectiveZoom()
) { |
| 496 zoomFactor = prev->style()->zoom(); | 496 zoomFactor = prev->style()->zoom(); |
| 497 break; | 497 break; |
| 498 } | 498 } |
| 499 prev = curr; | 499 prev = curr; |
| 500 } | 500 } |
| 501 if (prev->isRenderView()) | 501 if (prev->isRenderView()) |
| 502 zoomFactor = prev->style()->zoom(); | 502 zoomFactor = prev->style()->zoom(); |
| 503 } | 503 } |
| 504 return zoomFactor; | 504 return zoomFactor; |
| 505 } | 505 } |
| 506 | 506 |
| 507 static double adjustForLocalZoom(LayoutUnit value, RenderObject& renderer) | 507 static double adjustForLocalZoom(LayoutUnit value, LayoutObject& renderer) |
| 508 { | 508 { |
| 509 float zoomFactor = localZoomForRenderer(renderer); | 509 float zoomFactor = localZoomForRenderer(renderer); |
| 510 if (zoomFactor == 1) | 510 if (zoomFactor == 1) |
| 511 return value.toDouble(); | 511 return value.toDouble(); |
| 512 return value.toDouble() / zoomFactor; | 512 return value.toDouble() / zoomFactor; |
| 513 } | 513 } |
| 514 | 514 |
| 515 int Element::offsetLeft() | 515 int Element::offsetLeft() |
| 516 { | 516 { |
| 517 document().updateLayoutIgnorePendingStylesheets(); | 517 document().updateLayoutIgnorePendingStylesheets(); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 548 { | 548 { |
| 549 Element* element = offsetParent(); | 549 Element* element = offsetParent(); |
| 550 if (!element || !element->isInShadowTree()) | 550 if (!element || !element->isInShadowTree()) |
| 551 return element; | 551 return element; |
| 552 return element->containingShadowRoot()->shouldExposeToBindings() ? element :
nullptr; | 552 return element->containingShadowRoot()->shouldExposeToBindings() ? element :
nullptr; |
| 553 } | 553 } |
| 554 | 554 |
| 555 Element* Element::offsetParent() | 555 Element* Element::offsetParent() |
| 556 { | 556 { |
| 557 document().updateLayoutIgnorePendingStylesheets(); | 557 document().updateLayoutIgnorePendingStylesheets(); |
| 558 if (RenderObject* renderer = this->renderer()) | 558 if (LayoutObject* renderer = this->renderer()) |
| 559 return renderer->offsetParent(); | 559 return renderer->offsetParent(); |
| 560 return nullptr; | 560 return nullptr; |
| 561 } | 561 } |
| 562 | 562 |
| 563 int Element::clientLeft() | 563 int Element::clientLeft() |
| 564 { | 564 { |
| 565 document().updateLayoutIgnorePendingStylesheets(); | 565 document().updateLayoutIgnorePendingStylesheets(); |
| 566 | 566 |
| 567 if (RenderBox* renderer = renderBox()) | 567 if (RenderBox* renderer = renderBox()) |
| 568 return adjustLayoutUnitForAbsoluteZoom(roundToInt(renderer->clientLeft()
), *renderer); | 568 return adjustLayoutUnitForAbsoluteZoom(roundToInt(renderer->clientLeft()
), *renderer); |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 895 PinchViewport& pinchViewport = document().page()->frameHost().pinchViewport(
); | 895 PinchViewport& pinchViewport = document().page()->frameHost().pinchViewport(
); |
| 896 result = enclosingIntRect(pinchViewport.mainViewToViewportCSSPixels(result))
; | 896 result = enclosingIntRect(pinchViewport.mainViewToViewportCSSPixels(result))
; |
| 897 | 897 |
| 898 return result; | 898 return result; |
| 899 } | 899 } |
| 900 | 900 |
| 901 PassRefPtrWillBeRawPtr<ClientRectList> Element::getClientRects() | 901 PassRefPtrWillBeRawPtr<ClientRectList> Element::getClientRects() |
| 902 { | 902 { |
| 903 document().updateLayoutIgnorePendingStylesheets(); | 903 document().updateLayoutIgnorePendingStylesheets(); |
| 904 | 904 |
| 905 RenderObject* elementRenderer = renderer(); | 905 LayoutObject* elementRenderer = renderer(); |
| 906 if (!elementRenderer || (!elementRenderer->isBoxModelObject() && !elementRen
derer->isBR())) | 906 if (!elementRenderer || (!elementRenderer->isBoxModelObject() && !elementRen
derer->isBR())) |
| 907 return ClientRectList::create(); | 907 return ClientRectList::create(); |
| 908 | 908 |
| 909 // FIXME: Handle SVG elements. | 909 // FIXME: Handle SVG elements. |
| 910 // FIXME: Handle table/inline-table with a caption. | 910 // FIXME: Handle table/inline-table with a caption. |
| 911 | 911 |
| 912 Vector<FloatQuad> quads; | 912 Vector<FloatQuad> quads; |
| 913 elementRenderer->absoluteQuads(quads); | 913 elementRenderer->absoluteQuads(quads); |
| 914 document().adjustFloatQuadsForScrollAndAbsoluteZoom(quads, *elementRenderer)
; | 914 document().adjustFloatQuadsForScrollAndAbsoluteZoom(quads, *elementRenderer)
; |
| 915 return ClientRectList::create(quads); | 915 return ClientRectList::create(quads); |
| 916 } | 916 } |
| 917 | 917 |
| 918 PassRefPtrWillBeRawPtr<ClientRect> Element::getBoundingClientRect() | 918 PassRefPtrWillBeRawPtr<ClientRect> Element::getBoundingClientRect() |
| 919 { | 919 { |
| 920 document().updateLayoutIgnorePendingStylesheets(); | 920 document().updateLayoutIgnorePendingStylesheets(); |
| 921 | 921 |
| 922 Vector<FloatQuad> quads; | 922 Vector<FloatQuad> quads; |
| 923 RenderObject* elementRenderer = renderer(); | 923 LayoutObject* elementRenderer = renderer(); |
| 924 if (elementRenderer) { | 924 if (elementRenderer) { |
| 925 if (isSVGElement() && !elementRenderer->isSVGRoot()) { | 925 if (isSVGElement() && !elementRenderer->isSVGRoot()) { |
| 926 // Get the bounding rectangle from the SVG model. | 926 // Get the bounding rectangle from the SVG model. |
| 927 SVGElement* svgElement = toSVGElement(this); | 927 SVGElement* svgElement = toSVGElement(this); |
| 928 FloatRect localRect; | 928 FloatRect localRect; |
| 929 if (svgElement->getBoundingBox(localRect)) | 929 if (svgElement->getBoundingBox(localRect)) |
| 930 quads.append(elementRenderer->localToAbsoluteQuad(localRect)); | 930 quads.append(elementRenderer->localToAbsoluteQuad(localRect)); |
| 931 } else if (elementRenderer->isBoxModelObject() || elementRenderer->isBR(
)) { | 931 } else if (elementRenderer->isBoxModelObject() || elementRenderer->isBR(
)) { |
| 932 elementRenderer->absoluteQuads(quads); | 932 elementRenderer->absoluteQuads(quads); |
| 933 } | 933 } |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1315 const AtomicString Element::imageSourceURL() const | 1315 const AtomicString Element::imageSourceURL() const |
| 1316 { | 1316 { |
| 1317 return getAttribute(srcAttr); | 1317 return getAttribute(srcAttr); |
| 1318 } | 1318 } |
| 1319 | 1319 |
| 1320 bool Element::rendererIsNeeded(const RenderStyle& style) | 1320 bool Element::rendererIsNeeded(const RenderStyle& style) |
| 1321 { | 1321 { |
| 1322 return style.display() != NONE; | 1322 return style.display() != NONE; |
| 1323 } | 1323 } |
| 1324 | 1324 |
| 1325 RenderObject* Element::createRenderer(RenderStyle* style) | 1325 LayoutObject* Element::createRenderer(RenderStyle* style) |
| 1326 { | 1326 { |
| 1327 return RenderObject::createObject(this, style); | 1327 return LayoutObject::createObject(this, style); |
| 1328 } | 1328 } |
| 1329 | 1329 |
| 1330 Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertio
nPoint) | 1330 Node::InsertionNotificationRequest Element::insertedInto(ContainerNode* insertio
nPoint) |
| 1331 { | 1331 { |
| 1332 // need to do superclass processing first so inDocument() is true | 1332 // need to do superclass processing first so inDocument() is true |
| 1333 // by the time we reach updateId | 1333 // by the time we reach updateId |
| 1334 ContainerNode::insertedInto(insertionPoint); | 1334 ContainerNode::insertedInto(insertionPoint); |
| 1335 | 1335 |
| 1336 if (containsFullScreenElement() && parentElement() && !parentElement()->cont
ainsFullScreenElement()) | 1336 if (containsFullScreenElement() && parentElement() && !parentElement()->cont
ainsFullScreenElement()) |
| 1337 setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true); | 1337 setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 newPseudoStyle = renderer()->getUncachedPseudoStyle(PseudoStyleReque
st(pseudoId), newStyle, newStyle); | 1516 newPseudoStyle = renderer()->getUncachedPseudoStyle(PseudoStyleReque
st(pseudoId), newStyle, newStyle); |
| 1517 if (!newPseudoStyle) | 1517 if (!newPseudoStyle) |
| 1518 return true; | 1518 return true; |
| 1519 if (*newPseudoStyle != *pseudoStyleCache->at(i)) { | 1519 if (*newPseudoStyle != *pseudoStyleCache->at(i)) { |
| 1520 if (pseudoId < FIRST_INTERNAL_PSEUDOID) | 1520 if (pseudoId < FIRST_INTERNAL_PSEUDOID) |
| 1521 newStyle->setHasPseudoStyle(pseudoId); | 1521 newStyle->setHasPseudoStyle(pseudoId); |
| 1522 newStyle->addCachedPseudoStyle(newPseudoStyle); | 1522 newStyle->addCachedPseudoStyle(newPseudoStyle); |
| 1523 if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED) { | 1523 if (pseudoId == FIRST_LINE || pseudoId == FIRST_LINE_INHERITED) { |
| 1524 // FIXME: We should do an actual diff to determine whether a rep
aint vs. layout | 1524 // FIXME: We should do an actual diff to determine whether a rep
aint vs. layout |
| 1525 // is needed, but for now just assume a layout will be required.
The diff code | 1525 // is needed, but for now just assume a layout will be required.
The diff code |
| 1526 // in RenderObject::setStyle would need to be factored out so th
at it could be reused. | 1526 // in LayoutObject::setStyle would need to be factored out so th
at it could be reused. |
| 1527 renderer()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalid
ation(); | 1527 renderer()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalid
ation(); |
| 1528 } | 1528 } |
| 1529 return true; | 1529 return true; |
| 1530 } | 1530 } |
| 1531 } | 1531 } |
| 1532 return false; | 1532 return false; |
| 1533 } | 1533 } |
| 1534 | 1534 |
| 1535 PassRefPtr<RenderStyle> Element::styleForRenderer() | 1535 PassRefPtr<RenderStyle> Element::styleForRenderer() |
| 1536 { | 1536 { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 if (rendererWillChange || renderer()) | 1648 if (rendererWillChange || renderer()) |
| 1649 return Reattach; | 1649 return Reattach; |
| 1650 return ReattachNoRenderer; | 1650 return ReattachNoRenderer; |
| 1651 } | 1651 } |
| 1652 | 1652 |
| 1653 ASSERT(oldStyle); | 1653 ASSERT(oldStyle); |
| 1654 | 1654 |
| 1655 if (localChange != NoChange) | 1655 if (localChange != NoChange) |
| 1656 updateCallbackSelectors(oldStyle.get(), newStyle.get()); | 1656 updateCallbackSelectors(oldStyle.get(), newStyle.get()); |
| 1657 | 1657 |
| 1658 if (RenderObject* renderer = this->renderer()) { | 1658 if (LayoutObject* renderer = this->renderer()) { |
| 1659 if (localChange != NoChange || pseudoStyleCacheIsInvalid(oldStyle.get(),
newStyle.get()) || svgFilterNeedsLayerUpdate()) { | 1659 if (localChange != NoChange || pseudoStyleCacheIsInvalid(oldStyle.get(),
newStyle.get()) || svgFilterNeedsLayerUpdate()) { |
| 1660 renderer->setStyle(newStyle.get()); | 1660 renderer->setStyle(newStyle.get()); |
| 1661 } else { | 1661 } else { |
| 1662 // Although no change occurred, we use the new style so that the cou
sin style sharing code won't get | 1662 // Although no change occurred, we use the new style so that the cou
sin style sharing code won't get |
| 1663 // fooled into believing this style is the same. | 1663 // fooled into believing this style is the same. |
| 1664 // FIXME: We may be able to remove this hack, see discussion in | 1664 // FIXME: We may be able to remove this hack, see discussion in |
| 1665 // https://codereview.chromium.org/30453002/ | 1665 // https://codereview.chromium.org/30453002/ |
| 1666 renderer->setStyleInternal(newStyle.get()); | 1666 renderer->setStyleInternal(newStyle.get()); |
| 1667 } | 1667 } |
| 1668 } | 1668 } |
| (...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2607 if (element->needsStyleRecalc()) | 2607 if (element->needsStyleRecalc()) |
| 2608 renderer()->style()->removeCachedPseudoStyle(pseudoId); | 2608 renderer()->style()->removeCachedPseudoStyle(pseudoId); |
| 2609 | 2609 |
| 2610 // PseudoElement styles hang off their parent element's style so if we n
eeded | 2610 // PseudoElement styles hang off their parent element's style so if we n
eeded |
| 2611 // a style recalc we should Force one on the pseudo. | 2611 // a style recalc we should Force one on the pseudo. |
| 2612 // FIXME: We should figure out the right text sibling to pass. | 2612 // FIXME: We should figure out the right text sibling to pass. |
| 2613 element->recalcStyle(change == UpdatePseudoElements ? Force : change); | 2613 element->recalcStyle(change == UpdatePseudoElements ? Force : change); |
| 2614 | 2614 |
| 2615 // Wait until our parent is not displayed or pseudoElementRendererIsNeed
ed | 2615 // Wait until our parent is not displayed or pseudoElementRendererIsNeed
ed |
| 2616 // is false, otherwise we could continuously create and destroy PseudoEl
ements | 2616 // is false, otherwise we could continuously create and destroy PseudoEl
ements |
| 2617 // when RenderObject::isChildAllowed on our parent returns false for the | 2617 // when LayoutObject::isChildAllowed on our parent returns false for the |
| 2618 // PseudoElement's renderer for each style recalc. | 2618 // PseudoElement's renderer for each style recalc. |
| 2619 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedP
seudoStyle(pseudoId))) | 2619 if (!renderer() || !pseudoElementRendererIsNeeded(renderer()->getCachedP
seudoStyle(pseudoId))) |
| 2620 elementRareData()->setPseudoElement(pseudoId, nullptr); | 2620 elementRareData()->setPseudoElement(pseudoId, nullptr); |
| 2621 } else if (pseudoId == FIRST_LETTER && element && change >= UpdatePseudoElem
ents && !FirstLetterPseudoElement::firstLetterTextRenderer(*element)) { | 2621 } else if (pseudoId == FIRST_LETTER && element && change >= UpdatePseudoElem
ents && !FirstLetterPseudoElement::firstLetterTextRenderer(*element)) { |
| 2622 // This can happen if we change to a float, for example. We need to clea
nup the | 2622 // This can happen if we change to a float, for example. We need to clea
nup the |
| 2623 // first-letter pseudoElement and then fix the text of the original rema
ining | 2623 // first-letter pseudoElement and then fix the text of the original rema
ining |
| 2624 // text renderer. | 2624 // text renderer. |
| 2625 // This can be seen in Test 7 of fast/css/first-letter-removed-added.htm
l | 2625 // This can be seen in Test 7 of fast/css/first-letter-removed-added.htm
l |
| 2626 elementRareData()->setPseudoElement(pseudoId, nullptr); | 2626 elementRareData()->setPseudoElement(pseudoId, nullptr); |
| 2627 } else if (change >= UpdatePseudoElements) { | 2627 } else if (change >= UpdatePseudoElements) { |
| 2628 createPseudoElementIfNeeded(pseudoId); | 2628 createPseudoElementIfNeeded(pseudoId); |
| 2629 } | 2629 } |
| 2630 } | 2630 } |
| 2631 | 2631 |
| 2632 // If we're updating first letter, and the current first letter renderer | 2632 // If we're updating first letter, and the current first letter renderer |
| 2633 // is not the same as the one we're currently using we need to re-create | 2633 // is not the same as the one we're currently using we need to re-create |
| 2634 // the first letter renderer. | 2634 // the first letter renderer. |
| 2635 bool Element::updateFirstLetter(Element* element) | 2635 bool Element::updateFirstLetter(Element* element) |
| 2636 { | 2636 { |
| 2637 RenderObject* remainingTextRenderer = FirstLetterPseudoElement::firstLetterT
extRenderer(*element); | 2637 LayoutObject* remainingTextRenderer = FirstLetterPseudoElement::firstLetterT
extRenderer(*element); |
| 2638 if (!remainingTextRenderer || remainingTextRenderer != toFirstLetterPseudoEl
ement(element)->remainingTextRenderer()) { | 2638 if (!remainingTextRenderer || remainingTextRenderer != toFirstLetterPseudoEl
ement(element)->remainingTextRenderer()) { |
| 2639 // We have to clear out the old first letter here because when it is | 2639 // We have to clear out the old first letter here because when it is |
| 2640 // disposed it will set the original text back on the remaining text | 2640 // disposed it will set the original text back on the remaining text |
| 2641 // renderer. If we dispose after creating the new one we will get | 2641 // renderer. If we dispose after creating the new one we will get |
| 2642 // incorrect results due to setting the first letter back. | 2642 // incorrect results due to setting the first letter back. |
| 2643 if (remainingTextRenderer) | 2643 if (remainingTextRenderer) |
| 2644 element->reattach(); | 2644 element->reattach(); |
| 2645 else | 2645 else |
| 2646 elementRareData()->setPseudoElement(FIRST_LETTER, nullptr); | 2646 elementRareData()->setPseudoElement(FIRST_LETTER, nullptr); |
| 2647 return true; | 2647 return true; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 2668 InspectorInstrumentation::pseudoElementCreated(element.get()); | 2668 InspectorInstrumentation::pseudoElementCreated(element.get()); |
| 2669 | 2669 |
| 2670 ensureElementRareData().setPseudoElement(pseudoId, element.release()); | 2670 ensureElementRareData().setPseudoElement(pseudoId, element.release()); |
| 2671 } | 2671 } |
| 2672 | 2672 |
| 2673 PseudoElement* Element::pseudoElement(PseudoId pseudoId) const | 2673 PseudoElement* Element::pseudoElement(PseudoId pseudoId) const |
| 2674 { | 2674 { |
| 2675 return hasRareData() ? elementRareData()->pseudoElement(pseudoId) : nullptr; | 2675 return hasRareData() ? elementRareData()->pseudoElement(pseudoId) : nullptr; |
| 2676 } | 2676 } |
| 2677 | 2677 |
| 2678 RenderObject* Element::pseudoElementRenderer(PseudoId pseudoId) const | 2678 LayoutObject* Element::pseudoElementRenderer(PseudoId pseudoId) const |
| 2679 { | 2679 { |
| 2680 if (PseudoElement* element = pseudoElement(pseudoId)) | 2680 if (PseudoElement* element = pseudoElement(pseudoId)) |
| 2681 return element->renderer(); | 2681 return element->renderer(); |
| 2682 return nullptr; | 2682 return nullptr; |
| 2683 } | 2683 } |
| 2684 | 2684 |
| 2685 bool Element::matches(const String& selectors, ExceptionState& exceptionState) | 2685 bool Element::matches(const String& selectors, ExceptionState& exceptionState) |
| 2686 { | 2686 { |
| 2687 SelectorQuery* selectorQuery = document().selectorQueryCache().add(AtomicStr
ing(selectors), document(), exceptionState); | 2687 SelectorQuery* selectorQuery = document().selectorQueryCache().add(AtomicStr
ing(selectors), document(), exceptionState); |
| 2688 if (!selectorQuery) | 2688 if (!selectorQuery) |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3350 return false; | 3350 return false; |
| 3351 if (!parentOrShadowHostElement()->childrenSupportStyleSharing()) | 3351 if (!parentOrShadowHostElement()->childrenSupportStyleSharing()) |
| 3352 return false; | 3352 return false; |
| 3353 if (this == document().cssTarget()) | 3353 if (this == document().cssTarget()) |
| 3354 return false; | 3354 return false; |
| 3355 if (isHTMLElement() && toHTMLElement(this)->hasDirectionAuto()) | 3355 if (isHTMLElement() && toHTMLElement(this)->hasDirectionAuto()) |
| 3356 return false; | 3356 return false; |
| 3357 if (hasActiveAnimations()) | 3357 if (hasActiveAnimations()) |
| 3358 return false; | 3358 return false; |
| 3359 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. | 3359 // Turn off style sharing for elements that can gain layers for reasons outs
ide of the style system. |
| 3360 // See comments in RenderObject::setStyle(). | 3360 // See comments in LayoutObject::setStyle(). |
| 3361 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? | 3361 // FIXME: Why does gaining a layer from outside the style system require dis
abling sharing? |
| 3362 if (isHTMLFrameElementBase(*this) || isHTMLPlugInElement(*this) || isHTMLCan
vasElement(*this)) | 3362 if (isHTMLFrameElementBase(*this) || isHTMLPlugInElement(*this) || isHTMLCan
vasElement(*this)) |
| 3363 return false; | 3363 return false; |
| 3364 if (Fullscreen::isActiveFullScreenElement(*this)) | 3364 if (Fullscreen::isActiveFullScreenElement(*this)) |
| 3365 return false; | 3365 return false; |
| 3366 return true; | 3366 return true; |
| 3367 } | 3367 } |
| 3368 | 3368 |
| 3369 void Element::trace(Visitor* visitor) | 3369 void Element::trace(Visitor* visitor) |
| 3370 { | 3370 { |
| 3371 #if ENABLE(OILPAN) | 3371 #if ENABLE(OILPAN) |
| 3372 if (hasRareData()) | 3372 if (hasRareData()) |
| 3373 visitor->trace(elementRareData()); | 3373 visitor->trace(elementRareData()); |
| 3374 visitor->trace(m_elementData); | 3374 visitor->trace(m_elementData); |
| 3375 #endif | 3375 #endif |
| 3376 ContainerNode::trace(visitor); | 3376 ContainerNode::trace(visitor); |
| 3377 } | 3377 } |
| 3378 | 3378 |
| 3379 } // namespace blink | 3379 } // namespace blink |
| OLD | NEW |