Changeset 230656 in webkit


Ignore:
Timestamp:
Apr 13, 2018 9:48:35 PM (6 years ago)
Author:
Alan Bujtas
Message:

[LayoutReloaded] Update class documentation
https://bugs.webkit.org/show_bug.cgi?id=184625

Reviewed by Antti Koivisto.

  • LayoutReloaded/DisplayTree/Box.js:
  • LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js:
  • LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js:
  • LayoutReloaded/FormattingContext/FloatingContext.js:
  • LayoutReloaded/FormattingContext/FormattingContext.js:
  • LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js:
  • LayoutReloaded/FormattingContext/InlineFormatting/Line.js:
  • LayoutReloaded/FormattingState/BlockFormattingState.js:
  • LayoutReloaded/FormattingState/FloatingState.js:
  • LayoutReloaded/FormattingState/FormattingState.js:
  • LayoutReloaded/FormattingState/InlineFormattingState.js:
  • LayoutReloaded/LayoutState.js:
  • LayoutReloaded/LayoutTree/BlockContainer.js:
  • LayoutReloaded/LayoutTree/Box.js:
  • LayoutReloaded/LayoutTree/Container.js:
  • LayoutReloaded/LayoutTree/InlineBox.js:
  • LayoutReloaded/LayoutTree/InlineContainer.js:
  • LayoutReloaded/LayoutTree/Text.js:
  • LayoutReloaded/misc/headers/BlockContainer.h: Removed.
  • LayoutReloaded/misc/headers/BlockFormattingContext.h: Removed.
  • LayoutReloaded/misc/headers/BlockMarginCollapse.h: Removed.
  • LayoutReloaded/misc/headers/Box.h: Removed.
  • LayoutReloaded/misc/headers/Container.h: Removed.
  • LayoutReloaded/misc/headers/FloatingContext.h: Removed.
  • LayoutReloaded/misc/headers/FormattingContext.h: Removed.
  • LayoutReloaded/misc/headers/InitialBlockContainer.h: Removed.
  • LayoutReloaded/misc/headers/InlineBox.h: Removed.
  • LayoutReloaded/misc/headers/LayoutContext.h: Removed.
  • LayoutReloaded/misc/headers/Line.h: Removed.
  • LayoutReloaded/misc/headers/Text.h: Removed.
Location:
trunk/Tools
Files:
1 deleted
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/Tools/ChangeLog

    r230655 r230656  
     12018-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
    1392018-04-13  Zalan Bujtas  <zalan@apple.com>
    240
  • trunk/Tools/LayoutReloaded/DisplayTree/Box.js

    r230138 r230656  
    2424 */
    2525
     26/*
     27namespace Display {
     28class 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*/
    2680var Display = { }
    2781
  • trunk/Tools/LayoutReloaded/FormattingContext/BlockFormatting/BlockFormattingContext.js

    r230621 r230656  
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
     25
     26/*
     27class BlockFormattingContext : public FormattingContext {
     28public:
     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
     37private:
     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
    2545class BlockFormattingContext extends FormattingContext {
    2646    constructor(blockFormattingState) {
  • trunk/Tools/LayoutReloaded/FormattingContext/BlockFormatting/BlockMarginCollapse.js

    r229664 r230656  
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
     25/*
     26class BlockMarginCollapse {
     27public:
     28    LayoutUnit marginTop(const Layout::Box&);
     29    LayoutUnit marginBottom(const Layout::Box&);
     30
     31private:
     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*/
    2546class BlockMarginCollapse {
    2647
  • trunk/Tools/LayoutReloaded/FormattingContext/FloatingContext.js

    r230300 r230656  
    2424 */
    2525
     26/*
     27class FloatingContext {
     28public:
     29    void computePosition(Layout::Box&);
     30    LayoutUnit left(LayoutUnit verticalPosition);
     31    LayoutUnit right(LayoutUnit verticalPosition);
     32    LayoutUnit bottom();
     33
     34private:
     35    LayoutPoint positionForFloating(const Layout::Box&);
     36    LayoutPoint positionForClear(const Layout::Box&);
     37    LayoutPoint computePositionToAvoidIntrudingFloats(const Layout::Box&);
     38};
     39*/
    2640// All geometry here is absolute to the formatting context's root.
    2741class FloatingContext {
  • trunk/Tools/LayoutReloaded/FormattingContext/FormattingContext.js

    r230621 r230656  
    2424 */
    2525
     26/*
     27class FormattingContext {
     28public:
     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
     44private:
     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*/
    2661class FormattingContext {
    2762    constructor(formattingState) {
  • trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/InlineFormattingContext.js

    r230621 r230656  
    2424 */
    2525
     26/*
     27class InlineFormattingContext {
     28public:
     29    void layout() override;
     30
     31private:
     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*/
    2640class InlineFormattingContext extends FormattingContext {
    2741    constructor(inlineFormattingState) {
  • trunk/Tools/LayoutReloaded/FormattingContext/InlineFormatting/Line.js

    r230464 r230656  
    2424 */
    2525
     26/*
     27class Line {
     28public:
     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*/
    2643class Line {
    2744    constructor(topLeft, height, availableWidth) {
  • trunk/Tools/LayoutReloaded/FormattingState/BlockFormattingState.js

    r230075 r230656  
    2424 */
    2525
     26/*
     27class BlockFormattingState : public FormattingState {
     28
     29};
     30*/
    2631class BlockFormattingState extends FormattingState {
    2732    constructor(formattingRoot, layoutState) {
  • trunk/Tools/LayoutReloaded/FormattingState/FloatingState.js

    r230138 r230656  
    2424 */
    2525
     26/*
     27class FloatingState {
     28public:
     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*/
    2637class FloatingState {
    2738    constructor(parentFormattingState) {
  • trunk/Tools/LayoutReloaded/FormattingState/FormattingState.js

    r230655 r230656  
    2424 */
    2525
     26/*
     27class FormattingState {
     28public:
     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*/
    2644class FormattingState {
    2745    constructor(layoutState, formattingRoot) {
  • trunk/Tools/LayoutReloaded/FormattingState/InlineFormattingState.js

    r230140 r230656  
    2424 */
    2525
     26/*
     27class InlineFormattingState : public FormattingState {
     28public:
     29    Vector<Line> lines();
     30    void appendLine(Line);
     31};
     32*/
    2633class InlineFormattingState extends FormattingState {
    2734    constructor(formattingRoot, layoutState) {
  • trunk/Tools/LayoutReloaded/LayoutState.js

    r230655 r230656  
    2323 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
     25
     26/*
     27class LayoutState {
     28public:
     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*/
    2541
    2642class LayoutState {
  • trunk/Tools/LayoutReloaded/LayoutTree/BlockContainer.js

    r229623 r230656  
    2424 */
    2525
     26/*
     27namespace Layout {
     28class BlockContainer : public Continer {
     29public:
     30    bool establishesInlineFormattingContext() final;
     31};
     32}
     33*/
    2634Layout.BlockContainer = class BlockContainer extends Layout.Container {
    2735    constructor(node, id) {
  • trunk/Tools/LayoutReloaded/LayoutTree/Box.js

    r230580 r230656  
    2424 */
    2525
     26/*
     27namespace Layout {
     28class Box {
     29public:
     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
    2672var Layout = { }
    2773
  • trunk/Tools/LayoutReloaded/LayoutTree/Container.js

    r230580 r230656  
    2424 */
    2525
     26/*
     27namespace Layout {
     28class Container : public Box {
     29public:
     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*/
    2647Layout.Container = class Container extends Layout.Box {
    2748    constructor(node, id) {
  • trunk/Tools/LayoutReloaded/LayoutTree/InlineBox.js

    r229623 r230656  
    2424 */
    2525
     26/*
     27namespace Layout {
     28class InlineBox : public Box {
     29public:
     30    setText(const String&);
     31    const String& text();
     32};
     33}
     34*/
    2635Layout.InlineBox = class InlineBox extends Layout.Box {
    2736    constructor(node, id) {
  • trunk/Tools/LayoutReloaded/LayoutTree/InlineContainer.js

    r230373 r230656  
    2424 */
    2525
     26/*
     27namespace Layout {
     28class InlineContainer : public Container {
     29public:
     30
     31};
     32}
     33*/
    2634Layout.InlineContainer = class InlineContainer extends Layout.Container {
    2735    constructor(node, id) {
  • trunk/Tools/LayoutReloaded/LayoutTree/Text.js

    r230023 r230656  
    2424 */
    2525
     26/*
     27namespace Layout {
     28class Text {
     29public:
     30    const String& content();
     31    LayoutUnit length();
     32};
     33}
     34*/
    2635class Text {
    2736    constructor(node, id, inlineBox) {
Note: See TracChangeset for help on using the changeset viewer.