Changeset 230656 in webkit
- Timestamp:
- Apr 13, 2018 9:48:35 PM (6 years ago)
- Location:
- trunk/Tools
- Files:
-
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Tools/ChangeLog
r230655 r230656 1 2018-04-13 Zalan Bujtas <zalan@apple.com> 2 3 [LayoutReloaded] Update class documentation 4 https://bugs.webkit.org/show_bug.cgi?id=184625 5 6 Reviewed by Antti Koivisto. 7 8 * LayoutReloaded/DisplayTree/Box.js: 9 * LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js: 10 * LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js: 11 * LayoutReloaded/FormattingContext/FloatingContext.js: 12 * LayoutReloaded/FormattingContext/FormattingContext.js: 13 * LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js: 14 * LayoutReloaded/FormattingContext/InlineFormatting/Line.js: 15 * LayoutReloaded/FormattingState/BlockFormattingState.js: 16 * LayoutReloaded/FormattingState/FloatingState.js: 17 * LayoutReloaded/FormattingState/FormattingState.js: 18 * LayoutReloaded/FormattingState/InlineFormattingState.js: 19 * LayoutReloaded/LayoutState.js: 20 * LayoutReloaded/LayoutTree/BlockContainer.js: 21 * LayoutReloaded/LayoutTree/Box.js: 22 * LayoutReloaded/LayoutTree/Container.js: 23 * LayoutReloaded/LayoutTree/InlineBox.js: 24 * LayoutReloaded/LayoutTree/InlineContainer.js: 25 * LayoutReloaded/LayoutTree/Text.js: 26 * LayoutReloaded/misc/headers/BlockContainer.h: Removed. 27 * LayoutReloaded/misc/headers/BlockFormattingContext.h: Removed. 28 * LayoutReloaded/misc/headers/BlockMarginCollapse.h: Removed. 29 * LayoutReloaded/misc/headers/Box.h: Removed. 30 * LayoutReloaded/misc/headers/Container.h: Removed. 31 * LayoutReloaded/misc/headers/FloatingContext.h: Removed. 32 * LayoutReloaded/misc/headers/FormattingContext.h: Removed. 33 * LayoutReloaded/misc/headers/InitialBlockContainer.h: Removed. 34 * LayoutReloaded/misc/headers/InlineBox.h: Removed. 35 * LayoutReloaded/misc/headers/LayoutContext.h: Removed. 36 * LayoutReloaded/misc/headers/Line.h: Removed. 37 * LayoutReloaded/misc/headers/Text.h: Removed. 38 1 39 2018-04-13 Zalan Bujtas <zalan@apple.com> 2 40 -
trunk/Tools/LayoutReloaded/DisplayTree/Box.js
r230138 r230656 24 24 */ 25 25 26 /* 27 namespace Display { 28 class Box { 29 setRect(LayoutRect); 30 setTopLeft(LayoutPoint); 31 setTop(LayoutUnit); 32 setLeft(LayoutUnit); 33 setSize(LayoutSize); 34 setWidth(LayoutUnit); 35 setHeight(LayoutUnit); 36 37 LayoutRect rect(); 38 39 LayoutUnit top(); 40 LayoutUnit left(); 41 LayoutUnit bottom(); 42 LayoutUnit right(); 43 44 LayoutPoint topLeft(); 45 LayoutPoint bottomRight(); 46 47 LayoutSize size(); 48 LayoutUnit width(); 49 LayoutUnit height(); 50 51 setMarginTop(LayoutUnit); 52 setMarginLeft(LayoutUnit); 53 setMarginBottom(LayoutUnit); 54 setMarginRight(LayoutUnit); 55 56 LayoutUnit marginTop(); 57 LayoutUnit marginLeft(); 58 LayoutUnit marginBottom(); 59 LayoutUnit marginRight(); 60 61 LayoutRect marginBox(); 62 LayoutRect borderBox(); 63 LayoutRect paddingBox(); 64 LayoutRect contentBox(); 65 66 void setParent(Display::Box&); 67 void setNextSibling(Display::Box&); 68 void setPreviousSibling(Display::Box&); 69 void setFirstChild(Display::Box&); 70 void setLastChild(Display::Box&); 71 72 Display::Box* parent(); 73 Display::Box* nextSibling(); 74 Display::Box* previousSibling(); 75 Display::Box* firstChild(); 76 Display::Box* lastChild(); 77 }; 78 } 79 */ 26 80 var Display = { } 27 81 -
trunk/Tools/LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js
r230621 r230656 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 26 /* 27 class BlockFormattingContext : public FormattingContext { 28 public: 29 void layout() override; 30 31 void computeWidth(const Layout::Box&) override; 32 void computeHeight(const Layout::Box&) override; 33 34 void marginTop(const Layout::Box&) override; 35 void marginBottom(const Layout::Box&) override; 36 37 private: 38 void computeStaticPosition(const Layout::Box&); 39 void computeInFlowHeight(const Layout::Box&); 40 void horizontalConstraint(const Layout::Box&); 41 void contentHeight(const Layout::Box&); 42 }; 43 */ 44 25 45 class BlockFormattingContext extends FormattingContext { 26 46 constructor(blockFormattingState) { -
trunk/Tools/LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js
r229664 r230656 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 /* 26 class BlockMarginCollapse { 27 public: 28 LayoutUnit marginTop(const Layout::Box&); 29 LayoutUnit marginBottom(const Layout::Box&); 30 31 private: 32 bool isMarginTopCollapsedWithSibling(const Layout::Box&); 33 bool isMarginBottomCollapsedWithSibling(const Layout::Box&); 34 bool isMarginTopCollapsedWithParent(const Layout::Box&); 35 bool isMarginBottomCollapsedWithParent(const Layout::Box&); 36 37 LayoutUnit nonCollapsedMarginTop(const Layout::Box&); 38 LayoutUnit nonCollapsedMarginBottom(const Layout::Box&); 39 LayoutUnit collapsedMarginTopFromFirstChild(const Layout::Box&); 40 LayoutUnit collapsedMarginBottomFromLastChild(const Layout::Box&); 41 LayoutUnit marginValue(currentMarginValue, candidateMarginValue); 42 43 bool hasAdjoiningMarginTopAndBottom(const Layout::Box&); 44 }; 45 */ 25 46 class BlockMarginCollapse { 26 47 -
trunk/Tools/LayoutReloaded/FormattingContext/FloatingContext.js
r230300 r230656 24 24 */ 25 25 26 /* 27 class FloatingContext { 28 public: 29 void computePosition(Layout::Box&); 30 LayoutUnit left(LayoutUnit verticalPosition); 31 LayoutUnit right(LayoutUnit verticalPosition); 32 LayoutUnit bottom(); 33 34 private: 35 LayoutPoint positionForFloating(const Layout::Box&); 36 LayoutPoint positionForClear(const Layout::Box&); 37 LayoutPoint computePositionToAvoidIntrudingFloats(const Layout::Box&); 38 }; 39 */ 26 40 // All geometry here is absolute to the formatting context's root. 27 41 class FloatingContext { -
trunk/Tools/LayoutReloaded/FormattingContext/FormattingContext.js
r230621 r230656 24 24 */ 25 25 26 /* 27 class FormattingContext { 28 public: 29 Layout::Container& formattingRoot(); 30 FormattingState& formattingState(); 31 LayoutState& layoutState(); 32 FloatingContext& floatingContext(); 33 34 virtual void layout(); 35 36 virtual void computeWidth(const Layout::Box&); 37 virtual void computeHeight(const Layout::Box&); 38 39 virtual LayoutUnit marginTop(const Layout::Box&); 40 virtual LayoutUnit marginLeft(const Layout::Box&); 41 virtual LayoutUnit marginBottom(const Layout::Box&); 42 virtual LayoutUnit marginRight(const Layout::Box&); 43 44 private: 45 void computeFloatingWidth(const Layout::Box&); 46 void computeFloatingHeight(const Layout::Box&); 47 48 void placeInFlowPositionedChildren(const Layout::Box&); 49 void computeInFlowPositionedPosition(const Layout::Box&); 50 void computeInFlowWidth(const Layout::Box&); 51 52 void layoutOutOfFlowDescendants(); 53 54 void computeOutOfFlowWidth(const Layout::Box&); 55 void computeOutOfFlowHeight(const Layout::Box&); 56 void computeOutOfFlowPosition(const Layout::Box&); 57 58 LayoutUnit shrinkToFitWidth(Layout::Box&); 59 }; 60 */ 26 61 class FormattingContext { 27 62 constructor(formattingState) { -
trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js
r230621 r230656 24 24 */ 25 25 26 /* 27 class InlineFormattingContext { 28 public: 29 void layout() override; 30 31 private: 32 void handleInlineContainer(const Layout::Container&); 33 void handleInlineBlockContainer(const Layout::Container&); 34 void handleInlineContent(const Layout::Box&); 35 void handleInlineBox(const Layout::InlineBox&); 36 void handleText(const Layout::InlineBox&); 37 void handleFloatingBox(const Layout::Box&); 38 }; 39 */ 26 40 class InlineFormattingContext extends FormattingContext { 27 41 constructor(inlineFormattingState) { -
trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/Line.js
r230464 r230656 24 24 */ 25 25 26 /* 27 class Line { 28 public: 29 bool isEmpty(); 30 31 LayoutUnit availableWidth(); 32 33 LayoutRect rect(); 34 lineBoxes(); 35 36 shrink(float width); 37 adjustWithOffset(LayoutUnit offset); 38 moveContentHorizontally(LayoutUnit offset); 39 addInlineContainerBox(LayoutSize); 40 addTextLineBox(unsigned startPosition, unsigned endPosition, LayoutSize size); 41 }; 42 */ 26 43 class Line { 27 44 constructor(topLeft, height, availableWidth) { -
trunk/Tools/LayoutReloaded/FormattingState/BlockFormattingState.js
r230075 r230656 24 24 */ 25 25 26 /* 27 class BlockFormattingState : public FormattingState { 28 29 }; 30 */ 26 31 class BlockFormattingState extends FormattingState { 27 32 constructor(formattingRoot, layoutState) { -
trunk/Tools/LayoutReloaded/FormattingState/FloatingState.js
r230138 r230656 24 24 */ 25 25 26 /* 27 class FloatingState { 28 public: 29 addFloating(Display::Box&, bool isFloatingLeft) { 30 Vector<Display::Box&> leftFloatingStack(); 31 Vector<Display::Box&> rightFloatingStack(); 32 Display::Box& lastFloating(); 33 34 FormattingState& formattingState(); 35 }; 36 */ 26 37 class FloatingState { 27 38 constructor(parentFormattingState) { -
trunk/Tools/LayoutReloaded/FormattingState/FormattingState.js
r230655 r230656 24 24 */ 25 25 26 /* 27 class FormattingState { 28 public: 29 Layout::Container& formattingRoot(); 30 LayoutState& layoutState(); 31 FloatingState& floatingState(); 32 Display::Box& createDisplayBox(const Layout::Box&); 33 34 Vector<Display::Box&> displayBoxes(); 35 Display::Box& displayBox(const Layout::Box&); 36 37 void markNeedsLayout(const Layout::Box&); 38 void clearNeedsLayout(const Layout::Box&); 39 bool needsLayout(const Layout::Box&); 40 41 bool needsLayout(); 42 }; 43 */ 26 44 class FormattingState { 27 45 constructor(layoutState, formattingRoot) { -
trunk/Tools/LayoutReloaded/FormattingState/InlineFormattingState.js
r230140 r230656 24 24 */ 25 25 26 /* 27 class InlineFormattingState : public FormattingState { 28 public: 29 Vector<Line> lines(); 30 void appendLine(Line); 31 }; 32 */ 26 33 class InlineFormattingState extends FormattingState { 27 34 constructor(formattingRoot, layoutState) { -
trunk/Tools/LayoutReloaded/LayoutState.js
r230655 r230656 23 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 24 */ 25 26 /* 27 class LayoutState { 28 public: 29 Container& rootContainer(); 30 31 FormattingContext& formattingContext(const Layout::Container& formattingRoot); 32 FormattingState& establishedFormattingState(const Layout::Container& formattingRoot); 33 FormattingState& formattingStateForBox(const Layout::Box&); 34 35 Display::Box* displayBox(const Layout::Box&); 36 37 void markNeedsLayout(const Layout::Box&); 38 bool needsLayout(); 39 }; 40 */ 25 41 26 42 class LayoutState { -
trunk/Tools/LayoutReloaded/LayoutTree/BlockContainer.js
r229623 r230656 24 24 */ 25 25 26 /* 27 namespace Layout { 28 class BlockContainer : public Continer { 29 public: 30 bool establishesInlineFormattingContext() final; 31 }; 32 } 33 */ 26 34 Layout.BlockContainer = class BlockContainer extends Layout.Container { 27 35 constructor(node, id) { -
trunk/Tools/LayoutReloaded/LayoutTree/Box.js
r230580 r230656 24 24 */ 25 25 26 /* 27 namespace Layout { 28 class Box { 29 public: 30 Layout::Container& parent(); 31 Layout::Box* nextSibling(); 32 Layout::Box* nextInFlowSibling(); 33 Layout::Box* nextInFlowOrFloatSibling(); 34 Layout::Box* previousSibling(); 35 Layout::Box* previousInFlowSibling(); 36 37 void setParent(Layout::Container&); 38 void setNextSibling(Layout::Box&); 39 void setPreviousSibling(Layout::Box&); 40 41 bool isContainer(); 42 bool isInlineContainer(); 43 bool isInlineBox(); 44 bool isBlockLevelBox(); 45 bool isBlockContainerBox(); 46 bool isInlineBlockBox(); 47 bool isInlineLevelBox(); 48 49 void setIsAnonymous(bool); 50 bool isAnonymous(); 51 52 bool establishesFormattingContext(); 53 bool establishesBlockFormattingContext(); 54 bool establishesInlineFormattingContext(); 55 56 bool isPositioned(); 57 bool isRelativelyPositioned(); 58 bool isAbsolutelyPositioned(); 59 bool isFixedPositioned(); 60 bool isInFlow(); 61 bool isOutOfFlowPositioned(); 62 bool isInFlowPositioned(); 63 bool isFloatingPositioned(); 64 bool isFloatingOrOutOfFlowPositioned(); 65 bool isRootBox(); 66 Layout::Container* containingBlock(); 67 bool isDescendantOf(Layout::Container&); 68 }; 69 } 70 */ 71 26 72 var Layout = { } 27 73 -
trunk/Tools/LayoutReloaded/LayoutTree/Container.js
r230580 r230656 24 24 */ 25 25 26 /* 27 namespace Layout { 28 class Container : public Box { 29 public: 30 setFirstChild(Layout::Box&); 31 setLastChild(Layout::Box&); 32 33 Layout::Box* firstChild(); 34 Layout::Box* firstInFlowChild(); 35 Layout::Box* firstInFlowOrFloatChild(); 36 Layout::Box* lastChild(); 37 Layout::Box* lastInFlowChild(); 38 39 bool hasChild(); 40 bool hasInFlowChild(); 41 bool hasInFlowOrFloatChild(); 42 43 Vector<Layout::Box&> outOfFlowDescendants(); 44 }; 45 } 46 */ 26 47 Layout.Container = class Container extends Layout.Box { 27 48 constructor(node, id) { -
trunk/Tools/LayoutReloaded/LayoutTree/InlineBox.js
r229623 r230656 24 24 */ 25 25 26 /* 27 namespace Layout { 28 class InlineBox : public Box { 29 public: 30 setText(const String&); 31 const String& text(); 32 }; 33 } 34 */ 26 35 Layout.InlineBox = class InlineBox extends Layout.Box { 27 36 constructor(node, id) { -
trunk/Tools/LayoutReloaded/LayoutTree/InlineContainer.js
r230373 r230656 24 24 */ 25 25 26 /* 27 namespace Layout { 28 class InlineContainer : public Container { 29 public: 30 31 }; 32 } 33 */ 26 34 Layout.InlineContainer = class InlineContainer extends Layout.Container { 27 35 constructor(node, id) { -
trunk/Tools/LayoutReloaded/LayoutTree/Text.js
r230023 r230656 24 24 */ 25 25 26 /* 27 namespace Layout { 28 class Text { 29 public: 30 const String& content(); 31 LayoutUnit length(); 32 }; 33 } 34 */ 26 35 class Text { 27 36 constructor(node, id, inlineBox) {
Note: See TracChangeset
for help on using the changeset viewer.