OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 static PassOwnPtr<Shape> createShape(const StyleImage*, float threshold, con
st LayoutSize& logicalBoxSize, WritingMode, Length margin, Length padding); | 65 static PassOwnPtr<Shape> createShape(const StyleImage*, float threshold, con
st LayoutSize& logicalBoxSize, WritingMode, Length margin, Length padding); |
66 static PassOwnPtr<Shape> createLayoutBoxShape(const RoundedRect&, WritingMod
e, const Length& margin, const Length& padding); | 66 static PassOwnPtr<Shape> createLayoutBoxShape(const RoundedRect&, WritingMod
e, const Length& margin, const Length& padding); |
67 | 67 |
68 virtual ~Shape() { } | 68 virtual ~Shape() { } |
69 | 69 |
70 virtual LayoutRect shapeMarginLogicalBoundingBox() const = 0; | 70 virtual LayoutRect shapeMarginLogicalBoundingBox() const = 0; |
71 virtual LayoutRect shapePaddingLogicalBoundingBox() const = 0; | 71 virtual LayoutRect shapePaddingLogicalBoundingBox() const = 0; |
72 virtual bool isEmpty() const = 0; | 72 virtual bool isEmpty() const = 0; |
73 virtual void getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH
eight, SegmentList&) const = 0; | 73 virtual void getIncludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH
eight, SegmentList&) const = 0; |
74 virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH
eight, SegmentList&) const = 0; | 74 virtual void getExcludedIntervals(LayoutUnit logicalTop, LayoutUnit logicalH
eight, SegmentList&) const = 0; |
75 virtual bool firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTo
p, const LayoutSize& minLogicalIntervalSize, LayoutUnit& result) const = 0; | 75 virtual bool firstIncludedIntervalLogicalTop(LayoutUnit minLogicalIntervalTo
p, const FloatSize& minLogicalIntervalSize, LayoutUnit& result) const = 0; |
76 bool lineOverlapsShapeMarginBounds(LayoutUnit lineTop, LayoutUnit lineHeight
) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapeMarginLogical
BoundingBox()); } | 76 bool lineOverlapsShapeMarginBounds(LayoutUnit lineTop, LayoutUnit lineHeight
) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapeMarginLogical
BoundingBox()); } |
77 bool lineOverlapsShapePaddingBounds(LayoutUnit lineTop, LayoutUnit lineHeigh
t) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapePaddingLogic
alBoundingBox()); } | 77 bool lineOverlapsShapePaddingBounds(LayoutUnit lineTop, LayoutUnit lineHeigh
t) const { return lineOverlapsBoundingBox(lineTop, lineHeight, shapePaddingLogic
alBoundingBox()); } |
78 | 78 |
79 protected: | 79 protected: |
80 float shapeMargin() const { return m_margin; } | 80 float shapeMargin() const { return m_margin; } |
81 float shapePadding() const { return m_padding; } | 81 float shapePadding() const { return m_padding; } |
82 | 82 |
83 private: | 83 private: |
84 bool lineOverlapsBoundingBox(LayoutUnit lineTop, LayoutUnit lineHeight, cons
t LayoutRect& rect) const | 84 bool lineOverlapsBoundingBox(LayoutUnit lineTop, LayoutUnit lineHeight, cons
t LayoutRect& rect) const |
85 { | 85 { |
86 if (rect.isEmpty()) | 86 if (rect.isEmpty()) |
87 return false; | 87 return false; |
88 return (lineTop < rect.maxY() && lineTop + lineHeight > rect.y()) || (!l
ineHeight && lineTop == rect.y()); | 88 return (lineTop < rect.maxY() && lineTop + lineHeight > rect.y()) || (!l
ineHeight && lineTop == rect.y()); |
89 } | 89 } |
90 | 90 |
91 WritingMode m_writingMode; | 91 WritingMode m_writingMode; |
92 float m_margin; | 92 float m_margin; |
93 float m_padding; | 93 float m_padding; |
94 }; | 94 }; |
95 | 95 |
96 } // namespace WebCore | 96 } // namespace WebCore |
97 | 97 |
98 #endif // Shape_h | 98 #endif // Shape_h |
OLD | NEW |