LayoutTests/ChangeLog

 12010-10-12 Sheriff Bot <webkit.review.bot@gmail.com>
 2
 3 Unreviewed, rolling out r69639.
 4 http://trac.webkit.org/changeset/69639
 5 https://bugs.webkit.org/show_bug.cgi?id=47575
 6
 7 "regressed nav-element.html" (Requested by rniwa on #webkit).
 8
 9 * editing/execCommand/format-block-expected.txt:
 10 * editing/execCommand/format-block-from-range-selection-expected.txt:
 11 * editing/execCommand/format-block-multiple-paragraphs-expected.txt: Removed.
 12 * editing/execCommand/format-block-multiple-paragraphs.html: Removed.
 13 * editing/execCommand/format-block-table-expected.txt: Removed.
 14 * editing/execCommand/format-block-table.html: Removed.
 15 * editing/execCommand/format-block-with-braces-expected.txt:
 16
1172010-10-12 Ryosuke Niwa <rniwa@webkit.org>
218
319 Reviewed by Tony Chang.

LayoutTests/editing/execCommand/format-block-expected.txt

@@After FormatBlock:
5252"
5353| <pre>
5454| "Make Pre"
 55| <br>
5556| "
5657"
5758| <br>

@@After FormatBlock:
6162| "Foo"
6263| <br>
6364| <h1>
64 | <span>
65 | id="item2"
66 | "Make h1"
 65| "Make h1"
 66| <br>
6767| "baz"
6868| "
6969"

LayoutTests/editing/execCommand/format-block-from-range-selection-expected.txt

@@after FormatBlock:
3232"
3333| <dl>
3434| "Fo<#selection-anchor>o"
35 | <br>
36 | "bar"
37 | <br>
38 | <span>
39 | "baz"
40 | <br>
41 | "raz"
42 | <br>
43 | "
44 dar"
45 | <br>
46 | "
47 "
48 | "yar<#selection-focus>"
4935| "
5036"
 37| <div>
 38| <dl>
 39| "bar"
 40| <span>
 41| <dl>
 42| "baz"
 43| <dl>
 44| "raz"
 45| <dl>
 46| "dar"
 47| " "
5148| "
5249"
 50| <dl>
 51| "ya<#selection-focus>r"
5352| "
5453"

LayoutTests/editing/execCommand/format-block-multiple-paragraphs-expected.txt

1 This tests ensures formatBlock do not make multiple elements when formatting multiple paragraphs.
2 
3 Formatting:
4 | "
5 "
6 | <div>
7 | "<#selection-anchor>hello"
8 | <div>
9 | "world"
10 | <div>
11 | "WebKit<#selection-focus>"
12 | "
13 "
14 
15 by p yields:
16 | "
17 "
18 | <p>
19 | "<#selection-anchor>hello"
20 | <br>
21 | "world"
22 | <br>
23 | "WebKit<#selection-focus>"
24 | "
25 "
26 
27 Formatting:
28 | "
29 "
30 | <p>
31 | "<#selection-anchor>hello"
32 | <p>
33 | "world<#selection-focus>"
34 | "
35 "
36 
37 by blockquote yields:
38 | "
39 "
40 | <blockquote>
41 | "<#selection-anchor>hello"
42 | <br>
43 | "world<#selection-focus>"
44 | "
45 "
46 
47 Formatting:
48 | "
49 "
50 | <div>
51 | "<#selection-anchor>hello"
52 | <pre>
53 | "world<#selection-focus>"
54 | "
55 "
56 
57 by p yields:
58 | "
59 "
60 | <div>
61 | <p>
62 | "<#selection-anchor>hello"
63 | <br>
64 | "world<#selection-focus>"
65 | "
66 "
67 
68 Formatting:
69 | "
70 "
71 | <h1>
72 | "<#selection-anchor>hello"
73 | <div>
74 | <h2>
75 | "world"
76 | <h3>
77 | "WebKit<#selection-focus>"
78 | "
79 "
80 
81 by pre yields:
82 | "
83 "
84 | <pre>
85 | "<#selection-anchor>hello"
86 | <br>
87 | "world"
88 | <br>
89 | "WebKit<#selection-focus>"
90 | "
91 "
92 
93 Formatting:
94 | "
95 "
96 | <div>
97 | "hello"
98 | <p>
99 | "<#selection-anchor>world"
100 | "webki<#selection-focus>t"
101 | "
102 "
103 
104 by h1 yields:
105 | "
106 "
107 | <div>
108 | "hello"
109 | <h1>
110 | "<#selection-anchor>world"
111 | <br>
112 | "webkit<#selection-focus>"
113 | "
114 "
115 
116 Formatting:
117 | "
118 "
119 | <pre>
120 | "<#selection-anchor>hello
121 world<#selection-focus>
122 webkit
123 "
124 | "
125 "
126 
127 by blockquote yields:
128 | "
129 "
130 | <pre>
131 | <blockquote>
132 | "<#selection-anchor>hello"
133 | <br>
134 | "world<#selection-focus>"
135 | <br>
136 | "webkit"
137 | "
138 "
139 
140 Formatting:
141 | "
142 "
143 | <pre>
144 | "hello
145 <#selection-anchor>world
146 webki<#selection-focus>t
147 "
148 | "
149 "
150 
151 by blockquote yields:
152 | "
153 "
154 | <pre>
155 | "hello
156 "
157 | <blockquote>
158 | "<#selection-anchor>world"
159 | <br>
160 | "webki<#selection-focus>t"
161 | "
162 "
163 
164 Formatting:
165 | "
166 <#selection-anchor>hello"
167 | <p>
168 | "world<#selection-focus>"
169 | <p>
170 | "webkit"
171 | "
172 
173 "
174 
175 by pre yields:
176 | <pre>
177 | "<#selection-anchor>
178 hello"
179 | <br>
180 | "worl<#selection-focus>d"
181 | <p>
182 | "webkit"
183 | "
184 
185 "
186 
187 Formatting:
188 | "
189 "
190 | <div>
191 | "hello"
192 | <div>
193 | "<#selection-anchor>world"
194 | <div>
195 | "webki<#selection-focus>t"
196 | "
197 "
198 
199 by pre yields:
200 | "
201 "
202 | <div>
203 | "hello"
204 | <pre>
205 | "<#selection-anchor>world"
206 | <br>
207 | "webki<#selection-focus>t"
208 | "
209 "
210 
211 Formatting:
212 | "
213 "
214 | <ul>
215 | <li>
216 | "<#selection-anchor>hello"
217 | <li>
218 | "world<#selection-focus>"
219 | "
220 "
221 
222 by blockquote yields:
223 | "
224 "
225 | <blockquote>
226 | <ul>
227 | <li>
228 | "<#selection-anchor>hello"
229 | <ul>
230 | <li>
231 | "world<#selection-focus>"
232 | "
233 "

LayoutTests/editing/execCommand/format-block-multiple-paragraphs.html

1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/dump-as-markup.js"></script>
5 <div id="test0" contenteditable>
6 <div>hello</div><div>world</div><div>WebKit</div>
7 </div>
8 <div id="test1" contenteditable>
9 <p>hello</p><p>world</p>
10 </div>
11 <div id="test2" contenteditable>
12 <div>hello<pre>world</pre></div>
13 </div>
14 <div id="test3" contenteditable>
15 <h1>hello</h1><div><h2>world</h2><h3>WebKit</h3></div>
16 </div>
17 <div id="test4" contenteditable>
18 <div>hello<p>world</p>webkit</div>
19 </div>
20 <div id="test5" contenteditable>
21 <pre>hello
22 world
23 webkit
24 </pre>
25 </div>
26 <div id="test6" contenteditable>
27 <pre>hello
28 world
29 webkit
30 </pre>
31 </div>
32 <div id="test7" contenteditable>
33 hello<p>world</p><p>webkit</p>
34 </pre>
35 </div>
36 <div id="test8" contenteditable>
37 <div>hello</div><div>world</div><div>webkit</div>
38 </div>
39 <div id="test9" contenteditable>
40 <ul><li>hello</li><li>world</li></ul>
41 </div>
42 <script>
43 
44 Markup.description('This tests ensures formatBlock do not make multiple elements when formatting multiple paragraphs.')
45 
46 function testIndentation(containerId, selector, value) {
47  var container = document.getElementById(containerId);
48  selector(container);
49  Markup.dump(container, 'Formatting');
50  document.execCommand('FormatBlock', false, value);
51  Markup.dump(container, 'by ' + value + ' yields');
52 }
53 
54 function selectAll(container) {
55  window.getSelection().selectAllChildren(container);
56 }
57 
58 function selectorForLines(first, last) {
59  return function (container) {
60  window.getSelection().setPosition(container, 0);
61  for (var i = 0; i < first - 1; i++)
62  window.getSelection().modify('move', 'forward', 'line');
63  for (var i = 0; i < Math.abs(last - first, 0) + 1; i++)
64  window.getSelection().modify('extend', 'forward', 'line');
65  window.getSelection().modify('extend', 'backward', 'character');
66  }
67 }
68 
69 testIndentation('test0', selectAll, 'p');
70 testIndentation('test1', selectAll, 'blockquote');
71 testIndentation('test2', selectAll, 'p');
72 testIndentation('test3', selectAll, 'pre');
73 testIndentation('test4', selectorForLines(2, 3), 'h1');
74 testIndentation('test5', selectorForLines(1, 2), 'blockquote');
75 testIndentation('test6', selectorForLines(2, 3), 'blockquote');
76 testIndentation('test7', selectorForLines(1, 2), 'pre');
77 testIndentation('test8', selectorForLines(2, 3), 'pre');
78 testIndentation('test9', selectAll, 'blockquote');
79 
80 </script>
81 </body>
82 </html>

LayoutTests/editing/execCommand/format-block-table-expected.txt

1 
2 Formatting:
3 | "
4 "
5 | <table>
6 | <tbody>
7 | <tr>
8 | <td>
9 | "hello"
10 | <td>
11 | "world"
12 | "
13 "
14 
15 by p yields:
16 | "
17 "
18 | <p>
19 | <#selection-anchor>
20 | <table>
21 | <tbody>
22 | <tr>
23 | <td>
24 | "hello"
25 | <td>
26 | "world"
27 | <#selection-focus>
28 | "
29 "
30 
31 Formatting:
32 | "
33 "
34 | <table>
35 | <tbody>
36 | <tr>
37 | <td>
38 | "<#selection-anchor>hello<#selection-focus>"
39 | <td>
40 | "world"
41 | "
42 "
43 
44 by blockquote yields:
45 | "
46 "
47 | <table>
48 | <tbody>
49 | <tr>
50 | <td>
51 | <blockquote>
52 | "<#selection-anchor>hello<#selection-focus>"
53 | <td>
54 | "world"
55 | "
56 "
57 
58 Formatting:
59 | "
60 "
61 | <table>
62 | <tbody>
63 | <tr>
64 | <td>
65 | <p>
66 | "<#selection-anchor>hello"
67 | <div>
68 | "world<#selection-focus>"
69 | <td>
70 | "WebKit"
71 | "
72 "
73 
74 by h3 yields:
75 | "
76 "
77 | <table>
78 | <tbody>
79 | <tr>
80 | <td>
81 | <h3>
82 | "<#selection-anchor>hello"
83 | <br>
84 | "world<#selection-focus>"
85 | <td>
86 | "WebKit"
87 | "
88 "
89 
90 Formatting:
91 | "
92 "
93 | <table>
94 | <tbody>
95 | <tr>
96 | <td>
97 | <ul>
98 | <li>
99 | "<#selection-anchor>hello"
100 | <li>
101 | "world<#selection-focus>"
102 | <td>
103 | "WebKit"
104 | "
105 "
106 
107 by address yields:
108 | "
109 "
110 | <table>
111 | <tbody>
112 | <tr>
113 | <td>
114 | <address>
115 | <ul>
116 | <li>
117 | "<#selection-anchor>hello"
118 | <ul>
119 | <li>
120 | "world<#selection-focus>"
121 | <td>
122 | "WebKit"
123 | "
124 "

LayoutTests/editing/execCommand/format-block-table.html

1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../resources/dump-as-markup.js"></script>
5 <div id="test0" contenteditable>
6 <table><tr><td>hello</td><td>world</td></tr></table>
7 </div>
8 <div id="test1" contenteditable>
9 <table><tr><td>hello</td><td>world</td></tr></table>
10 </div>
11 <div id="test2" contenteditable>
12 <table><tr><td><p>hello</p><div>world</div></td><td>WebKit</td></tr></table>
13 </div>
14 <div id="test3" contenteditable>
15 <table><tr><td><ul><li>hello</li><li>world</li></ul></td><td>WebKit</td></tr></table>
16 </div>
17 <script>
18 
19 function testIndentation(containerId, selector, value) {
20  var container = document.getElementById(containerId);
21  selector(container);
22  Markup.dump(container, 'Formatting');
23  document.execCommand('FormatBlock', false, value);
24  Markup.dump(container, 'by ' + value + ' yields');
25 }
26 
27 function selectAll(container) {
28  window.getSelection().selectAllChildren(container);
29 }
30 
31 function selectFirstCell(container) {
32  window.getSelection().selectAllChildren(container.getElementsByTagName('td')[0]);
33 }
34 
35 testIndentation('test0', selectAll, 'p');
36 testIndentation('test1', selectFirstCell, 'blockquote');
37 testIndentation('test2', selectFirstCell, 'h3');
38 testIndentation('test3', selectFirstCell, 'address');
39 
40 </script>
41 </body>
42 </html>

LayoutTests/editing/execCommand/format-block-with-braces-expected.txt

@@Format Me
1616
1717After FormatBlock with <h1>:
1818| <h1>
19 | "
20 <#selection-caret>Format Me
21 "
 19| "<#selection-caret>Format Me"
 20| <br>

WebCore/ChangeLog

 12010-10-12 Sheriff Bot <webkit.review.bot@gmail.com>
 2
 3 Unreviewed, rolling out r69639.
 4 http://trac.webkit.org/changeset/69639
 5 https://bugs.webkit.org/show_bug.cgi?id=47575
 6
 7 "regressed nav-element.html" (Requested by rniwa on #webkit).
 8
 9 * editing/ApplyBlockElementCommand.cpp:
 10 (WebCore::ApplyBlockElementCommand::formatSelection):
 11 * editing/EditorCommand.cpp:
 12 (WebCore::executeFormatBlock):
 13 * editing/FormatBlockCommand.cpp:
 14 (WebCore::FormatBlockCommand::formatRange):
 15 * editing/FormatBlockCommand.h:
 16 (WebCore::FormatBlockCommand::editingAction):
 17 * editing/VisiblePosition.cpp:
 18 (WebCore::enclosingBlockFlowElement):
 19 * editing/VisiblePosition.h:
 20 * editing/htmlediting.cpp:
 21 (WebCore::validBlockTag):
 22 * editing/htmlediting.h:
 23
1242010-10-12 Ryosuke Niwa <rniwa@webkit.org>
225
326 Reviewed by Tony Chang.

WebCore/editing/ApplyBlockElementCommand.cpp

@@void ApplyBlockElementCommand::formatSelection(const VisiblePosition& startOfSel
112112 VisiblePosition endOfLastParagraph = endOfParagraph(endOfSelection);
113113
114114 bool atEnd = false;
115  Position end;
116115 while (endOfCurrentParagraph != endAfterSelection && !atEnd) {
 116 Position start;
 117 Position end;
 118
117119 if (endOfCurrentParagraph == endOfLastParagraph)
118120 atEnd = true;
119121

WebCore/editing/EditorCommand.cpp

@@static bool executeFormatBlock(Frame* frame, Event*, EditorCommandSource, const
432432 String tagName = value.lower();
433433 if (tagName[0] == '<' && tagName[tagName.length() - 1] == '>')
434434 tagName = tagName.substring(1, tagName.length() - 2);
 435 if (!validBlockTag(tagName))
 436 return false;
435437
436438 ExceptionCode ec;
437439 String localName, prefix;

@@static bool executeFormatBlock(Frame* frame, Event*, EditorCommandSource, const
439441 return false;
440442 QualifiedName qualifiedTagName(prefix, localName, xhtmlNamespaceURI);
441443
442  if (!FormatBlockCommand::isElementToApplyInFormatBlockCommand(qualifiedTagName))
443  return false;
444 
445444 applyCommand(FormatBlockCommand::create(frame->document(), qualifiedTagName));
446445 return true;
447446}

WebCore/editing/FormatBlockCommand.cpp

@@namespace WebCore {
3636
3737using namespace HTMLNames;
3838
39 static Node* enclosingBlockToSplitTreeTo(Node* startNode);
40 
4139FormatBlockCommand::FormatBlockCommand(Document* document, const QualifiedName& tagName)
4240 : ApplyBlockElementCommand(document, tagName)
4341{
4442}
4543
46 void FormatBlockCommand::formatRange(const Position& start, const Position& end, RefPtr<Element>& blockNode)
 44void FormatBlockCommand::formatRange(const Position&, const Position& end, RefPtr<Element>&)
4745{
48  Node* nodeToSplitTo = enclosingBlockToSplitTreeTo(start.node());
49  RefPtr<Node> outerBlock = (start.node() == nodeToSplitTo) ? start.node() : splitTreeToNode(start.node(), nodeToSplitTo);
50  RefPtr<Node> nodeAfterInsertionPosition = outerBlock;
51 
52  Element* refNode = enclosingBlockFlowElement(end);
53  Element* root = editableRootForPosition(start);
54  if (isElementToApplyInFormatBlockCommand(refNode->tagQName()) && start == startOfBlock(start) && end == endOfBlock(end)
55  && refNode != root && !root->isDescendantOf(refNode)) {
56  // Already in a block element that only contains the current paragraph
57  if (refNode->hasTagName(tagName()))
58  return;
59  nodeAfterInsertionPosition = refNode;
60  }
61 
62  if (!blockNode) {
63  // Create a new blockquote and insert it as a child of the root editable element. We accomplish
64  // this by splitting all parents of the current paragraph up to that point.
65  blockNode = createBlockElement();
66  insertNodeBefore(blockNode, nodeAfterInsertionPosition);
67  }
 46 setEndingSelection(VisiblePosition(end));
6847
69  Position lastParagraphInBlockNode = lastPositionInNode(blockNode.get());
70  bool wasEndOfParagraph = isEndOfParagraph(lastParagraphInBlockNode);
 48 Node* refNode = enclosingBlockFlowElement(endingSelection().visibleStart());
 49 if (refNode->hasTagName(tagName()))
 50 // We're already in a block with the format we want, so we don't have to do anything
 51 return;
7152
72  moveParagraphWithClones(start, end, blockNode.get(), outerBlock.get());
 53 VisiblePosition paragraphStart = startOfParagraph(end);
 54 VisiblePosition paragraphEnd = endOfParagraph(end);
 55 VisiblePosition blockStart = startOfBlock(endingSelection().visibleStart());
 56 VisiblePosition blockEnd = endOfBlock(endingSelection().visibleStart());
 57 RefPtr<Element> blockNode = createBlockElement();
 58 RefPtr<Element> placeholder = createBreakElement(document());
7359
74  if (wasEndOfParagraph && !isEndOfParagraph(lastParagraphInBlockNode) && !isStartOfParagraph(lastParagraphInBlockNode))
75  insertBlockPlaceholder(lastParagraphInBlockNode);
76 }
77 
78 // FIXME: We should consider mering this function with isElementForFormatBlockCommand in Editor.cpp
79 // Checks if a tag name is valid for execCommand('FormatBlock').
80 bool FormatBlockCommand::isElementToApplyInFormatBlockCommand(const QualifiedName& tagName)
81 {
82  DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, blockTags, ());
83  if (blockTags.isEmpty()) {
84  blockTags.add(addressTag);
85  blockTags.add(articleTag);
86  blockTags.add(asideTag);
87  blockTags.add(blockquoteTag);
88  blockTags.add(ddTag);
89  blockTags.add(divTag);
90  blockTags.add(dlTag);
91  blockTags.add(dtTag);
92  blockTags.add(footerTag);
93  blockTags.add(h1Tag);
94  blockTags.add(h2Tag);
95  blockTags.add(h3Tag);
96  blockTags.add(h4Tag);
97  blockTags.add(h5Tag);
98  blockTags.add(h6Tag);
99  blockTags.add(headerTag);
100  blockTags.add(hgroupTag);
101  blockTags.add(navTag);
102  blockTags.add(pTag);
103  blockTags.add(preTag);
104  blockTags.add(sectionTag);
 60 Node* root = endingSelection().start().node()->rootEditableElement();
 61 if (validBlockTag(refNode->nodeName().lower()) &&
 62 paragraphStart == blockStart && paragraphEnd == blockEnd &&
 63 refNode != root && !root->isDescendantOf(refNode))
 64 // Already in a valid block tag that only contains the current paragraph, so we can swap with the new tag
 65 insertNodeBefore(blockNode, refNode);
 66 else {
 67 // Avoid inserting inside inline elements that surround paragraphStart with upstream().
 68 // This is only to avoid creating bloated markup.
 69 insertNodeAt(blockNode, paragraphStart.deepEquivalent().upstream());
10570 }
106  return blockTags.contains(tagName);
107 }
 71 appendNode(placeholder, blockNode);
10872
109 Node* enclosingBlockToSplitTreeTo(Node* startNode)
110 {
111  Node* lastBlock = startNode;
112  for (Node* n = startNode; n; n = n->parentNode()) {
113  if (!n->isContentEditable())
114  return lastBlock;
115  if (isTableCell(n) || n->hasTagName(bodyTag) || !n->parentNode() || !n->parentNode()->isContentEditable()
116  || (n->isElementNode() && FormatBlockCommand::isElementToApplyInFormatBlockCommand(static_cast<Element*>(n)->tagQName())))
117  return n;
118  if (isBlock(n))
119  lastBlock = n;
120  if (isListElement(n))
121  return n->parentNode()->isContentEditable() ? n->parentNode() : n;
 73 VisiblePosition destination(Position(placeholder.get(), 0));
 74 if (paragraphStart == paragraphEnd && !lineBreakExistsAtVisiblePosition(paragraphStart)) {
 75 setEndingSelection(destination);
 76 return;
12277 }
123  return lastBlock;
 78 moveParagraph(paragraphStart, paragraphEnd, destination, true, false);
12479}
12580
12681}

WebCore/editing/FormatBlockCommand.h

@@public:
3838 return adoptRef(new FormatBlockCommand(document, tagName));
3939 }
4040
41  static bool isElementToApplyInFormatBlockCommand(const QualifiedName& tagName);
42 
4341private:
4442 FormatBlockCommand(Document*, const QualifiedName& tagName);
4543
46  void formatRange(const Position&, const Position&, RefPtr<Element>&);
47  EditAction editingAction() const { return EditActionFormatBlock; }
 44 virtual void formatRange(const Position&, const Position&, RefPtr<Element>&);
 45 virtual EditAction editingAction() const { return EditActionFormatBlock; }
4846};
4947
5048} // namespace WebCore

WebCore/editing/VisiblePosition.cpp

@@bool setEnd(Range *r, const VisiblePosition &visiblePosition)
634634 return code == 0;
635635}
636636
637 Element* enclosingBlockFlowElement(const VisiblePosition &visiblePosition)
 637Node *enclosingBlockFlowElement(const VisiblePosition &visiblePosition)
638638{
639639 if (visiblePosition.isNull())
640640 return NULL;

WebCore/editing/VisiblePosition.h

@@bool setEnd(Range*, const VisiblePosition&);
136136VisiblePosition startVisiblePosition(const Range*, EAffinity);
137137VisiblePosition endVisiblePosition(const Range*, EAffinity);
138138
139 Element* enclosingBlockFlowElement(const VisiblePosition&);
 139Node *enclosingBlockFlowElement(const VisiblePosition&);
140140
141141bool isFirstVisiblePositionInNode(const VisiblePosition&, const Node*);
142142bool isLastVisiblePositionInNode(const VisiblePosition&, const Node*);

WebCore/editing/htmlediting.cpp

@@bool isSpecialElement(const Node *n)
465465 return false;
466466}
467467
 468// Checks if a string is a valid tag for the FormatBlockCommand function of execCommand. Expects lower case strings.
 469bool validBlockTag(const AtomicString& blockTag)
 470{
 471 if (blockTag.isEmpty())
 472 return false;
 473
 474 DEFINE_STATIC_LOCAL(HashSet<AtomicString>, blockTags, ());
 475 if (blockTags.isEmpty()) {
 476 blockTags.add(addressTag.localName());
 477 blockTags.add(articleTag.localName());
 478 blockTags.add(asideTag.localName());
 479 blockTags.add(blockquoteTag.localName());
 480 blockTags.add(ddTag.localName());
 481 blockTags.add(divTag.localName());
 482 blockTags.add(dlTag.localName());
 483 blockTags.add(dtTag.localName());
 484 blockTags.add(footerTag.localName());
 485 blockTags.add(h1Tag.localName());
 486 blockTags.add(h2Tag.localName());
 487 blockTags.add(h3Tag.localName());
 488 blockTags.add(h4Tag.localName());
 489 blockTags.add(h5Tag.localName());
 490 blockTags.add(h6Tag.localName());
 491 blockTags.add(headerTag.localName());
 492 blockTags.add(hgroupTag.localName());
 493 blockTags.add(navTag.localName());
 494 blockTags.add(pTag.localName());
 495 blockTags.add(preTag.localName());
 496 blockTags.add(sectionTag.localName());
 497 }
 498 return blockTags.contains(blockTag);
 499}
 500
468501static Node* firstInSpecialElement(const Position& pos)
469502{
470503 // FIXME: This begins at pos.node(), which doesn't necessarily contain pos (suppose pos was [img, 0]). See <rdar://problem/5027702>.

WebCore/editing/htmlediting.h

@@VisibleSelection selectionForParagraphIteration(const VisibleSelection&);
228228
229229String stringWithRebalancedWhitespace(const String&, bool, bool);
230230const String& nonBreakingSpaceString();
 231bool validBlockTag(const AtomicString&);
 232
231233
232234}
233235