Skip to content
Permalink
Browse files
Correct LayoutUnit usage in VisiblePosition.cpp
https://bugs.webkit.org/show_bug.cgi?id=81775

Reviewed by Eric Seidel.

Correcting a mismatch between the .h and .cpp for the definition of localCaretRect,
and properly using LayoutUnits for local coordinates.

No new tests. No change in behavior.

* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::localCaretRect): Switching to return a LayoutRect, as in the
header. Local coordinates are in LayoutUnits.
(WebCore::VisiblePosition::absoluteCaretBounds): Using LayoutRect for the localCaretRect.
(WebCore::VisiblePosition::lineDirectionPointForBlockDirectionNavigation): Ditto.


Canonical link: https://commits.webkit.org/99116@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@111613 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
leviw committed Mar 21, 2012
1 parent 1b4e61f commit 6626ef6c3c7792b7c803740d027f7a60e143368a
Showing 2 changed files with 22 additions and 4 deletions.
@@ -1,3 +1,21 @@
2012-03-21 Levi Weintraub <leviw@chromium.org>

Correct LayoutUnit usage in VisiblePosition.cpp
https://bugs.webkit.org/show_bug.cgi?id=81775

Reviewed by Eric Seidel.

Correcting a mismatch between the .h and .cpp for the definition of localCaretRect,
and properly using LayoutUnits for local coordinates.

No new tests. No change in behavior.

* editing/VisiblePosition.cpp:
(WebCore::VisiblePosition::localCaretRect): Switching to return a LayoutRect, as in the
header. Local coordinates are in LayoutUnits.
(WebCore::VisiblePosition::absoluteCaretBounds): Using LayoutRect for the localCaretRect.
(WebCore::VisiblePosition::lineDirectionPointForBlockDirectionNavigation): Ditto.

2012-03-21 Adam Klein <adamk@chromium.org>

"this" argument for MutationCallbacks should be the MutationObserver
@@ -595,7 +595,7 @@ UChar32 VisiblePosition::characterAfter() const
return ch;
}

IntRect VisiblePosition::localCaretRect(RenderObject*& renderer) const
LayoutRect VisiblePosition::localCaretRect(RenderObject*& renderer) const
{
if (m_deepPosition.isNull()) {
renderer = 0;
@@ -605,7 +605,7 @@ IntRect VisiblePosition::localCaretRect(RenderObject*& renderer) const

renderer = node->renderer();
if (!renderer)
return IntRect();
return LayoutRect();

InlineBox* inlineBox;
int caretOffset;
@@ -620,7 +620,7 @@ IntRect VisiblePosition::localCaretRect(RenderObject*& renderer) const
IntRect VisiblePosition::absoluteCaretBounds() const
{
RenderObject* renderer;
IntRect localRect = localCaretRect(renderer);
LayoutRect localRect = localCaretRect(renderer);
if (localRect.isEmpty() || !renderer)
return IntRect();

@@ -630,7 +630,7 @@ IntRect VisiblePosition::absoluteCaretBounds() const
int VisiblePosition::lineDirectionPointForBlockDirectionNavigation() const
{
RenderObject* renderer;
IntRect localRect = localCaretRect(renderer);
LayoutRect localRect = localCaretRect(renderer);
if (localRect.isEmpty() || !renderer)
return 0;

0 comments on commit 6626ef6

Please sign in to comment.