| 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. | 7 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. |
| 8 * All rights reserved. | 8 * All rights reserved. |
| 9 * (C) 2007 Eric Seidel (eric@webkit.org) | 9 * (C) 2007 Eric Seidel (eric@webkit.org) |
| 10 * | 10 * |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 return isHTMLElement() && document().isHTMLDocument(); | 428 return isHTMLElement() && document().isHTMLDocument(); |
| 429 } | 429 } |
| 430 | 430 |
| 431 void Element::scrollIntoView(bool alignToTop) { | 431 void Element::scrollIntoView(bool alignToTop) { |
| 432 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 432 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 433 | 433 |
| 434 if (!layoutObject()) | 434 if (!layoutObject()) |
| 435 return; | 435 return; |
| 436 | 436 |
| 437 bool makeVisibleInVisualViewport = | 437 bool makeVisibleInVisualViewport = |
| 438 !document().page()->settings().inertVisualViewport(); | 438 !document().page()->settings().getInertVisualViewport(); |
| 439 | 439 |
| 440 LayoutRect bounds = boundingBox(); | 440 LayoutRect bounds = boundingBox(); |
| 441 // Align to the top / bottom and to the closest edge. | 441 // Align to the top / bottom and to the closest edge. |
| 442 if (alignToTop) | 442 if (alignToTop) |
| 443 layoutObject()->scrollRectToVisible( | 443 layoutObject()->scrollRectToVisible( |
| 444 bounds, ScrollAlignment::alignToEdgeIfNeeded, | 444 bounds, ScrollAlignment::alignToEdgeIfNeeded, |
| 445 ScrollAlignment::alignTopAlways, ProgrammaticScroll, | 445 ScrollAlignment::alignTopAlways, ProgrammaticScroll, |
| 446 makeVisibleInVisualViewport); | 446 makeVisibleInVisualViewport); |
| 447 else | 447 else |
| 448 layoutObject()->scrollRectToVisible( | 448 layoutObject()->scrollRectToVisible( |
| 449 bounds, ScrollAlignment::alignToEdgeIfNeeded, | 449 bounds, ScrollAlignment::alignToEdgeIfNeeded, |
| 450 ScrollAlignment::alignBottomAlways, ProgrammaticScroll, | 450 ScrollAlignment::alignBottomAlways, ProgrammaticScroll, |
| 451 makeVisibleInVisualViewport); | 451 makeVisibleInVisualViewport); |
| 452 | 452 |
| 453 document().setSequentialFocusNavigationStartingPoint(this); | 453 document().setSequentialFocusNavigationStartingPoint(this); |
| 454 } | 454 } |
| 455 | 455 |
| 456 void Element::scrollIntoViewIfNeeded(bool centerIfNeeded) { | 456 void Element::scrollIntoViewIfNeeded(bool centerIfNeeded) { |
| 457 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 457 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 458 | 458 |
| 459 if (!layoutObject()) | 459 if (!layoutObject()) |
| 460 return; | 460 return; |
| 461 | 461 |
| 462 bool makeVisibleInVisualViewport = | 462 bool makeVisibleInVisualViewport = |
| 463 !document().page()->settings().inertVisualViewport(); | 463 !document().page()->settings().getInertVisualViewport(); |
| 464 | 464 |
| 465 LayoutRect bounds = boundingBox(); | 465 LayoutRect bounds = boundingBox(); |
| 466 if (centerIfNeeded) | 466 if (centerIfNeeded) |
| 467 layoutObject()->scrollRectToVisible( | 467 layoutObject()->scrollRectToVisible( |
| 468 bounds, ScrollAlignment::alignCenterIfNeeded, | 468 bounds, ScrollAlignment::alignCenterIfNeeded, |
| 469 ScrollAlignment::alignCenterIfNeeded, ProgrammaticScroll, | 469 ScrollAlignment::alignCenterIfNeeded, ProgrammaticScroll, |
| 470 makeVisibleInVisualViewport); | 470 makeVisibleInVisualViewport); |
| 471 else | 471 else |
| 472 layoutObject()->scrollRectToVisible( | 472 layoutObject()->scrollRectToVisible( |
| 473 bounds, ScrollAlignment::alignToEdgeIfNeeded, | 473 bounds, ScrollAlignment::alignToEdgeIfNeeded, |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 708 // When in quirks mode, clientWidth for the body element should return the | 708 // When in quirks mode, clientWidth for the body element should return the |
| 709 // width of the containing frame. | 709 // width of the containing frame. |
| 710 bool inQuirksMode = document().inQuirksMode(); | 710 bool inQuirksMode = document().inQuirksMode(); |
| 711 if ((!inQuirksMode && document().documentElement() == this) || | 711 if ((!inQuirksMode && document().documentElement() == this) || |
| 712 (inQuirksMode && isHTMLElement() && document().body() == this)) { | 712 (inQuirksMode && isHTMLElement() && document().body() == this)) { |
| 713 LayoutViewItem layoutView = document().layoutViewItem(); | 713 LayoutViewItem layoutView = document().layoutViewItem(); |
| 714 if (!layoutView.isNull()) { | 714 if (!layoutView.isNull()) { |
| 715 if (!RuntimeEnabledFeatures::overlayScrollbarsEnabled() || | 715 if (!RuntimeEnabledFeatures::overlayScrollbarsEnabled() || |
| 716 !document().frame()->isLocalRoot()) | 716 !document().frame()->isLocalRoot()) |
| 717 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 717 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 718 if (document().page()->settings().forceZeroLayoutHeight()) | 718 if (document().page()->settings().getForceZeroLayoutHeight()) |
| 719 return adjustLayoutUnitForAbsoluteZoom( | 719 return adjustLayoutUnitForAbsoluteZoom( |
| 720 layoutView.overflowClipRect(LayoutPoint()).width(), | 720 layoutView.overflowClipRect(LayoutPoint()).width(), |
| 721 layoutView.styleRef()) | 721 layoutView.styleRef()) |
| 722 .round(); | 722 .round(); |
| 723 return adjustLayoutUnitForAbsoluteZoom( | 723 return adjustLayoutUnitForAbsoluteZoom( |
| 724 LayoutUnit(layoutView.layoutSize().width()), | 724 LayoutUnit(layoutView.layoutSize().width()), |
| 725 layoutView.styleRef()) | 725 layoutView.styleRef()) |
| 726 .round(); | 726 .round(); |
| 727 } | 727 } |
| 728 } | 728 } |
| (...skipping 15 matching lines...) Expand all Loading... |
| 744 // height of the containing frame. | 744 // height of the containing frame. |
| 745 bool inQuirksMode = document().inQuirksMode(); | 745 bool inQuirksMode = document().inQuirksMode(); |
| 746 | 746 |
| 747 if ((!inQuirksMode && document().documentElement() == this) || | 747 if ((!inQuirksMode && document().documentElement() == this) || |
| 748 (inQuirksMode && isHTMLElement() && document().body() == this)) { | 748 (inQuirksMode && isHTMLElement() && document().body() == this)) { |
| 749 LayoutViewItem layoutView = document().layoutViewItem(); | 749 LayoutViewItem layoutView = document().layoutViewItem(); |
| 750 if (!layoutView.isNull()) { | 750 if (!layoutView.isNull()) { |
| 751 if (!RuntimeEnabledFeatures::overlayScrollbarsEnabled() || | 751 if (!RuntimeEnabledFeatures::overlayScrollbarsEnabled() || |
| 752 !document().frame()->isLocalRoot()) | 752 !document().frame()->isLocalRoot()) |
| 753 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); | 753 document().updateStyleAndLayoutIgnorePendingStylesheetsForNode(this); |
| 754 if (document().page()->settings().forceZeroLayoutHeight()) | 754 if (document().page()->settings().getForceZeroLayoutHeight()) |
| 755 return adjustLayoutUnitForAbsoluteZoom( | 755 return adjustLayoutUnitForAbsoluteZoom( |
| 756 layoutView.overflowClipRect(LayoutPoint()).height(), | 756 layoutView.overflowClipRect(LayoutPoint()).height(), |
| 757 layoutView.styleRef()) | 757 layoutView.styleRef()) |
| 758 .round(); | 758 .round(); |
| 759 return adjustLayoutUnitForAbsoluteZoom( | 759 return adjustLayoutUnitForAbsoluteZoom( |
| 760 LayoutUnit(layoutView.layoutSize().height()), | 760 LayoutUnit(layoutView.layoutSize().height()), |
| 761 layoutView.styleRef()) | 761 layoutView.styleRef()) |
| 762 .round(); | 762 .round(); |
| 763 } | 763 } |
| 764 } | 764 } |
| (...skipping 2679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3444 case SpellcheckAttributeFalse: | 3444 case SpellcheckAttributeFalse: |
| 3445 return false; | 3445 return false; |
| 3446 case SpellcheckAttributeDefault: | 3446 case SpellcheckAttributeDefault: |
| 3447 break; | 3447 break; |
| 3448 } | 3448 } |
| 3449 } | 3449 } |
| 3450 | 3450 |
| 3451 if (!document().page()) | 3451 if (!document().page()) |
| 3452 return true; | 3452 return true; |
| 3453 | 3453 |
| 3454 return document().page()->settings().spellCheckEnabledByDefault(); | 3454 return document().page()->settings().getSpellCheckEnabledByDefault(); |
| 3455 } | 3455 } |
| 3456 | 3456 |
| 3457 #if DCHECK_IS_ON() | 3457 #if DCHECK_IS_ON() |
| 3458 bool Element::fastAttributeLookupAllowed(const QualifiedName& name) const { | 3458 bool Element::fastAttributeLookupAllowed(const QualifiedName& name) const { |
| 3459 if (name == HTMLNames::styleAttr) | 3459 if (name == HTMLNames::styleAttr) |
| 3460 return false; | 3460 return false; |
| 3461 | 3461 |
| 3462 if (isSVGElement()) | 3462 if (isSVGElement()) |
| 3463 return !toSVGElement(this)->isAnimatableAttribute(name); | 3463 return !toSVGElement(this)->isAnimatableAttribute(name); |
| 3464 | 3464 |
| (...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4112 } | 4112 } |
| 4113 | 4113 |
| 4114 DEFINE_TRACE_WRAPPERS(Element) { | 4114 DEFINE_TRACE_WRAPPERS(Element) { |
| 4115 if (hasRareData()) { | 4115 if (hasRareData()) { |
| 4116 visitor->traceWrappers(elementRareData()); | 4116 visitor->traceWrappers(elementRareData()); |
| 4117 } | 4117 } |
| 4118 ContainerNode::traceWrappers(visitor); | 4118 ContainerNode::traceWrappers(visitor); |
| 4119 } | 4119 } |
| 4120 | 4120 |
| 4121 } // namespace blink | 4121 } // namespace blink |
| OLD | NEW |