Changeset 89945 in webkit
- Timestamp:
- Jun 28, 2011 11:31:19 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 1 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r89942 r89945 1 2011-06-28 Levi Weintraub <leviw@chromium.org> 2 3 Reviewed by Darin Adler. 4 5 Create intermediate classes as a path towards getting off of pixel offsets 6 https://bugs.webkit.org/show_bug.cgi?id=61896 7 8 Creating three intermediate typedefs to aid in moving layout and hit testing from integers 9 to floats. We'll transition the render tree over to these intermediate types and add 10 infrastructure to support the new types behind USE(FLOAT_LAYOUT_OFFSETS). This allows the ultimate 11 changeover to be easier. 12 13 Switching LayoutState over to this abstraction to verify it works correctly. 14 15 No new tests since this is creating a new abstraction, not changing current behavior. 16 17 * GNUmakefile.list.am: 18 * WebCore.gypi: 19 * WebCore.pro: 20 * WebCore.vcproj/WebCore.vcproj: 21 * WebCore.xcodeproj/project.pbxproj: 22 * rendering/LayoutState.cpp: 23 (WebCore::LayoutState::LayoutState): 24 (WebCore::LayoutState::pageLogicalOffset): 25 (WebCore::LayoutState::addForcedColumnBreak): 26 * rendering/LayoutState.h: 27 * rendering/LayoutTypes.h: Added. 28 1 29 2011-06-28 Jeff Miller <jeffm@apple.com> 2 30 -
trunk/Source/WebCore/GNUmakefile.list.am
r89937 r89945 2908 2908 Source/WebCore/rendering/LayoutState.cpp \ 2909 2909 Source/WebCore/rendering/LayoutState.h \ 2910 Source/WebCore/rendering/LayoutTypes.h \ 2910 2911 Source/WebCore/rendering/OverlapTestRequestClient.h \ 2911 2912 Source/WebCore/rendering/PaintInfo.h \ -
trunk/Source/WebCore/WebCore.gypi
r89851 r89945 967 967 'rendering/InlineTextBox.h', 968 968 'rendering/LayoutState.h', 969 'rendering/LayoutTypes.h', 969 970 'rendering/OverlapTestRequestClient.h', 970 971 'rendering/PaintInfo.h', -
trunk/Source/WebCore/WebCore.pro
r89833 r89945 2133 2133 rendering/InlineTextBox.h \ 2134 2134 rendering/LayoutState.h \ 2135 rendering/LayoutTypes.h \ 2135 2136 rendering/mathml/RenderMathMLBlock.h \ 2136 2137 rendering/mathml/RenderMathMLFenced.h \ -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r89942 r89945 33619 33619 </File> 33620 33620 <File 33621 RelativePath="..\rendering\LayoutTypes.h" 33622 > 33623 </File> 33624 <File 33621 33625 RelativePath="..\rendering\PaintInfo.h" 33622 33626 > -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r89851 r89945 4773 4773 B8DBDB4D130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B8DBDB49130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp */; }; 4774 4774 B8DBDB4E130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B8DBDB4A130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h */; }; 4775 BACF290113B2A0D500781F90 /* LayoutTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BACF290013B2A0D500781F90 /* LayoutTypes.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4775 4776 BC00F0040E0A185500FD04E3 /* DOMFile.h in Headers */ = {isa = PBXBuildFile; fileRef = BC00EFFE0E0A185500FD04E3 /* DOMFile.h */; }; 4776 4777 BC00F0050E0A185500FD04E3 /* DOMFile.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC00EFFF0E0A185500FD04E3 /* DOMFile.mm */; }; … … 11376 11377 B8DBDB49130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpellingCorrectionCommand.cpp; sourceTree = "<group>"; }; 11377 11378 B8DBDB4A130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpellingCorrectionCommand.h; sourceTree = "<group>"; }; 11379 BACF290013B2A0D500781F90 /* LayoutTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutTypes.h; sourceTree = "<group>"; }; 11378 11380 BC00EFFE0E0A185500FD04E3 /* DOMFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFile.h; sourceTree = "<group>"; }; 11379 11381 BC00EFFF0E0A185500FD04E3 /* DOMFile.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMFile.mm; sourceTree = "<group>"; }; … … 19308 19310 2D9066040BE141D400956998 /* LayoutState.cpp */, 19309 19311 2D9066050BE141D400956998 /* LayoutState.h */, 19312 BACF290013B2A0D500781F90 /* LayoutTypes.h */, 19310 19313 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */, 19311 19314 0885067D11DA045B00182B98 /* PaintInfo.h */, … … 23078 23081 B1AD4E7D13A12A7200846B27 /* CueParserPrivate.h in Headers */, 23079 23082 97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */, 23083 BACF290113B2A0D500781F90 /* LayoutTypes.h in Headers */, 23080 23084 43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */, 23081 23085 43A625F813B3304000AC94B8 /* SVGAnimatedColor.h in Headers */, -
trunk/Source/WebCore/rendering/LayoutState.cpp
r76726 r89945 35 35 namespace WebCore { 36 36 37 LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const IntSize& offset, int pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo)37 LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo) 38 38 : m_columnInfo(columnInfo) 39 39 , m_next(prev) … … 48 48 // FIXME: This doesn't work correctly with transforms. 49 49 FloatPoint fixedOffset = renderer->view()->localToAbsolute(FloatPoint(), true); 50 m_paintOffset = IntSize(fixedOffset.x(), fixedOffset.y()) + offset;50 m_paintOffset = LayoutSize(fixedOffset.x(), fixedOffset.y()) + offset; 51 51 } else 52 52 m_paintOffset = prev->m_paintOffset + offset; … … 70 70 if (renderer->hasOverflowClip()) { 71 71 RenderLayer* layer = renderer->layer(); 72 IntRect clipRect(toPoint(m_paintOffset) + renderer->view()->layoutDelta(), layer->size());72 LayoutRect clipRect(toPoint(m_paintOffset) + renderer->view()->layoutDelta(), layer->size()); 73 73 if (m_clipped) 74 74 m_clipRect.intersect(clipRect); … … 85 85 if (pageLogicalHeight || m_columnInfo) { 86 86 m_pageLogicalHeight = pageLogicalHeight; 87 m_pageOffset = IntSize(m_layoutOffset.width() + renderer->borderLeft() + renderer->paddingLeft(),87 m_pageOffset = LayoutSize(m_layoutOffset.width() + renderer->borderLeft() + renderer->paddingLeft(), 88 88 m_layoutOffset.height() + renderer->borderTop() + renderer->paddingTop()); 89 89 m_pageLogicalHeightChanged = pageLogicalHeightChanged; … … 119 119 RenderObject* container = root->container(); 120 120 FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), false, true); 121 m_paintOffset = IntSize(absContentPoint.x(), absContentPoint.y());121 m_paintOffset = LayoutSize(absContentPoint.x(), absContentPoint.y()); 122 122 123 123 if (container->hasOverflowClip()) { 124 124 RenderLayer* layer = toRenderBoxModelObject(container)->layer(); 125 125 m_clipped = true; 126 m_clipRect = IntRect(toPoint(m_paintOffset), layer->size());126 m_clipRect = LayoutRect(toPoint(m_paintOffset), layer->size()); 127 127 m_paintOffset -= layer->scrolledContentOffset(); 128 128 } … … 163 163 } 164 164 165 int LayoutState::pageLogicalOffset(int childLogicalOffset) const165 LayoutUnit LayoutState::pageLogicalOffset(LayoutUnit childLogicalOffset) const 166 166 { 167 167 return m_layoutOffset.height() + childLogicalOffset - m_pageOffset.height(); 168 168 } 169 169 170 void LayoutState::addForcedColumnBreak( int childLogicalOffset)170 void LayoutState::addForcedColumnBreak(LayoutUnit childLogicalOffset) 171 171 { 172 172 if (!m_columnInfo || m_columnInfo->columnHeight()) -
trunk/Source/WebCore/rendering/LayoutState.h
r76726 r89945 27 27 #define LayoutState_h 28 28 29 #include "IntRect.h" 30 #include "IntSize.h" 29 #include "LayoutTypes.h" 31 30 #include <wtf/Noncopyable.h> 32 31 … … 53 52 } 54 53 55 LayoutState(LayoutState*, RenderBox*, const IntSize& offset, int pageHeight, bool pageHeightChanged, ColumnInfo*);54 LayoutState(LayoutState*, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged, ColumnInfo*); 56 55 LayoutState(RenderObject*); 57 56 … … 70 69 // The page logical offset is the object's offset from the top of the page in the page progression 71 70 // direction (so an x-offset in vertical text and a y-offset for horizontal text). 72 int pageLogicalOffset(int childLogicalOffset) const;71 LayoutUnit pageLogicalOffset(LayoutUnit childLogicalOffset) const; 73 72 74 void addForcedColumnBreak( int childLogicalOffset);73 void addForcedColumnBreak(LayoutUnit childLogicalOffset); 75 74 76 75 bool pageLogicalHeight() const { return m_pageLogicalHeight; } … … 83 82 public: 84 83 bool m_clipped; 85 IntRect m_clipRect; 86 IntSize m_paintOffset; // x/y offset from container. Includes relative positioning and scroll offsets. 87 IntSize m_layoutOffset; // x/y offset from container. Does not include relative positioning or scroll offsets. 88 IntSize m_layoutDelta; // Transient offset from the final position of the object 89 // used to ensure that repaints happen in the correct place. 90 // This is a total delta accumulated from the root. 84 LayoutRect m_clipRect; 85 86 // x/y offset from container. Includes relative positioning and scroll offsets. 87 LayoutSize m_paintOffset; 88 // x/y offset from container. Does not include relative positioning or scroll offsets. 89 LayoutSize m_layoutOffset; 90 // Transient offset from the final position of the object 91 // used to ensure that repaints happen in the correct place. 92 // This is a total delta accumulated from the root. 93 LayoutSize m_layoutDelta; 91 94 92 int m_pageLogicalHeight; // The current page height for the pagination model that encloses us. 93 bool m_pageLogicalHeightChanged; // If our page height has changed, this will force all blocks to relayout. 94 IntSize m_pageOffset; // The offset of the start of the first page in the nearest enclosing pagination model. 95 ColumnInfo* m_columnInfo; // If the enclosing pagination model is a column model, then this will store column information for easy retrieval/manipulation. 95 // The current page height for the pagination model that encloses us. 96 LayoutUnit m_pageLogicalHeight; 97 // If our page height has changed, this will force all blocks to relayout. 98 bool m_pageLogicalHeightChanged; 99 // The offset of the start of the first page in the nearest enclosing pagination model. 100 LayoutSize m_pageOffset; 101 // If the enclosing pagination model is a column model, then this will store column information for easy retrieval/manipulation. 102 ColumnInfo* m_columnInfo; 96 103 97 104 LayoutState* m_next;
Note: See TracChangeset
for help on using the changeset viewer.