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

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

Issue 2474603002: Don't include LayoutObject-derived headers where not needed. (Closed)
Patch Set: Created 4 years, 1 month 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, 2005, 2006, 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 #include "core/frame/LocalFrame.h" 49 #include "core/frame/LocalFrame.h"
50 #include "core/frame/UseCounter.h" 50 #include "core/frame/UseCounter.h"
51 #include "core/html/HTMLBRElement.h" 51 #include "core/html/HTMLBRElement.h"
52 #include "core/html/HTMLDivElement.h" 52 #include "core/html/HTMLDivElement.h"
53 #include "core/html/HTMLLIElement.h" 53 #include "core/html/HTMLLIElement.h"
54 #include "core/html/HTMLParagraphElement.h" 54 #include "core/html/HTMLParagraphElement.h"
55 #include "core/html/HTMLSpanElement.h" 55 #include "core/html/HTMLSpanElement.h"
56 #include "core/html/HTMLTableCellElement.h" 56 #include "core/html/HTMLTableCellElement.h"
57 #include "core/html/HTMLUListElement.h" 57 #include "core/html/HTMLUListElement.h"
58 #include "core/layout/LayoutObject.h" 58 #include "core/layout/LayoutObject.h"
59 #include "core/layout/LayoutTableCell.h"
60 #include "wtf/Assertions.h" 59 #include "wtf/Assertions.h"
61 #include "wtf/StdLibExtras.h" 60 #include "wtf/StdLibExtras.h"
62 #include "wtf/text/StringBuilder.h" 61 #include "wtf/text/StringBuilder.h"
63 #include "wtf/text/Unicode.h" 62 #include "wtf/text/Unicode.h"
64 63
65 namespace blink { 64 namespace blink {
66 65
67 using namespace HTMLNames; 66 using namespace HTMLNames;
68 67
69 namespace { 68 namespace {
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 if (layoutObject->isBR()) { 1493 if (layoutObject->isBR()) {
1495 layoutObject = layoutObject->parent(); 1494 layoutObject = layoutObject->parent();
1496 if (!layoutObject) 1495 if (!layoutObject)
1497 return false; 1496 return false;
1498 } 1497 }
1499 if (!layoutObject->isTableCell()) 1498 if (!layoutObject->isTableCell())
1500 return false; 1499 return false;
1501 1500
1502 // Check that the table cell contains no child layoutObjects except for 1501 // Check that the table cell contains no child layoutObjects except for
1503 // perhaps a single <br>. 1502 // perhaps a single <br>.
1504 LayoutObject* childLayoutObject = 1503 LayoutObject* childLayoutObject = layoutObject->slowFirstChild();
1505 toLayoutTableCell(layoutObject)->firstChild();
1506 if (!childLayoutObject) 1504 if (!childLayoutObject)
1507 return true; 1505 return true;
1508 if (!childLayoutObject->isBR()) 1506 if (!childLayoutObject->isBR())
1509 return false; 1507 return false;
1510 return !childLayoutObject->nextSibling(); 1508 return !childLayoutObject->nextSibling();
1511 } 1509 }
1512 1510
1513 HTMLElement* createDefaultParagraphElement(Document& document) { 1511 HTMLElement* createDefaultParagraphElement(Document& document) {
1514 switch (document.frame()->editor().defaultParagraphSeparator()) { 1512 switch (document.frame()->editor().defaultParagraphSeparator()) {
1515 case EditorParagraphSeparatorIsDiv: 1513 case EditorParagraphSeparatorIsDiv:
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after
2107 return InputType::DeleteWordBackward; 2105 return InputType::DeleteWordBackward;
2108 if (granularity == LineBoundary) 2106 if (granularity == LineBoundary)
2109 return InputType::DeleteLineBackward; 2107 return InputType::DeleteLineBackward;
2110 return InputType::DeleteContentBackward; 2108 return InputType::DeleteContentBackward;
2111 default: 2109 default:
2112 return InputType::None; 2110 return InputType::None;
2113 } 2111 }
2114 } 2112 }
2115 2113
2116 } // namespace blink 2114 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/ElementRareData.h ('k') | third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698