Changeset 32353 in webkit
- Timestamp:
- Apr 21, 2008 3:48:41 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r32352 r32353 1 2008-04-21 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by John Sullivan. 4 5 <rdar://problem/5803706> Pressing return at the end of a header doesn't break out of header (17460) 6 7 * editing/inserting/5803706-1-expected.txt: Added. 8 * editing/inserting/5803706-1.html: Added. 9 * editing/inserting/5803706-2-expected.txt: Added. 10 * editing/inserting/5803706-2.html: Added. 11 1 12 2008-04-21 Mark Rowe <mrowe@apple.com> 2 13 -
trunk/WebCore/ChangeLog
r32351 r32353 1 2008-04-21 Justin Garcia <justin.garcia@apple.com> 2 3 Reviewed by John Sullivan. 4 5 <rdar://problem/5803706> Pressing return at the end of a header doesn't break out of header (17460) 6 7 If we're doing InsertParagraphSeparator at the end of a header element, do not clone it. 8 Renamed m_useDefaultParagraphElement to m_mustUseDefaultParagraphElement, since now, 9 when it is false, that does not necessarily mean that a default paragraph element 10 will not be used. Callers that passed false for this argument are OK with this. 11 12 * editing/InsertParagraphSeparatorCommand.cpp: 13 (WebCore::InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand): 14 (WebCore::InsertParagraphSeparatorCommand::shouldUseDefaultParagraphElement): 15 (WebCore::InsertParagraphSeparatorCommand::doApply): 16 * editing/InsertParagraphSeparatorCommand.h: 17 1 18 2008-04-21 Anders Carlsson <andersca@apple.com> 2 19 -
trunk/WebCore/editing/InsertParagraphSeparatorCommand.cpp
r30016 r32353 43 43 using namespace HTMLNames; 44 44 45 InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand(Document *document, bool useDefaultParagraphElement)45 InsertParagraphSeparatorCommand::InsertParagraphSeparatorCommand(Document *document, bool mustUseDefaultParagraphElement) 46 46 : CompositeEditCommand(document) 47 , m_ useDefaultParagraphElement(useDefaultParagraphElement)47 , m_mustUseDefaultParagraphElement(mustUseDefaultParagraphElement) 48 48 { 49 49 } … … 77 77 if (m_style->length() > 0) 78 78 applyStyle(m_style.get()); 79 } 80 81 bool InsertParagraphSeparatorCommand::shouldUseDefaultParagraphElement(Node* enclosingBlock) const 82 { 83 if (m_mustUseDefaultParagraphElement) 84 return true; 85 86 // Assumes that if there was a range selection, it was already deleted. 87 if (!isEndOfBlock(endingSelection().visibleStart())) 88 return false; 89 90 return enclosingBlock->hasTagName(h1Tag) || 91 enclosingBlock->hasTagName(h2Tag) || 92 enclosingBlock->hasTagName(h3Tag) || 93 enclosingBlock->hasTagName(h4Tag) || 94 enclosingBlock->hasTagName(h5Tag); 79 95 } 80 96 … … 140 156 blockToInsert = static_pointer_cast<Node>(createDefaultParagraphElement(document())); 141 157 nestNewBlock = true; 142 } else if ( m_useDefaultParagraphElement)158 } else if (shouldUseDefaultParagraphElement(startBlock)) 143 159 blockToInsert = static_pointer_cast<Node>(createDefaultParagraphElement(document())); 144 160 else -
trunk/WebCore/editing/InsertParagraphSeparatorCommand.h
r25327 r32353 40 40 void calculateStyleBeforeInsertion(const Position&); 41 41 void applyStyleAfterInsertion(); 42 43 bool shouldUseDefaultParagraphElement(Node*) const; 42 44 43 45 virtual bool preservesTypingStyle() const; … … 45 47 RefPtr<CSSMutableStyleDeclaration> m_style; 46 48 47 bool m_ useDefaultParagraphElement;49 bool m_mustUseDefaultParagraphElement; 48 50 }; 49 51
Note: See TracChangeset
for help on using the changeset viewer.