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

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

Issue 2073563002: Rework mapToVisualRectInAncestorSpace to handle flipped blocks correctly. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head. Created 4 years, 5 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 855 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 if (!UNLIKELY(hasFlippedBlocksWritingMode())) 866 if (!UNLIKELY(hasFlippedBlocksWritingMode()))
867 return position; 867 return position;
868 return FloatPoint(m_frameRect.width() - position.x(), position.y()); 868 return FloatPoint(m_frameRect.width() - position.x(), position.y());
869 } 869 }
870 void flipForWritingMode(FloatRect& rect) const 870 void flipForWritingMode(FloatRect& rect) const
871 { 871 {
872 if (!UNLIKELY(hasFlippedBlocksWritingMode())) 872 if (!UNLIKELY(hasFlippedBlocksWritingMode()))
873 return; 873 return;
874 rect.setX(m_frameRect.width() - rect.maxX()); 874 rect.setX(m_frameRect.width() - rect.maxX());
875 } 875 }
876 // These represent your location relative to your container as a physical of fset. 876 // These represent your location relative to your container as a physical
877 // In layout related methods you almost always want the logical location (e. g. x() and y()). 877 // offset. In layout related methods you almost always want the logical
878 LayoutPoint topLeftLocation() const; 878 // location (e.g. x() and y()). Passing |container| causes flipped-block
879 // flipping w.r.t. that container, or containingBlock() otherwise.
880 LayoutPoint topLeftLocation(const LayoutBox* flippedBlocksContainer = nullpt r) const;
879 LayoutSize topLeftLocationOffset() const { return toLayoutSize(topLeftLocati on()); } 881 LayoutSize topLeftLocationOffset() const { return toLayoutSize(topLeftLocati on()); }
880 882
881 LayoutRect logicalVisualOverflowRectForPropagation(const ComputedStyle&) con st; 883 LayoutRect logicalVisualOverflowRectForPropagation(const ComputedStyle&) con st;
882 LayoutRect visualOverflowRectForPropagation(const ComputedStyle&) const; 884 LayoutRect visualOverflowRectForPropagation(const ComputedStyle&) const;
883 LayoutRect logicalLayoutOverflowRectForPropagation(const ComputedStyle&) con st; 885 LayoutRect logicalLayoutOverflowRectForPropagation(const ComputedStyle&) con st;
884 LayoutRect layoutOverflowRectForPropagation(const ComputedStyle&) const; 886 LayoutRect layoutOverflowRectForPropagation(const ComputedStyle&) const;
885 887
886 bool hasOverflowModel() const { return m_overflow.get(); } 888 bool hasOverflowModel() const { return m_overflow.get(); }
887 bool hasSelfVisualOverflow() const { return m_overflow && !borderBoxRect().c ontains(m_overflow->selfVisualOverflowRect()); } 889 bool hasSelfVisualOverflow() const { return m_overflow && !borderBoxRect().c ontains(m_overflow->selfVisualOverflowRect()); }
888 bool hasVisualOverflow() const { return m_overflow && !borderBoxRect().conta ins(visualOverflowRect()); } 890 bool hasVisualOverflow() const { return m_overflow && !borderBoxRect().conta ins(visualOverflowRect()); }
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 || breakValue == BreakLeft 1232 || breakValue == BreakLeft
1231 || breakValue == BreakPage 1233 || breakValue == BreakPage
1232 || breakValue == BreakRecto 1234 || breakValue == BreakRecto
1233 || breakValue == BreakRight 1235 || breakValue == BreakRight
1234 || breakValue == BreakVerso; 1236 || breakValue == BreakVerso;
1235 } 1237 }
1236 1238
1237 } // namespace blink 1239 } // namespace blink
1238 1240
1239 #endif // LayoutBox_h 1241 #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