Skip to content
Permalink
Browse files
Mark more InlineBox member functions as const
https://bugs.webkit.org/show_bug.cgi?id=178217

Reviewed by Andy Estes.

* rendering/InlineBox.cpp:
(WebCore::InlineBox::locationIncludingFlipping const): Mark as const. Also fix some style
nits while I am here.
(WebCore::InlineBox::flipForWritingMode const): Mark as const.
(WebCore::InlineBox::locationIncludingFlipping): Deleted.
(WebCore::InlineBox::flipForWritingMode): Deleted.
* rendering/InlineBox.h:

Canonical link: https://commits.webkit.org/194477@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@223260 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
dydz committed Oct 12, 2017
1 parent 698ba85 commit e1f6536ae292e22b4ebb7dc79500612a46a79c03
Showing 3 changed files with 28 additions and 14 deletions.
@@ -1,3 +1,18 @@
2017-10-12 Daniel Bates <dabates@apple.com>

Mark more InlineBox member functions as const
https://bugs.webkit.org/show_bug.cgi?id=178217

Reviewed by Andy Estes.

* rendering/InlineBox.cpp:
(WebCore::InlineBox::locationIncludingFlipping const): Mark as const. Also fix some style
nits while I am here.
(WebCore::InlineBox::flipForWritingMode const): Mark as const.
(WebCore::InlineBox::locationIncludingFlipping): Deleted.
(WebCore::InlineBox::flipForWritingMode): Deleted.
* rendering/InlineBox.h:

2017-10-12 Daniel Bates <dabates@apple.com>

Teach InlineTextBox::clampOffset() about combined text and hyphenation
@@ -288,39 +288,38 @@ void InlineBox::clearKnownToHaveNoOverflow()
parent()->clearKnownToHaveNoOverflow();
}

FloatPoint InlineBox::locationIncludingFlipping()
FloatPoint InlineBox::locationIncludingFlipping() const
{
if (!m_renderer.style().isFlippedBlocksWritingMode())
return FloatPoint(x(), y());
return topLeft();
RenderBlockFlow& block = root().blockFlow();
if (block.style().isHorizontalWritingMode())
return FloatPoint(x(), block.height() - height() - y());
else
return FloatPoint(block.width() - width() - x(), y());
return { x(), block.height() - height() - y() };
return { block.width() - width() - x(), y() };
}

void InlineBox::flipForWritingMode(FloatRect& rect)
void InlineBox::flipForWritingMode(FloatRect& rect) const
{
if (!m_renderer.style().isFlippedBlocksWritingMode())
return;
root().blockFlow().flipForWritingMode(rect);
}

FloatPoint InlineBox::flipForWritingMode(const FloatPoint& point)
FloatPoint InlineBox::flipForWritingMode(const FloatPoint& point) const
{
if (!m_renderer.style().isFlippedBlocksWritingMode())
return point;
return root().blockFlow().flipForWritingMode(point);
}

void InlineBox::flipForWritingMode(LayoutRect& rect)
void InlineBox::flipForWritingMode(LayoutRect& rect) const
{
if (!m_renderer.style().isFlippedBlocksWritingMode())
return;
root().blockFlow().flipForWritingMode(rect);
}

LayoutPoint InlineBox::flipForWritingMode(const LayoutPoint& point)
LayoutPoint InlineBox::flipForWritingMode(const LayoutPoint& point) const
{
if (!m_renderer.style().isFlippedBlocksWritingMode())
return point;
@@ -254,11 +254,11 @@ class InlineBox {
return nullptr;
}

FloatPoint locationIncludingFlipping();
void flipForWritingMode(FloatRect&);
FloatPoint flipForWritingMode(const FloatPoint&);
void flipForWritingMode(LayoutRect&);
LayoutPoint flipForWritingMode(const LayoutPoint&);
FloatPoint locationIncludingFlipping() const;
void flipForWritingMode(FloatRect&) const;
FloatPoint flipForWritingMode(const FloatPoint&) const;
void flipForWritingMode(LayoutRect&) const;
LayoutPoint flipForWritingMode(const LayoutPoint&) const;

bool knownToHaveNoOverflow() const { return m_bitfields.knownToHaveNoOverflow(); }
void clearKnownToHaveNoOverflow();

0 comments on commit e1f6536

Please sign in to comment.