1. 12 May, 2011 1 commit
    • tonyg@chromium.org's avatar
      2011-05-10 Tony Gentilcore <tonyg@chromium.org> · 4b0a55f4
      tonyg@chromium.org authored
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * accessibility/AccessibilityObject.cpp:
              * accessibility/AccessibilityRenderObject.cpp:
              * accessibility/mac/AccessibilityObjectWrapper.mm:
              * dom/DocumentMarkerController.cpp:
              * dom/Position.cpp:
              * dom/PositionIterator.cpp:
              * dom/Range.cpp:
              * editing/ApplyBlockElementCommand.cpp:
              * editing/ApplyStyleCommand.cpp:
              * editing/Editor.cpp:
              * editing/EditorCommand.cpp:
              * editing/FrameSelection.cpp:
              * editing/HTMLInterchange.cpp:
              * editing/IndentOutdentCommand.cpp:
              * editing/ReplaceSelectionCommand.cpp:
              * editing/SpellChecker.h:
              * editing/SpellingCorrectionCommand.cpp:
              * editing/SpellingCorrectionController.h:
              * editing/TextCheckingHelper.cpp:
              * editing/TextIterator.h:
              * editing/htmlediting.h:
              * editing/markup.cpp:
              * editing/visible_units.cpp:
              * editing/visible_units.h:
              * fileapi/DOMFileSystem.cpp:
              * fileapi/DirectoryReaderSync.cpp:
              * fileapi/DirectoryReaderSync.h:
              * fileapi/FileEntry.h:
              * fileapi/FileWriter.h:
              * fileapi/FileWriterBase.h:
              * fileapi/FileWriterSync.h:
              * history/CachedFrame.cpp:
              * history/CachedPage.cpp:
              * history/HistoryItem.cpp:
              * history/HistoryItem.h:
              * history/PageCache.h:
              * loader/HistoryController.h:
              * loader/PingLoader.h:
              * loader/ResourceLoader.h:
              * loader/appcache/DOMApplicationCache.h:
              * loader/cache/CachedCSSStyleSheet.h:
              * loader/cache/CachedFont.cpp:
              * loader/cache/CachedFont.h:
              * loader/cache/CachedResourceRequest.cpp:
              * loader/cache/CachedResourceRequest.h:
              * loader/cache/MemoryCache.h:
              * notifications/Notification.cpp:
              * notifications/Notification.h:
              * notifications/NotificationCenter.cpp:
              * notifications/NotificationCenter.h:
              * page/Chrome.cpp:
              * page/Chrome.h:
              * page/DOMSelection.cpp:
              * page/DOMTimer.h:
              * page/DOMWindow.cpp:
              * page/EventHandler.cpp:
              * page/FocusController.h:
              * page/Geolocation.cpp:
              * page/Geolocation.h:
              * page/History.cpp:
              * rendering/RenderListBox.cpp:
              * workers/WorkerContext.cpp:
      2011-05-10  Tony Gentilcore  <tonyg@chromium.org>
      
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * src/WebHistoryItem.cpp:
              * src/WebNotification.cpp:
              * src/WebTextCheckingCompletionImpl.cpp:
              * src/mac/WebSubstringUtil.mm:
      2011-05-10  Tony Gentilcore  <tonyg@chromium.org>
      
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * Plugins/Hosted/WebHostedNetscapePluginView.mm:
              * WebView/WebFrame.mm:
      2011-05-10  Tony Gentilcore  <tonyg@chromium.org>
      
              Reviewed by Darin Adler.
      
              Perform some forward declarations suggested by include-what-you-use
              https://bugs.webkit.org/show_bug.cgi?id=60545
      
              * WebProcess/WebPage/mac/WebPageMac.mm:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@86325 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      4b0a55f4
  2. 25 Mar, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-03-25 Chang Shu <cshu@webkit.org> · 595681f4
      commit-queue@webkit.org authored
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              Code refactoring. No new tests.
      
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::isReadOnly):
              (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
              * dom/Document.cpp:
              (WebCore::acceptsEditingFocus):
              * dom/Node.cpp:
              (WebCore::Node::rendererIsEditable):
              (WebCore::Node::shouldUseInputMethod):
              (WebCore::Node::canStartSelection):
              (WebCore::Node::rootEditableElement):
              * dom/Node.h:
              (WebCore::Node::isContentEditable):
              (WebCore::Node::rendererIsEditable):
              (WebCore::Node::rendererIsRichlyEditable):
              * dom/Position.cpp:
              (WebCore::nextRenderedEditable):
              (WebCore::previousRenderedEditable):
              (WebCore::Position::atEditingBoundary):
              (WebCore::Position::parentEditingBoundary):
              (WebCore::Position::upstream):
              (WebCore::Position::downstream):
              (WebCore::Position::isCandidate):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::isCandidate):
              * editing/AppendNodeCommand.cpp:
              (WebCore::AppendNodeCommand::AppendNodeCommand):
              (WebCore::AppendNodeCommand::doApply):
              (WebCore::AppendNodeCommand::doUnapply):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::containsNonEditableRegion):
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
              (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
              * editing/DeleteButtonController.cpp:
              (WebCore::isDeletableElement):
              (WebCore::enclosingDeletableElement):
              * editing/DeleteFromTextNodeCommand.cpp:
              (WebCore::DeleteFromTextNodeCommand::doApply):
              (WebCore::DeleteFromTextNodeCommand::doUnapply):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::removeNode):
              * editing/Editor.cpp:
              (WebCore::Editor::canDeleteRange):
              (WebCore::Editor::markMisspellingsOrBadGrammar):
              (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
              * editing/EditorCommand.cpp:
              (WebCore::verticalScrollDistance):
              * editing/FormatBlockCommand.cpp:
              (WebCore::enclosingBlockToSplitTreeTo):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertIntoTextNodeCommand.cpp:
              (WebCore::InsertIntoTextNodeCommand::doApply):
              (WebCore::InsertIntoTextNodeCommand::doUnapply):
              * editing/InsertNodeBeforeCommand.cpp:
              (WebCore::InsertNodeBeforeCommand::InsertNodeBeforeCommand):
              (WebCore::InsertNodeBeforeCommand::doApply):
              (WebCore::InsertNodeBeforeCommand::doUnapply):
              * editing/JoinTextNodesCommand.cpp:
              (WebCore::JoinTextNodesCommand::doApply):
              (WebCore::JoinTextNodesCommand::doUnapply):
              * editing/MergeIdenticalElementsCommand.cpp:
              (WebCore::MergeIdenticalElementsCommand::doApply):
              (WebCore::MergeIdenticalElementsCommand::doUnapply):
              * editing/RemoveNodeCommand.cpp:
              (WebCore::RemoveNodeCommand::doApply):
              (WebCore::RemoveNodeCommand::doUnapply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::ReplacementFragment):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              (WebCore::SelectionController::setSelectionFromNone):
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::executeApply):
              (WebCore::SplitElementCommand::doUnapply):
              * editing/SplitTextNodeCommand.cpp:
              (WebCore::SplitTextNodeCommand::doApply):
              (WebCore::SplitTextNodeCommand::doUnapply):
              (WebCore::SplitTextNodeCommand::doReapply):
              * editing/SplitTextNodeContainingElementCommand.cpp:
              (WebCore::SplitTextNodeContainingElementCommand::doApply):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::canonicalPosition):
              * editing/WrapContentsInDummySpanCommand.cpp:
              (WebCore::WrapContentsInDummySpanCommand::doUnapply):
              (WebCore::WrapContentsInDummySpanCommand::doReapply):
              * editing/htmlediting.cpp:
              (WebCore::highestEditableRoot):
              (WebCore::lowestEditableAncestor):
              (WebCore::isEditablePosition):
              (WebCore::isRichlyEditablePosition):
              (WebCore::firstEditablePositionAfterPositionInRoot):
              (WebCore::extendRangeToWrappingNodes):
              (WebCore::enclosingNodeWithTag):
              (WebCore::enclosingNodeOfType):
              (WebCore::highestEnclosingNodeOfType):
              (WebCore::canMergeLists):
              * editing/visible_units.cpp:
              (WebCore::previousLeafWithSameEditability):
              (WebCore::previousLinePosition):
              (WebCore::nextLeafWithSameEditability):
              (WebCore::nextLinePosition):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              * html/HTMLAnchorElement.cpp:
              (WebCore::HTMLAnchorElement::supportsFocus):
              (WebCore::HTMLAnchorElement::defaultEventHandler):
              (WebCore::HTMLAnchorElement::setActive):
              (WebCore::HTMLAnchorElement::canStartSelection):
              (WebCore::HTMLAnchorElement::treatLinkAsLiveForEventType):
              * html/HTMLBodyElement.cpp:
              (WebCore::HTMLBodyElement::supportsFocus):
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::supportsFocus):
              (WebCore::HTMLElement::isContentEditable):
              (WebCore::HTMLElement::contentEditable):
              * html/HTMLElement.h:
              * page/DragController.cpp:
              (WebCore::DragController::operationForLoad):
              (WebCore::DragController::canProcessDrag):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMouseReleaseEvent):
              (WebCore::EventHandler::selectCursor):
              * page/FocusController.cpp:
              (WebCore::relinquishesEditingFocus):
              * rendering/HitTestResult.cpp:
              (WebCore::HitTestResult::isContentEditable):
              * rendering/RenderBlock.cpp:
              (WebCore::positionForPointRespectingEditingBoundaries):
              (WebCore::RenderBlock::hasLineIfEmpty):
              * rendering/RenderBlockLineLayout.cpp:
              (WebCore::RenderBlock::addOverflowFromInlineChildren):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::canBeProgramaticallyScrolled):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::createVisiblePosition):
              * rendering/RootInlineBox.cpp:
              (WebCore::isEditableLeaf):
              * svg/SVGAElement.cpp:
              (WebCore::SVGAElement::supportsFocus):
      2011-03-25  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              * src/WebNode.cpp:
              (WebKit::WebNode::isContentEditable):
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::setFocus):
              (WebKit::WebViewImpl::setComposition):
              (WebKit::WebViewImpl::confirmComposition):
      2011-03-25  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::handleKeyboardEvent):
      2011-03-25  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              rename Node::isContentEditable and all call sites to rendererIsEditable
              https://bugs.webkit.org/show_bug.cgi?id=54290
      
              This is part of the effort to separate JS API HTMLElement isContentEditable from
              internal Node::rendererIsEditable.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::handleKeyboardEvent):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81965 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      595681f4
  3. 17 Mar, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-17 Ryosuke Niwa <rniwa@webkit.org> · c986a805
      rniwa@webkit.org authored
              Reviewed by Justin Garcia.
      
              Assert that editing does not ignore position's anchorNode if position is an offset in anchor
              https://bugs.webkit.org/show_bug.cgi?id=56027
      
              Added a test to ensure WebKit lets users edit contents inside a button element properly.
      
              * editing/execCommand/button-expected.txt: Added.
              * editing/execCommand/button.html: Added.
      2011-03-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Justin Garcia.
      
              Assert that editing does not ignore position's anchorNode if position is an offset in anchor
              https://bugs.webkit.org/show_bug.cgi?id=56027
      
              Added the assertion in Position::Position and Position::moveToPosition. This assertion catches
              places where we instantiate positions inside a node on which editingIgnoresContent returns true.
      
              Test: editing/execCommand/button.html
      
              * dom/Position.cpp:
              (WebCore::Position::Position): Added an assertion.
              (WebCore::Position::moveToPosition): Ditto.
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position): Avoid creating a position immediately below
              a node whose content is ignored by editing. While this does not avoid creation of positions
              inside ignored contents completely, it works in most cases. Filed the bug 56027 to resolve
              the underlying problem. Without this change, the assertion hits in existing layout tests.
              cannot be tested directly.
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): Call firstPositionInOrBeforeNode
              instead of firstPositionInNode because startNode may as well be a br element. Without this change,
              the assertion hits in existing layout tests.
              * editing/htmlediting.cpp:
              (WebCore::canHaveChildrenForEditing): button is editable so content is not ignored. Added a test
              for this.
              * editing/visible_units.cpp:
              (WebCore::previousBoundary): Added a FIXME.
              (WebCore::startPositionForLine): Because br can also have an inline text box, checking that
              startBox is an inline text box isn't an adequate to instantiate a position inside startNode.
              Call startNode->isTextNode() instead. Without this change, the assertion hits in existing layout
              tests.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c986a805
  4. 15 Mar, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-03-08 Levi Weintraub <leviw@chromium.org> · 1f95362b
      leviw@chromium.org authored
              Reviewed by Ryosuke Niwa.
      
              Get rid of firstDeepEditingPositionForNode and lastDeepEditingPositionForNode
              https://bugs.webkit.org/show_bug.cgi?id=52642
      
              Replacing calls to first/lastDeepEditingPositionForNode with calls to their analogous
              functions that create new positions. Also fixing various parts of editing code that
              incorrectly handled the new positions now being created.
      
              No new tests as this is refactoring/cleanup.
      
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionRange):
              * dom/Position.cpp:
              (WebCore::Position::parentAnchoredEquivalent):
              (WebCore::Position::previous):
              (WebCore::Position::next):
              (WebCore::Position::atFirstEditingPositionForNode):
              (WebCore::Position::atLastEditingPositionForNode):
              (WebCore::Position::upstream):
              (WebCore::Position::isCandidate):
              (WebCore::Position::getInlineBoxAndOffset):
              * dom/Position.h:
              (WebCore::operator==):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position):
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::rangeForParagraphSplittingTextNodesIfNeeded):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::isTableCellEmpty):
              (WebCore::DeleteSelectionCommand::removeNode):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::unlistifyParagraph):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::selectionFromContentsOfNode):
              (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::firstEditablePositionAfterPositionInRoot):
              (WebCore::lastEditablePositionBeforePositionInRoot):
              (WebCore::enclosingEmptyListItem):
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::startOfEditableContent):
              (WebCore::endOfEditableContent):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::positionForPoint):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@81165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1f95362b
  5. 08 Jan, 2011 1 commit
  6. 12 Dec, 2010 1 commit
    • morrita@google.com's avatar
      2010-10-28 MORITA Hajime <morrita@google.com> · 7a18feed
      morrita@google.com authored
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              * editing/spelling/script-tests/spellcheck-paste.js: Added.
              * editing/spelling/spellcheck-paste.html: Added.
              * editing/spelling/spellcheck-paste-expected.txt: Added.
              * platform/chromium/test_expectations.txt:
              * platform/gtk/Skipped:
              * platform/mac-leopard/Skipped:
              * platform/mac-tiger/Skipped:
              * platform/mac-wk2/Skipped:
              * platform/qt/Skipped:
              * platform/win/Skipped:
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              - Introduced SpellChecker class to encapsulate asynchronous spell
                checker state: sequence id, requesting text and target node.
                This is also the first step to decompose spell-check related
                code to a separate class.
              - Added EditorClient::isAsynchronousSpellCheckingEnabled()
                to use async spellcheck API on the platform.
                These APIs are touched by SpellChecker.
              - Used SpellChecker to check a pasted test. Text to check is
                collected from the subtree under the editingRoot.
              - Added Setting::m_asynchronousSpellCheckingEnabled to control
                async spell checking.
      
              Test: editing/spelling/spellcheck-paste.html
      
              * CMakeLists.txt:
              * GNUmakefile.am:
              * WebCore.exp.in:
              * WebCore.gypi:
              * WebCore.pro:
              * WebCore.vcproj/WebCore.vcproj:
              * WebCore.xcodeproj/project.pbxproj:
              * dom/DocumentMarkerController.cpp:
              (WebCore::DocumentMarkerController::showMarkers):
              (showDocumentMarkers):
              * dom/DocumentMarkerController.h:
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::setOffsetInLeafNode):
              * dom/PositionIterator.h:
              * editing/Editor.cpp:
              (WebCore::Editor::replaceSelectionWithFragment):
              (WebCore::Editor::Editor):
              (WebCore::findFirstMarkable):
              (WebCore::Editor::selectionStartHasSpellingMarkerFor):
              * editing/Editor.h:
              (WebCore::Editor::spellChecker):
              * editing/SpellChecker.cpp: Added.
              (WebCore::SpellChecker::SpellChecker):
              (WebCore::SpellChecker::~SpellChecker):
              (WebCore::SpellChecker::initRequest):
              (WebCore::SpellChecker::clearRequest):
              (WebCore::SpellChecker::isAsynchronousEnabled):
              (WebCore::SpellChecker::canCheckAsynchronously):
              (WebCore::SpellChecker::isBusy):
              (WebCore::SpellChecker::isValid):
              (WebCore::SpellChecker::isCheckable):
              (WebCore::SpellChecker::requestCheckingFor):
              (WebCore::forwardIterator):
              (WebCore::SpellChecker::didCheck):
              * editing/SpellChecker.h: Added.
              (WebCore::SpellCheckingResult::SpellCheckingResult):
              (WebCore::SpellCheckingResult::type):
              (WebCore::SpellCheckingResult::location):
              (WebCore::SpellCheckingResult::length):
              * loader/EmptyClients.h:
              (WebCore::EmptyEditorClient::requestCheckingOfString):
              * page/EditorClient.h:
              * page/Settings.cpp:
              (WebCore::Settings::Settings):
              * page/Settings.h:
              (WebCore::Settings::setAsynchronousSpellCheckingEnabled):
              (WebCore::Settings::asynchronousSpellCheckingEnabled):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added a stub implememntation.
      
              * src/EditorClientImpl.h:
              (WebKit::EditorClientImpl::requestCheckingOfString):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added a stub implememntation.
      
              * WebCoreSupport/EditorClientEfl.h:
              (WebCore::EditorClientEfl::requestCheckingOfString):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added a stub implememntation.
      
              * WebCoreSupport/EditorClientGtk.h:
              (WebKit::EditorClient::requestCheckingOfString):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added a stub implememntation.
      
              * WebCoreSupport/EditorClientHaiku.h:
              (WebCore::EditorClientHaiku::requestCheckingOfString):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added asynchronous spell checking API to WebEditorClient using
              -[NSSpellChecker requestCheckingOfString].
              Note that WebEditorSpellCheckResponder is a small class to receive
              requested spell-checking result. Note that this feature is
              disabled at default.
      
              Also added [WebPreferences setAsynchronousSpellCheckingEnabled:] to
              enable the feature from LayoutTestController.
      
              * WebCoreSupport/WebEditorClient.h:
              * WebCoreSupport/WebEditorClient.mm:
              (-[WebEditorSpellCheckResponder initWithSender:WebCore::sequence:results:]):
              (-[WebEditorSpellCheckResponder perform]):
              (toCoreSpellingResult):
              (-[WebEditorSpellCheckResponder WTF::WebCore::]):
              (WebEditorClient::requestCheckingOfString):
              * WebView/WebPreferenceKeysPrivate.h:
              * WebView/WebPreferences.mm:
              (+[WebPreferences initialize]):
              (-[WebPreferences setAsynchronousSpellCheckingEnabled:]):
              (-[WebPreferences asynchronousSpellCheckingEnabled]):
              * WebView/WebPreferencesPrivate.h:
              * WebView/WebView.mm:
              (-[WebView _preferencesChangedNotification:]):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added a stub implememntation.
      
              * WebCoreSupport/EditorClientQt.h:
              (WebCore::EditorClientQt::requestCheckingOfString):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added a stub implememntation.
      
              * WebCoreSupport/WebEditorClient.h:
              (WebEditorClient::requestCheckingOfString):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added a stub implememntation.
      
              * WebCoreSupport/EditorClientWinCE.h:
              (WebKit::EditorClient::requestCheckingOfString):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added a stub implememntation.
      
              * WebKitSupport/EditorClientWx.h:
              (WebCore::EditorClientWx::requestCheckingOfString):
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added a stub implememntation.
      
              * WebProcess/WebCoreSupport/WebEditorClient.cpp:
              (WebKit::WebEditorClient::requestCheckingOfString):
              * WebProcess/WebCoreSupport/WebEditorClient.h:
      2010-10-28  MORITA Hajime  <morrita@google.com>
      
              Reviewed by Ojan Vafai.
      
              spellcheck does not check pasted text
              https://bugs.webkit.org/show_bug.cgi?id=40092
      
              Added LayoutTestController::setAsynchronousSpellCheckingEnabled()
              to control the setting.
      
              * DumpRenderTree/LayoutTestController.cpp:
              (setAsynchronousSpellCheckingEnabledCallback):
              (LayoutTestController::staticFunctions):
              * DumpRenderTree/LayoutTestController.h:
              * DumpRenderTree/chromium/LayoutTestController.h:
              * DumpRenderTree/chromium/LayoutTestController.cpp:
              (LayoutTestController::LayoutTestController):
              (LayoutTestController::setAsynchronousSpellCheckingEnabled):
              * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
              (LayoutTestController::setAsynchronousSpellCheckingEnabled):
              * DumpRenderTree/mac/DumpRenderTree.mm:
              (resetDefaultsToConsistentValues):
              * DumpRenderTree/mac/LayoutTestControllerMac.mm:
              (LayoutTestController::setAsynchronousSpellCheckingEnabled):
              * DumpRenderTree/qt/LayoutTestControllerQt.h:
              * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
              (LayoutTestController::setAsynchronousSpellCheckingEnabled):
              * DumpRenderTree/win/LayoutTestControllerWin.cpp:
              (LayoutTestController::setAsynchronousSpellCheckingEnabled):
              * DumpRenderTree/wx/LayoutTestControllerWx.cpp:
              (LayoutTestController::setAsynchronousSpellCheckingEnabled):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73886 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7a18feed
  7. 17 Nov, 2010 1 commit
    • dglazkov@chromium.org's avatar
      Converge means of querying a parent node into one way, which is Node::parentNode. · e43caa78
      dglazkov@chromium.org authored
      https://bugs.webkit.org/show_bug.cgi?id=49686
      
      Reviewed by Darin Adler.
      
      WebCore:
      
      No change in behavior, so no new tests.
      
      * accessibility/AccessibilityObject.cpp:
      (WebCore::renderListItemContainerForNode): Changed to use parentNode.
      * accessibility/AccessibilityRenderObject.cpp:
      (WebCore::AccessibilityRenderObject::mouseButtonListener): Ditto.
      (WebCore::siblingWithAriaRole): Ditto.
      (WebCore::AccessibilityRenderObject::getDocumentLinks): Ditto.
      (WebCore::AccessibilityRenderObject::accessibilityImageMapHitTest): Ditto.
      * accessibility/mac/AccessibilityObjectWrapper.mm: Ditto.
      (blockquoteLevel): Ditto.
      * bindings/v8/V8GCController.cpp:
      (WebCore::ObjectGrouperVisitor::visitDOMWrapper): Ditto.
      * dom/ContainerNode.cpp: Ditto.
      (WebCore::ContainerNode::insertBefore): Ditto.
      (WebCore::ContainerNode::insertBeforeCommon): Ditto.
      (WebCore::ContainerNode::replaceChild): Ditto.
      (WebCore::ContainerNode::removeChild): Ditto.
      (WebCore::ContainerNode::appendChild): Ditto.
      (WebCore::ContainerNode::parserAddChild): Ditto.
      * dom/DocumentType.cpp:
      (WebCore::DocumentType::insertedIntoDocument): Ditto.
      * dom/Element.cpp:
      (WebCore::Element::computeInheritedLanguage): Ditto.
      * dom/MouseRelatedEvent.cpp:
      (WebCore::MouseRelatedEvent::receivedTarget): Ditto.
      * dom/Position.cpp:
      (WebCore::Position::isCandidate): Changed to use parentNode.
      * dom/PositionIterator.cpp:
      (WebCore::PositionIterator::isCandidate): Ditto.
      * editing/AppendNodeCommand.cpp:
      (WebCore::AppendNodeCommand::AppendNodeCommand): Ditto.
      * editing/ApplyStyleCommand.cpp:
      (WebCore::dummySpanAncestorForNode): Ditto.
      (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi): Ditto.
      (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock): Ditto.
      (WebCore::highestEmbeddingAncestor): Ditto.
      (WebCore::ApplyStyleCommand::splitTextElementAtEnd): Ditto.
      (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical): Ditto.
      (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical): Ditto.
      * editing/CompositeEditCommand.cpp:
      (WebCore::CompositeEditCommand::splitTreeToNode): Ditto.
      * editing/DeleteSelectionCommand.cpp:
      (WebCore::updatePositionForNodeRemoval): Ditto.
      * editing/Editor.cpp:
      (WebCore::Editor::textDirectionForSelection): Ditto.
      * editing/MergeIdenticalElementsCommand.cpp:
      (WebCore::MergeIdenticalElementsCommand::doUnapply): Ditto.
      * editing/htmlediting.cpp:
      (WebCore::isEmptyTableCell): Ditto.
      * editing/markup.cpp:
      (WebCore::StyledMarkupAccumulator::serializeNodes): Ditto.
      * editing/visible_units.cpp:
      (WebCore::previousLinePosition): Ditto.
      (WebCore::nextLinePosition): Ditto.
      * html/HTMLAreaElement.cpp:
      (WebCore::HTMLAreaElement::imageElement): Ditto.
      * html/HTMLElement.cpp:
      (WebCore::HTMLElement::setOuterHTML): Ditto.
      (WebCore::HTMLElement::insertAdjacent): Ditto.
      (WebCore::HTMLElement::supportsFocus): Ditto.
      * html/HTMLEmbedElement.cpp:
      (WebCore::HTMLEmbedElement::insertedIntoDocument): Ditto.
      (WebCore::HTMLEmbedElement::attributeChanged): Ditto.
      * html/HTMLTableElement.cpp:
      (WebCore::HTMLTableElement::insertRow): Ditto.
      * html/HTMLTableRowsCollection.cpp: Ditto.
      (WebCore::isInHead): Ditto.
      (WebCore::isInBody): Ditto.
      (WebCore::isInFoot): Ditto.
      (WebCore::HTMLTableRowsCollection::rowAfter): Ditto.
      * html/HTMLViewSourceDocument.cpp:
      (WebCore::HTMLViewSourceDocument::addRange): Ditto.
      * html/MediaDocument.cpp:
      (WebCore::MediaDocument::replaceMediaElementTimerFired): Ditto.
      * html/parser/HTMLConstructionSite.cpp:
      (WebCore::HTMLConstructionSite::attach): Ditto.
      (WebCore::HTMLConstructionSite::findFosterSite): Ditto.
      * html/parser/HTMLTreeBuilder.cpp:
      * page/FocusController.cpp:
      (WebCore::FocusController::findFocusableNodeInDirection): Ditto.
      * rendering/MediaControlElements.cpp:
      (WebCore::MediaControlElement::rendererIsNeeded): Ditto.
      (WebCore::MediaControlElement::attach): Ditto.
      (WebCore::MediaControlElement::updateStyle): Ditto.
      (WebCore::MediaControlInputElement::rendererIsNeeded): Ditto.
      (WebCore::MediaControlInputElement::attach): Ditto.
      (WebCore::MediaControlInputElement::updateStyle): Ditto.
      * rendering/RenderSVGGradientStop.cpp:
      (WebCore::RenderSVGGradientStop::gradientElement): Ditto.
      * svg/SVGAElement.cpp:
      (WebCore::SVGAElement::createRenderer): Ditto.
      (WebCore::SVGAElement::childShouldCreateRenderer): Ditto.
      * svg/SVGFELightElement.cpp:
      (WebCore::SVGFELightElement::svgAttributeChanged): Ditto.
      (WebCore::SVGFELightElement::childrenChanged): Ditto.
      * svg/SVGFEMergeNodeElement.cpp:
      (WebCore::SVGFEMergeNodeElement::svgAttributeChanged): Ditto.
      * svg/SVGLength.cpp:
      (WebCore::SVGLength::determineViewport): Ditto.
      * svg/SVGStyledElement.cpp:
      (WebCore::SVGStyledElement::updateRelativeLengthsInformation): Ditto.
      * svg/SVGUseElement.cpp:
      (WebCore::SVGUseElement::removeDisallowedElementsFromSubtree): Ditto.
      * svg/animation/SVGSMILElement.cpp:
      (WebCore::SVGSMILElement::insertedIntoDocument): Ditto.
      * xml/XPathNodeSet.cpp:
      (WebCore::XPath::NodeSet::sort): Ditto.
      * xml/XPathStep.cpp:
      (WebCore::XPath::Step::nodesInAxis): Ditto.
      * xml/XSLTProcessorLibxslt.cpp:
      (WebCore::xsltStylesheetPointer): Ditto.
      
      WebKit/chromium:
      
      * src/WebFrameImpl.cpp:
      (WebKit::WebFrameImpl::insertStyleText): Changed to use parentNode.
      (WebKit::WebFrameImpl::setFindEndstateFocusAndSelection): Ditto.
      
      WebKit/qt:
      
      * Api/qwebelement.cpp:
      (QWebElement::prependOutside): Changed to use parentNode.
      (QWebElement::appendOutside): Ditto.
      (QWebElement::encloseContentsWith): Ditto.
      (QWebElement::encloseWith): Ditto.
      
      WebKit2:
      
      * WebProcess/WebPage/WebPage.cpp: Changed to use parentNode.
      (WebKit::WebPage::findZoomableAreaForPoint): Ditto.
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72259 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e43caa78
  8. 23 Jun, 2010 1 commit
  9. 25 May, 2010 1 commit
    • enrica@apple.com's avatar
      REGRESSION(51522): typing at the end of a line in designMode documents is *very* slow. · f7a5c0a0
      enrica@apple.com authored
      https://bugs.webkit.org/show_bug.cgi?id=36037
      <rdar://problem/8022887>
      
      Reviewed by Darin Adler.
      
      The performance regression was traced to r51522 but this is not entirely true. That revision introduced, among other things,
      additional checks in the method isCandidate of both Position and PositionIterator classes to support scenarios of mixed editability
      that were not allowed before. This change uncovered an underlying issue with the decrement method of PositionIterator, that in some
      cases would iterate through every position as offset in a block before moving to the last child in the block.
      This was exactly the case of the attached test case, where, trying to check if the caret was placed at the end of a block, we were examining
      every position in the block before considering the last true position in the block.
      The performance was linear with the number of child nodes in the block, instead of constant.
              
      * dom/PositionIterator.cpp:
      (WebCore::PositionIterator::decrement):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60176 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f7a5c0a0
  10. 05 Apr, 2010 1 commit
  11. 02 Apr, 2010 1 commit
    • eric@webkit.org's avatar
      2010-04-02 Roland Steiner <rolandsteiner@chromium.org> · b7bf1f2a
      eric@webkit.org authored
              Reviewed by Eric Seidel.
      
              Bug 36741 -  Duplicate, slightly divergent implementation of Position[Iterator]::isCandidate()
              https://bugs.webkit.org/show_bug.cgi?id=36741
      
              Patch: change Position::isCandididate() to call the PositionIterator::isCandidate() version.
              Update PositionIterator::isCandidate() to mirror Position::isCandidate().
      
              Rationale: PositionIterator::isCandidate() is called in a tight loop within
              next/previousCandidate(). Also, creation of a PositionIterator from a Position
              is cheaper than vice-versa.
      
              Tests: ran all tests in 'editing'.
      
              * dom/Position.cpp:
              (WebCore::Position::isCandidate):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::isCandidate):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b7bf1f2a
  12. 30 Nov, 2009 1 commit
    • enrica@apple.com's avatar
      WebCore: Can focus but not type into content editable block that contains only... · 429c6e2b
      enrica@apple.com authored
      WebCore: Can focus but not type into content editable block that contains only non-editable content.
      <rdar://problem/5982901>
      https://bugs.webkit.org/show_bug.cgi?id=31750
              
      Reviewed by Darin Adler.
      
      The goal is to change the way we choose a visible position
      after hit detection, by preferring a visually equivalent editable
      position if available. By doing this, it is possible to add content
      to an editable block that initially contains only non editable elements.
      
      Test: editing/selection/mixed-editability-10.html
      
      * WebCore.base.exp: Changed to match the new signature of downstream
      and upstream in the Position class.
      * dom/Position.cpp:
      (WebCore::Position::atEditingBoundary): Added.
      (WebCore::Position::upstream): Modified to allow to cross the boundary
      between editable and non editable content if required.
      (WebCore::Position::downstream): Modified to allow to cross the boundary
      between editable and non editable content if required.
      (WebCore::Position::isCandidate): Modified to qualify as candidates positions
      that are at the editability boundary.
      (WebCore::Position::getInlineBoxAndOffset): Modified to retrieve the inline box
      to be used in calculating the caret rectangle.
      * dom/Position.h:
      (WebCore::Position::):
      * dom/PositionIterator.cpp:
      (WebCore::PositionIterator::atEditingBoundary): Added.
      (WebCore::PositionIterator::isCandidate): Modified to qualify as candidates positions
      that are at the editability boundary.
      * dom/PositionIterator.h:
      * editing/htmlediting.cpp:
      (WebCore::firstEditablePositionAfterPositionInRoot): Modified to accept not only
      descendants of the editable container, but the container itself.
      (WebCore::lastEditablePositionBeforePositionInRoot): Modified to accept not only
      descendants of the editable container, but the container itself.
      * rendering/RenderObject.cpp:
      (WebCore::RenderObject::createVisiblePosition): Added logic to prefer an editable position,
      if available.
      * rendering/RenderText.cpp:
      (WebCore::RenderText::isAllCollapsibleWhitespace): Added.
      * rendering/RenderText.h:
      
      LayoutTests: Can focus but not type into content editable block that contains only non-editable content.
      <rdar://problem/5982901>
      https://bugs.webkit.org/show_bug.cgi?id=31750
      
      Reviewed by Darin Adler.
      
      * editing/selection/5825350-1-expected.txt:
      * editing/selection/5825350-1.html: Modified to use caret rectangle.
      * editing/selection/5825350-2-expected.txt:
      * editing/selection/5825350-2.html: Modified to use caret rectangle.
      * editing/selection/mixed-editability-10-expected.txt: Added.
      * editing/selection/mixed-editability-10.html: Added.
      * platform/mac/editing/deleting/5390681-2-expected.txt: Re-baselined
      to account for the new possible caret position.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      429c6e2b
  13. 09 Sep, 2009 1 commit
    • eric@webkit.org's avatar
      2009-07-30 Eric Seidel <eric@webkit.org> · f74ae5cf
      eric@webkit.org authored
              Reviewed by Adam Barth.
      
              Rename positionBeforeNode to positionInParentBeforeNode
              and positionAfterNode to positionInParentAfterNode
              in preparation for adding a positionBeforeNode
              which returns a neighbor-anchored position.
              https://bugs.webkit.org/show_bug.cgi?id=25494
      
              No functional changes, thus no tests.
      
              * dom/PositionConstructors.h:
              (WebCore::positionInParentBeforeNode):
              (WebCore::positionInParentAfterNode):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyInlineStyle):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::positionOutsideTabSpan):
              (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph):
              (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
              * editing/CreateLinkCommand.cpp:
              (WebCore::CreateLinkCommand::doApply):
              * editing/DeleteButtonController.cpp:
              (WebCore::DeleteButtonController::deleteTarget):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::initializeStartEnd):
              (WebCore::updatePositionForNodeRemoval):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::input):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::positionAtStartOfInsertedContent):
              (WebCore::ReplaceSelectionCommand::doApply):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::firstEditablePositionAfterPositionInRoot):
              (WebCore::lastEditablePositionBeforePositionInRoot):
              (WebCore::rangeCompliantEquivalent):
              (WebCore::positionBeforeContainingSpecialElement):
              (WebCore::positionAfterContainingSpecialElement):
              (WebCore::positionBeforeTabSpan):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48234 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f74ae5cf
  14. 02 Jun, 2009 1 commit
    • eric@webkit.org's avatar
      2009-06-02 Eric Seidel <eric@webkit.org> · f0ce649d
      eric@webkit.org authored
              Reviewed by Darin Adler.
      
              Rename PositionIterator members in hope of futher clarity
              https://bugs.webkit.org/show_bug.cgi?id=24854
      
              Rename m_parent to m_anchorNode (since although it's always the parent
              of the previous m_child member, it is not always the parent of the effective position)
              Rename m_child to m_nodeAfterPositionInAnchor to make clear that it's the node
              directly following the position.  This member is often NULL, but is always
              a child of m_parent, now m_anchorNode if set.
              Rename m_offset to m_offsetInAnchor (since it's interpreted relative to m_anchorNode)
      
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position):
              (WebCore::PositionIterator::increment):
              (WebCore::PositionIterator::decrement):
              (WebCore::PositionIterator::atStart):
              (WebCore::PositionIterator::atEnd):
              (WebCore::PositionIterator::atStartOfNode):
              (WebCore::PositionIterator::atEndOfNode):
              (WebCore::PositionIterator::isCandidate):
              * dom/PositionIterator.h:
              (WebCore::PositionIterator::PositionIterator):
              (WebCore::PositionIterator::node):
              (WebCore::PositionIterator::offsetInLeafNode):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44374 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f0ce649d
  15. 01 Apr, 2009 1 commit
  16. 31 Mar, 2009 1 commit
    • darin@apple.com's avatar
      2009-03-31 Darin Adler <darin@apple.com> · caa9bf1a
      darin@apple.com authored
              Reviewed by Eric Seidel.
      
              Bug 24621: PositionIterator doesn't iterate "after last child" positions when going backwards
              https://bugs.webkit.org/show_bug.cgi?id=24621
      
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::decrement): Make sure that when the parent has no children, we
              don't ever use Position::uncheckedPreviousOffset. This is consistent with the forward
              iterator, but also should never arise because of the fix below.
              * dom/PositionIterator.h:
              (WebCore::PositionIterator::PositionIterator): Fixed so m_offset will always be 0 when
              the passed-in node has no children. Like the change above, this is consistent with the rest
              of the class, although in the long run I think it's a bit strange to treat a <p> element
              with no children differently than a <p> element with children.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42147 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      caa9bf1a
  17. 26 Mar, 2009 1 commit
  18. 20 Mar, 2009 1 commit
    • eric@webkit.org's avatar
      Reviewed by Justin Garcia. · f3a1881c
      eric@webkit.org authored
              maxDeepOffset is confusing and should be removed
              https://bugs.webkit.org/show_bug.cgi?id=24586
      
              Abstract some hard-to-read (but shared) logic into a new renderedAsNonInlineTableOrHR function.
              Add first/lastDeepEditingPositionForNode Position creation functions
              and deploy them to places we used to call maxDeepOffset.
      
              Rename Position::atStart and atEnd to atStartOfTree atEndOfTree
              Add a new Position::atFirst/atLastEditingPositionForNode() and use these
              to replace a few more callers for maxDeepOffset()
      
              Rename maxDeepOffset to lastEditingOffsetForNode (so that we mere mortals have some clue what it does)
      
              "Editing positions" are confusing because they have one
              of two behaviors, depending on if the container node is ignored
              by editing (if editingIgnoresContent(node) returns true) or not.
              Positions referring to nodes ignored by editing are
              neighbor-relative (they are before or after the node) where as
              positions reffering to other nodes are container-relative
              (they are between two child nodes of the container, identified
              by the offset() member).  I will be fixing this confusion in
              future patches.  These renames hopefully make the current behavior clearer.
      
              * dom/Position.cpp:
              (WebCore::Position::previous):
              (WebCore::Position::next):
              (WebCore::Position::atFirstEditingPositionForNode):
              (WebCore::Position::atLastEditingPositionForNode):
              (WebCore::Position::atStartOfTree):
              (WebCore::Position::atEndOfTree):
              (WebCore::Position::previousCharacterPosition):
              (WebCore::Position::nextCharacterPosition):
              (WebCore::Position::upstream):
              (WebCore::Position::isCandidate):
              (WebCore::firstDeepEditingPositionForNode):
              (WebCore::lastDeepEditingPositionForNode):
              * dom/Position.h:
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position):
              (WebCore::PositionIterator::increment):
              (WebCore::PositionIterator::decrement):
              (WebCore::PositionIterator::atEnd):
              (WebCore::PositionIterator::atEndOfNode):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::isTableCellEmpty):
              (WebCore::DeleteSelectionCommand::removeNode):
              (WebCore::DeleteSelectionCommand::handleGeneralDelete):
              * editing/Editor.cpp:
              (WebCore::Editor::advanceToNextMisspelling):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
              * editing/TypingCommand.cpp:
              (WebCore::TypingCommand::forwardDeleteKeyPressed):
              * editing/VisiblePosition.cpp:
              (WebCore::VisiblePosition::previous):
              (WebCore::VisiblePosition::leftVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::left):
              (WebCore::VisiblePosition::rightVisuallyDistinctCandidate):
              (WebCore::VisiblePosition::right):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::selectionFromContentsOfNode):
              (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingEditingBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::nextVisuallyDistinctCandidate):
              (WebCore::previousVisuallyDistinctCandidate):
              (WebCore::firstEditablePositionAfterPositionInRoot):
              (WebCore::lastEditablePositionBeforePositionInRoot):
              (WebCore::lastOffsetForEditing):
              (WebCore::isFirstPositionAfterTable):
              (WebCore::isLastPositionBeforeTable):
              (WebCore::positionBeforeNode):
              (WebCore::positionAfterNode):
              (WebCore::enclosingEmptyListItem):
              (WebCore::caretMaxOffset):
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::renderedAsNonInlineTableOrHR):
              (WebCore::startOfParagraph):
              (WebCore::endOfParagraph):
              (WebCore::startOfEditableContent):
              (WebCore::endOfEditableContent):
              * page/AccessibilityObject.cpp:
              (WebCore::endOfStyleRange):
              * page/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::visiblePositionRange):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::positionForPoint):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f3a1881c
  19. 30 Jan, 2009 1 commit
    • hyatt@apple.com's avatar
      2009-01-30 David Hyatt <hyatt@apple.com> · 801ed3fd
      hyatt@apple.com authored
              Add toRenderBlock methods for casting RenderObjects to RenderBlocks.  The methods will assert if the object
              is not a RenderBlock.  Also add a toRenderBlock method that takes a RenderBlock but returns void and that
              is unimplemented.  This method will catch anyone trying to do a cast when the object is already a RenderBlock.
      
              Making this change caught a bad cast in RenderBlock::layoutBlockChildren, so that is also fixed by this
              patch with a containsFloats() check.
      
              Reviewed by Darin Adler
      
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::isCandidate):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
              * editing/Editor.cpp:
              (WebCore::Editor::hasBidiSelection):
              * page/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::anchorElement):
              (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::styleWillChange):
              (WebCore::RenderBlock::removeChild):
              (WebCore::RenderBlock::layoutBlock):
              (WebCore::RenderBlock::collapseMargins):
              (WebCore::RenderBlock::clearFloatsIfNeeded):
              (WebCore::RenderBlock::layoutBlockChildren):
              (WebCore::RenderBlock::fillBlockSelectionGaps):
              (WebCore::RenderBlock::markAllDescendantsWithFloatsForLayout):
              (WebCore::RenderBlock::firstLineBlock):
              (WebCore::getLineAtIndex):
              (WebCore::getHeightForLineCount):
              (WebCore::RenderBlock::lineCount):
              (WebCore::RenderBlock::adjustForBorderFit):
              (WebCore::RenderBlock::clearTruncation):
              * rendering/RenderBlock.h:
              (WebCore::toRenderBlock):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::offsetFromContainer):
              (WebCore::RenderBox::computeRectForRepaint):
              (WebCore::RenderBox::calcReplacedHeightUsing):
              * rendering/RenderFlexibleBox.cpp:
              (WebCore::RenderFlexibleBox::layoutHorizontalBox):
              (WebCore::RenderFlexibleBox::layoutVerticalBox):
              * rendering/RenderInline.cpp:
              (WebCore::RenderInline::inlineContinuation):
              (WebCore::nextContinuation):
              (WebCore::RenderInline::positionForCoordinates):
              * rendering/RenderLayer.cpp:
              (WebCore::RenderLayer::updateScrollInfoAfterLayout):
              * rendering/RenderListItem.cpp:
              (WebCore::getParentOfFirstLineBox):
              (WebCore::RenderListItem::positionListMarker):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::containingBlock):
              (WebCore::RenderObject::computeRectForRepaint):
              (WebCore::RenderObject::removeFromObjectLists):
              (WebCore::RenderObject::getTextDecorationColors):
              * rendering/RenderTable.cpp:
              (WebCore::RenderTable::addChild):
              (WebCore::RenderTable::recalcSections):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::styleDidChange):
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight):
              * rendering/RootInlineBox.cpp:
              (WebCore::RootInlineBox::block):
              * rendering/bidi.cpp:
              (WebCore::RenderBlock::createLineBoxes):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      801ed3fd
  20. 21 Jan, 2009 1 commit
    • hyatt@apple.com's avatar
      WebCore: · d885df72
      hyatt@apple.com authored
      2009-01-21  David Hyatt  <hyatt@apple.com>
      
              Fix for https://bugs.webkit.org/show_bug.cgi?id=23453
      
              Devirtualize the width/height/x/y methods of the render tree.  The methods are now non-virtual on RenderBox.
              Many functions that were previously in RenderObject.cpp are now in RenderBox.cpp.
      
              Reviewed by Eric Seidel and Darin Adler
      
              * WebCore.base.exp:
              * css/CSSComputedStyleDeclaration.cpp:
              (WebCore::sizingBox):
              * dom/ContainerNode.cpp:
              (WebCore::ContainerNode::getUpperLeftCorner):
              (WebCore::ContainerNode::getLowerRightCorner):
              * dom/Element.cpp:
              (WebCore::Element::offsetLeft):
              (WebCore::Element::offsetTop):
              (WebCore::Element::offsetWidth):
              (WebCore::Element::offsetHeight):
              (WebCore::Element::offsetParent):
              (WebCore::Element::clientLeft):
              (WebCore::Element::clientTop):
              (WebCore::Element::clientWidth):
              (WebCore::Element::clientHeight):
              (WebCore::Element::scrollLeft):
              (WebCore::Element::scrollTop):
              (WebCore::Element::setScrollLeft):
              (WebCore::Element::setScrollTop):
              (WebCore::Element::scrollWidth):
              (WebCore::Element::scrollHeight):
              * dom/Node.cpp:
              (WebCore::Node::renderBox):
              (WebCore::Node::getRect):
              * dom/Node.h:
              * dom/Position.cpp:
              (WebCore::endsOfNodeAreVisuallyDistinctPositions):
              (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
              (WebCore::Position::isCandidate):
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::isCandidate):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::addBlockPlaceholderIfNeeded):
              * editing/DeleteButtonController.cpp:
              (WebCore::isDeletableElement):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::removeNode):
              * editing/Editor.cpp:
              (WebCore::Editor::insideVisibleArea):
              * editing/EditorCommand.cpp:
              (WebCore::verticalScrollDistance):
              * html/HTMLAnchorElement.cpp:
              (WebCore::HTMLAnchorElement::isKeyboardFocusable):
              * html/HTMLCanvasElement.cpp:
              (WebCore::HTMLCanvasElement::willDraw):
              * html/HTMLFormControlElement.cpp:
              (WebCore::HTMLFormControlElement::isFocusable):
              * html/HTMLFrameElementBase.cpp:
              (WebCore::HTMLFrameElementBase::width):
              (WebCore::HTMLFrameElementBase::height):
              * html/HTMLImageElement.cpp:
              (WebCore::HTMLImageElement::width):
              (WebCore::HTMLImageElement::height):
              * inspector/InspectorController.cpp:
              (WebCore::InspectorController::drawNodeHighlight):
              * page/AccessibilityRenderObject.cpp:
              (WebCore::AccessibilityRenderObject::accessibilityIsIgnored):
              * page/FrameView.cpp:
              (WebCore::FrameView::createScrollbar):
              (WebCore::FrameView::updateDashboardRegions):
              * page/animation/AnimationBase.cpp:
              (WebCore::blendFunc):
              * rendering/HitTestResult.cpp:
              (WebCore::HitTestResult::imageRect):
              * rendering/InlineBox.cpp:
              (WebCore::InlineBox::renderBox):
              (WebCore::InlineBox::adjustPosition):
              * rendering/InlineBox.h:
              * rendering/InlineFlowBox.cpp:
              (WebCore::InlineFlowBox::placeBoxesHorizontally):
              (WebCore::InlineFlowBox::verticallyAlignBoxes):
              (WebCore::InlineFlowBox::placeBoxesVertically):
              * rendering/InlineFlowBox.h:
              * rendering/RenderApplet.cpp:
              (WebCore::RenderApplet::createWidgetIfNecessary):
              * rendering/RenderBlock.cpp:
              (WebCore::RenderBlock::overflowHeight):
              (WebCore::RenderBlock::overflowWidth):
              (WebCore::RenderBlock::overflowRect):
              (WebCore::RenderBlock::isSelfCollapsingBlock):
              (WebCore::RenderBlock::layout):
              (WebCore::RenderBlock::layoutBlock):
              (WebCore::RenderBlock::adjustPositionedBlock):
              (WebCore::RenderBlock::adjustFloatingBlock):
              (WebCore::RenderBlock::handleSpecialChild):
              (WebCore::RenderBlock::handlePositionedChild):
              (WebCore::RenderBlock::handleFloatingChild):
              (WebCore::RenderBlock::handleCompactChild):
              (WebCore::RenderBlock::insertCompactIfNeeded):
              (WebCore::RenderBlock::handleRunInChild):
              (WebCore::RenderBlock::collapseMargins):
              (WebCore::RenderBlock::clearFloatsIfNeeded):
              (WebCore::RenderBlock::estimateVerticalPosition):
              (WebCore::RenderBlock::determineHorizontalPosition):
              (WebCore::RenderBlock::handleBottomOfBlock):
              (WebCore::RenderBlock::layoutBlockChildren):
              (WebCore::RenderBlock::layoutOnlyPositionedObjects):
              (WebCore::RenderBlock::layoutPositionedObjects):
              (WebCore::RenderBlock::markPositionedObjectsForLayout):
              (WebCore::RenderBlock::repaintOverhangingFloats):
              (WebCore::RenderBlock::paint):
              (WebCore::RenderBlock::paintChildren):
              (WebCore::RenderBlock::paintObject):
              (WebCore::RenderBlock::paintFloats):
              (WebCore::RenderBlock::paintContinuationOutlines):
              (WebCore::clipOutPositionedObjects):
              (WebCore::RenderBlock::fillSelectionGaps):
              (WebCore::RenderBlock::fillBlockSelectionGaps):
              (WebCore::RenderBlock::leftSelectionOffset):
              (WebCore::RenderBlock::rightSelectionOffset):
              (WebCore::RenderBlock::insertPositionedObject):
              (WebCore::RenderBlock::removePositionedObject):
              (WebCore::RenderBlock::removePositionedObjects):
              (WebCore::RenderBlock::insertFloatingObject):
              (WebCore::RenderBlock::removeFloatingObject):
              (WebCore::RenderBlock::positionNewFloats):
              (WebCore::RenderBlock::newLine):
              (WebCore::RenderBlock::lowestPosition):
              (WebCore::RenderBlock::rightmostPosition):
              (WebCore::RenderBlock::leftmostPosition):
              (WebCore::RenderBlock::clearFloats):
              (WebCore::RenderBlock::addOverhangingFloats):
              (WebCore::RenderBlock::markAllDescendantsWithFloatsForLayout):
              (WebCore::RenderBlock::getClearDelta):
              (WebCore::RenderBlock::nodeAtPoint):
              (WebCore::RenderBlock::positionForCoordinates):
              (WebCore::RenderBlock::layoutColumns):
              (WebCore::RenderBlock::getBaselineOfFirstLineBox):
              (WebCore::RenderBlock::getBaselineOfLastLineBox):
              (WebCore::getHeightForLineCount):
              (WebCore::RenderBlock::adjustForBorderFit):
              * rendering/RenderBlock.h:
              (WebCore::RenderBlock::FloatWithRect::FloatWithRect):
              (WebCore::RenderBlock::hasOverhangingFloats):
              (WebCore::RenderBlock::CompactInfo::compact):
              (WebCore::RenderBlock::CompactInfo::set):
              * rendering/RenderBox.cpp:
              (WebCore::RenderBox::RenderBox):
              (WebCore::RenderBox::offsetLeft):
              (WebCore::RenderBox::offsetTop):
              (WebCore::RenderBox::offsetParent):
              (WebCore::RenderBox::clientWidth):
              (WebCore::RenderBox::clientHeight):
              (WebCore::RenderBox::scrollWidth):
              (WebCore::RenderBox::scrollHeight):
              (WebCore::RenderBox::scrollLeft):
              (WebCore::RenderBox::scrollTop):
              (WebCore::RenderBox::setScrollLeft):
              (WebCore::RenderBox::setScrollTop):
              (WebCore::RenderBox::absoluteRects):
              (WebCore::RenderBox::absoluteQuads):
              (WebCore::RenderBox::absoluteContentBox):
              (WebCore::RenderBox::absoluteContentQuad):
              (WebCore::RenderBox::absoluteOutlineBounds):
              (WebCore::RenderBox::addFocusRingRects):
              (WebCore::RenderBox::reflectionBox):
              (WebCore::RenderBox::reflectionOffset):
              (WebCore::RenderBox::reflectedRect):
              (WebCore::RenderBox::overrideWidth):
              (WebCore::RenderBox::overrideHeight):
              (WebCore::RenderBox::nodeAtPoint):
              (WebCore::RenderBox::paint):
              (WebCore::RenderBox::maskClipRect):
              (WebCore::RenderBox::repaintLayerRectsForImage):
              (WebCore::RenderBox::paintCustomHighlight):
              (WebCore::RenderBox::getOverflowClipRect):
              (WebCore::RenderBox::getClipRect):
              (WebCore::RenderBox::containingBlockWidth):
              (WebCore::RenderBox::localToAbsolute):
              (WebCore::RenderBox::offsetFromContainer):
              (WebCore::RenderBox::position):
              (WebCore::RenderBox::computeAbsoluteRepaintRect):
              (WebCore::RenderBox::repaintDuringLayoutIfMoved):
              (WebCore::RenderBox::calcWidth):
              (WebCore::RenderBox::calcWidthUsing):
              (WebCore::RenderBox::calcHorizontalMargins):
              (WebCore::RenderBox::calcHeight):
              (WebCore::RenderBox::calcPercentageHeight):
              (WebCore::RenderBox::calcReplacedHeightUsing):
              (WebCore::RenderBox::containingBlockWidthForPositioned):
              (WebCore::RenderBox::containingBlockHeightForPositioned):
              (WebCore::RenderBox::calcAbsoluteHorizontal):
              (WebCore::RenderBox::calcAbsoluteVertical):
              (WebCore::RenderBox::calcAbsoluteVerticalValues):
              (WebCore::RenderBox::calcAbsoluteHorizontalReplaced):
              (WebCore::RenderBox::calcAbsoluteVerticalReplaced):
              (WebCore::RenderBox::localCaretRect):
              (WebCore::RenderBox::lowestPosition):
              (WebCore::RenderBox::rightmostPosition):
              (WebCore::RenderBox::leftmostPosition):
              (WebCore::RenderBox::localTransform):
              * rendering/RenderBox.h:
              (WebCore::):
              (WebCore::RenderBox::x):
              (WebCore::RenderBox::y):
              (WebCore::RenderBox::width):
              (WebCore::RenderBox::height):
              (WebCore::RenderBox::setX):
              (WebCore::RenderBox::setY):
              (WebCore::RenderBox::setWidth):
              (WebCore::RenderBox::setHeight):
              (WebCore::RenderBox::location):
              (WebCore::RenderBox::size):
              (WebCore::RenderBox::setLocation):
              (WebCore::RenderBox::setSize):
              (WebCore::RenderBox::move):
              (WebCore::RenderBox::frameRect):
              (WebCore::RenderBox::setFrameRect):
              (WebCore::RenderBox::borderBoxRect):
              (WebCore::RenderBox::contentBoxRect):
              (WebCore::RenderBox::previousSiblingBox):
              (WebCore::RenderBox::nextSiblingBox):
              (WebCore::RenderBox::parentBox):
              (WebCore::RenderBox::overflowHeight):
              (WebCore::RenderBox::overflowWidth):
              (WebCore::RenderBox::setOverflowHeight):
              (WebCore::RenderBox::setOverflowWidth):
              (WebCore::RenderBox::overflowLeft):
              (WebCore::RenderBox::overflowTop):
              (WebCore::RenderBox::overflowRect):
              (WebCore::RenderBox::contentWidth):
              (WebCore::RenderBox::contentHeight):
              (WebCore::RenderBox::offsetWidth):
              (WebCore::RenderBox::offsetHeight):
              (WebCore::RenderBox::clientLeft):
              (WebCore::RenderBox::clientTop):
              (WebCore::RenderBox::availableWidth):
              (WebCore::RenderBox::tryLayoutDoingPositionedMovementOnly):
              * rendering/RenderButton.cpp:
              (WebCore::RenderButton::controlClipRect):
              * rendering/RenderContainer.cpp:
              (WebCore::RenderContainer::layout):
              (WebCore::RenderContainer::positionForCoordinates):
              * rendering/RenderContainer.h:
              (WebCore::RenderContainer::firstChildBox):
              (WebCore::RenderContainer::lastChildBox):
              * rendering/RenderFieldset.cpp:
              (WebCore::RenderFieldset::calcPrefWidths):
              (WebCore::RenderFieldset::layoutLegend):
              (WebCore::RenderFieldset::findLegend):
              (WebCore::RenderFieldset::paintBoxDecorations):
              (WebCore::RenderFieldset::paintMask):
              * rendering/RenderFieldset.h:
              * rendering/RenderFileUploadControl.cpp:
              (WebCore::RenderFileUploadControl::maxFilenameWidth):
              (WebCore::RenderFileUploadControl::paintObject):
              * rendering/RenderFlexibleBox.cpp:
              (WebCore::FlexBoxIterator::FlexBoxIterator):
              (WebCore::FlexBoxIterator::first):
              (WebCore::FlexBoxIterator::next):
              (WebCore::RenderFlexibleBox::calcHorizontalPrefWidths):
              (WebCore::RenderFlexibleBox::calcVerticalPrefWidths):
              (WebCore::RenderFlexibleBox::layoutBlock):
              (WebCore::RenderFlexibleBox::layoutHorizontalBox):
              (WebCore::RenderFlexibleBox::layoutVerticalBox):
              (WebCore::RenderFlexibleBox::placeChild):
              (WebCore::RenderFlexibleBox::allowedChildFlex):
              * rendering/RenderFlexibleBox.h:
              * rendering/RenderFlow.cpp:
              (WebCore::RenderFlow::absoluteClippedOverflowRect):
              (WebCore::RenderFlow::lowestPosition):
              (WebCore::RenderFlow::rightmostPosition):
              (WebCore::RenderFlow::leftmostPosition):
              (WebCore::RenderFlow::localCaretRect):
              (WebCore::RenderFlow::addFocusRingRects):
              * rendering/RenderFrameSet.cpp:
              (WebCore::RenderFrameSet::paint):
              (WebCore::RenderFrameSet::layout):
              (WebCore::RenderFrameSet::positionFrames):
              * rendering/RenderHTMLCanvas.cpp:
              (WebCore::RenderHTMLCanvas::paintReplaced):
              (WebCore::RenderHTMLCanvas::canvasSizeChanged):
              * rendering/RenderImage.cpp:
              (WebCore::RenderImage::imageChanged):
              (WebCore::RenderImage::paintReplaced):
              (WebCore::RenderImage::nodeAtPoint):
              (WebCore::RenderImage::calcReplacedWidth):
              * rendering/RenderInline.cpp:
              (WebCore::RenderInline::absoluteRects):
              (WebCore::RenderInline::boundingBoxWidth):
              (WebCore::RenderInline::boundingBoxHeight):
              (WebCore::RenderInline::positionForCoordinates):
              * rendering/RenderInline.h:
              (WebCore::RenderInline::offsetWidth):
              (WebCore::RenderInline::offsetHeight):
              * rendering/RenderLayer.cpp:
              (WebCore::RenderLayer::updateTransform):
              (WebCore::RenderLayer::updateLayerPosition):
              (WebCore::RenderLayer::scrollbarCornerPresent):
              (WebCore::RenderLayer::createScrollbar):
              (WebCore::RenderLayer::positionOverflowControls):
              (WebCore::RenderLayer::paintScrollCorner):
              (WebCore::RenderLayer::paintResizer):
              (WebCore::RenderLayer::paintLayer):
              (WebCore::RenderLayer::hitTestLayer):
              (WebCore::RenderLayer::calculateRects):
              (WebCore::RenderLayer::boundingBox):
              * rendering/RenderListBox.cpp:
              (WebCore::RenderListBox::calcHeight):
              (WebCore::RenderListBox::controlClipRect):
              * rendering/RenderListItem.cpp:
              (WebCore::RenderListItem::positionListMarker):
              (WebCore::RenderListItem::paint):
              * rendering/RenderListMarker.cpp:
              (WebCore::RenderListMarker::paint):
              (WebCore::RenderListMarker::layout):
              (WebCore::RenderListMarker::imageChanged):
              (WebCore::RenderListMarker::getRelativeMarkerRect):
              (WebCore::RenderListMarker::selectionRect):
              * rendering/RenderMarquee.cpp:
              (WebCore::RenderMarquee::computePosition):
              * rendering/RenderMedia.cpp:
              (WebCore::RenderMedia::layout):
              (WebCore::RenderMedia::lowestPosition):
              (WebCore::RenderMedia::rightmostPosition):
              (WebCore::RenderMedia::leftmostPosition):
              * rendering/RenderMenuList.cpp:
              (WebCore::RenderMenuList::controlClipRect):
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::RenderObject):
              (WebCore::RenderObject::markAllDescendantsWithFloatsForLayout):
              (WebCore::RenderObject::paintOutline):
              (WebCore::RenderObject::addLineBoxRects):
              (WebCore::RenderObject::absoluteBoundingBoxRect):
              (WebCore::RenderObject::addAbsoluteRectForLayer):
              (WebCore::RenderObject::paintingRootRect):
              (WebCore::RenderObject::container):
              (WebCore::RenderObject::removeFromObjectLists):
              (WebCore::RenderObject::updateHitTestResult):
              (WebCore::RenderObject::addDashboardRegions):
              (WebCore::RenderObject::localTransform):
              * rendering/RenderObject.h:
              (WebCore::RenderObject::isBox):
              (WebCore::RenderObject::hasMask):
              (WebCore::RenderObject::setIsText):
              (WebCore::RenderObject::setIsBox):
              (WebCore::RenderObject::borderTop):
              (WebCore::RenderObject::borderBottom):
              (WebCore::RenderObject::absoluteRects):
              (WebCore::RenderObject::collectAbsoluteLineBoxQuads):
              (WebCore::RenderObject::absoluteQuads):
              (WebCore::RenderObject::hasReflection):
              (WebCore::RenderObject::addFocusRingRects):
              (WebCore::RenderObject::absoluteOutlineBounds):
              * rendering/RenderPart.cpp:
              (WebCore::RenderPart::updateWidgetPosition):
              * rendering/RenderPath.cpp:
              (WebCore::RenderPath::layout):
              (WebCore::RenderPath::paint):
              (WebCore::RenderPath::absoluteOutlineBounds):
              * rendering/RenderPath.h:
              * rendering/RenderReplaced.cpp:
              (WebCore::RenderReplaced::layout):
              (WebCore::RenderReplaced::paint):
              (WebCore::RenderReplaced::shouldPaint):
              (WebCore::RenderReplaced::positionForCoordinates):
              (WebCore::RenderReplaced::localSelectionRect):
              (WebCore::RenderReplaced::adjustOverflowForBoxShadow):
              (WebCore::RenderReplaced::overflowRect):
              * rendering/RenderReplica.cpp:
              (WebCore::RenderReplica::layout):
              (WebCore::RenderReplica::calcPrefWidths):
              (WebCore::RenderReplica::paint):
              * rendering/RenderSVGContainer.cpp:
              (WebCore::RenderSVGContainer::paint):
              (WebCore::RenderSVGContainer::absoluteOutlineBounds):
              * rendering/RenderSVGContainer.h:
              (WebCore::RenderSVGContainer::width):
              (WebCore::RenderSVGContainer::height):
              * rendering/RenderSVGImage.cpp:
              (WebCore::RenderSVGImage::layout):
              * rendering/RenderSVGInlineText.cpp:
              (WebCore::RenderSVGInlineText::computeAbsoluteRectForRange):
              (WebCore::RenderSVGInlineText::positionForCoordinates):
              * rendering/RenderSVGRoot.cpp:
              (WebCore::RenderSVGRoot::layout):
              (WebCore::RenderSVGRoot::applyContentTransforms):
              (WebCore::RenderSVGRoot::paint):
              (WebCore::RenderSVGRoot::absoluteTransform):
              (WebCore::RenderSVGRoot::nodeAtPoint):
              * rendering/RenderSVGTSpan.cpp:
              (WebCore::RenderSVGTSpan::absoluteRects):
              (WebCore::RenderSVGTSpan::absoluteQuads):
              * rendering/RenderSVGText.cpp:
              (WebCore::RenderSVGText::layout):
              (WebCore::RenderSVGText::relativeBBox):
              * rendering/RenderSVGTextPath.cpp:
              (WebCore::RenderSVGTextPath::absoluteRects):
              (WebCore::RenderSVGTextPath::absoluteQuads):
              * rendering/RenderSVGViewportContainer.cpp:
              (WebCore::RenderSVGViewportContainer::nodeAtPoint):
              * rendering/RenderScrollbar.cpp:
              (WebCore::RenderScrollbar::createCustomScrollbar):
              (WebCore::RenderScrollbar::RenderScrollbar):
              (WebCore::RenderScrollbar::setParent):
              * rendering/RenderScrollbar.h:
              (WebCore::RenderScrollbar::owningRenderer):
              * rendering/RenderScrollbarPart.cpp:
              (WebCore::RenderScrollbarPart::layout):
              (WebCore::RenderScrollbarPart::layoutHorizontalPart):
              (WebCore::RenderScrollbarPart::layoutVerticalPart):
              (WebCore::RenderScrollbarPart::computeScrollbarWidth):
              (WebCore::RenderScrollbarPart::computeScrollbarHeight):
              (WebCore::RenderScrollbarPart::paintIntoRect):
              * rendering/RenderSlider.cpp:
              (WebCore::HTMLSliderThumbElement::defaultEventHandler):
              (WebCore::RenderSlider::layout):
              (WebCore::RenderSlider::mouseEventIsInThumb):
              (WebCore::RenderSlider::positionForOffset):
              (WebCore::RenderSlider::trackSize):
              * rendering/RenderTable.cpp:
              (WebCore::RenderTable::calcWidth):
              (WebCore::RenderTable::layout):
              (WebCore::RenderTable::paint):
              (WebCore::RenderTable::getBaselineOfFirstLineBox):
              * rendering/RenderTableCell.cpp:
              (WebCore::RenderTableCell::updateWidth):
              (WebCore::RenderTableCell::computeAbsoluteRepaintRect):
              (WebCore::RenderTableCell::localToAbsolute):
              (WebCore::RenderTableCell::absoluteToLocal):
              (WebCore::RenderTableCell::localToAbsoluteQuad):
              (WebCore::RenderTableCell::paint):
              (WebCore::RenderTableCell::paintBackgroundsBehindCell):
              * rendering/RenderTableCell.h:
              * rendering/RenderTableSection.cpp:
              (WebCore::RenderTableSection::addChild):
              (WebCore::RenderTableSection::addCell):
              (WebCore::RenderTableSection::setCellWidths):
              (WebCore::RenderTableSection::calcRowHeight):
              (WebCore::RenderTableSection::layoutRows):
              (WebCore::RenderTableSection::lowestPosition):
              (WebCore::RenderTableSection::rightmostPosition):
              (WebCore::RenderTableSection::leftmostPosition):
              (WebCore::RenderTableSection::getBaselineOfFirstLineBox):
              (WebCore::RenderTableSection::paint):
              (WebCore::RenderTableSection::recalcCells):
              (WebCore::RenderTableSection::nodeAtPoint):
              * rendering/RenderTableSection.h:
              (WebCore::RenderTableSection::overflowWidth):
              (WebCore::RenderTableSection::overflowHeight):
              * rendering/RenderText.cpp:
              (WebCore::RenderText::RenderText):
              (WebCore::RenderText::boundingBoxX):
              (WebCore::RenderText::boundingBoxY):
              (WebCore::RenderText::firstRunX):
              (WebCore::RenderText::firstRunY):
              (WebCore::RenderText::boundingBoxHeight):
              (WebCore::RenderText::boundingBoxWidth):
              * rendering/RenderText.h:
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::textBlockHeight):
              (WebCore::RenderTextControl::textBlockWidth):
              (WebCore::RenderTextControl::setSelectionRange):
              (WebCore::RenderTextControl::calcHeight):
              (WebCore::RenderTextControl::hitInnerTextBlock):
              (WebCore::RenderTextControl::controlClipRect):
              * rendering/RenderTextControlMultiLine.cpp:
              (WebCore::RenderTextControlMultiLine::layout):
              (WebCore::RenderTextControlMultiLine::adjustControlHeightBasedOnLineHeight):
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::paint):
              (WebCore::RenderTextControlSingleLine::layout):
              (WebCore::RenderTextControlSingleLine::nodeAtPoint):
              (WebCore::RenderTextControlSingleLine::forwardEvent):
              (WebCore::RenderTextControlSingleLine::textBlockWidth):
              (WebCore::RenderTextControlSingleLine::adjustControlHeightBasedOnLineHeight):
              (WebCore::RenderTextControlSingleLine::clientPaddingLeft):
              (WebCore::RenderTextControlSingleLine::clientPaddingRight):
              * rendering/RenderTheme.cpp:
              (WebCore::RenderTheme::hitTestMediaControlPart):
              (WebCore::RenderTheme::baselinePosition):
              * rendering/RenderThemeMac.mm:
              (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
              (WebCore::RenderThemeMac::paintSearchFieldResultsDecoration):
              (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
              (WebCore::RenderThemeMac::hitTestMediaControlPart):
              * rendering/RenderTreeAsText.cpp:
              (WebCore::operator<<):
              * rendering/RenderVideo.cpp:
              (WebCore::RenderVideo::videoBox):
              * rendering/RenderView.cpp:
              (WebCore::RenderView::RenderView):
              (WebCore::RenderView::calcHeight):
              (WebCore::RenderView::calcWidth):
              (WebCore::RenderView::layout):
              (WebCore::RenderView::viewRect):
              (WebCore::RenderView::docHeight):
              (WebCore::RenderView::docWidth):
              (WebCore::RenderView::setBestTruncatedAt):
              * rendering/RenderView.h:
              * rendering/RenderWidget.cpp:
              (WebCore::RenderWidget::paint):
              (WebCore::RenderWidget::updateWidgetPosition):
              (WebCore::RenderWidget::nodeAtPoint):
              * rendering/RootInlineBox.h:
              (WebCore::RootInlineBox::floats):
              (WebCore::RootInlineBox::floatsPtr):
              * rendering/SVGInlineFlowBox.cpp:
              (WebCore::SVGInlineFlowBox::verticallyAlignBoxes):
              * rendering/SVGInlineFlowBox.h:
              * rendering/SVGRenderTreeAsText.cpp:
              (WebCore::operator<<):
              (WebCore::write):
              * rendering/SVGRootInlineBox.cpp:
              (WebCore::SVGRootInlineBox::verticallyAlignBoxes):
              (WebCore::SVGRootInlineBox::computePerCharacterLayoutInformation):
              (WebCore::SVGRootInlineBox::layoutInlineBoxes):
              * rendering/SVGRootInlineBox.h:
              * rendering/bidi.cpp:
              (WebCore::RenderBlock::computeHorizontalPositionsForLine):
              (WebCore::RenderBlock::computeVerticalPositionsForLine):
              (WebCore::RenderBlock::layoutInlineChildren):
              (WebCore::RenderBlock::determineStartPosition):
              (WebCore::RenderBlock::matchedEndLine):
              (WebCore::RenderBlock::skipTrailingWhitespace):
              (WebCore::RenderBlock::skipLeadingWhitespace):
              (WebCore::RenderBlock::fitBelowFloats):
              (WebCore::RenderBlock::findNextLineBreak):
              (WebCore::RenderBlock::checkLinesForOverflow):
              * svg/SVGLength.cpp:
              (WebCore::SVGLength::PercentageOfViewport):
      
      WebKit/mac:
      
      2009-01-21  David Hyatt  <hyatt@apple.com>
      
              Devirtualize width/height/x/y on RenderObject and move the methods to RenderBox.
      
              Reviewed by Eric Seidel and Darin Adler
      
              * WebView/WebRenderNode.mm:
              (copyRenderNode):
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d885df72
  21. 11 Mar, 2008 1 commit
    • darin@apple.com's avatar
      WebCore: · b7bf13ad
      darin@apple.com authored
              Reviewed by Mitz.
      
              - make some Range improvements (preparation for Range support for DOM mutation)
      
              Made constructors private, added create functions.
              Made refcount start at 1 rather than starting at 0 and being incremented.
              Made Range use two Position objects for the start/end container/offset pairs.
      
              * WebCore.base.exp: Updated.
      
              * dom/Document.cpp:
              (WebCore::Document::createRange): Changed to use Range::create.
              (WebCore::Document::removeMarkers): Updated for Range::first/pastLastNode name change.
      
              * dom/Position.cpp:
              (WebCore::Position::formatForDebugger): Updated for member variable name change.
              (WebCore::Position::showTreeForThis): Ditto.
              (WebCore::startPosition): Changed to use Range::startPosition.
              (WebCore::endPosition): Changed to use Range::endPosition.
      
              * dom/Position.h: Made the data members public and renamed them to container
              and offset. But since offset() is already a function, temporarily used posOffset
              for the data member. Later we'll get rid of offset(). Made more functions inline.
              Removed the constructor that takes a PositionIterator.
      
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::operator Position): Added. Replaces the constructor
              that used to be in Position.
              * dom/PositionIterator.h: Added conversion operator to produce a Position.
              Removed friend declaration for Position.
      
              * dom/Range.cpp:
              (WebCore::Range::Range): Updated constructors for data member changes and made
              them use a refcount of 1.
              (WebCore::Range::create): Added.
              (WebCore::Range::startContainer): Updated to eliminate use of m_detached; detached
              is now indicated by m_start.container of 0. Also updated to use m_start instead
              of the old m_startContainer.
              (WebCore::Range::startOffset): Ditto.
              (WebCore::Range::endContainer): Ditto.
              (WebCore::Range::endOffset): Ditto.
              (WebCore::Range::commonAncestorContainer): Ditto.
              (WebCore::Range::collapsed): Ditto.
              (WebCore::Range::setStart): Ditto.
              (WebCore::Range::setEnd): Ditto.
              (WebCore::Range::collapse): Ditto.
              (WebCore::Range::isPointInRange): Ditto.
              (WebCore::Range::comparePoint): Ditto.
              (WebCore::Range::compareNode): Ditto.
              (WebCore::Range::compareBoundaryPoints): Ditto.
              (WebCore::Range::boundaryPointsValid): Ditto.
              (WebCore::Range::deleteContents): Ditto.
              (WebCore::Range::intersectsNode): Ditto.
              (WebCore::Range::processContents): Ditto.
              (WebCore::Range::extractContents): Ditto.
              (WebCore::Range::cloneContents): Ditto.
              (WebCore::Range::insertNode): Ditto.
              (WebCore::Range::toString): Ditto.
              (WebCore::Range::text): Ditto.
              (WebCore::Range::createContextualFragment): Ditto.
              (WebCore::Range::detach): Ditto.
              (WebCore::Range::checkNodeBA): Changed to use switch statements instead of
              multiple calls to the virtual nodeType() function.
              (WebCore::Range::cloneRange): Ditto.
              (WebCore::Range::setStartAfter): Ditto.
              (WebCore::Range::setEndBefore): Ditto.
              (WebCore::Range::setEndAfter): Ditto.
              (WebCore::Range::selectNode): Ditto.
              (WebCore::Range::selectNodeContents): Ditto.
              (WebCore::Range::surroundContents): Ditto.
              (WebCore::Range::setStartBefore): Ditto.
              (WebCore::Range::checkDeleteExtract): Ditto.
              (WebCore::Range::containedByReadOnly): Ditto.
              (WebCore::Range::firstNode): Ditto.
              (WebCore::Range::editingStartPosition): Ditto.
              (WebCore::Range::pastLastNode): Ditto.
              (WebCore::Range::addLineBoxRects): Ditto.
              (WebCore::Range::formatForDebugger): Ditto.
              (WebCore::operator==): Ditto.
              (WebCore::rangeOfContents): Ditto.
              (WebCore::Range::maxStartOffset): Ditto.
              (WebCore::Range::maxEndOffset): Ditto.
      
              * dom/Range.h: Made constructors private. Added create functions.
              Added getters for startContainer/Offset and endContainer/Offset that
              return 0 instead of an exception for detached ranges that are inline
              and don't require an ExceptionCode out parameter. Changed the parameters
              to setStart and setEnd to PassRefPtr. Removed isDetached function.
              Made ActionType and processContents private. Made startPosition and
              endPosition inlines and have then return const&. Renamed startNode and
              pastEndNode to firstNode and pastLastNode to reduce the chance of
              confusion with startContainer/endContainer. Used Position for m_start
              and m_end instead of separate container and offset members. Changed
              maxStartOffset and maxEndOffset into int to match other offsets.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle): Changed to use Range::create.
              (WebCore::ApplyStyleCommand::applyInlineStyle): Ditto.
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::inputText): Ditto.
              (WebCore::CompositeEditCommand::moveParagraphs): Ditto.
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::mergeParagraphs): Ditto.
              * editing/Editor.cpp:
              (WebCore::Editor::fontForSelection): Changed for pastLastNode name change.
              (WebCore::Editor::setComposition): Changed to use Range::create.
              (WebCore::paragraphAlignedRangeForRange): Ditto.
              (WebCore::markMisspellingsOrBadGrammar): Changed to get rid of check for
              isDetached and check for 0 from startContainer instead.
              (WebCore::Editor::compositionRange): Changed to use Range::create.
              * editing/EditorCommand.cpp:
              (WebCore::unionDOMRanges): Ditto.
              * editing/Selection.cpp:
              (WebCore::Selection::toRange): Ditto.
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::TextIterator): Changed for firstNode and pastLastNode
              name change.
              (WebCore::TextIterator::range): Changed to use Range::create.
              (WebCore::SimplifiedBackwardsTextIterator::range): Ditto.
              (WebCore::TextIterator::subrange): Ditto.
              * editing/VisiblePosition.cpp:
              (WebCore::makeRange): Ditto.
              * editing/VisiblePosition.h: Added now-needed include.
              * editing/htmlediting.cpp:
              (WebCore::indexForVisiblePosition): Changed to use Range::create.
              (WebCore::avoidIntersectionWithNode): Changed to get rid of check for
              isDetached and check for 0 instead and to use Range::create.
              * editing/markup.cpp:
              (WebCore::renderedText): Changed to use Range::create.
              (WebCore::createMarkup): Changed to no longer use isDetached and also
              for new firstNode/pastEndNode names.
              (WebCore::createFragmentFromText): Ditto.
              * editing/visible_units.cpp:
              (WebCore::previousBoundary): Changed to use Range::create.
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge convertToNSRange:]): Changed to no longer use
              isDetached().
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::visiblePositionForIndex): Changed to use Range::create.
              (WebCore::RenderTextControl::indexForVisiblePosition): Ditto.
      
      WebKit/mac:
      
              Reviewed by Mitz.
      
              - update code affected by Range changes
      
              * Misc/WebNSAttributedStringExtras.mm:
              (+[NSAttributedString _web_attributedStringFromRange:]): Update for name changes.
              * WebView/WebHTMLRepresentation.mm:
              (-[WebHTMLRepresentation attributedStringFrom:startOffset:to:endOffset:]):
              Use Range::create.
              * WebView/WebHTMLView.mm:
              (-[WebHTMLView attributedString]): Ditto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30973 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b7bf13ad
  22. 11 Nov, 2007 1 commit
    • ap@webkit.org's avatar
      Reviewed by Darin. · ff51b523
      ap@webkit.org authored
              http://bugs.webkit.org/show_bug.cgi?id=15896
              More editing cleanup
      
              No functionality changes.
      
              * dom/Node.h: Moved several editing-related methods elsewhere.
              * dom/Node.cpp: (WebCore::Node::maxCharacterOffset): Renamed from maxOffset()
              to highlight that it is a match to offsetInCharacters(), and much different from other
              offset-related methods. Added ASSERT_NOT_REACHED(), as callers are supposed to check
              offsetInCharacters() before calling this.
      
              * dom/CharacterData.cpp: (WebCore::CharacterData::maxCharacterOffset):
              * dom/CharacterData.h: (WebCore::CharacterData::isCharacterDataNode):
              Updated for above renamings.
      
              * dom/Comment.{h,cpp}: Removed an override for offsetInCharacters(), which is already present in CharacterData.
      
              * dom/Document.{h,cpp}: Folded updateSelection() into Frame::selectionLayoutChanged().
      
              * dom/Position.h:
              * dom/Position.cpp:
              (WebCore::Position::uncheckedPreviousOffset): Moved from Node::previousOffset().
              (WebCore::Position::uncheckedNextOffset): Moved from Node::NextOffset().
              (WebCore::Position::previous): Adapted to the above move.
              (WebCore::Position::next): Ditto.
              (WebCore::Position::upstream): Removed an isBR() check, since a non-BR element cannot have a BR renderer (I think),
              and BR elements are covered by editingIgnoresContent().
              (WebCore::Position::downstream): Ditto.
              (WebCore::caretMaxRenderedOffset): Moved from Node::caretMaxRenderedOffset().
              (WebCore::Position::rendersInDifferentPosition): Updated for the above moves.
      
              * dom/PositionIterator.h: Added a comment describing this class from the original check-in.
              * dom/PositionIterator.cpp:
              (WebCore::PositionIterator::increment): Updated for the above moves.
              (WebCore::PositionIterator::decrement): Ditto.
      
              * dom/ProcessingInstruction.h:
              * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::maxCharacterOffset):
              ProcessingInstruction was already returning true from offsetInCharacters(), but didn't override maxCharacterOffset().
              I think that implementing it has no actual effect, as PIs are not rendered, but it looks cleaner this way.
      
              * dom/Range.cpp:
              (WebCore::Range::selectNodeContents):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
              (WebCore::ApplyStyleCommand::applyInlineStyle):
              (WebCore::maxRangeOffset):
              (WebCore::ApplyStyleCommand::removeInlineStyle):
              (WebCore::ApplyStyleCommand::splitTextAtStartIfNeeded):
              (WebCore::ApplyStyleCommand::splitTextAtEndIfNeeded):
              (WebCore::ApplyStyleCommand::splitTextElementAtStartIfNeeded):
              (WebCore::ApplyStyleCommand::splitTextElementAtEndIfNeeded):
              (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::insertNodeAt):
              (WebCore::CompositeEditCommand::positionOutsideTabSpan):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::handleGeneralDelete):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::insertTab):
              * editing/visible_units.cpp:
              (WebCore::previousLinePosition):
              (WebCore::nextLinePosition):
              Updated for the above moves.
      
              * editing/Editor.cpp:
              (WebCore::Editor::advanceToNextMisspelling): Added a missing rangeCompliantEquivalent() call.
      
              * editing/TextIterator.cpp:
              (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): Changed the condition to obviously
              match a maxCharacterOffset() call made after it; hopefully, this doesn't break any border cases.
              (WebCore::SimplifiedBackwardsTextIterator::advance): Updated for the above moves.
      
              * editing/htmlediting.h:
              * editing/htmlediting.cpp:
              (WebCore::canHaveChildrenForEditing): Removed a bogus comment: I don't thin BRs have a special ability to accept
              child nodes, other than via DOM manipulation, which is not specific to BRs.
              (WebCore::rangeCompliantEquivalent): Removed a check for BR, which is already covered by editingIgnoresContent().
              (WebCore::maxDeepOffset): Ditto.
              (WebCore::caretMinOffset): Moved from Node. Changed some runtime checks that seemingly cannot fail into assertions.
              (WebCore::caretMaxOffset): Ditto.
      
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMousePressEventSingleClick): Pass 0 to VisiblePosition constructor instead of
              caretMinOffset. I didn't want to include htmlediting.h here, and I think that VisiblePosition constructor
              will take care of adjusting the offset.
      
              * page/Frame.cpp: (WebCore::Frame::selectionLayoutChanged): Folded Document::updateSelection() here.
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge smartDeleteRangeForProposedRange:]): Added missing rangeCompliantEquivalent() calls.
              * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForRenderer): Changed to not round-trip via editing.
              Changed some runtime checks that seemingly cannot fail into assertions.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@27690 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ff51b523
  23. 20 Feb, 2007 1 commit
    • weinig's avatar
      Reviewed by Darin and then Sam. · 346f9e37
      weinig authored
              - fix http://bugs.webkit.org/show_bug.cgi?id=10735
                Clicking in SVG results causes WebKit to consume 100% CPU for several minutes
      
              No test since there is no change in functionality.
      
              * CMakeLists.txt:
              * WebCore.pro:
              * WebCore.xcodeproj/project.pbxproj: Added PositionIterator.{cpp,h}.
              * WebCoreSources.bkl:
              * dom/Position.cpp:
              (WebCore::Position::Position): Added converting constructor from
              PositionIterator.
              (WebCore::Position::previous): Changed assert() to ASSERT().
              (WebCore::Position::next): Ditto.
              (WebCore::isStreamer): Changed the argument to a PositionIterator.
              (WebCore::Position::upstream): Changed to use PositionIterator.
              (WebCore::Position::downstream): Ditto.
              (WebCore::Position::inRenderedText): Made public.
              (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight): Changed
              into a static member function.
              (WebCore::Position::nodeIsUserSelectNone): Ditto.
              * dom/Position.h:
              * dom/PositionIterator.cpp: Added. A Position iterator with constant-time
              increment, decrement, and several predicates on the Position it is at.
              Conversion to/from Position is O(n) in the offset.
              (WebCore::PositionIterator::increment):
              (WebCore::PositionIterator::decrement):
              (WebCore::PositionIterator::atStart):
              (WebCore::PositionIterator::atEnd):
              (WebCore::PositionIterator::atStartOfNode):
              (WebCore::PositionIterator::atEndOfNode):
              (WebCore::PositionIterator::isCandidate):
              * dom/PositionIterator.h: Added.
              (WebCore::PositionIterator::PositionIterator):
              (WebCore::PositionIterator::node):
              (WebCore::PositionIterator::offsetInLeafNode):
              * editing/htmlediting.cpp:
              (WebCore::nextCandidate): Changed to use PositionIterator.
              (WebCore::previousCandidate): Changed to use PositionIterator.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19734 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      346f9e37