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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutBox.h

Issue 2302733002: Add DISABLE_CFI_PERF attribute on the methods with CFI checks disabled. (Closed)
Patch Set: Created 4 years, 3 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/LayoutBox.cpp » ('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 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 } 340 }
341 341
342 // Note that those functions have their origin at this box's CSS border box. 342 // Note that those functions have their origin at this box's CSS border box.
343 // As such their location doesn't account for 'top'/'left'. 343 // As such their location doesn't account for 'top'/'left'.
344 LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); } 344 LayoutRect borderBoxRect() const { return LayoutRect(LayoutPoint(), size()); }
345 LayoutRect paddingBoxRect() const { return LayoutRect(LayoutUnit(borderLeft( )), LayoutUnit(borderTop()), clientWidth(), clientHeight()); } 345 LayoutRect paddingBoxRect() const { return LayoutRect(LayoutUnit(borderLeft( )), LayoutUnit(borderTop()), clientWidth(), clientHeight()); }
346 IntRect pixelSnappedBorderBoxRect() const { return IntRect(IntPoint(), m_fra meRect.pixelSnappedSize()); } 346 IntRect pixelSnappedBorderBoxRect() const { return IntRect(IntPoint(), m_fra meRect.pixelSnappedSize()); }
347 IntRect borderBoundingBox() const final { return pixelSnappedBorderBoxRect() ; } 347 IntRect borderBoundingBox() const final { return pixelSnappedBorderBoxRect() ; }
348 348
349 // The content area of the box (excludes padding - and intrinsic padding for table cells, etc... - and border). 349 // The content area of the box (excludes padding - and intrinsic padding for table cells, etc... - and border).
350 LayoutRect contentBoxRect() const { return LayoutRect(borderLeft() + padding Left(), borderTop() + paddingTop(), contentWidth(), contentHeight()); } 350 DISABLE_CFI_PERF LayoutRect contentBoxRect() const { return LayoutRect(borde rLeft() + paddingLeft(), borderTop() + paddingTop(), contentWidth(), contentHeig ht()); }
351 LayoutSize contentBoxOffset() const { return LayoutSize(borderLeft() + paddi ngLeft(), borderTop() + paddingTop()); } 351 LayoutSize contentBoxOffset() const { return LayoutSize(borderLeft() + paddi ngLeft(), borderTop() + paddingTop()); }
352 // The content box in absolute coords. Ignores transforms. 352 // The content box in absolute coords. Ignores transforms.
353 IntRect absoluteContentBox() const; 353 IntRect absoluteContentBox() const;
354 // The offset of the content box in absolute coords, ignoring transforms. 354 // The offset of the content box in absolute coords, ignoring transforms.
355 IntSize absoluteContentBoxOffset() const; 355 IntSize absoluteContentBoxOffset() const;
356 // The content box converted to absolute coords (taking transforms into acco unt). 356 // The content box converted to absolute coords (taking transforms into acco unt).
357 FloatQuad absoluteContentQuad() const; 357 FloatQuad absoluteContentQuad() const;
358 // The enclosing rectangle of the background with given opacity requirement. 358 // The enclosing rectangle of the background with given opacity requirement.
359 LayoutRect backgroundRect(BackgroundRectType) const; 359 LayoutRect backgroundRect(BackgroundRectType) const;
360 360
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 410
411 void addVisualEffectOverflow(); 411 void addVisualEffectOverflow();
412 LayoutRectOutsets computeVisualEffectOverflowOutsets() const; 412 LayoutRectOutsets computeVisualEffectOverflowOutsets() const;
413 void addOverflowFromChild(LayoutBox* child) { addOverflowFromChild(child, ch ild->locationOffset()); } 413 void addOverflowFromChild(LayoutBox* child) { addOverflowFromChild(child, ch ild->locationOffset()); }
414 void addOverflowFromChild(LayoutBox* child, const LayoutSize& delta); 414 void addOverflowFromChild(LayoutBox* child, const LayoutSize& delta);
415 void clearLayoutOverflow(); 415 void clearLayoutOverflow();
416 void clearAllOverflows() { m_overflow.reset(); } 416 void clearAllOverflows() { m_overflow.reset(); }
417 417
418 void updateLayerTransformAfterLayout(); 418 void updateLayerTransformAfterLayout();
419 419
420 LayoutUnit contentWidth() const { return clientWidth() - paddingLeft() - pad dingRight(); } 420 DISABLE_CFI_PERF LayoutUnit contentWidth() const { return clientWidth() - pa ddingLeft() - paddingRight(); }
421 LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - pa ddingBottom(); } 421 DISABLE_CFI_PERF LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - paddingBottom(); }
422 LayoutSize contentSize() const { return LayoutSize(contentWidth(), contentHe ight()); } 422 LayoutSize contentSize() const { return LayoutSize(contentWidth(), contentHe ight()); }
423 LayoutUnit contentLogicalWidth() const { return style()->isHorizontalWriting Mode() ? contentWidth() : contentHeight(); } 423 LayoutUnit contentLogicalWidth() const { return style()->isHorizontalWriting Mode() ? contentWidth() : contentHeight(); }
424 LayoutUnit contentLogicalHeight() const { return style()->isHorizontalWritin gMode() ? contentHeight() : contentWidth(); } 424 LayoutUnit contentLogicalHeight() const { return style()->isHorizontalWritin gMode() ? contentHeight() : contentWidth(); }
425 425
426 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (LayoutFlow) 426 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (LayoutFlow)
427 // to return the remaining width on a given line (and the height of a single line). 427 // to return the remaining width on a given line (and the height of a single line).
428 LayoutUnit offsetWidth() const override { return m_frameRect.width(); } 428 LayoutUnit offsetWidth() const override { return m_frameRect.width(); }
429 LayoutUnit offsetHeight() const override { return m_frameRect.height(); } 429 LayoutUnit offsetHeight() const override { return m_frameRect.height(); }
430 430
431 int pixelSnappedOffsetWidth(const Element*) const final; 431 int pixelSnappedOffsetWidth(const Element*) const final;
432 int pixelSnappedOffsetHeight(const Element*) const final; 432 int pixelSnappedOffsetHeight(const Element*) const final;
433 433
434 // More IE extensions. clientWidth and clientHeight represent the interior of an object 434 // More IE extensions. clientWidth and clientHeight represent the interior of an object
435 // excluding border and scrollbar. clientLeft/Top are just the borderLeftWi dth and borderTopWidth. 435 // excluding border and scrollbar. clientLeft/Top are just the borderLeftWi dth and borderTopWidth.
436 LayoutUnit clientLeft() const { return LayoutUnit(borderLeft() + (shouldPlac eBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidth() : 0)); } 436 DISABLE_CFI_PERF LayoutUnit clientLeft() const { return LayoutUnit(borderLef t() + (shouldPlaceBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidt h() : 0)); }
437 LayoutUnit clientTop() const { return LayoutUnit(borderTop()); } 437 DISABLE_CFI_PERF LayoutUnit clientTop() const { return LayoutUnit(borderTop( )); }
438 LayoutUnit clientWidth() const; 438 LayoutUnit clientWidth() const;
439 LayoutUnit clientHeight() const; 439 LayoutUnit clientHeight() const;
440 LayoutUnit clientLogicalWidth() const { return style()->isHorizontalWritingM ode() ? clientWidth() : clientHeight(); } 440 DISABLE_CFI_PERF LayoutUnit clientLogicalWidth() const { return style()->isH orizontalWritingMode() ? clientWidth() : clientHeight(); }
441 LayoutUnit clientLogicalHeight() const { return style()->isHorizontalWriting Mode() ? clientHeight() : clientWidth(); } 441 DISABLE_CFI_PERF LayoutUnit clientLogicalHeight() const { return style()->is HorizontalWritingMode() ? clientHeight() : clientWidth(); }
442 LayoutUnit clientLogicalBottom() const { return borderBefore() + clientLogic alHeight(); } 442 DISABLE_CFI_PERF LayoutUnit clientLogicalBottom() const { return borderBefor e() + clientLogicalHeight(); }
443 LayoutRect clientBoxRect() const { return LayoutRect(clientLeft(), clientTop (), clientWidth(), clientHeight()); } 443 DISABLE_CFI_PERF LayoutRect clientBoxRect() const { return LayoutRect(client Left(), clientTop(), clientWidth(), clientHeight()); }
444 444
445 int pixelSnappedClientWidth() const; 445 int pixelSnappedClientWidth() const;
446 int pixelSnappedClientHeight() const; 446 int pixelSnappedClientHeight() const;
447 447
448 // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unl ess the 448 // scrollWidth/scrollHeight will be the same as clientWidth/clientHeight unl ess the
449 // object has overflow:hidden/scroll/auto specified and also has overflow. 449 // object has overflow:hidden/scroll/auto specified and also has overflow.
450 // scrollLeft/Top return the current scroll position. These methods are vir tual so that objects like 450 // scrollLeft/Top return the current scroll position. These methods are vir tual so that objects like
451 // textareas can scroll shadow content (but pretend that they are the object s that are 451 // textareas can scroll shadow content (but pretend that they are the object s that are
452 // scrolling). 452 // scrolling).
453 virtual LayoutUnit scrollLeft() const; 453 virtual LayoutUnit scrollLeft() const;
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 virtual ScrollResult scroll(ScrollGranularity, const FloatSize&); 764 virtual ScrollResult scroll(ScrollGranularity, const FloatSize&);
765 bool canBeScrolledAndHasScrollableArea() const; 765 bool canBeScrolledAndHasScrollableArea() const;
766 virtual bool canBeProgramaticallyScrolled() const; 766 virtual bool canBeProgramaticallyScrolled() const;
767 virtual void autoscroll(const IntPoint&); 767 virtual void autoscroll(const IntPoint&);
768 bool canAutoscroll() const; 768 bool canAutoscroll() const;
769 IntSize calculateAutoscrollDirection(const IntPoint& pointInRootFrame) const ; 769 IntSize calculateAutoscrollDirection(const IntPoint& pointInRootFrame) const ;
770 static LayoutBox* findAutoscrollable(LayoutObject*); 770 static LayoutBox* findAutoscrollable(LayoutObject*);
771 virtual void stopAutoscroll() { } 771 virtual void stopAutoscroll() { }
772 virtual void panScroll(const IntPoint&); 772 virtual void panScroll(const IntPoint&);
773 773
774 bool hasAutoVerticalScrollbar() const { return hasOverflowClip() && (style() ->overflowY() == OverflowAuto || style()->overflowY() == OverflowPagedY || style ()->overflowY() == OverflowOverlay); } 774 DISABLE_CFI_PERF bool hasAutoVerticalScrollbar() const { return hasOverflowC lip() && (style()->overflowY() == OverflowAuto || style()->overflowY() == Overfl owPagedY || style()->overflowY() == OverflowOverlay); }
775 bool hasAutoHorizontalScrollbar() const { return hasOverflowClip() && (style ()->overflowX() == OverflowAuto || style()->overflowX() == OverflowOverlay); } 775 DISABLE_CFI_PERF bool hasAutoHorizontalScrollbar() const { return hasOverflo wClip() && (style()->overflowX() == OverflowAuto || style()->overflowX() == Over flowOverlay); }
776 bool scrollsOverflow() const { return scrollsOverflowX() || scrollsOverflowY (); } 776 DISABLE_CFI_PERF bool scrollsOverflow() const { return scrollsOverflowX() || scrollsOverflowY(); }
777 virtual bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { retur n style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft(); } 777 virtual bool shouldPlaceBlockDirectionScrollbarOnLogicalLeft() const { retur n style()->shouldPlaceBlockDirectionScrollbarOnLogicalLeft(); }
778 778
779 bool hasScrollableOverflowX() const { return scrollsOverflowX() && pixelSnap pedScrollWidth() != pixelSnappedClientWidth(); } 779 bool hasScrollableOverflowX() const { return scrollsOverflowX() && pixelSnap pedScrollWidth() != pixelSnappedClientWidth(); }
780 bool hasScrollableOverflowY() const { return scrollsOverflowY() && pixelSnap pedScrollHeight() != pixelSnappedClientHeight(); } 780 bool hasScrollableOverflowY() const { return scrollsOverflowY() && pixelSnap pedScrollHeight() != pixelSnappedClientHeight(); }
781 virtual bool scrollsOverflowX() const { return hasOverflowClip() && (style() ->overflowX() == OverflowScroll || hasAutoHorizontalScrollbar()); } 781 virtual bool scrollsOverflowX() const { return hasOverflowClip() && (style() ->overflowX() == OverflowScroll || hasAutoHorizontalScrollbar()); }
782 virtual bool scrollsOverflowY() const { return hasOverflowClip() && (style() ->overflowY() == OverflowScroll || hasAutoVerticalScrollbar()); } 782 virtual bool scrollsOverflowY() const { return hasOverflowClip() && (style() ->overflowY() == OverflowScroll || hasAutoVerticalScrollbar()); }
783 783
784 // Elements such as the <input> field override this to specify that they are scrollable 784 // Elements such as the <input> field override this to specify that they are scrollable
785 // outside the context of the CSS overflow style 785 // outside the context of the CSS overflow style
786 virtual bool isIntrinsicallyScrollable(ScrollbarOrientation orientation) con st { return false; } 786 virtual bool isIntrinsicallyScrollable(ScrollbarOrientation orientation) con st { return false; }
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1216 || breakValue == BreakLeft 1216 || breakValue == BreakLeft
1217 || breakValue == BreakPage 1217 || breakValue == BreakPage
1218 || breakValue == BreakRecto 1218 || breakValue == BreakRecto
1219 || breakValue == BreakRight 1219 || breakValue == BreakRight
1220 || breakValue == BreakVerso; 1220 || breakValue == BreakVerso;
1221 } 1221 }
1222 1222
1223 } // namespace blink 1223 } // namespace blink
1224 1224
1225 #endif // LayoutBox_h 1225 #endif // LayoutBox_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698