Source/JavaScriptCore/ChangeLog

 12011-06-22 Levi Weintraub <leviw@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 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 * wtf/Platform.h: Adding flag for toggling the typedef of the intermediate Layout* classes
 9 from ints to floats and defaulting it to ints (off).
 10
1112011-06-23 Oliver Hunt <oliver@apple.com>
212
313 Reviewed by Gavin Barraclough.
89634

Source/JavaScriptCore/wtf/Platform.h

10091009#define ENABLE_REPAINT_THROTTLING 0
10101010#endif
10111011
 1012#if !defined(WTF_USE_FLOAT_LAYOUT_OFFSETS)
 1013#define WTF_USE_FLOAT_LAYOUT_OFFSETS 0
 1014#endif
 1015
10121016/* Disable the JIT on versions of GCC prior to 4.1 */
10131017#if !defined(ENABLE_JIT) && COMPILER(GCC) && !GCC_VERSION_AT_LEAST(4, 1, 0)
10141018#define ENABLE_JIT 0
89634

Source/WebCore/ChangeLog

 12011-06-22 Levi Weintraub <leviw@chromium.org>
 2
 3 Reviewed by NOBODY (OOPS!).
 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
1292011-06-23 Alok Priyadarshi <alokp@chromium.org>
230
331 Reviewed by James Robinson.
89634

Source/WebCore/GNUmakefile.list.am

@@webcore_sources += \
28832883 Source/WebCore/rendering/InlineTextBox.h \
28842884 Source/WebCore/rendering/LayoutState.cpp \
28852885 Source/WebCore/rendering/LayoutState.h \
 2886 Source/WebCore/rendering/LayoutTypes.h \
28862887 Source/WebCore/rendering/OverlapTestRequestClient.h \
28872888 Source/WebCore/rendering/PaintInfo.h \
28882889 Source/WebCore/rendering/PaintPhase.h \
89634

Source/WebCore/WebCore.gypi

965965 'rendering/InlineFlowBox.h',
966966 'rendering/InlineTextBox.h',
967967 'rendering/LayoutState.h',
 968 'rendering/LayoutTypes.h',
968969 'rendering/OverlapTestRequestClient.h',
969970 'rendering/PaintInfo.h',
970971 'rendering/PaintPhase.h',
89634

Source/WebCore/WebCore.pro

@@HEADERS += \
21342134 rendering/InlineFlowBox.h \
21352135 rendering/InlineTextBox.h \
21362136 rendering/LayoutState.h \
 2137 rendering/LayoutTypes.h \
21372138 rendering/mathml/RenderMathMLBlock.h \
21382139 rendering/mathml/RenderMathMLFenced.h \
21392140 rendering/mathml/RenderMathMLFraction.h \
89634

Source/WebCore/WebCore.vcproj/WebCore.vcproj

3359433594 >
3359533595 </File>
3359633596 <File
 33597 RelativePath="..\rendering\LayoutTypes.h"
 33598 >
 33599 </File>
 33600 <File
3359733601 RelativePath="..\rendering\PaintInfo.h"
3359833602 >
3359933603 </File>
89634

Source/WebCore/WebCore.xcodeproj/project.pbxproj

47654765 B8DBDB4C130B0F8A00F5CDB1 /* SetSelectionCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B8DBDB48130B0F8A00F5CDB1 /* SetSelectionCommand.h */; };
47664766 B8DBDB4D130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B8DBDB49130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp */; };
47674767 B8DBDB4E130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = B8DBDB4A130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h */; };
 4768 BACF290113B2A0D500781F90 /* LayoutTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = BACF290013B2A0D500781F90 /* LayoutTypes.h */; settings = {ATTRIBUTES = (Private, ); }; };
47684769 BC00F0040E0A185500FD04E3 /* DOMFile.h in Headers */ = {isa = PBXBuildFile; fileRef = BC00EFFE0E0A185500FD04E3 /* DOMFile.h */; };
47694770 BC00F0050E0A185500FD04E3 /* DOMFile.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC00EFFF0E0A185500FD04E3 /* DOMFile.mm */; };
47704771 BC00F0060E0A185500FD04E3 /* DOMFileInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = BC00F0000E0A185500FD04E3 /* DOMFileInternal.h */; };

1136111362 B8DBDB48130B0F8A00F5CDB1 /* SetSelectionCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SetSelectionCommand.h; sourceTree = "<group>"; };
1136211363 B8DBDB49130B0F8A00F5CDB1 /* SpellingCorrectionCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SpellingCorrectionCommand.cpp; sourceTree = "<group>"; };
1136311364 B8DBDB4A130B0F8A00F5CDB1 /* SpellingCorrectionCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpellingCorrectionCommand.h; sourceTree = "<group>"; };
 11365 BACF290013B2A0D500781F90 /* LayoutTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayoutTypes.h; sourceTree = "<group>"; };
1136411366 BC00EFFE0E0A185500FD04E3 /* DOMFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFile.h; sourceTree = "<group>"; };
1136511367 BC00EFFF0E0A185500FD04E3 /* DOMFile.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMFile.mm; sourceTree = "<group>"; };
1136611368 BC00F0000E0A185500FD04E3 /* DOMFileInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFileInternal.h; sourceTree = "<group>"; };

1928619288 BCEA481B097D93020094C9E4 /* InlineTextBox.h */,
1928719289 2D9066040BE141D400956998 /* LayoutState.cpp */,
1928819290 2D9066050BE141D400956998 /* LayoutState.h */,
 19291 BACF290013B2A0D500781F90 /* LayoutTypes.h */,
1928919292 3774ABA30FA21EB400AD7DE9 /* OverlapTestRequestClient.h */,
1929019293 0885067D11DA045B00182B98 /* PaintInfo.h */,
1929119294 0885067E11DA045B00182B98 /* PaintPhase.h */,

2305923062 B1AD4E7C13A12A7200846B27 /* CueParser.h in Headers */,
2306023063 B1AD4E7D13A12A7200846B27 /* CueParserPrivate.h in Headers */,
2306123064 97B1F02F13B025D200F5103F /* SharedBufferChunkReader.h in Headers */,
 23065 BACF290113B2A0D500781F90 /* LayoutTypes.h in Headers */,
2306223066 43B9336913B261B1004584BF /* SVGAnimatedPointList.h in Headers */,
2306323067 43A625F813B3304000AC94B8 /* SVGAnimatedColor.h in Headers */,
2306423068 );
89634

Source/WebCore/rendering/LayoutState.cpp

3434
3535namespace WebCore {
3636
37 LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const IntSize& offset, int pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo)
 37LayoutState::LayoutState(LayoutState* prev, RenderBox* renderer, const LayoutSize& offset, LayoutUnit pageLogicalHeight, bool pageLogicalHeightChanged, ColumnInfo* columnInfo)
3838 : m_columnInfo(columnInfo)
3939 , m_next(prev)
4040#ifndef NDEBUG

@@LayoutState::LayoutState(LayoutState* pr
4747 if (fixed) {
4848 // FIXME: This doesn't work correctly with transforms.
4949 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;
5151 } else
5252 m_paintOffset = prev->m_paintOffset + offset;
5353

@@LayoutState::LayoutState(LayoutState* pr
6969
7070 if (renderer->hasOverflowClip()) {
7171 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());
7373 if (m_clipped)
7474 m_clipRect.intersect(clipRect);
7575 else {

@@LayoutState::LayoutState(LayoutState* pr
8484 // We can compare this later on to figure out what part of the page we're actually on,
8585 if (pageLogicalHeight || m_columnInfo) {
8686 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(),
8888 m_layoutOffset.height() + renderer->borderTop() + renderer->paddingTop());
8989 m_pageLogicalHeightChanged = pageLogicalHeightChanged;
9090 } else {

@@LayoutState::LayoutState(RenderObject* r
118118{
119119 RenderObject* container = root->container();
120120 FloatPoint absContentPoint = container->localToAbsolute(FloatPoint(), false, true);
121  m_paintOffset = IntSize(absContentPoint.x(), absContentPoint.y());
 121 m_paintOffset = LayoutSize(absContentPoint.x(), absContentPoint.y());
122122
123123 if (container->hasOverflowClip()) {
124124 RenderLayer* layer = toRenderBoxModelObject(container)->layer();
125125 m_clipped = true;
126  m_clipRect = IntRect(toPoint(m_paintOffset), layer->size());
 126 m_clipRect = LayoutRect(toPoint(m_paintOffset), layer->size());
127127 m_paintOffset -= layer->scrolledContentOffset();
128128 }
129129}

@@void LayoutState::clearPaginationInforma
162162 m_columnInfo = m_next->m_columnInfo;
163163}
164164
165 int LayoutState::pageLogicalOffset(int childLogicalOffset) const
 165LayoutUnit LayoutState::pageLogicalOffset(LayoutUnit childLogicalOffset) const
166166{
167167 return m_layoutOffset.height() + childLogicalOffset - m_pageOffset.height();
168168}
169169
170 void LayoutState::addForcedColumnBreak(int childLogicalOffset)
 170void LayoutState::addForcedColumnBreak(LayoutUnit childLogicalOffset)
171171{
172172 if (!m_columnInfo || m_columnInfo->columnHeight())
173173 return;
89634

Source/WebCore/rendering/LayoutState.h

2626#ifndef LayoutState_h
2727#define LayoutState_h
2828
29 #include "IntRect.h"
30 #include "IntSize.h"
 29#include "LayoutTypes.h"
3130#include <wtf/Noncopyable.h>
3231
3332namespace WebCore {

@@public:
5251 {
5352 }
5453
55  LayoutState(LayoutState*, RenderBox*, const IntSize& offset, int pageHeight, bool pageHeightChanged, ColumnInfo*);
 54 LayoutState(LayoutState*, RenderBox*, const LayoutSize& offset, LayoutUnit pageHeight, bool pageHeightChanged, ColumnInfo*);
5655 LayoutState(RenderObject*);
5756
5857 void destroy(RenderArena*);

@@public:
6968
7069 // The page logical offset is the object's offset from the top of the page in the page progression
7170 // 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;
7372
74  void addForcedColumnBreak(int childLogicalOffset);
 73 void addForcedColumnBreak(LayoutUnit childLogicalOffset);
7574
7675 bool pageLogicalHeight() const { return m_pageLogicalHeight; }
7776 bool pageLogicalHeightChanged() const { return m_pageLogicalHeightChanged; }

@@private:
8281
8382public:
8483 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
 84 LayoutRect m_clipRect;
 85 LayoutSize m_paintOffset; // x/y offset from container. Includes relative positioning and scroll offsets.
 86 LayoutSize m_layoutOffset; // x/y offset from container. Does not include relative positioning or scroll offsets.
 87 LayoutSize m_layoutDelta; // Transient offset from the final position of the object
8988 // used to ensure that repaints happen in the correct place.
9089 // This is a total delta accumulated from the root.
9190
92  int m_pageLogicalHeight; // The current page height for the pagination model that encloses us.
 91 LayoutUnit m_pageLogicalHeight; // The current page height for the pagination model that encloses us.
9392 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.
 93 LayoutSize m_pageOffset; // The offset of the start of the first page in the nearest enclosing pagination model.
9594 ColumnInfo* m_columnInfo; // If the enclosing pagination model is a column model, then this will store column information for easy retrieval/manipulation.
9695
9796 LayoutState* m_next;
89634

Source/WebCore/rendering/LayoutTypes.h

 1/*
 2 * Copyright (C) 2010 Google Inc. All rights reserved.
 3 *
 4 * Redistribution and use in source and binary forms, with or without
 5 * modification, are permitted provided that the following conditions are
 6 * met:
 7 *
 8 * * Redistributions of source code must retain the above copyright
 9 * notice, this list of conditions and the following disclaimer.
 10 * * Redistributions in binary form must reproduce the above
 11 * copyright notice, this list of conditions and the following disclaimer
 12 * in the documentation and/or other materials provided with the
 13 * distribution.
 14 * * Neither the name of Google Inc. nor the names of its
 15 * contributors may be used to endorse or promote products derived from
 16 * this software without specific prior written permission.
 17 *
 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 29 */
 30
 31// These typedefs are being used to abstract layout and hit testing off
 32// of integers and eventually replace them with floats. Once this transition
 33// is complete, these types will be removed. Progress can be tracked at
 34// https://bugs.webkit.org/show_bug.cgi?id=60318
 35
 36#ifndef LayoutTypes_h
 37#define LayoutTypes_h
 38
 39#if USE(FLOAT_LAYOUT_OFFSETS)
 40#include "FloatRect.h"
 41#else
 42#include "IntRect.h"
 43#endif
 44
 45namespace WebCore {
 46
 47#if USE(FLOAT_OFFSETS)
 48typedef float LayoutUnit;
 49typedef FloatPoint LayoutPoint;
 50typedef FloatSize LayoutSize;
 51typedef FloatRect LayoutRect;
 52#else
 53typedef int LayoutUnit;
 54typedef IntPoint LayoutPoint;
 55typedef IntSize LayoutSize;
 56typedef IntRect LayoutRect;
 57#endif
 58
 59} // namespace WebCore
 60
 61#endif // LayoutTypes_h
0