Changeset 157373 in webkit
- Timestamp:
- Oct 13, 2013, 9:00:10 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r157372 r157373 1 2013-10-13 Antti Koivisto <antti@apple.com> 2 3 Text::renderer() should return RenderText 4 https://bugs.webkit.org/show_bug.cgi?id=122729 5 6 Reviewed by Andreas Kling. 7 8 Tighten typing. 9 1 10 2013-10-13 Andreas Kling <akling@apple.com> 2 11 -
trunk/Source/WebCore/dom/Text.cpp
r155908 r157373 88 88 89 89 if (renderer()) 90 toRenderText(renderer())->setTextWithOffset(dataImpl(), 0, oldStr.length());90 renderer()->setTextWithOffset(dataImpl(), 0, oldStr.length()); 91 91 92 92 return newText.release(); -
trunk/Source/WebCore/dom/Text.h
r157044 r157373 52 52 virtual bool canContainRangeEndPoint() const OVERRIDE FINAL { return true; } 53 53 54 RenderText* renderer() const; 55 54 56 protected: 55 57 Text(Document& document, const String& data, ConstructionType type) … … 71 73 }; 72 74 73 inline bool isText(const Node& node) 74 { 75 return node.isTextNode(); 76 } 75 void isText(const Text&); // Catch unnecessary runtime check of type known at compile time. 76 void isText(const ContainerNode&); // Catch unnecessary runtime check of type known at compile time. 77 inline bool isText(const Node& node) { return node.isTextNode(); } 77 78 78 79 NODE_TYPE_CASTS(Text) -
trunk/Source/WebCore/editing/CompositeEditCommand.cpp
r157018 r157373 735 735 document().updateLayout(); 736 736 737 RenderText* textRenderer = t oRenderText(textNode->renderer());737 RenderText* textRenderer = textNode->renderer(); 738 738 if (!textRenderer) 739 739 return; -
trunk/Source/WebCore/editing/DeleteSelectionCommand.cpp
r157292 r157373 40 40 #include "NodeTraversal.h" 41 41 #include "RenderTableCell.h" 42 #include "RenderText.h" 42 43 #include "Text.h" 43 44 #include "VisibleUnits.h" -
trunk/Source/WebCore/editing/HTMLInterchange.cpp
r156527 r157373 28 28 29 29 #include "RenderElement.h" 30 #include "RenderText.h" 30 31 #include "Text.h" 31 32 #include "TextIterator.h" -
trunk/Source/WebCore/editing/InsertIntoTextNodeCommand.cpp
r154938 r157373 58 58 59 59 if (passwordEchoEnabled) { 60 RenderText* renderText = toRenderText(m_node->renderer());60 RenderText* renderText = m_node->renderer(); 61 61 if (renderText && renderText->isSecure()) 62 62 renderText->momentarilyRevealLastTypedCharacter(m_offset + m_text.length() - 1); -
trunk/Source/WebCore/editing/InsertLineBreakCommand.cpp
r156527 r157373 36 36 #include "Range.h" 37 37 #include "RenderElement.h" 38 #include "RenderText.h" 38 39 #include "Text.h" 39 40 #include "VisiblePosition.h" -
trunk/Source/WebCore/editing/InsertParagraphSeparatorCommand.cpp
r156289 r157373 35 35 #include "InsertLineBreakCommand.h" 36 36 #include "NodeTraversal.h" 37 #include "Render Object.h"37 #include "RenderText.h" 38 38 #include "Text.h" 39 39 #include "VisibleUnits.h" -
trunk/Source/WebCore/editing/ReplaceSelectionCommand.cpp
r157368 r157373 668 668 } 669 669 670 static inline bool nodeHasVisibleRenderText(Text*text)671 { 672 return text ->renderer() && toRenderText(text->renderer())->hasRenderedText();670 static inline bool hasRenderedText(const Text& text) 671 { 672 return text.renderer() && text.renderer()->hasRenderedText(); 673 673 } 674 674 … … 678 678 679 679 Node* lastLeafInserted = insertedNodes.lastLeafInserted(); 680 if (lastLeafInserted && lastLeafInserted->isTextNode() && ! nodeHasVisibleRenderText(toText(lastLeafInserted))680 if (lastLeafInserted && lastLeafInserted->isTextNode() && !hasRenderedText(toText(*lastLeafInserted)) 681 681 && !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted), selectTag) 682 682 && !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted), scriptTag)) { … … 688 688 // because it is a top level node in the fragment and the user can't insert into those elements. 689 689 Node* firstNodeInserted = insertedNodes.firstNodeInserted(); 690 if (firstNodeInserted && firstNodeInserted->isTextNode() && ! nodeHasVisibleRenderText(toText(firstNodeInserted))) {690 if (firstNodeInserted && firstNodeInserted->isTextNode() && !hasRenderedText(toText(*firstNodeInserted))) { 691 691 insertedNodes.willRemoveNode(firstNodeInserted); 692 692 removeNode(firstNodeInserted); -
trunk/Source/WebCore/page/Frame.cpp
r157056 r157373 78 78 #include "RegularExpression.h" 79 79 #include "RenderTableCell.h" 80 #include "RenderText.h" 80 81 #include "RenderTextControl.h" 81 82 #include "RenderTheme.h" -
trunk/Source/WebCore/rendering/RenderText.h
r157366 r157373 26 26 #include "RenderElement.h" 27 27 #include "RenderTextLineBoxes.h" 28 #include "Text.h" 28 29 #include <wtf/Forward.h> 29 30 … … 31 32 32 33 class InlineTextBox; 33 class Text;34 34 35 35 class RenderText : public RenderObject { … … 134 134 135 135 InlineTextBox* findNextInlineTextBox(int offset, int& pos) const { return m_lineBoxes.findNext(offset, pos); } 136 137 void checkConsistency() const;138 136 139 137 bool isAllCollapsibleWhitespace() const; … … 251 249 } 252 250 253 #ifdef NDEBUG254 inline void RenderText::checkConsistency() const255 {256 }257 #endif258 259 251 void applyTextTransform(const RenderStyle*, String&, UChar); 260 252 253 inline RenderText* Text::renderer() const 254 { 255 return toRenderText(Node::renderer()); 256 } 257 261 258 } // namespace WebCore 262 259 -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r157265 r157373 410 410 if (!textNode.attached()) 411 411 return; 412 RenderText* textRenderer = t oRenderText(textNode.renderer());412 RenderText* textRenderer = textNode.renderer(); 413 413 if (!textRenderer) { 414 414 attachTextRenderer(textNode); … … 629 629 static void updateTextStyle(Text& text) 630 630 { 631 RenderText* renderer = t oRenderText(text.renderer());631 RenderText* renderer = text.renderer(); 632 632 633 633 if (!text.needsStyleRecalc())
Note:
See TracChangeset
for help on using the changeset viewer.