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

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

Issue 2727233005: Remove calls to styleForLayoutObject() in LayoutTreeBuilder::style() (Closed)
Patch Set: Created 3 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
Index: third_party/WebKit/Source/core/editing/EditingUtilities.cpp
diff --git a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
index c4fd9c04fa9072c1e1cc67fcd884951b81944d23..938482c99be4adab23803faf9df6327df92a0e93 100644
--- a/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
+++ b/third_party/WebKit/Source/core/editing/EditingUtilities.cpp
@@ -316,18 +316,18 @@ static bool hasEditableLevel(const Node& node, EditableLevel editableLevel) {
// would fire in the middle of Document::setFocusedNode().
for (const Node& ancestor : NodeTraversal::inclusiveAncestorsOf(node)) {
- if ((ancestor.isHTMLElement() || ancestor.isDocumentNode()) &&
- ancestor.layoutObject()) {
- switch (ancestor.layoutObject()->style()->userModify()) {
- case READ_ONLY:
- return false;
- case READ_WRITE:
- return true;
- case READ_WRITE_PLAINTEXT_ONLY:
- return editableLevel != RichlyEditable;
- }
- NOTREACHED();
- return false;
+ if (!ancestor.isHTMLElement() && !ancestor.isDocumentNode())
+ continue;
+ const ComputedStyle* style = ancestor.computedStyle();
+ if (!style)
+ continue;
+ switch (style->userModify()) {
+ case READ_ONLY:
+ return false;
+ case READ_WRITE:
+ return true;
+ case READ_WRITE_PLAINTEXT_ONLY:
+ return editableLevel != RichlyEditable;
}
}
« no previous file with comments | « third_party/WebKit/Source/core/dom/NodeComputedStyle.h ('k') | third_party/WebKit/Source/core/html/HTMLObjectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698