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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleUnits.cpp

Issue 1815183002: [Layout API] Add LayoutItem.isBR() and use from editing/VisibleUnits (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/api/LayoutItem.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/VisibleUnits.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
index 150706e606f6151d00ddd38568493bacf6631963..0e62147626a93b29da7a6448491b0d3100df5b48 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnits.cpp
@@ -55,6 +55,7 @@
#include "core/layout/LayoutObject.h"
#include "core/layout/LayoutTextFragment.h"
#include "core/layout/LayoutView.h"
+#include "core/layout/api/LayoutItem.h"
#include "core/layout/api/LineLayoutAPIShim.h"
#include "core/layout/api/LineLayoutItem.h"
#include "core/layout/line/InlineIterator.h"
@@ -1510,20 +1511,21 @@ VisiblePositionTemplate<Strategy> startOfParagraphAlgorithm(const VisiblePositio
break;
}
LayoutObject* r = n->layoutObject();
- if (!r) {
+ LayoutItem ri = LayoutItem(r);
+ if (ri.isNull()) {
n = Strategy::previousPostOrder(*n, startBlock);
continue;
}
- const ComputedStyle& style = r->styleRef();
+ const ComputedStyle& style = ri.styleRef();
if (style.visibility() != VISIBLE) {
n = Strategy::previousPostOrder(*n, startBlock);
continue;
}
- if (r->isBR() || isEnclosingBlock(n))
+ if (ri.isBR() || isEnclosingBlock(n))
break;
- if (r->isText() && toLayoutText(r)->resolvedTextLength()) {
+ if (ri.isText() && toLayoutText(r)->resolvedTextLength()) {
ASSERT_WITH_SECURITY_IMPLICATION(n->isTextNode());
type = PositionAnchorType::OffsetInAnchor;
if (style.preserveNewline()) {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/api/LayoutItem.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698