| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2005, 2006, 2008 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 class EditingStyle; | 33 class EditingStyle; |
| 34 | 34 |
| 35 class InsertParagraphSeparatorCommand final : public CompositeEditCommand { | 35 class InsertParagraphSeparatorCommand final : public CompositeEditCommand { |
| 36 public: | 36 public: |
| 37 static PassRefPtr<InsertParagraphSeparatorCommand> create(Document& document
, bool useDefaultParagraphElement = false, bool pasteBlockquoteIntoUnquotedArea
= false) | 37 static PassRefPtr<InsertParagraphSeparatorCommand> create(Document& document
, bool useDefaultParagraphElement = false, bool pasteBlockquoteIntoUnquotedArea
= false) |
| 38 { | 38 { |
| 39 return adoptRef(new InsertParagraphSeparatorCommand(document, useDefault
ParagraphElement, pasteBlockquoteIntoUnquotedArea)); | 39 return adoptRef(new InsertParagraphSeparatorCommand(document, useDefault
ParagraphElement, pasteBlockquoteIntoUnquotedArea)); |
| 40 } | 40 } |
| 41 | 41 |
| 42 virtual void trace(Visitor*) override; | |
| 43 | |
| 44 private: | 42 private: |
| 45 InsertParagraphSeparatorCommand(Document&, bool useDefaultParagraphElement,
bool pasteBlockquoteIntoUnquotedArea); | 43 InsertParagraphSeparatorCommand(Document&, bool useDefaultParagraphElement,
bool pasteBlockquoteIntoUnquotedArea); |
| 46 | 44 |
| 47 virtual void doApply() override; | 45 virtual void doApply() override; |
| 48 | 46 |
| 49 void calculateStyleBeforeInsertion(const Position&); | 47 void calculateStyleBeforeInsertion(const Position&); |
| 50 void getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock,
Vector<RefPtr<Element> >& ancestors); | 48 void getAncestorsInsideBlock(const Node* insertionNode, Element* outerBlock,
Vector<RefPtr<Element> >& ancestors); |
| 51 PassRefPtr<Element> cloneHierarchyUnderNewBlock(const Vector<RefPtr<Element>
>& ancestors, PassRefPtr<Element> blockToInsert); | 49 PassRefPtr<Element> cloneHierarchyUnderNewBlock(const Vector<RefPtr<Element>
>& ancestors, PassRefPtr<Element> blockToInsert); |
| 52 | 50 |
| 53 bool shouldUseDefaultParagraphElement(Element*) const; | 51 bool shouldUseDefaultParagraphElement(Element*) const; |
| 54 | 52 |
| 55 virtual bool preservesTypingStyle() const override; | 53 virtual bool preservesTypingStyle() const override; |
| 56 | 54 |
| 57 RefPtr<EditingStyle> m_style; | 55 RefPtr<EditingStyle> m_style; |
| 58 | 56 |
| 59 bool m_mustUseDefaultParagraphElement; | 57 bool m_mustUseDefaultParagraphElement; |
| 60 }; | 58 }; |
| 61 | 59 |
| 62 } | 60 } |
| 63 | 61 |
| 64 #endif | 62 #endif |
| OLD | NEW |