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

Side by Side Diff: Source/core/editing/htmlediting.cpp

Issue 18313005: Introduce isHTMLTableElement and toHTMLTableElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Retry Created 7 years, 5 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
« no previous file with comments | « Source/core/editing/InsertLineBreakCommand.cpp ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 28 matching lines...) Expand all
39 #include "core/editing/HTMLInterchange.h" 39 #include "core/editing/HTMLInterchange.h"
40 #include "core/editing/TextIterator.h" 40 #include "core/editing/TextIterator.h"
41 #include "core/editing/VisiblePosition.h" 41 #include "core/editing/VisiblePosition.h"
42 #include "core/editing/VisibleSelection.h" 42 #include "core/editing/VisibleSelection.h"
43 #include "core/editing/VisibleUnits.h" 43 #include "core/editing/VisibleUnits.h"
44 #include "core/html/HTMLBRElement.h" 44 #include "core/html/HTMLBRElement.h"
45 #include "core/html/HTMLDivElement.h" 45 #include "core/html/HTMLDivElement.h"
46 #include "core/html/HTMLLIElement.h" 46 #include "core/html/HTMLLIElement.h"
47 #include "core/html/HTMLOListElement.h" 47 #include "core/html/HTMLOListElement.h"
48 #include "core/html/HTMLParagraphElement.h" 48 #include "core/html/HTMLParagraphElement.h"
49 #include "core/html/HTMLTableElement.h"
49 #include "core/html/HTMLUListElement.h" 50 #include "core/html/HTMLUListElement.h"
50 #include "core/page/Frame.h" 51 #include "core/page/Frame.h"
51 #include "core/rendering/RenderObject.h" 52 #include "core/rendering/RenderObject.h"
52 #include <wtf/Assertions.h> 53 #include <wtf/Assertions.h>
53 #include <wtf/StdLibExtras.h> 54 #include <wtf/StdLibExtras.h>
54 #include <wtf/unicode/CharacterNames.h> 55 #include <wtf/unicode/CharacterNames.h>
55 56
56 using namespace std; 57 using namespace std;
57 58
58 namespace WebCore { 59 namespace WebCore {
(...skipping 1103 matching lines...) Expand 10 before | Expand all | Expand 10 after
1162 return false; 1163 return false;
1163 1164
1164 return firstElement->hasEquivalentAttributes(secondElement); 1165 return firstElement->hasEquivalentAttributes(secondElement);
1165 } 1166 }
1166 1167
1167 bool isNonTableCellHTMLBlockElement(const Node* node) 1168 bool isNonTableCellHTMLBlockElement(const Node* node)
1168 { 1169 {
1169 return node->hasTagName(listingTag) 1170 return node->hasTagName(listingTag)
1170 || node->hasTagName(olTag) 1171 || node->hasTagName(olTag)
1171 || node->hasTagName(preTag) 1172 || node->hasTagName(preTag)
1172 || node->hasTagName(tableTag) 1173 || isHTMLTableElement(node)
1173 || node->hasTagName(ulTag) 1174 || node->hasTagName(ulTag)
1174 || node->hasTagName(xmpTag) 1175 || node->hasTagName(xmpTag)
1175 || node->hasTagName(h1Tag) 1176 || node->hasTagName(h1Tag)
1176 || node->hasTagName(h2Tag) 1177 || node->hasTagName(h2Tag)
1177 || node->hasTagName(h3Tag) 1178 || node->hasTagName(h3Tag)
1178 || node->hasTagName(h4Tag) 1179 || node->hasTagName(h4Tag)
1179 || node->hasTagName(h5Tag); 1180 || node->hasTagName(h5Tag);
1180 } 1181 }
1181 1182
1182 Position adjustedSelectionStartForStyleComputation(const VisibleSelection& selec tion) 1183 Position adjustedSelectionStartForStyleComputation(const VisibleSelection& selec tion)
(...skipping 15 matching lines...) Expand all
1198 // if the selection starts just before a paragraph break, skip over it 1199 // if the selection starts just before a paragraph break, skip over it
1199 if (isEndOfParagraph(visiblePosition)) 1200 if (isEndOfParagraph(visiblePosition))
1200 return visiblePosition.next().deepEquivalent().downstream(); 1201 return visiblePosition.next().deepEquivalent().downstream();
1201 1202
1202 // otherwise, make sure to be at the start of the first selected node, 1203 // otherwise, make sure to be at the start of the first selected node,
1203 // instead of possibly at the end of the last node before the selection 1204 // instead of possibly at the end of the last node before the selection
1204 return visiblePosition.deepEquivalent().downstream(); 1205 return visiblePosition.deepEquivalent().downstream();
1205 } 1206 }
1206 1207
1207 } // namespace WebCore 1208 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/editing/InsertLineBreakCommand.cpp ('k') | Source/core/editing/markup.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698