Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(690)

Side by Side Diff: sky/engine/core/rendering/RenderBox.h

Issue 683803006: Remove all writing mode function arguments and remove writing mode from RenderStyle. (Closed) Base URL: git@github.com:domokit/mojo.git@writingmode
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/rendering/InlineFlowBox.cpp ('k') | sky/engine/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2006, 2007 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 virtual LayoutUnit marginTop() const override { return m_marginBox.top(); } 287 virtual LayoutUnit marginTop() const override { return m_marginBox.top(); }
288 virtual LayoutUnit marginBottom() const override { return m_marginBox.bottom (); } 288 virtual LayoutUnit marginBottom() const override { return m_marginBox.bottom (); }
289 virtual LayoutUnit marginLeft() const override { return m_marginBox.left(); } 289 virtual LayoutUnit marginLeft() const override { return m_marginBox.left(); }
290 virtual LayoutUnit marginRight() const override { return m_marginBox.right() ; } 290 virtual LayoutUnit marginRight() const override { return m_marginBox.right() ; }
291 void setMarginTop(LayoutUnit margin) { m_marginBox.setTop(margin); } 291 void setMarginTop(LayoutUnit margin) { m_marginBox.setTop(margin); }
292 void setMarginBottom(LayoutUnit margin) { m_marginBox.setBottom(margin); } 292 void setMarginBottom(LayoutUnit margin) { m_marginBox.setBottom(margin); }
293 void setMarginLeft(LayoutUnit margin) { m_marginBox.setLeft(margin); } 293 void setMarginLeft(LayoutUnit margin) { m_marginBox.setLeft(margin); }
294 void setMarginRight(LayoutUnit margin) { m_marginBox.setRight(margin); } 294 void setMarginRight(LayoutUnit margin) { m_marginBox.setRight(margin); }
295 295
296 LayoutUnit marginLogicalLeft() const { return m_marginBox.logicalLeft(style( )->writingMode()); } 296 LayoutUnit marginLogicalLeft() const { return m_marginBox.logicalLeft(); }
297 LayoutUnit marginLogicalRight() const { return m_marginBox.logicalRight(styl e()->writingMode()); } 297 LayoutUnit marginLogicalRight() const { return m_marginBox.logicalRight(); }
298 298
299 virtual LayoutUnit marginBefore(const RenderStyle* overrideStyle = 0) const override final { return m_marginBox.before((overrideStyle ? overrideStyle : styl e())->writingMode()); } 299 virtual LayoutUnit marginBefore(const RenderStyle* overrideStyle = 0) const override final { return m_marginBox.before(); }
300 virtual LayoutUnit marginAfter(const RenderStyle* overrideStyle = 0) const o verride final { return m_marginBox.after((overrideStyle ? overrideStyle : style( ))->writingMode()); } 300 virtual LayoutUnit marginAfter(const RenderStyle* overrideStyle = 0) const o verride final { return m_marginBox.after(); }
301 virtual LayoutUnit marginStart(const RenderStyle* overrideStyle = 0) const o verride final 301 virtual LayoutUnit marginStart(const RenderStyle* overrideStyle = 0) const o verride final
302 { 302 {
303 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); 303 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style();
304 return m_marginBox.start(styleToUse->writingMode(), styleToUse->directio n()); 304 return m_marginBox.start(styleToUse->direction());
305 } 305 }
306 virtual LayoutUnit marginEnd(const RenderStyle* overrideStyle = 0) const ove rride final 306 virtual LayoutUnit marginEnd(const RenderStyle* overrideStyle = 0) const ove rride final
307 { 307 {
308 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); 308 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style();
309 return m_marginBox.end(styleToUse->writingMode(), styleToUse->direction( )); 309 return m_marginBox.end(styleToUse->direction());
310 } 310 }
311 void setMarginBefore(LayoutUnit value, const RenderStyle* overrideStyle = 0) { m_marginBox.setBefore((overrideStyle ? overrideStyle : style())->writingMode( ), value); } 311 void setMarginBefore(LayoutUnit value, const RenderStyle* overrideStyle = 0) { m_marginBox.setBefore(value); }
312 void setMarginAfter(LayoutUnit value, const RenderStyle* overrideStyle = 0) { m_marginBox.setAfter((overrideStyle ? overrideStyle : style())->writingMode(), value); } 312 void setMarginAfter(LayoutUnit value, const RenderStyle* overrideStyle = 0) { m_marginBox.setAfter(value); }
313 void setMarginStart(LayoutUnit value, const RenderStyle* overrideStyle = 0) 313 void setMarginStart(LayoutUnit value, const RenderStyle* overrideStyle = 0)
314 { 314 {
315 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); 315 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style();
316 m_marginBox.setStart(styleToUse->writingMode(), styleToUse->direction(), value); 316 m_marginBox.setStart(styleToUse->direction(), value);
317 } 317 }
318 void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0) 318 void setMarginEnd(LayoutUnit value, const RenderStyle* overrideStyle = 0)
319 { 319 {
320 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style(); 320 const RenderStyle* styleToUse = overrideStyle ? overrideStyle : style();
321 m_marginBox.setEnd(styleToUse->writingMode(), styleToUse->direction(), v alue); 321 m_marginBox.setEnd(styleToUse->direction(), value);
322 } 322 }
323 323
324 // The following five functions are used to implement collapsing margins. 324 // The following five functions are used to implement collapsing margins.
325 // All objects know their maximal positive and negative margins. The 325 // All objects know their maximal positive and negative margins. The
326 // formula for computing a collapsed margin is |maxPosMargin| - |maxNegmargi n|. 326 // formula for computing a collapsed margin is |maxPosMargin| - |maxNegmargi n|.
327 // For a non-collapsing box, such as a leaf element, this formula will simpl y return 327 // For a non-collapsing box, such as a leaf element, this formula will simpl y return
328 // the margin of the element. Blocks override the maxMarginBefore and maxMa rginAfter 328 // the margin of the element. Blocks override the maxMarginBefore and maxMa rginAfter
329 // methods. 329 // methods.
330 enum MarginSign { PositiveMargin, NegativeMargin }; 330 enum MarginSign { PositiveMargin, NegativeMargin };
331 virtual bool isSelfCollapsingBlock() const { return false; } 331 virtual bool isSelfCollapsingBlock() const { return false; }
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
520 void removeFloatingOrPositionedChildFromBlockLists(); 520 void removeFloatingOrPositionedChildFromBlockLists();
521 521
522 RenderLayer* enclosingFloatPaintingLayer() const; 522 RenderLayer* enclosingFloatPaintingLayer() const;
523 523
524 virtual int firstLineBoxBaseline() const { return -1; } 524 virtual int firstLineBoxBaseline() const { return -1; }
525 virtual int inlineBlockBaseline(LineDirectionMode) const { return -1; } // R eturns -1 if we should skip this box when computing the baseline of an inline-bl ock. 525 virtual int inlineBlockBaseline(LineDirectionMode) const { return -1; } // R eturns -1 if we should skip this box when computing the baseline of an inline-bl ock.
526 526
527 bool shrinkToAvoidFloats() const; 527 bool shrinkToAvoidFloats() const;
528 virtual bool avoidsFloats() const; 528 virtual bool avoidsFloats() const;
529 529
530 bool isWritingModeRoot() const { return !parent() || parent()->style()->writ ingMode() != style()->writingMode(); } 530 bool isWritingModeRoot() const { return false; }
531 531
532 bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloati ngOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBox(); } 532 bool isFlexItemIncludingDeprecated() const { return !isInline() && !isFloati ngOrOutOfFlowPositioned() && parent() && parent()->isFlexibleBox(); }
533 533
534 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const override; 534 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio nMode = PositionOnContainingLine) const override;
535 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const override; 535 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode , LinePositionMode = PositionOnContainingLine) const override;
536 536
537 virtual LayoutUnit offsetLeft() const override; 537 virtual LayoutUnit offsetLeft() const override;
538 virtual LayoutUnit offsetTop() const override; 538 virtual LayoutUnit offsetTop() const override;
539 539
540 LayoutPoint flipForWritingModeForChild(const RenderBox* child, const LayoutP oint&) const; 540 LayoutPoint flipForWritingModeForChild(const RenderBox* child, const LayoutP oint&) const;
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
783 if (UNLIKELY(inlineBoxWrapper() != 0)) 783 if (UNLIKELY(inlineBoxWrapper() != 0))
784 deleteLineBoxWrapper(); 784 deleteLineBoxWrapper();
785 } 785 }
786 786
787 ensureRareData().m_inlineBoxWrapper = boxWrapper; 787 ensureRareData().m_inlineBoxWrapper = boxWrapper;
788 } 788 }
789 789
790 } // namespace blink 790 } // namespace blink
791 791
792 #endif // RenderBox_h 792 #endif // RenderBox_h
OLDNEW
« no previous file with comments | « sky/engine/core/rendering/InlineFlowBox.cpp ('k') | sky/engine/core/rendering/RenderGrid.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698