OLD | NEW |
1 /** | 1 /** |
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 enum LogicalBoxSide { BeforeSide, EndSide, AfterSide, StartSide }; | 48 enum LogicalBoxSide { BeforeSide, EndSide, AfterSide, StartSide }; |
49 enum PhysicalBoxSide { TopSide, RightSide, BottomSide, LeftSide }; | 49 enum PhysicalBoxSide { TopSide, RightSide, BottomSide, LeftSide }; |
50 | 50 |
51 static CSSPropertyID resolveToPhysicalProperty( | 51 static CSSPropertyID resolveToPhysicalProperty( |
52 TextDirection direction, | 52 TextDirection direction, |
53 WritingMode writingMode, | 53 WritingMode writingMode, |
54 LogicalBoxSide logicalSide, | 54 LogicalBoxSide logicalSide, |
55 const StylePropertyShorthand& shorthand) { | 55 const StylePropertyShorthand& shorthand) { |
56 if (direction == LTR) { | 56 if (direction == TextDirection::Ltr) { |
57 if (writingMode == TopToBottomWritingMode) { | 57 if (writingMode == TopToBottomWritingMode) { |
58 // The common case. The logical and physical box sides match. | 58 // The common case. The logical and physical box sides match. |
59 // Left = Start, Right = End, Before = Top, After = Bottom | 59 // Left = Start, Right = End, Before = Top, After = Bottom |
60 return shorthand.properties()[logicalSide]; | 60 return shorthand.properties()[logicalSide]; |
61 } | 61 } |
62 | 62 |
63 if (writingMode == LeftToRightWritingMode) { | 63 if (writingMode == LeftToRightWritingMode) { |
64 // Start = Top, End = Bottom, Before = Left, After = Right. | 64 // Start = Top, End = Bottom, Before = Left, After = Right. |
65 switch (logicalSide) { | 65 switch (logicalSide) { |
66 case StartSide: | 66 case StartSide: |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 return propertyID != CSSPropertyUnicodeBidi && | 281 return propertyID != CSSPropertyUnicodeBidi && |
282 propertyID != CSSPropertyDirection; | 282 propertyID != CSSPropertyDirection; |
283 } | 283 } |
284 | 284 |
285 bool CSSProperty::operator==(const CSSProperty& other) const { | 285 bool CSSProperty::operator==(const CSSProperty& other) const { |
286 return m_value->equals(*other.m_value) && | 286 return m_value->equals(*other.m_value) && |
287 isImportant() == other.isImportant(); | 287 isImportant() == other.isImportant(); |
288 } | 288 } |
289 | 289 |
290 } // namespace blink | 290 } // namespace blink |
OLD | NEW |