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. 28 Apr, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-04-28 Chang Shu <cshu@webkit.org> · 713aea46
      commit-queue@webkit.org authored
              Reviewed by Eric Seidel.
      
              isContentEditable is not working properly with document.designMode
              https://bugs.webkit.org/show_bug.cgi?id=53031
      
              1. Added test cases for checking isContentEditable with designMode.
              2. Added a new test case for setting contenteditable attribute to "inherit" as the
              original code will cause a crash.
              3. Ryosuke Niwa also helped to fix test cases under editing/style that cause infinite loop.
      
              * editing/style/iframe-onload-crash-mac.html:
              * editing/style/iframe-onload-crash-unix.html:
              * editing/style/iframe-onload-crash-win.html:
              * fast/dom/HTMLElement/attr-invalid-string-expected.txt:
              * fast/dom/HTMLElement/attr-invalid-string.html:
              * fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-expected.txt: Added.
              * fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-subframe-expected.txt: Added.
              * fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-subframe.html: Added.
              * fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit.html: Added.
              * fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor-expected.txt: Added.
              * fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor.html: Added.
              * fast/dom/HTMLElement/iscontenteditable-designmodeon-expected.txt: Added.
              * fast/dom/HTMLElement/iscontenteditable-designmodeon.html: Added.
      2011-04-28  Chang Shu  <cshu@webkit.org>
      
              Reviewed by Eric Seidel.
      
              isContentEditable is not working properly with document.designMode
              https://bugs.webkit.org/show_bug.cgi?id=53031
      
              The specification (http://dev.w3.org/html5/spec/Overview.html#attr-contenteditable)
              indicates that the element.isContentEditable relies on document.designMode if its
              and its ancestors' contenteditable attributes are set to inherit.
      
              1. Sync document render style after document.designMode is changed.
              2. Removed the code that does unnecessary and incorrect handling for contenteditable
              attribute with "inherit" value.
              3. Ryosuke Niwa also helped to fix the code in ApplyStyleCommand that causes an assertion.
      
              Tests: fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit-subframe.html
                     fast/dom/HTMLElement/iscontenteditable-designmodeon-allinherit.html
                     fast/dom/HTMLElement/iscontenteditable-designmodeon-ancestor.html
                     fast/dom/HTMLElement/iscontenteditable-designmodeon.html
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::styleForDocument):
              * dom/Document.cpp:
              (WebCore::Document::setDesignMode):
              * dom/Node.cpp:
              (WebCore::Node::rendererIsEditable):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::setContentEditable):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@85267 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      713aea46
  3. 12 Apr, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-04-12 Ryosuke Niwa <rniwa@webkit.org> · a4499a52
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              Move StyleChange and other global functions from ApplyStyleCommand to EditingStyle
              https://bugs.webkit.org/show_bug.cgi?id=55974
      
              Moved StyleChange, getIdentifierValue, and legacyFontSizeFromCSSValue from ApplyStyleCommand
              to EditingStyle. Also moved reconcileTextDecorationProperties, getIdentifierValue,
              setTextDecorationProperty, isCSSValueLength, legacyFontSizeFromCSSValue, extractTextStyles,
              diffTextDecorations, fontWeightIsBold, getTextAlignment, and getPropertiesNotIn.
      
              Because of this move, getPropertiesNotIn is no longer visible outside of EditingStyle.cpp
      
              * editing/ApplyStyleCommand.cpp:
              * editing/ApplyStyleCommand.h:
              * editing/EditingStyle.cpp:
              (WebCore::reconcileTextDecorationProperties):
              (WebCore::StyleChange::StyleChange):
              (WebCore::setTextDecorationProperty):
              (WebCore::getRGBAFontColor):
              (WebCore::StyleChange::extractTextStyles):
              (WebCore::diffTextDecorations):
              (WebCore::fontWeightIsBold):
              (WebCore::getTextAlignment):
              (WebCore::getPropertiesNotIn):
              (WebCore::getIdentifierValue):
              (WebCore::isCSSValueLength):
              (WebCore::legacyFontSizeFromCSSValue):
              * editing/EditingStyle.h:
              (WebCore::StyleChange::cssStyle):
              (WebCore::StyleChange::applyBold):
              (WebCore::StyleChange::applyItalic):
              (WebCore::StyleChange::applyUnderline):
              (WebCore::StyleChange::applyLineThrough):
              (WebCore::StyleChange::applySubscript):
              (WebCore::StyleChange::applySuperscript):
              (WebCore::StyleChange::applyFontColor):
              (WebCore::StyleChange::applyFontFace):
              (WebCore::StyleChange::applyFontSize):
              (WebCore::StyleChange::fontColor):
              (WebCore::StyleChange::fontFace):
              (WebCore::StyleChange::fontSize):
              (WebCore::StyleChange::operator==):
              (WebCore::StyleChange::operator!=):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83618 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a4499a52
  4. 30 Mar, 2011 1 commit
    • inferno@chromium.org's avatar
      2011-03-30 Abhishek Arya <inferno@chromium.org> · 2da9b7ad
      inferno@chromium.org authored
              Reviewed by Simon Fraser.
      
              Tests that we do not crash when removing inline style
              from a node that is not a html element.
              https://bugs.webkit.org/show_bug.cgi?id=57348
      
              * editing/execCommand/remove-format-non-html-element-crash-expected.txt: Added.
              * editing/execCommand/remove-format-non-html-element-crash.html: Added.
      2011-03-30  Abhishek Arya  <inferno@chromium.org>
      
              Reviewed by Simon Fraser.
      
              Fix wrong type assumptions in editing code. Move code
              from ASSERTs to hard checks.
              https://bugs.webkit.org/show_bug.cgi?id=57348
      
              Test: editing/execCommand/remove-format-non-html-element-crash.html
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::applyProperty):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::getRGBAFontColor):
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
              * editing/DeleteButtonController.cpp:
              (WebCore::enclosingDeletableElement):
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::textDirection):
              (WebCore::EditingStyle::prepareToApplyAt):
              * editing/Editor.cpp:
              (WebCore::Editor::textDirectionForSelection):
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::elementForFormatBlockCommand):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@82503 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2da9b7ad
  5. 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
  6. 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
  7. 08 Mar, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-03-08 Ryosuke Niwa <rniwa@webkit.org> · e18eb043
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              addInlineStyleIfNeeded should take EditingStyle
              https://bugs.webkit.org/show_bug.cgi?id=55950
      
              Deployed EditingStyle in addInlineStyleIfNeeded, StyleChange::StyleChange, and StyleChange::init.
              Also extracted EditingStyle::styleIsPresentInComputedStyleOfNode from removeStyleFromRunBeforeApplyingStyle.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::StyleChange::StyleChange): Takes EditingStyle instead of CSSStyleDeclaration.
              (WebCore::StyleChange::init): Ditto.
              (WebCore::ApplyStyleCommand::applyBlockStyle): Instantiates StyleChange.
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): Calls addInlineStyleIfNeeded.
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): Calls styleIsPresentInComputedStyleOfNode.
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Calls EditingStyle::mergeInlineStyleOfElement
              instead of manually merging styles.
              (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): Calls addInlineStyleIfNeeded.
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded): Takes EditingStyle instead of CSSMutableStyleDeclaration.
              * editing/ApplyStyleCommand.h:
              * editing/CompositeEditCommand.h:
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode): Extracted from removeStyleFromRunBeforeApplyingStyle.
              * editing/EditingStyle.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80580 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e18eb043
  8. 01 Mar, 2011 2 commits
    • rniwa@webkit.org's avatar
      2011-03-01 Ryosuke Niwa <rniwa@webkit.org> · b249876e
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              WebKit does not merge text decorations in the typing style and the selected element properly
              https://bugs.webkit.org/show_bug.cgi?id=55349
      
              Added a test to ensure WebKit merges text decorations in the typing style and the inline style
              of the element around the caret when computing the style at the selection start.
      
              * editing/execCommand/merge-text-decoration-with-typing-style-expected.txt: Added.
              * editing/execCommand/merge-text-decoration-with-typing-style.html: Added.
              * editing/style/push-down-inline-styles-expected.txt: Rebaselined due to the change in which text decoration
              values appear.
              * editing/style/script-tests/push-down-inline-styles.js: Ditto.
      2011-03-01  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              WebKit does not merge text decorations in the typing style and the selected element properly
              https://bugs.webkit.org/show_bug.cgi?id=55349
      
              The bug was caused by EditingStyle::mergeTypingStyle's not properly merging text decoration property.
              Fixed the bug by extracting a function from ApplyStyleCommand::pushDownInlineStyleAroundNode and
              calling it in pushDownInlineStyleAroundNode and in mergeTypingStyle.
      
              Test: editing/execCommand/merge-text-decoration-with-typing-style.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown): Takes EditingStyle*;
              calls mergeInlineStyleOfElement.
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Calls applyInlineStyleToPushDown.
              (WebCore::ApplyStyleCommand::removeInlineStyle): Ditto.
              * editing/ApplyStyleCommand.h:
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::mergeTypingStyle): Added; calls mergeStyle.
              (WebCore::EditingStyle::mergeInlineStyleOfElement): Ditto.
              (WebCore::EditingStyle::mergeStyle): Extracted from applyInlineStyleToPushDown.
              * editing/EditingStyle.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@80060 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b249876e
    • rniwa@webkit.org's avatar
      2011-03-01 Ryosuke Niwa <rniwa@webkit.org> · bf57284a
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              applyInlineStyleToPushDown and removeInlineStyleFromElement should take EditingStyle
              https://bugs.webkit.org/show_bug.cgi?id=55338
      
              Deployed EditingStyle in applyInlineStyleToPushDown and removeInlineStyleFromElement.
      
              Also added a convenience function EditingStyle::setProperty, which lazily instantiates
              new CSSMutableStyleDeclaration for m_mutableStyle.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Takes EditingStyle*.
              (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Ditto.
              (WebCore::ApplyStyleCommand::removeCSSStyle): Ditto.
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Calls the above three functions.
              (WebCore::ApplyStyleCommand::removeInlineStyle): Calls pushDownInlineStyleAroundNode.
              * editing/ApplyStyleCommand.h:
              * editing/EditingStyle.cpp:
              (WebCore::HTMLElementEquivalent::addToStyle): Takes EditingStyle*; calls EditingStyle::setProperty.
              (WebCore::HTMLAttributeEquivalent::addToStyle): Ditto.
              (WebCore::EditingStyle::setProperty): Added.  This member function lazily instantiates
              new CSSMutableStyleDeclaration for m_mutableStyle.
              (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Takes EditingStyle*.
              (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement): Ditto.
              (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes): Ditto.
              * editing/EditingStyle.h: Added HTMLElementEquivalent and HTMLAttributeEquivalent as friends.
              (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Ditto.
              * editing/InsertTextCommand.cpp: Removed unnecessary includes.
              * editing/RemoveCSSPropertyCommand.h: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79976 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bf57284a
  9. 25 Feb, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-02-25 Ryosuke Niwa <rniwa@webkit.org> · b2168a94
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Move HTMLEquivalent and its subclasses to EditingStyle
              https://bugs.webkit.org/show_bug.cgi?id=55207
      
              Moved HTMLEquivalent and its subclasses from ApplyStyleCommand to EditingStyle,
              and renamed HTMLEquivalent, HTMLEquivalentValueList, HTMLAttributeEquivalent,
              and HTMLEquivalentFontSizeAttribute to HTMLElementEquivalent, HTMLTextDecorationEquivalent,
              HTMLAttributeEquivalent, and HTMLFontSizeEquivalent respectively.
      
              Also extracted the logic to determine which element and attribute are removed
              as conflictsWithImplicitStyleOfElement, conflictsWithImplicitStyleOfAttributes,
              and extractConflictingImplicitStyleOfAttributes.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
              (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
              * editing/ApplyStyleCommand.h:
              * editing/EditingStyle.cpp:
              (WebCore::HTMLElementEquivalent::create): Moved from ApplyStyleCommand.cpp.
              (WebCore::HTMLElementEquivalent::~HTMLElementEquivalent): Ditto.
              (WebCore::HTMLElementEquivalent::matches): Ditto.
              (WebCore::HTMLElementEquivalent::hasAttribute): Ditto.
              (WebCore::HTMLElementEquivalent::propertyExistsInStyle): Ditto.
              (WebCore::HTMLElementEquivalent::HTMLElementEquivalent): Ditto.
              (WebCore::HTMLElementEquivalent::valueIsPresentInStyle): Ditto.
              (WebCore::HTMLElementEquivalent::addToStyle): Ditto.
              (WebCore::HTMLTextDecorationEquivalent::create): Ditto.
              (WebCore::HTMLTextDecorationEquivalent::HTMLTextDecorationEquivalent): Ditto.
              (WebCore::HTMLTextDecorationEquivalent::valueIsPresentInStyle): Ditto.
              (WebCore::HTMLAttributeEquivalent::create): Ditto.
              (WebCore::HTMLAttributeEquivalent::matches): Ditto.
              (WebCore::HTMLAttributeEquivalent::hasAttribute): Ditto.
              (WebCore::HTMLAttributeEquivalent::attributeName): Ditto.
              (WebCore::HTMLAttributeEquivalent::HTMLAttributeEquivalent): Ditto.
              (WebCore::HTMLAttributeEquivalent::valueIsPresentInStyle): Ditto.
              (WebCore::HTMLAttributeEquivalent::addToStyle): Ditto.
              (WebCore::HTMLAttributeEquivalent::attributeValueAsCSSValue): Ditto.
              (WebCore::HTMLFontSizeEquivalent::create): Ditto.
              (WebCore::HTMLFontSizeEquivalent::HTMLFontSizeEquivalent): Ditto.
              (WebCore::HTMLFontSizeEquivalent::attributeValueAsCSSValue): Ditto.
              (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement): Added.
              (WebCore::htmlAttributeEquivalents): Added.
              (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes): Added.
              (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes): Added.
              * editing/EditingStyle.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79758 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b2168a94
  10. 24 Feb, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-02-23 Ryosuke Niwa <rniwa@webkit.org> · 0c5851d0
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Refactor HTMLEquivalent into a hierachy of classes
              https://bugs.webkit.org/show_bug.cgi?id=55025
      
              Converted HTMLEquivalent into a class.  Some logic in removeImplicitlyStyledElement is
              extracted as member functions of HTMLEquivalent and its subclasses.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::HTMLEquivalent::create): Added.
              (WebCore::HTMLEquivalent::~HTMLEquivalent): Added.
              (WebCore::HTMLEquivalent::matches): Returns true if the element is an equivalent, meaning that
              the element's implicit style affects the property of this equivalence.
              (WebCore::HTMLEquivalent::hasAttribute): Returns true if this equivalence requires attributes;
              e.g. color, size, dir.
              (WebCore::HTMLEquivalent::propertyExistsInStyle): Returns true if the property of this equivalence
              exists in the specified style. e.g. if this equivalence is for size attribute and font-size property,
              this function returns true if the specified style has font-size property set.
              (WebCore::HTMLEquivalent::HTMLEquivalent): Added.
              (WebCore::HTMLEquivalent::valueIsPresentInStyle): Returns true if the specified style has the
              implicit style of the specified element of this equivalence.
              (WebCore::HTMLEquivalent::addToStyle): Adds the implicit style of the element of this equivalence
              to the specified mutable style.
              (WebCore::HTMLEquivalentValueList::create): Added.
              (WebCore::HTMLEquivalentValueList::HTMLEquivalentValueList): Added.
              (WebCore::HTMLEquivalentValueList::valueIsPresentInStyle): Added.
              (WebCore::HTMLEquivalentAttribute::create): Added.
              (WebCore::HTMLEquivalentAttribute::matches): Added.
              (WebCore::HTMLEquivalentAttribute::hasAttribute): Added.
              (WebCore::HTMLEquivalentAttribute::attributeName): Added.
              (WebCore::HTMLEquivalentAttribute::HTMLEquivalentAttribute): Added.
              (WebCore::HTMLEquivalentAttribute::valueIsPresentInStyle): Added.
              (WebCore::HTMLEquivalentAttribute::addToStyle): Added.
              (WebCore::HTMLEquivalentAttribute::attributeValueAsCSSValue): Added.
              (WebCore::HTMLEquivalentFontSizeAttribute::create): Added.
              (WebCore::HTMLEquivalentFontSizeAttribute::HTMLEquivalentFontSizeAttribute): Added.
              (WebCore::HTMLEquivalentFontSizeAttribute::attributeValueAsCSSValue): Added.
              (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Uses new classes.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0c5851d0
  11. 22 Feb, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-02-22 Ryosuke Niwa <rniwa@webkit.org> · 84b451c8
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Deploy EditingStyle in removeInlineStyleFromElement and removeCSSStyle
              https://bugs.webkit.org/show_bug.cgi?id=54944
      
              Deployed EditingStyle in removeInlineStyleFromElement and removeCSSStyle.
      
              Also extracted EditingStyle::conflictsWithInlineStyleOfElement from ApplyStyleCommand::removeCSSStyle,
              which returns true iff the specified element has inline style that conflicts or matches the editing style.
              It also appends conflicting property IDs to the vector of property IDs if one is specified.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle): Calls removeCSSStyle.
              (WebCore::ApplyStyleCommand::applyInlineStyle): Calls shouldSplitTextElement.
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): Calls removeInlineStyleFromElement.
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Takes EditingStyle* instead of CSSMutableStyleDeclaration*.
              (WebCore::ApplyStyleCommand::removeCSSStyle): Ditto; extracted the logic to decide properties to remove as
              conflictsWithInlineStyleOfElement.
              (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle): Calls shouldRemoveInlineStyleFromElement.
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Calls removeInlineStyleFromElement.
              (WebCore::ApplyStyleCommand::removeInlineStyle): Ditto.
              (WebCore::ApplyStyleCommand::shouldSplitTextElement): Takes EditingStyle* instead of CSSMutableStyleDeclaration*.
              * editing/ApplyStyleCommand.h:
              (WebCore::ApplyStyleCommand::shouldRemoveInlineStyleFromElement): Ditto.
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Extracted from ApplyStyleCommand::removeCSSStyle.
              * editing/EditingStyle.h:
              (WebCore::EditingStyle::conflictsWithInlineStyleOfElement): Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79382 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      84b451c8
  12. 21 Feb, 2011 2 commits
    • rniwa@webkit.org's avatar
      2011-02-21 Ryosuke Niwa <rniwa@webkit.org> · 221a9c70
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Deploy EditingStyle more in ApplyStyleCommand and do some cleanup
              https://bugs.webkit.org/show_bug.cgi?id=54528
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::StyleChange::init): Allows style to be a null pointer.
              (WebCore::ApplyStyleCommand::applyInlineStyle): Overrides the value of text-decoration property by that of
              -webkit-text-decorations-in-effect and remove the latter property when present. This allows removeImplicitlyStyledElement
              to ignore -webkit-text-decorations-in-effect. Also uses the return value of EditingStyle::textDirection to determine
              whether or not we need to apply unicode-bidi / direction instead of directly checking the value of unicode-bidi property.
              (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle): Takes EditingStyle* instead of CSSMutableStyleDeclaration*.
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): Ditto.
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): Ditto.
              (WebCore::ApplyStyleCommand::removeCSSStyle): Ditto.
              (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle): Ditto.
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): Ditto.
              (WebCore::ApplyStyleCommand::removeInlineStyle): Ditto; no longer collapse text decoration properties because
              ApplyStyleCommand::applyInlineStyle already does it.
              * editing/ApplyStyleCommand.h:
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::textDirection): Exits early when m_mutableStyle is null.
              (WebCore::EditingStyle::collapseTextDecorationProperties): Extracted from ApplyStyleCommand::removeInlineStyle.
              * editing/EditingStyle.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79278 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      221a9c70
    • rniwa@webkit.org's avatar
      2011-02-17 Ryosuke Niwa <rniwa@webkit.org> · 62b16970
      rniwa@webkit.org authored
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode().
      
              * src/WebViewImpl.cpp:
              (WebKit::WebViewImpl::setComposition): Check the nullity of startContainer() instead of startPosition()->node().
              (WebKit::WebViewImpl::confirmComposition): Ditto.
              (WebKit::WebViewImpl::textInputType):
              (WebKit::WebViewImpl::caretOrSelectionBounds):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Replaced the call to node() by a call to containerNode() because the returned node is
              used to determine whether or not the selected contents are editable and such a check
              must be done against the container node.
      
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::handleKeyboardEvent):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode().
      
              * webkit/webkitwebview.cpp:
              (webkit_web_view_popup_menu_handler):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              * WebView/WebFrame.mm:
              (-[WebFrame _smartDeleteRangeForProposedRange:]):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Replaced the call to node() by a call to containerNode() because the returned node is
              used to determine whether or not the selected contents are editable and such a check
              must be done against the container node.
      
              * WebCoreSupport/EditorClientHaiku.cpp:
              (WebCore::EditorClientHaiku::handleKeyboardEvent):
      2011-02-17  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Kent Tamura.
      
              Rename Position::node() to Position::deprecatedNode()
              https://bugs.webkit.org/show_bug.cgi?id=54622
      
              Done the rename. All calls to node() are replaced by calls to deprecatedNode() except when
              calls were of the form node()->document() and node()->inDocument() in which case they were
              replaced by anchorNode()->document() and anchorNode()->inDocument() respectively.
      
              * WebCore.exp.in: Added Position::containerNode.
      
              The rest abbreviated for simplicity. Please see svn log.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@79196 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      62b16970
  13. 16 Feb, 2011 1 commit
    • andreas.kling@nokia.com's avatar
      2011-02-16 Andreas Kling <kling@webkit.org> · cb0f1860
      andreas.kling@nokia.com authored
              Reviewed by Ryosuke Niwa.
      
              Editing styles should not emit #RRGGBBAA colors
              https://bugs.webkit.org/show_bug.cgi?id=54540
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::StyleChange::extractTextStyles): Use Color::serialized()
              instead of Color::nameForRenderTreeAsText().
      2011-02-16  Andreas Kling  <kling@webkit.org>
      
              Reviewed by Ryosuke Niwa.
      
              Editing styles should not emit #RRGGBBAA colors
              https://bugs.webkit.org/show_bug.cgi?id=54540
      
              Added a test to editing/style/inline-style-container.html
              that would cause invalid #RRGGBBAA output with the previous code.
      
              * editing/execCommand/delete-image-in-anchor-expected.txt:
              * editing/execCommand/script-tests/toggle-unlink.js:
              * editing/execCommand/toggle-unlink-expected.txt:
              * editing/style/fore-color-by-name-expected.txt:
              * editing/style/inline-style-container-expected.txt:
              * editing/style/script-tests/inline-style-container.js:
              * editing/style/style-text-node-without-editable-parent-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      cb0f1860
  14. 15 Feb, 2011 1 commit
    • andreas.kling@nokia.com's avatar
      2011-02-15 Andreas Kling <kling@webkit.org> · a0943e6e
      andreas.kling@nokia.com authored
              Reviewed by Darin Adler.
      
              Rename Color::name() to Color::nameForRenderTreeAsText()
              https://bugs.webkit.org/show_bug.cgi?id=54464
      
              Color::name() returns the color as either #RRGGBB or #RRGGBBAA.
              Since the latter is not a valid CSS color, it can't be re-parsed
              by WebKit, and should only be used in DRT dumps.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::StyleChange::extractTextStyles):
              * page/DragController.cpp:
              (WebCore::DragController::concludeEditDrag):
              * platform/graphics/Color.cpp:
              (WebCore::Color::nameForRenderTreeAsText):
              * platform/graphics/Color.h:
              * platform/graphics/GraphicsLayer.cpp:
              (WebCore::GraphicsLayer::dumpProperties):
              * platform/graphics/filters/FEFlood.cpp:
              (WebCore::FEFlood::externalRepresentation):
              * rendering/RenderTreeAsText.cpp:
              (WebCore::RenderTreeAsText::writeRenderObject):
              * rendering/svg/SVGRenderTreeAsText.cpp:
              (WebCore::operator<<):
              (WebCore::writeRenderSVGTextBox):
              * svg/SVGAnimateElement.cpp:
              (WebCore::SVGAnimateElement::applyResultsToTarget):
              * svg/SVGColor.cpp:
              (WebCore::SVGColor::cssText):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78590 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a0943e6e
  15. 14 Feb, 2011 1 commit
    • leviw@chromium.org's avatar
      2011-02-14 Levi Weintraub <leviw@chromium.org> · 5ec8029d
      leviw@chromium.org authored
              Reviewed by Alexey Proskuryakov.
      
              Strikethrough disappears when posting a message on odnoklassniki.ru
              https://bugs.webkit.org/show_bug.cgi?id=53475
      
              Changing the behavior of the strikethrough execCommand when styleWithCSS
              is false. We formerly created <s> tags, which was different than both IE
              and FF and caused problems with some rich text editors that would strip
              out unexpected tags such as <s>.
      
              Test: editing/execCommand/strikethrough-uses-strike-tag.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
      2011-02-14  Levi Weintraub  <leviw@chromium.org>
      
              Reviewed by Alexey Proskuryakov.
      
              Strikethrough disappears when posting a message on odnoklassniki.ru
              https://bugs.webkit.org/show_bug.cgi?id=53475
      
              Updating test expectations and creating a test in an attempt to prevent the
              uninformed WebKit dev from switching back to using <s> tags for strikethrough.
              As explained in the bug, this is bad for compatibility with various rich text
              editors.
      
              * editing/execCommand/query-text-decoration-with-typing-style-expected.txt:
              * editing/execCommand/script-tests/strikethrough-uses-strike-tag.js: Added.
              (test):
              * editing/execCommand/script-tests/toggle-style-2.js:
              * editing/execCommand/strikethrough-uses-strike-tag-expected.txt: Added.
              * editing/execCommand/strikethrough-uses-strike-tag.html: Added.
              * editing/execCommand/strikethroughSelection-expected.txt:
              * editing/execCommand/toggle-style-2-expected.txt:
              * editing/style/inline-style-container-expected.txt:
              * editing/style/inline-style-extend-run-expected.txt:
              * editing/style/push-down-implicit-styles-around-list-expected.txt:
              * editing/style/push-down-implicit-styles-expected.txt:
              * editing/style/script-tests/inline-style-container.js:
              * editing/style/script-tests/inline-style-extend-run.js:
              * editing/style/script-tests/push-down-implicit-styles-around-list.js:
              * editing/style/script-tests/push-down-implicit-styles.js:
              * editing/style/style-text-node-without-editable-parent-expected.txt:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5ec8029d
  16. 12 Feb, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-02-12 Ryosuke Niwa <rniwa@webkit.org> · 33a9ab25
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              Deploy EditingStyle in applyBlockStyle and applyInlineStyle
              https://bugs.webkit.org/show_bug.cgi?id=53911
      
              Deployed EditingStyle in ApplyStyleCommand::applyBlockStyle and ApplyStyleCommand::applyInlineStyle.
              Extracted EditingStyle::extractAndRemoveTextDirection from applyInlineStyle.
              Also added propertiesToInclude to the argument list of EditingStyle's constructor that takes Node*
              so that splitAncestorsWithUnicodeBidi can call EditingStyle::textDirection to obtain the text direction.
      
              No new tests are added since this is a refactoring.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::doApply): Passes EditingStyle* to applyBlockStyle and applyInlineStyle.
              (WebCore::ApplyStyleCommand::applyBlockStyle): Takes EditingStyle*.
              (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi): Changed the type of allowedDirection
              from int to WritingDirection. Uses EditingStyle's textDirection to obtain the writing direction.
              (WebCore::ApplyStyleCommand::applyInlineStyle): Takes EditingStyle*.
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Allows style to be null; exit early instead.
              (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement): Asserts that style is not null.
              (WebCore::ApplyStyleCommand::removeInlineStyle): Allows style to be null.
              * editing/ApplyStyleCommand.h: Includes WritingDirection.h; prototype changes.
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::EditingStyle): Added PropertiesToInclude to the argument.
              (WebCore::EditingStyle::init): Supports PropertiesToInclude.
              (WebCore::EditingStyle::extractAndRemoveTextDirection): Extracted from applyInlineStyle.
              * editing/EditingStyle.h:
              (WebCore::EditingStyle::create): Supports PropertiesToInclude.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      33a9ab25
  17. 09 Feb, 2011 1 commit
    • yael.aharon@nokia.com's avatar
      2011-02-09 Yael Aharon <yael.aharon@nokia.com> · 3be82c17
      yael.aharon@nokia.com authored
              Reviewed by Darin Adler.
      
              Replace static_cast<HTMLElement*> with toHTMLElement
              https://bugs.webkit.org/show_bug.cgi?id=54117
      
              No new tests since no new functionality was introduced.
      
              * accessibility/AccessibilityListBox.cpp:
              (WebCore::AccessibilityListBox::addChildren):
              * accessibility/AccessibilityMenuListPopup.cpp:
              (WebCore::AccessibilityMenuListPopup::addChildren):
              * accessibility/AccessibilityRenderObject.cpp:
              (WebCore::accessibleNameForNode):
              (WebCore::AccessibilityRenderObject::accessibilityDescription):
              * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp:
              (webkit_accessible_get_name):
              (webkit_accessible_get_description):
              * bindings/gobject/WebKitDOMBinding.cpp:
              (WebKit::createWrapper):
              (WebKit::kit):
              * bindings/js/JSElementCustom.cpp:
              (WebCore::toJSNewlyCreated):
              * bindings/js/JSHTMLFrameSetElementCustom.cpp:
              (WebCore::JSHTMLFrameSetElement::nameGetter):
              * bindings/js/JSNodeCustom.cpp:
              (WebCore::createWrapperInline):
              * bindings/v8/custom/V8ElementCustom.cpp:
              (WebCore::toV8):
              * dom/Document.cpp:
              (WebCore::Document::body):
              * dom/Element.cpp:
              (WebCore::Element::deprecatedCreateContextualFragment):
              * dom/Range.cpp:
              (WebCore::Range::createContextualFragment):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle):
              (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
              (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi):
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
              (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
              (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
              (WebCore::ApplyStyleCommand::removeInlineStyle):
              (WebCore::ApplyStyleCommand::shouldSplitTextElement):
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
              * editing/DeleteButtonController.cpp:
              (WebCore::enclosingDeletableElement):
              (WebCore::DeleteButtonController::show):
              * editing/Editor.cpp:
              (WebCore::Editor::setBaseWritingDirection):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::mergeWithNeighboringLists):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::negateStyleRulesThatAffectAppearance):
              (WebCore::ReplaceSelectionCommand::handleStyleSpans):
              (WebCore::ReplaceSelectionCommand::copyStyleToChildren):
              * editing/SelectionController.cpp:
              (WebCore::scanForForm):
              (WebCore::SelectionController::currentForm):
              * editing/htmlediting.cpp:
              (WebCore::enclosingList):
              (WebCore::enclosingListChild):
              (WebCore::embeddedSublist):
              (WebCore::appendedSublist):
              * editing/markup.cpp:
              (WebCore::StyledMarkupAccumulator::appendElement):
              * html/HTMLCollection.cpp:
              (WebCore::HTMLCollection::checkForNameMatch):
              (WebCore::HTMLCollection::updateNameCache):
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::setOuterHTML):
              (WebCore::HTMLElement::shadowAncestorOwnerForm):
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::formElementIndex):
              * html/HTMLSelectElement.cpp:
              (WebCore::HTMLSelectElement::setOption):
              (WebCore::HTMLSelectElement::setLength):
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::getOuterHTML):
              (WebCore::InspectorDOMAgent::setOuterHTML):
              * page/EventHandler.cpp:
              (WebCore::EventHandler::handleMouseMoveEvent):
              * rendering/RenderMeter.cpp:
              (WebCore::RenderMeter::createPart):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::createSubtreeIfNeeded):
              * rendering/RenderTextControlSingleLine.cpp:
              (WebCore::RenderTextControlSingleLine::createSubtreeIfNeeded):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      3be82c17
  18. 08 Feb, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-02-08 Ryosuke Niwa <rniwa@webkit.org> · b846ddcc
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              REGRESSION(71556,68059): queryCommandValue screws up background color at collapsed cursor
              https://bugs.webkit.org/show_bug.cgi?id=53196
      
              The bug was caused by Editor::selectionComputedStyle's modifying typing style without making a copy,
              and its removing non-inheritable properties from the typing style. Fixed the bug by making a copy
              before making the modification and not removing non-inheritable properties.
      
              Also fixed a bug in selectionStartCSSPropertyValue that it doesn't handle xx-small to -webkit-xxx-large
              by extracting a function from StyleChange::extractTextStyles and calling it in both extractTextStyles
              and selectionStartCSSPropertyValue.
      
              Test: editing/style/query-typing-style.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::legacyFontSizeFromCSSValue): Extracted from StyleChange::extractTextStyles.
              (WebCore::StyleChange::extractTextStyles): Calls legacyFontSizeFromCSSValue; this fixes the bug that
              CSS values from xx-small through -webkit-xxx-large are not accounted.
              * editing/ApplyStyleCommand.h:
              * editing/Editor.cpp:
              (WebCore::Editor::selectionStartCSSPropertyValue): Calls legacyFontSizeFromCSSValue.
              (WebCore::Editor::selectionComputedStyle): Makes a copy before modifying typing style.
              No longer calls removeNonEditingProperties on the copied typing style so that background-color property
              is included when merged into the style.
      2011-02-08  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              REGRESSION(71556,68059): queryCommandValue screws up background color at collapsed cursor
              https://bugs.webkit.org/show_bug.cgi?id=53196
      
              Added a test to ensure calling queryCommandValue returns the correct value for backColor
              and fontSize from typing style.
      
              * editing/style/query-typing-style-expected.txt: Added.
              * editing/style/query-typing-style.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@78011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b846ddcc
  19. 19 Jan, 2011 1 commit
    • commit-queue@webkit.org's avatar
      2011-01-19 Levi Weintraub <leviw@google.com> · c56f5de7
      commit-queue@webkit.org authored
              Reviewed by Ryosuke Niwa.
      
              Replaced rangeCompliantEquivalent with Position::parentAnchoredEquivalent
              and simplified the logic a bit. Unfortunately, Tables and some legacy
              editing positions still need to be handled specifically.
      
              remove rangeCompliantEquivalent and replace it with Position methods
              https://bugs.webkit.org/show_bug.cgi?id=25057
      
              No new tests as this is a refactor that doesn't change behavior.
      
              * WebCore.exp.in:
              * dom/Document.cpp:
              (WebCore::Document::caretRangeFromPoint):
              * dom/Position.cpp:
              (WebCore::Position::parentAnchoredEquivalent):
              * dom/Position.h:
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle):
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::insertNodeAt):
              (WebCore::CompositeEditCommand::moveParagraphs):
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::initializePositionData):
              (WebCore::DeleteSelectionCommand::mergeParagraphs):
              * editing/Editor.cpp:
              (WebCore::Editor::textDirectionForSelection):
              (WebCore::Editor::advanceToNextMisspelling):
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::shouldUseBreakElement):
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::doApply):
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::handleStyleSpansBeforeInsertion):
              * editing/VisiblePosition.cpp:
              (WebCore::makeRange):
              (WebCore::setStart):
              (WebCore::setEnd):
              * editing/VisibleSelection.cpp:
              (WebCore::VisibleSelection::firstRange):
              (WebCore::VisibleSelection::toNormalizedRange):
              (WebCore::makeSearchRange):
              * editing/htmlediting.cpp:
              (WebCore::indexForVisiblePosition):
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::previousBoundary):
              (WebCore::nextBoundary):
              * page/DOMSelection.cpp:
              (WebCore::anchorPosition):
              (WebCore::focusPosition):
              (WebCore::basePosition):
              (WebCore::extentPosition):
      2011-01-19  Levi Weintraub  <leviw@google.com>
      
              Reviewed by Ryosuke Niwa.
      
              Updating to use Position::parentAnchoredEquivalent instead of
              the old htmlediting rangeCompliantEquivalent.
      
              remove rangeCompliantEquivalent and replace it with Position methods
              https://bugs.webkit.org/show_bug.cgi?id=25057
      
              * WebView/WebFrame.mm:
              (-[WebFrame _smartDeleteRangeForProposedRange:]):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c56f5de7
  20. 14 Jan, 2011 1 commit
  21. 12 Jan, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-01-12 Ryosuke Niwa <rniwa@webkit.org> · 7bfcc007
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              Removed instantiation of legacy editing positions.
              Calls to Position::Position are replaced by calls to Position's convenience functions.
      
              Also added firstPositionInOrBeforeNode and lastPositionInOrAfterNode,
              which are functions that return firstPositionInNode and lastPositionInNode respectively
              when the specified node can have children for editing purpose and return positionBeforeNode
              and positionAfterNode respectively otherwise. They can be used to guarantee that we never
              create a bogus position like [img, 0] or [br, 0].
      
              No tests are added since this is a cleanup.
      
              * editing/ApplyBlockElementCommand.cpp:
              (WebCore::ApplyBlockElementCommand::formatSelection):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle):
              (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
              (WebCore::ApplyStyleCommand::highestAncestorWithConflictingInlineStyle):
              (WebCore::ApplyStyleCommand::removeInlineStyle):
              (WebCore::ApplyStyleCommand::nodeFullySelected):
              (WebCore::ApplyStyleCommand::nodeFullyUnselected):
              (WebCore::ApplyStyleCommand::splitTextAtStart):
              (WebCore::ApplyStyleCommand::splitTextAtEnd):
              (WebCore::ApplyStyleCommand::splitTextElementAtStart):
              (WebCore::ApplyStyleCommand::splitTextElementAtEnd):
              (WebCore::ApplyStyleCommand::isValidCaretPositionInTextNode):
              (WebCore::ApplyStyleCommand::mergeStartWithPreviousIfIdentical):
              (WebCore::ApplyStyleCommand::mergeEndWithNextIfIdentical):
              (WebCore::ApplyStyleCommand::computedFontSize):
              (WebCore::ApplyStyleCommand::joinChildTextNodes):
              * editing/ApplyStyleCommand.h:
              * editing/htmlediting.h:
              (WebCore::firstPositionInOrBeforeNode): Added.
              (WebCore::lastPositionInOrAfterNode): Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7bfcc007
  22. 08 Jan, 2011 1 commit
  23. 05 Jan, 2011 1 commit
    • rniwa@webkit.org's avatar
      2011-01-05 Ryosuke Niwa <rniwa@webkit.org> · 809f9979
      rniwa@webkit.org authored
              Reviewed by Eric Seidel.
      
              ApplyStyleCommand::applyRelativeFontStyleChange should take EditingStyle*
              https://bugs.webkit.org/show_bug.cgi?id=50641
      
              Modified applyRelativeFontStyleChange to take EditingStyle instead of CSSMutableStyleDeclaration.
              Also extracted the logic to obtain the font size delta from ApplyStyleCommand to EditingStyle.
              The font size delta is now stored as a member variable of EditingStyle as supposed to a property
              in CSSMutableStyleDeclration as soon as EditingStyle is instantiated.
      
              No new tests are added since this is a refactoring.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::doApply): Calls applyRelativeFontStyleChange.
              (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange): Takes EditingStyle.
              * editing/ApplyStyleCommand.h:
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::EditingStyle): Initializes m_fontSizeDelta.
              (WebCore::EditingStyle::init): Ditto.
              (WebCore::EditingStyle::extractFontSizeDelta): Extracted from applyRelativeFontStyleChange.
              (WebCore::EditingStyle::isEmpty): Takes care of m_fontSizeDelta.
              (WebCore::EditingStyle::setStyle): Calls extractFontSizeDelta.
              (WebCore::EditingStyle::overrideWithStyle): Ditto.
              (WebCore::EditingStyle::clear): Initializes m_fontSizeDelta.
              (WebCore::EditingStyle::copy): Calls extractFontSizeDelta.
              * editing/EditingStyle.h:
              (WebCore::EditingStyle::fontSizeDelta): Added.
              (WebCore::EditingStyle::hasFontSizeDelta): Added.
              * editing/Editor.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75080 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      809f9979
  24. 06 Dec, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-12-06 Ryosuke Niwa <rniwa@webkit.org> · 5359dff3
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              ApplyStyleCommand should take EditingStyle instead of CSSStyleDeclaration
              https://bugs.webkit.org/show_bug.cgi?id=49938
      
              Modified ApplyStyleCommand::ApplyStyleCommand and ApplyStyleCommand::create to take EditingStyle*
              instead of CSSStyleDeclaration*. Also replaced much of code in Editor::computeAndSetTypingStyle
              by calls to EditingStyle's member functions and extracted EditingStyle::overrideWith and
              EditingStyle::extractAndRemoveBlockProperties.
      
              No new tests are added since this is a refactoring.
      
              * WebCore.exp.in: Added SelectionController::copyTypingStyle and EditingStyle::~EditingStyle.
              * css/CSSMutableStyleDeclaration.cpp: Made CSSMutableStyleDeclaration* in the argument list const.
              (WebCore::CSSMutableStyleDeclaration::merge):
              * css/CSSMutableStyleDeclaration.h:
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::ApplyStyleCommand): Takes EditingStyle* instead of CSSStyleDeclaration*.
              (WebCore::ApplyStyleCommand::doApply): Uses EditingStyle.
              * editing/ApplyStyleCommand.h: m_style is now a ref-pointer to EditingStyle instead of CSSMutableStyleDeclaration.
              (WebCore::ApplyStyleCommand::create): Takes EditingStyle* instead of CSSStyleDeclaration*.
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::applyStyle): Ditto.
              (WebCore::CompositeEditCommand::moveParagraphs): Calls applyStyle.
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
              * editing/CompositeEditCommand.h:
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
              * editing/EditCommand.cpp:
              * editing/EditCommand.h:
              * editing/EditingStyle.cpp:
              (WebCore::EditingStyle::~EditingStyle): Added.
              (WebCore::EditingStyle::overrideWithStyle): Extracted from Editor::calculateTypingStyleAfterDelete.
              (WebCore::EditingStyle::copy): Added.
              (WebCore::EditingStyle::extractAndRemoveBlockProperties): Extracted from Editor::calculateTypingStyleAfterDelete.
              * editing/EditingStyle.h:
              * editing/Editor.cpp:
              (WebCore::Editor::applyStyle): Calls ApplyStyleCommand::create.
              (WebCore::Editor::applyParagraphStyle): Ditto.
              (WebCore::Editor::computeAndSetTypingStyle): Ditto.
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply): Calls applyStyle.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::input): Ditto.
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply): Calls ApplyStyleCommand::create.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::completeHTMLReplacement): Calls applyStyle.
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::copyTypingStyle): Moved from SelectionController.h
              * editing/SelectionController.h:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73416 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      5359dff3
  25. 21 Nov, 2010 1 commit
    • paroga@webkit.org's avatar
      2010-11-21 Patrick Gansterer <paroga@webkit.org> · f27e2eb1
      paroga@webkit.org authored
              Reviewed by Csaba Osztrogonác.
      
              Use WTF_ARRAY_LENGTH in WebCore directory
              https://bugs.webkit.org/show_bug.cgi?id=49882
      
              * accessibility/AccessibilityObject.cpp:
              (WebCore::createARIARoleMap):
              * bindings/js/JSDOMWindowBase.cpp:
              (WebCore::JSDOMWindowBase::JSDOMWindowBase):
              * bindings/scripts/CodeGeneratorV8.pm:
              * bindings/scripts/test/V8/V8TestObj.cpp:
              (WebCore::ConfigureV8TestObjTemplate):
              * css/CSSComputedStyleDeclaration.cpp:
              * css/CSSMutableStyleDeclaration.cpp:
              (WebCore::CSSMutableStyleDeclaration::getPropertyValue):
              * css/CSSParser.cpp:
              (WebCore::CSSParser::parseAnimationShorthand):
              (WebCore::CSSParser::parseTransitionShorthand):
              * css/CSSPropertyLonghand.cpp:
              (WebCore::initShorthandMap):
              * dom/ExceptionCode.cpp:
              (WebCore::getExceptionCodeDescription):
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
              * editing/EditingStyle.cpp:
              * editing/Editor.cpp:
              (WebCore::triStateOfStyle):
              * editing/EditorCommand.cpp:
              (WebCore::createCommandMap):
              * editing/MarkupAccumulator.cpp:
              (WebCore::appendCharactersReplacingEntities):
              * html/canvas/WebGLBuffer.cpp:
              (WebCore::WebGLBuffer::getCachedMaxIndex):
              (WebCore::WebGLBuffer::setCachedMaxIndex):
              * loader/FTPDirectoryParser.cpp:
              (WebCore::parseOneFTPLine):
              * mathml/RenderMathMLOperator.cpp:
              (WebCore::RenderMathMLOperator::updateFromElement):
              * page/animation/AnimationBase.cpp:
              (WebCore::addShorthandProperties):
              * rendering/RenderTextControl.cpp:
              (WebCore::RenderTextControl::hasValidAvgCharWidth):
              * rendering/break_lines.cpp:
              * svg/SVGTransformable.cpp:
              (WebCore::parseAndSkipType):
              * svg/SVGViewSpec.cpp:
              (WebCore::SVGViewSpec::parseViewSpec):
              * svg/SVGZoomAndPan.cpp:
              (WebCore::SVGZoomAndPan::parseZoomAndPan):
              * xml/XPathFunctions.cpp:
              (WebCore::XPath::createFunctionMap):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72500 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f27e2eb1
  26. 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
  27. 08 Nov, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-11-08 Ryosuke Niwa <rniwa@webkit.org> · 0d96cf61
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Remove the remaining editing-style functions from ApplyStyleCommand
              https://bugs.webkit.org/show_bug.cgi?id=49155
      
              Replaced removeNonEditingProperties, editingStyleAtPosition, prepareEditingStyleToApplyAt,
              and removeStylesAddedByNode in ApplyStyleCommand.cpp by removeNonEditingProperties, EditingStyle::create,
              prepareToApplyAt, and removeStyleAddedByNode in EditingStyle.cpp.
      
              Also removed unnecessary header includes from various cpp files.
      
              No tests are added since this is a cleanup.
      
              * editing/ApplyStyleCommand.cpp: Removed removeNonEditingProperties, editingStyleAtPosition,
              prepareEditingStyleToApplyAt, and removeStylesAddedByNode.
              * editing/ApplyStyleCommand.h: Ditto.
              * editing/DeleteSelectionCommand.cpp: Removed removeEnclosingAnchorStyle.
              (WebCore::DeleteSelectionCommand::saveTypingStyleState): Calls removeStylesAddedByNode instead.
              * editing/EditingStyle.cpp:
              (WebCore::copyEditingProperties): Moved and renamed ApplyStyleCommand::removeNonEditingProperties.
              (WebCore::editingStyleFromComputedStyle): Calls copyEditingProperties. Changed the argument to PassRefPtr
              as supposed to a raw pointer for convenience.
              (WebCore::EditingStyle::init): Calls editingStyleFromComputedStyle.
              (WebCore::EditingStyle::removeStyleAddedByNode): Added.
              (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode): Added.
              (WebCore::EditingStyle::removeNonEditingProperties): Added.
              (WebCore::editingStyleIncludingTypingStyle): Calls copyEditingProperties.
              * editing/EditingStyle.h: Added prototypes.
              * editing/Editor.cpp:
              (WebCore::Editor::selectionComputedStyle): Uses EditingStyle.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::calculateStyleBeforeInsertion): Ditto.
              (WebCore::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Ditto.
              * editing/InsertParagraphSeparatorCommand.h:
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply): Ditto.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::handleStyleSpansBeforeInsertion): Ditto.
              (WebCore::ReplaceSelectionCommand::handleStyleSpans): Ditto.
              (WebCore::ReplaceSelectionCommand::doApply): Ditto.
              (WebCore::ReplaceSelectionCommand::completeHTMLReplacement): Ditto.
              * editing/ReplaceSelectionCommand.h:
              * editing/markup.cpp: Removed removeEnclosingMailBlockquoteStyle and removeDefaultStyles.
              (WebCore::createMarkup): Uses EditingStyle.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0d96cf61
  28. 06 Nov, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-11-04 Ryosuke Niwa <rniwa@webkit.org> · 7e06f4ab
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Bug 46335 - Add EditingStyle
              https://bugs.webkit.org/show_bug.cgi?id=46335
      
              Added EditingStyle to WebCore/editing.  This class is intended to encapsulate getPropertiesNotIn, removeNonEditingProperties,
              editingStyleAtPosition, and prepareEditingStyleToApplyAt in ApplyStyleCommand.cpp once deployed everywhere.
              Deployed it in typing styles.
      
              No new tests are added since this is a refactoring in progress.
      
              * CMakeLists.txt: Added EditingStyle.cpp
              * GNUmakefile.am: Added EditingStyle.cpp and EditingStyle.h
              * WebCore.gypi: Ditto.
              * WebCore.pro: Ditto.
              * WebCore.xcodeproj/project.pbxproj: Ditto.
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::moveParagraphs): Calls editingStyleIncludingTypingStyle.
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Uses EditingStyle.
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::saveTypingStyleState): Ditto.
              (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): Ditto.
              * editing/DeleteSelectionCommand.h:
              * editing/EditingStyle.cpp: Added.
              (WebCore::editingStyleFromComputedStyle): Added.
              (WebCore::EditingStyle::EditingStyle): Added.
              (WebCore::EditingStyle::init): Added; a clone of ApplyStyleCommand::editingStyleAtPosition.
              (WebCore::EditingStyle::removeTextFillAndStrokeColorsIfNeeded): Extracted from init.
              (WebCore::EditingStyle::replaceFontSizeByKeywordIfPossible): Extracted from init.
              (WebCore::EditingStyle::isEmpty): Added.
              (WebCore::EditingStyle::setStyle): Added.
              (WebCore::EditingStyle::clear): Added.
              (WebCore::EditingStyle::removeBlockProperties): Added.
              (WebCore::EditingStyle::prepareToApplyAt): Added.
              (WebCore::editingStyleIncludingTypingStyle): Added.
              * editing/EditingStyle.h: Added.
              (WebCore::EditingStyle::create): Added.
              (WebCore::EditingStyle::style): Added.
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply): Uses EditingStyle.
              * editing/SelectionController.h:
              (WebCore::SelectionController::typingStyle): Uses EditingStyle.
              (WebCore::SelectionController::clearTypingStyle): Uses EditingStyle.
              (WebCore::SelectionController::setTypingStyle): Uses EditingStyle.
              * rendering/style/RenderStyle.h: Added EditingStyle as a friend.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71469 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7e06f4ab
  29. 05 Nov, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-11-05 Ryosuke Niwa <rniwa@webkit.org> · caa18c1b
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Crash in ApplyStyleCommand::surroundNodeRangeWithElement
              https://bugs.webkit.org/show_bug.cgi?id=48581
      
              The crash was caused by a false assertion that we can always recover selection in
              ApplyStyleCommand::removeInlineStyle.  Fixed the crash by removing the assertion
              and adding an early exit to the call site.  Also converted raw pointers to RefPtr
              in surroundNodeRangeWithElement and addInlineStyleIfNeeded.
      
              Test (non-Mac platforms): editing/style/iframe-onload-crash.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyInlineStyle):
              (WebCore::ApplyStyleCommand::removeInlineStyle):
              (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement):
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
              * editing/ApplyStyleCommand.h:
      2010-11-04  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              Re-enabled editing/style/iframe-onload-crash.html on Chromium, Qt, and Windows platforms.
      
              * platform/chromium/test_expectations.txt:
              * platform/qt/Skipped:
              * platform/win/Skipped:
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      caa18c1b
  30. 03 Nov, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-11-01 Ryosuke Niwa <rniwa@webkit.org> · bc908feb
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Crash in ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle
              https://bugs.webkit.org/show_bug.cgi?id=48581
      
              The crash was caused by RemoveNodePreservingChildrenCommand's calling removeNode
              on m_node without checking that m_node has a parent and it's still in the document.
              Fixed the crash by adding an early exit in CompositeEditCommand::removeNode and
              deploying RefPtr in several places of ApplyStyleCommand.cpp.
      
              Test: editing/style/iframe-onload-crash.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
              * editing/ApplyStyleCommand.h:
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::removeNode):
      2010-10-29  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              Crash in ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle
              https://bugs.webkit.org/show_bug.cgi?id=48581
      
              Added a test to ensure removeStyleFromRunBeforeApplyingStyle doesn't crash.
      
              * editing/style/iframe-onload-crash-expected.txt: Added.
              * editing/style/iframe-onload-crash.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71288 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      bc908feb
  31. 28 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-10-28 Ryosuke Niwa <rniwa@webkit.org> · 2683322b
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              chrome.dll!WebCore::Node::shadowAncestorNode ReadAV@NULL (98643190851b5662363449cc7303d8a5)
              https://bugs.webkit.org/show_bug.cgi?id=47888
      
              The crash was caused by the while loop in ApplyStyleCommand::fixRangeAndApplyInlineStyle
              not considering the case where startNode is the root editable element.
              Fixed the bug by not entering the loop when startNode is the editable root.
      
              Test: editing/style/fix-range-from-root-editable-crash.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
      2010-10-28  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              chrome.dll!WebCore::Node::shadowAncestorNode ReadAV@NULL (98643190851b5662363449cc7303d8a5)
              https://bugs.webkit.org/show_bug.cgi?id=47888
      
              Added a test to ensure ApplyStyleCommand::fixRangeAndApplyInlineStyle doesn't crash
              when startNode is body and it is, therefore, the editable root.
      
              Note that the test does not reproduce the crash when DOCTYPE is added.
      
              * editing/style/fix-range-from-root-editable-crash-expected.txt: Added.
              * editing/style/fix-range-from-root-editable-crash.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70821 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2683322b
  32. 26 Oct, 2010 1 commit
  33. 21 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-10-21 Ryosuke Niwa <rniwa@webkit.org> · 601e805e
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              removeFormat needs to be reimplemented
              https://bugs.webkit.org/show_bug.cgi?id=43017
      
              Reimplemented execCommand('RemoveFormat', false, null). New implementation removes
              the same elements removed by Internet Explorer. Because WebKit supports StyleWithCSS
              we also reset any editing styles to match that of the root editable element
              while Internet Explorer does not remove any CSS styles.
      
              New implementation uses ApplyStyleCommand to remove appropriate elements and reset the style.
              Added new constructor and member variable to ApplyStyleCommand to support mass-removal of elements
              since it's inefficient to call ApplyStyleCommand on each element we're removing.
      
              To avoid an infinite loop in pushDownInlineStyleAroundNode when mass-removing, WebKit no longer
              push down element one level at a time. Instead, we keep a stack of styled elements to be applied,
              and apply wrap siblings of targetNode's ancestors by all of them at once.
      
              Tests: editing/execCommand/remove-format-elements.html
                     editing/execCommand/remove-format-multiple-elements.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::ApplyStyleCommand): Added; this version takes style and a function pointer
              to a boolean function that determines which element needs to removed, and set m_removeOnly to true.
              (WebCore::ApplyStyleCommand::doApply): Added support for m_isInlineElementToRemoveFunction.
              (WebCore::ApplyStyleCommand::applyBlockStyle): Ditto.
              (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange): Exits early if m_removeOnly is true.
              (WebCore::ApplyStyleCommand::isStyledInlineElementToRemove): Added.
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle): Calls isStyledInlineElementToRemove.
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): Ditto.
              (WebCore::ApplyStyleCommand::removeInlineStyle): Ditto.
              (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): See above.
              * editing/ApplyStyleCommand.h:
              (WebCore::ApplyStyleCommand::create): Added.
              * editing/RemoveFormatCommand.cpp:
              (WebCore::isElementForRemoveFormatCommand): Added.
              (WebCore::RemoveFormatCommand::doApply): Rewritten.
      2010-10-21  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              removeFormat needs to be reimplemented
              https://bugs.webkit.org/show_bug.cgi?id=43017
      
              * editing/execCommand/19403-expected.txt: hr element is no longer removed erroneously.
              * editing/execCommand/19403.html: Updated the test description.
              * editing/execCommand/4786404-1-expected.txt: Change in text nodes but identical rendering.
              * editing/execCommand/4786404-2-expected.txt: Ditto.
              * editing/execCommand/4920488-expected.txt: Preserves anchor element on RemoveFormat.
              * editing/execCommand/4920488.html: Updated the test description.
              * editing/execCommand/4920742-1-expected.txt: Preserves div elements.
              * editing/execCommand/5049671.html: Updated the test to dump twice before and after RemoveFormat.
              This was a test to ensure WebKit removes anchor elements but we no longer removes anchor elements.
              * editing/execCommand/5049671-expected.txt:
              * editing/execCommand/5573879.html: Updated the test description because WebKit no longer removes
              lists on RemoveFormat.
              * editing/execCommand/5573879-expected.txt:
              * editing/execCommand/5770834-1-expected.txt: Removed redundant text-align property value.
              * editing/execCommand/remove-format-elements-expected.txt: Added.
              * editing/execCommand/remove-format-elements.html: Added.
              * editing/execCommand/remove-format-multiple-elements-expected.txt: Added.
              * editing/execCommand/remove-format-multiple-elements.html: Added.
              * editing/execCommand/remove-formatting-2-expected.txt: Change in text nodes but identical rendering.
              * editing/execCommand/remove-formatting-expected.txt: WebKit no longer removes anchor, table,
              tbody, tr, and td elements.
              * editing/execCommand/script-tests/remove-format-multiple-elements.js: Added.
              (testRemoveFormat):
              (selectAll):
              (selectSecondWord):
              (selectFirstTwoWords):
              (selectLastTwoWords):
              (selectLastWord):
              * editing/execCommand/script-tests/toggle-link.js: Anchor wraps div instead of div wrapping anchor.
              * editing/execCommand/script-tests/toggle-unlink.js: Ditto.
              * editing/execCommand/toggle-link-expected.txt: Ditto.
              * editing/execCommand/toggle-unlink-expected.txt: Ditto.
              * editing/execCommand/unlink-expected.txt: i wraps div instead of i wrapping anchor.
              * editing/inserting/space-after-removeformat-expected.txt: Editing delegate change.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70283 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      601e805e
  34. 15 Oct, 2010 3 commits
    • rniwa@webkit.org's avatar
      2010-10-15 Ryosuke Niwa <rniwa@webkit.org> · 6a1d84da
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              unlink removes inline style of anchor elements
              https://bugs.webkit.org/show_bug.cgi?id=47424
      
              The bug was caused by our not extracting styles when the anchor element is removed by removeInlineStyle.
              Because we removed the element without pushing its inline style down, we lost style information.
      
              Fixed the bug by pushing down styles in removeInlineStyle as done in pushDownInlineStyleAroundNode.
              Also fixed a bug in addInlineStyleIfNeeded where StyleChange incorrectly removed styles of the container
              node as supposed to that of startNode from the style to apply when startNode is not an element.
      
              Test: editing/execCommand/toggle-unlink.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement): To prevent a similar bug in the future,
              added an assert that extractedStyle is specified whenever we're removing a styled element.
              (WebCore::ApplyStyleCommand::removeInlineStyle):
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
      2010-10-15  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              unlink removes inline style of anchor elements
              https://bugs.webkit.org/show_bug.cgi?id=47424
      
              Added a test to ensure execCommand('unlink', false, null) preserves the inline style declaration.
      
              * editing/execCommand/script-tests/toggle-unlink.js: Added.
              (testSingleToggle):
              (selectAll):
              (selectFirstTwoWords):
              (selectLastTwoWords):
              (selectLastWord):
              * editing/execCommand/toggle-unlink-expected.txt: Added.
              * editing/execCommand/toggle-unlink.html: Added.
              * editing/style/script-tests/make-text-writing-direction-inline.js: Specifies both direction
              and unicode-bidi properties instead of just direction property.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6a1d84da
    • darin@apple.com's avatar
      2010-10-14 Darin Adler <darin@apple.com> · 601d44bd
      darin@apple.com authored
              Reviewed by Alexey Proskuryakov.
      
              Use more specific types for node pointers, especially when calling node insertion and removal functions
              https://bugs.webkit.org/show_bug.cgi?id=47702
      
              Refactoring. No new tests.
      
              While developing this patch I temporarily removed the node insertion and
              removal member functions from the Node class and fixed almost all call sites
              so they call it directly on the ContainerNode class, which will be important
              once we make the functions non-virtual.
      
              * css/CSSStyleSelector.cpp:
              (WebCore::CSSStyleSelector::SelectorChecker::checkSelector):
              * dom/ContainerNode.cpp:
              (WebCore::ContainerNode::insertBefore):
              (WebCore::ContainerNode::replaceChild):
              (WebCore::ContainerNode::appendChild):
              * dom/Document.cpp:
              (WebCore::Document::caretRangeFromPoint):
              * dom/DynamicNodeList.cpp:
              (WebCore::DynamicNodeList::itemWithName):
              * dom/Position.cpp:
              (WebCore::Position::previous):
              (WebCore::Position::next):
              * dom/Text.cpp:
              (WebCore::Text::replaceWholeText):
              * dom/TreeWalker.cpp:
              (WebCore::TreeWalker::firstChild):
              (WebCore::TreeWalker::lastChild):
              (WebCore::TreeWalker::previousNode):
              * dom/XMLDocumentParserLibxml2.cpp:
              (WebCore::XMLDocumentParser::XMLDocumentParser):
              * editing/BreakBlockquoteCommand.cpp:
              (WebCore::BreakBlockquoteCommand::doApply):
              * editing/CompositeEditCommand.h:
              * editing/DeleteButtonController.cpp:
              (WebCore::isDeletableElement):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertNodeBeforeCommand.cpp:
              (WebCore::InsertNodeBeforeCommand::doApply):
              * editing/JoinTextNodesCommand.cpp:
              (WebCore::JoinTextNodesCommand::doApply):
              (WebCore::JoinTextNodesCommand::doUnapply):
              * editing/MergeIdenticalElementsCommand.cpp:
              (WebCore::MergeIdenticalElementsCommand::doUnapply):
              * editing/RemoveNodeCommand.cpp:
              (WebCore::RemoveNodeCommand::doApply):
              (WebCore::RemoveNodeCommand::doUnapply):
              * editing/RemoveNodeCommand.h:
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::executeApply):
              * editing/SplitTextNodeCommand.cpp:
              (WebCore::SplitTextNodeCommand::doApply):
              (WebCore::SplitTextNodeCommand::doReapply):
              * editing/TextIterator.cpp:
              (WebCore::parentCrossingShadowBoundaries):
              * editing/htmlediting.cpp:
              (WebCore::enclosingList):
              * editing/markup.cpp:
              (WebCore::serializeNodes):
              (WebCore::ancestorToRetainStructureAndAppearance):
              (WebCore::createMarkup):
              * html/HTMLAreaElement.cpp:
              (WebCore::HTMLAreaElement::updateFocusAppearance):
              * html/HTMLEmbedElement.cpp:
              (WebCore::HTMLEmbedElement::rendererIsNeeded):
              * html/HTMLFormElement.cpp:
              (WebCore::HTMLFormElement::rendererIsNeeded):
              * html/HTMLFrameSetElement.cpp:
              (WebCore::HTMLFrameSetElement::attach):
              * html/HTMLImageElement.cpp:
              (WebCore::HTMLImageElement::insertedIntoTree):
              * html/HTMLLegendElement.cpp:
              (WebCore::HTMLLegendElement::associatedControl):
              * html/HTMLOptGroupElement.cpp:
              (WebCore::HTMLOptGroupElement::recalcSelectOptions):
              (WebCore::HTMLOptGroupElement::ownerSelectElement):
              * html/HTMLOptionElement.cpp:
              (WebCore::HTMLOptionElement::ownerSelectElement):
              * html/HTMLTableCellElement.cpp:
              (WebCore::HTMLTableCellElement::additionalAttributeStyleDecls):
              * html/HTMLTableColElement.cpp:
              (WebCore::HTMLTableColElement::additionalAttributeStyleDecls):
              * html/HTMLTableElement.cpp:
              (WebCore::HTMLTableElement::insertRow):
              * html/HTMLTableRowElement.cpp:
              (WebCore::HTMLTableRowElement::rowIndex):
              * html/HTMLTableSectionElement.cpp:
              (WebCore::HTMLTableSectionElement::additionalAttributeStyleDecls):
              * page/DOMSelection.cpp:
              (WebCore::DOMSelection::getRangeAt):
              (WebCore::DOMSelection::containsNode):
              * rendering/RenderSVGGradientStop.cpp:
              (WebCore::RenderSVGGradientStop::gradientElement):
              * svg/SVGElement.cpp:
              (WebCore::SVGElement::ownerSVGElement):
              (WebCore::SVGElement::viewportElement):
              * svg/SVGFELightElement.cpp:
              (WebCore::SVGFELightElement::svgAttributeChanged):
              (WebCore::SVGFELightElement::childrenChanged):
              * svg/SVGFEMergeNodeElement.cpp:
              (WebCore::SVGFEMergeNodeElement::svgAttributeChanged):
              * svg/SVGFontFaceFormatElement.cpp:
              (WebCore::SVGFontFaceFormatElement::childrenChanged):
              * svg/SVGFontFaceUriElement.cpp:
              (WebCore::SVGFontFaceUriElement::childrenChanged):
              * svg/SVGGlyphElement.cpp:
              (WebCore::SVGGlyphElement::invalidateGlyphCache):
              * svg/SVGHKernElement.cpp:
              (WebCore::SVGHKernElement::insertedIntoDocument):
              (WebCore::SVGHKernElement::removedFromDocument):
              * svg/SVGLocatable.cpp:
              (WebCore::SVGLocatable::nearestViewportElement):
              (WebCore::SVGLocatable::farthestViewportElement):
              * svg/SVGUseElement.cpp:
              (WebCore::SVGUseElement::updateContainerOffsets):
              * svg/SVGVKernElement.cpp:
              (WebCore::SVGVKernElement::insertedIntoDocument):
              (WebCore::SVGVKernElement::removedFromDocument):
              * svg/animation/SVGSMILElement.cpp:
              (WebCore::SVGSMILElement::targetElement):
              * wml/WMLDoElement.cpp:
              (WebCore::WMLDoElement::insertedIntoDocument):
              (WebCore::WMLDoElement::removedFromDocument):
              * wml/WMLNoopElement.cpp:
              (WebCore::WMLNoopElement::insertedIntoDocument):
              * wml/WMLOptionElement.cpp:
              (WebCore::ownerSelectElement):
              * wml/WMLPostfieldElement.cpp:
              (WebCore::WMLPostfieldElement::insertedIntoDocument):
              (WebCore::WMLPostfieldElement::removedFromDocument):
              * wml/WMLSetvarElement.cpp:
              (WebCore::WMLSetvarElement::insertedIntoDocument):
              (WebCore::WMLSetvarElement::removedFromDocument):
              * wml/WMLTaskElement.cpp:
              (WebCore::WMLTaskElement::insertedIntoDocument):
              (WebCore::WMLTaskElement::removedFromDocument):
              * wml/WMLTimerElement.cpp:
              (WebCore::WMLTimerElement::insertedIntoDocument):
              (WebCore::WMLTimerElement::removedFromDocument):
              * xml/XPathStep.cpp:
              (WebCore::XPath::Step::nodesInAxis):
              Use ContainerNode* for the result of the parentNode function now that
              it returns a ContainerNode*. In the past it used to return just Node*.
      
              * dom/ContainerNode.h: Added toContainerNode.
      
              * dom/Element.h: Use ContainerNode*. Added toElement.
      
              * dom/Element.cpp:
              (WebCore::Element::deprecatedCreateContextualFragment): Explcitly
              cast to HTMLElement* in the case that handles <html> and <body>
              elements.
              (WebCore::Element::baseURI): Use ContainerNode*.
      
              * dom/Node.cpp:
              (WebCore::Node::markAncestorsWithChildNeedsStyleRecalc): Use ContainerNode*.
              (WebCore::Node::isDescendantOf): Ditto.
              (WebCore::Node::createRendererIfNeeded): Ditto.
              (WebCore::Node::setTextContent): Use already-typecast pointer in a call to
              appendChild.
              (WebCore::Node::ancestorElement): Use ContainerNode*.
      
              * dom/Range.cpp:
              (WebCore::Range::compareNode): Use ContainerNode*.
              (WebCore::Range::intersectsNode): Ditto.
              (WebCore::Range::processContents): Cast to ContainerNode* in a couple cases
              where we previously checked that the node in question has a child. Any node
              that returns a non-zero value for firstChild is a ContainerNode.
              (WebCore::Range::checkNodeBA): Ditto.
              (WebCore::Range::selectNode): Ditto.
              (WebCore::Range::surroundContents): Ditto.
      
              * dom/XMLDocumentParser.cpp:
              (WebCore::XMLDocumentParser::insertErrorMessageBlock): Rewrote code to use
              more specific types, document instead of doc, and paragraph instead of par.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
              Use ContainerNode*.
              (WebCore::ApplyStyleCommand::replaceWithSpanOrRemoveIfWithoutAttributes):
              Use replaceElementWithSpanPreservingChildrenAndAttributes; the old function
              took a Node argument and had Node in its name.
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::removeNodeAndPruneAncestors): Use ContainerNode.
              (WebCore::CompositeEditCommand::replaceElementWithSpanPreservingChildrenAndAttributes):
              Renamed and changed to take HTMLElement. Also use ContainerNode.
              (WebCore::CompositeEditCommand::prune): Ditto.
              (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): Ditto.
              (WebCore::CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph): Ditto.
      
              * editing/ReplaceNodeWithSpanCommand.cpp:
              (WebCore::ReplaceNodeWithSpanCommand::ReplaceNodeWithSpanCommand): Take an
              HTMLElement instead of a Node. Call it m_elementToReplace instead of m_node.
              (WebCore::swapInNodePreservingAttributesAndChildren): Take HTMLElement.
              (WebCore::ReplaceNodeWithSpanCommand::doApply): Updated for name changes.
              (WebCore::ReplaceNodeWithSpanCommand::doUnapply): Ditto.
              * editing/ReplaceNodeWithSpanCommand.h: Ditto.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplacementFragment::ReplacementFragment): Use StyledElement for result
              of insertFragmentForTestRendering since that's what it returns.
              (WebCore::ReplacementFragment::removeNode): Use ContainerNode.
              (WebCore::ReplacementFragment::insertNodeBefore): Ditto.
              (WebCore::ReplacementFragment::insertFragmentForTestRendering): Return StyledElement.
              Use HTMLElement for body.
              (WebCore::ReplacementFragment::restoreTestRenderingNodesToFragment): Take
              StyledElement.
              (WebCore::ReplaceSelectionCommand::handleStyleSpans): Use ContainerNode.
              (WebCore::ReplaceSelectionCommand::copyStyleToChildren): Use HTMLElement for
              the cloned span, since the clone will be a sspan too.
              (WebCore::ReplaceSelectionCommand::insertAsListItems): Use ContainerNode since
              the list item has a child, and that proves it is a ContainerNode.
      
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::selectFrameElementInParentIfFullySelected):
              Use ContainerNode and also removed an unnneded local variable.
      
              * html/HTMLElement.cpp:
              (WebCore::HTMLElement::setOuterText): Use ContainerNode.
              (WebCore::HTMLElement::insertAdjacent): Use ContainerNode and also use && to make
              the logic a little simpler.
              (WebCore::contextElementForInsertion): Use ContainerNode.
              (WebCore::HTMLElement::findFormAncestor): Ditto.
      
              * inspector/InspectorDOMAgent.cpp:
              (WebCore::InspectorDOMAgent::removeNode): Use ContainerNode.
              (WebCore::InspectorDOMAgent::changeTagName): Ditto.
              (WebCore::InspectorDOMAgent::setOuterHTML): Ditto.
              (WebCore::InspectorDOMAgent::innerParentNode): Use isDocumentNode instead of
              nodeType. We should almost never use nodeType inside the engine.
              (WebCore::InspectorDOMAgent::didInsertDOMNode): Use ContainerNode.
              (WebCore::InspectorDOMAgent::didRemoveDOMNode): Ditto.
      
              * wml/WMLOptGroupElement.cpp: Removed unneeded overrides of insertBefore,
              replaceChild, removeChild, appendChild, and removeChildren functions.
              Ths already overrides childrenChanged, that is called by all of the above,
              and it does the same thing these functions did.
              (WebCore::ownerSelectElement): Use ContainerNode.
              * wml/WMLOptGroupElement.h: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      601d44bd
    • rniwa@webkit.org's avatar
      2010-10-15 Ryosuke Niwa <rniwa@webkit.org> · ac4687c5
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Crash in WebCore::ApplyStyleCommand::applyBlockStyle
              https://bugs.webkit.org/show_bug.cgi?id=47699
      
              The crash was caused by applyBlockStyle's invalidly assuming that visibleStart and visibleEnd always exist.
              Added an early exit to the function when either visibleStart or visibleEnd is null or orphaned.
      
              Test: editing/style/block-style-progress-crash.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyBlockStyle):
      2010-10-15  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              Crash in WebCore::ApplyStyleCommand::applyBlockStyle
              https://bugs.webkit.org/show_bug.cgi?id=47699
      
              Added a test to ensure WebKit does not crash when the body is content editable
              and justifying a progress element and '>' following the element to the right.
      
              * editing/style/block-style-progress-crash-expected.txt: Added.
              * editing/style/block-style-progress-crash.html: Added.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ac4687c5
  35. 01 Oct, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-09-30 Ryosuke Niwa <rniwa@webkit.org> · a23cf764
      rniwa@webkit.org authored
              Reviewed by Darin Adler.
      
              Implement queryCommandState('justifyFull')
              https://bugs.webkit.org/show_bug.cgi?id=46954
      
              Implemented queryCommandState('justifyFull').
              New tests are added to editing/style/inline-style-container.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::getTextAlignment): Added support for CSSValueJustify.
              * editing/EditorCommand.cpp:
              (WebCore::stateJustifyFull): Added.
              (WebCore::createCommandMap): Added stateJustifyFull.
      2010-09-30  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Darin Adler.
      
              Implement queryCommandState('justifyFull')
              https://bugs.webkit.org/show_bug.cgi?id=46954
      
              Added tests for queryCommandState('justifyFull') to editing/execCommand/query-text-alignment.html
      
              * editing/execCommand/query-text-alignment-expected.txt:
              * editing/execCommand/script-tests/query-text-alignment.js:
              (queryTextAlignment):
              (runRangeTests):
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a23cf764
  36. 30 Sep, 2010 1 commit
    • rniwa@webkit.org's avatar
      2010-09-30 Ryosuke Niwa <rniwa@webkit.org> · d4052bc5
      rniwa@webkit.org authored
              Reviewed by Tony Chang.
      
              WebKit nests font element when applying different font styles
              https://bugs.webkit.org/show_bug.cgi?id=45568
      
              The bug was caused by fixRangeAndApplyInlineStyle's not including fully selected ancestors,
              and addInlineStyleIfNeeded's always surrounding the contents by new elements as supposed to
              adding font attributes or style attribute.
      
              Fixed the bug by extending the node range in fixRangeAndApplyInlineStyle and finding
              the appropriate container node to add attributes in addInlineStyleIfNeeded.
              addInlineStyleIfNeeded now tires to add font and style attributes to the inner most font and
              span elements respectively.
      
              Also added an early exit check to removeStyleFromRunBeforeApplyingStyle so that WebKit does not
              modify the contents when the entire contents already have the desired style.
      
              Test: editing/style/inline-style-container.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::fixRangeAndApplyInlineStyle):
              (WebCore::ApplyStyleCommand::removeStyleFromRunBeforeApplyingStyle):
              (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
      2010-09-30  Ryosuke Niwa  <rniwa@webkit.org>
      
              Reviewed by Tony Chang.
      
              WebKit nests font element when applying different font styles
              https://bugs.webkit.org/show_bug.cgi?id=45568
      
              Added a test to ensure WebKit does not add extra font elements when the content already has an enclosing font element.
              The test also ensures WebKit tries to add style attribute to the inner most span.
      
              * editing/execCommand/createLink-expected.txt: The ordering of anchor and span changed.
              * editing/execCommand/unlink-expected.txt: Ditto.
              * editing/execCommand/query-font-size-expected.txt: Merged font elements.
              * editing/execCommand/script-tests/toggle-style-2.js: The ordering of s and u elements changed.
              * editing/execCommand/toggle-style-2-expected.txt:  Ditto.
              * editing/style/inline-style-container-expected.txt: Added.
              * editing/style/inline-style-container.html: Added.
              * editing/style/make-text-writing-direction-inline-expected.txt: Removed some extraneous spans added by the bug 44359.
              * editing/style/script-tests/inline-style-container.js: Added.
              (testSingleToggle):
              * editing/style/style-3690704-fix-expected.txt: Merged two b elements.
              * fast/events/event-input-contentEditable-expected.txt: Merged anchor elements.
              * fast/events/script-tests/event-input-contentEditable-expected.txt: Ditto.
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@68830 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d4052bc5