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

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

Issue 2051703002: Implement closed shadow adjustment for Element.offsetParent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test Created 4 years, 6 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
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - pa ddingBottom(); } 416 LayoutUnit contentHeight() const { return clientHeight() - paddingTop() - pa ddingBottom(); }
417 LayoutSize contentSize() const { return LayoutSize(contentWidth(), contentHe ight()); } 417 LayoutSize contentSize() const { return LayoutSize(contentWidth(), contentHe ight()); }
418 LayoutUnit contentLogicalWidth() const { return style()->isHorizontalWriting Mode() ? contentWidth() : contentHeight(); } 418 LayoutUnit contentLogicalWidth() const { return style()->isHorizontalWriting Mode() ? contentWidth() : contentHeight(); }
419 LayoutUnit contentLogicalHeight() const { return style()->isHorizontalWritin gMode() ? contentHeight() : contentWidth(); } 419 LayoutUnit contentLogicalHeight() const { return style()->isHorizontalWritin gMode() ? contentHeight() : contentWidth(); }
420 420
421 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (LayoutFlow) 421 // IE extensions. Used to calculate offsetWidth/Height. Overridden by inlin es (LayoutFlow)
422 // to return the remaining width on a given line (and the height of a single line). 422 // to return the remaining width on a given line (and the height of a single line).
423 LayoutUnit offsetWidth() const override { return m_frameRect.width(); } 423 LayoutUnit offsetWidth() const override { return m_frameRect.width(); }
424 LayoutUnit offsetHeight() const override { return m_frameRect.height(); } 424 LayoutUnit offsetHeight() const override { return m_frameRect.height(); }
425 425
426 int pixelSnappedOffsetWidth() const final; 426 int pixelSnappedOffsetWidth(const Element*) const final;
427 int pixelSnappedOffsetHeight() const final; 427 int pixelSnappedOffsetHeight(const Element*) const final;
428 428
429 // More IE extensions. clientWidth and clientHeight represent the interior of an object 429 // More IE extensions. clientWidth and clientHeight represent the interior of an object
430 // excluding border and scrollbar. clientLeft/Top are just the borderLeftWi dth and borderTopWidth. 430 // excluding border and scrollbar. clientLeft/Top are just the borderLeftWi dth and borderTopWidth.
431 LayoutUnit clientLeft() const { return LayoutUnit(borderLeft() + (shouldPlac eBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidth() : 0)); } 431 LayoutUnit clientLeft() const { return LayoutUnit(borderLeft() + (shouldPlac eBlockDirectionScrollbarOnLogicalLeft() ? verticalScrollbarWidth() : 0)); }
432 LayoutUnit clientTop() const { return LayoutUnit(borderTop()); } 432 LayoutUnit clientTop() const { return LayoutUnit(borderTop()); }
433 LayoutUnit clientWidth() const; 433 LayoutUnit clientWidth() const;
434 LayoutUnit clientHeight() const; 434 LayoutUnit clientHeight() const;
435 LayoutUnit clientLogicalWidth() const { return style()->isHorizontalWritingM ode() ? clientWidth() : clientHeight(); } 435 LayoutUnit clientLogicalWidth() const { return style()->isHorizontalWritingM ode() ? clientWidth() : clientHeight(); }
436 LayoutUnit clientLogicalHeight() const { return style()->isHorizontalWriting Mode() ? clientHeight() : clientWidth(); } 436 LayoutUnit clientLogicalHeight() const { return style()->isHorizontalWriting Mode() ? clientHeight() : clientWidth(); }
437 LayoutUnit clientLogicalBottom() const { return borderBefore() + clientLogic alHeight(); } 437 LayoutUnit clientLogicalBottom() const { return borderBefore() + clientLogic alHeight(); }
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
827 827
828 bool isDeprecatedFlexItem() const { return !isInline() && !isFloatingOrOutOf FlowPositioned() && parent() && parent()->isDeprecatedFlexibleBox(); } 828 bool isDeprecatedFlexItem() const { return !isInline() && !isFloatingOrOutOf FlowPositioned() && parent() && parent()->isDeprecatedFlexibleBox(); }
829 bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloati ngOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBoxIncludingDepreca ted(); } 829 bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloati ngOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBoxIncludingDepreca ted(); }
830 bool isFlexItem() const { return !isInline() && !isFloatingOrOutOfFlowPositi oned() && parent() && parent()->isFlexibleBox(); } 830 bool isFlexItem() const { return !isInline() && !isFloatingOrOutOfFlowPositi oned() && parent() && parent()->isFlexibleBox(); }
831 831
832 bool isGridItem() const { return parent() && parent()->isLayoutGrid(); } 832 bool isGridItem() const { return parent() && parent()->isLayoutGrid(); }
833 833
834 LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override; 834 LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override;
835 int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePo sitionMode = PositionOnContainingLine) const override; 835 int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePo sitionMode = PositionOnContainingLine) const override;
836 836
837 LayoutUnit offsetLeft() const override; 837 LayoutUnit offsetLeft(const Element*) const override;
838 LayoutUnit offsetTop() const override; 838 LayoutUnit offsetTop(const Element*) const override;
839 839
840 LayoutPoint flipForWritingModeForChild(const LayoutBox* child, const LayoutP oint&) const; 840 LayoutPoint flipForWritingModeForChild(const LayoutBox* child, const LayoutP oint&) const;
841 LayoutUnit flipForWritingMode(LayoutUnit position) const WARN_UNUSED_RETURN { 841 LayoutUnit flipForWritingMode(LayoutUnit position) const WARN_UNUSED_RETURN {
842 // The offset is in the block direction (y for horizontal writing modes, x for vertical writing modes). 842 // The offset is in the block direction (y for horizontal writing modes, x for vertical writing modes).
843 if (!UNLIKELY(hasFlippedBlocksWritingMode())) 843 if (!UNLIKELY(hasFlippedBlocksWritingMode()))
844 return position; 844 return position;
845 return logicalHeight() - position; 845 return logicalHeight() - position;
846 } 846 }
847 LayoutPoint flipForWritingMode(const LayoutPoint& position) const WARN_UNUSE D_RETURN { 847 LayoutPoint flipForWritingMode(const LayoutPoint& position) const WARN_UNUSE D_RETURN {
848 if (!UNLIKELY(hasFlippedBlocksWritingMode())) 848 if (!UNLIKELY(hasFlippedBlocksWritingMode()))
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 || breakValue == BreakLeft 1218 || breakValue == BreakLeft
1219 || breakValue == BreakPage 1219 || breakValue == BreakPage
1220 || breakValue == BreakRecto 1220 || breakValue == BreakRecto
1221 || breakValue == BreakRight 1221 || breakValue == BreakRight
1222 || breakValue == BreakVerso; 1222 || breakValue == BreakVerso;
1223 } 1223 }
1224 1224
1225 } // namespace blink 1225 } // namespace blink
1226 1226
1227 #endif // LayoutBox_h 1227 #endif // LayoutBox_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698