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

Side by Side Diff: third_party/WebKit/Source/core/editing/FrameSelection.cpp

Issue 2709503003: Expand FrameSeleciton::isContentEditable() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-22T08:13:55 rebase Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2008, 2009, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 HTMLSelectElement* selectElement = 623 HTMLSelectElement* selectElement =
624 toHTMLSelectElement(document().focusedElement()); 624 toHTMLSelectElement(document().focusedElement());
625 if (selectElement->canSelectAll()) { 625 if (selectElement->canSelectAll()) {
626 selectElement->selectAll(); 626 selectElement->selectAll();
627 return; 627 return;
628 } 628 }
629 } 629 }
630 630
631 Node* root = nullptr; 631 Node* root = nullptr;
632 Node* selectStartTarget = nullptr; 632 Node* selectStartTarget = nullptr;
633 if (isContentEditable()) { 633 if (computeVisibleSelectionInDOMTreeDeprecated().isContentEditable()) {
634 root = highestEditableRoot( 634 root = highestEditableRoot(
635 computeVisibleSelectionInDOMTreeDeprecated().start()); 635 computeVisibleSelectionInDOMTreeDeprecated().start());
636 if (Node* shadowRoot = nonBoundaryShadowTreeRootNode( 636 if (Node* shadowRoot = nonBoundaryShadowTreeRootNode(
637 computeVisibleSelectionInDOMTreeDeprecated().start())) 637 computeVisibleSelectionInDOMTreeDeprecated().start()))
638 selectStartTarget = shadowRoot->ownerShadowHost(); 638 selectStartTarget = shadowRoot->ownerShadowHost();
639 else 639 else
640 selectStartTarget = root; 640 selectStartTarget = root;
641 } else { 641 } else {
642 root = nonBoundaryShadowTreeRootNode( 642 root = nonBoundaryShadowTreeRootNode(
643 computeVisibleSelectionInDOMTreeDeprecated().start()); 643 computeVisibleSelectionInDOMTreeDeprecated().start());
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
1179 } 1179 }
1180 1180
1181 void showTree(const blink::FrameSelection* sel) { 1181 void showTree(const blink::FrameSelection* sel) {
1182 if (sel) 1182 if (sel)
1183 sel->showTreeForThis(); 1183 sel->showTreeForThis();
1184 else 1184 else
1185 LOG(INFO) << "Cannot showTree for <null> FrameSelection."; 1185 LOG(INFO) << "Cannot showTree for <null> FrameSelection.";
1186 } 1186 }
1187 1187
1188 #endif 1188 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698