1. 05 May, 2009 1 commit
    • ap@webkit.org's avatar
      Reviewed by Dave Hyatt. · d0295906
      ap@webkit.org authored
              <rdar://problem/6576889> REGRESSION (r35185): Cannot watch Flash movies on omg.yahoo.com
      
              The problem was caused by missing <head> element - we used to create it when moving a
              misplaced <style> element, but we now handle those in place. Other browsers always create
              a <head> element.
      
              There is no guarantee that a <head> element always exists - first, it can be removed with
              removeChild or innerHTML, and also, we don't currently create it for frameset documents, or
              for manually created ones (e.g. ImageDocument).
      
              Test: fast/parser/head-element-for-yahoo-player.html
      
      WebKit:
              * dom/Document.cpp: (WebCore::Document::implicitClose): Create a <head> element for about:blank.
              A removed comment talked about rdar://3758785, but that problem doesn't re-occur even if this
              code is removed completely.
      
              * html/HTMLHtmlElement.cpp: (WebCore::HTMLHtmlElement::checkDTD): No longer allow <script>
              elements as children of <html>. This isn't directly related to this bug, but it was easier
              to fix both at once (IE and Firefox both don't allow such mispositioned <script> elements).
      
              * html/HTMLParser.cpp:
              (WebCore::HTMLParser::handleError): Move <script> to <head> if <body> hasn't been created yet.
              Create a <head> it a <body> is created implicitly to contain some other element.
              (WebCore::HTMLParser::bodyCreateErrorCheck): Ensure that a <head> exists when <body> is
              explicitly present in source.
              (WebCore::HTMLParser::createHead): Do the work even if <html> element hasn't been created yet.
      
      LayoutTests:
              * fast/parser/head-element-for-yahoo-player-expected.txt: Added.
              * fast/parser/head-element-for-yahoo-player.html: Added.
              Test the regression case (a misplaced <style> that used to create <head> implicitly).
      
              * editing/selection/select-all-005.html: Use a new index when selecting the body.
      
              * fast/dom/Document/document-write-doctype-expected.txt:
              * fast/dom/Document/resources/document-write-doctype.js:
              Removed checks for "Gecko quirk" of implicitly adding HEAD - that not a quirk, but standard
              behavior per HTML5.
      
              * editing/execCommand/create-list-1-expected.txt:
              * platform/mac/editing/deleting/4845371-expected.txt:
              * platform/mac/editing/deleting/4866671-expected.txt:
              * platform/mac/editing/deleting/4875189-expected.txt:
              * platform/mac/editing/deleting/5026848-1-expected.txt:
              * platform/mac/editing/deleting/5026848-2-expected.txt:
              * platform/mac/editing/deleting/5026848-3-expected.txt:
              * platform/mac/editing/deleting/5032066-expected.txt:
              * platform/mac/editing/deleting/5091898-expected.txt:
              * platform/mac/editing/deleting/5099303-expected.txt:
              * platform/mac/editing/deleting/5115601-expected.txt:
              * platform/mac/editing/deleting/5126166-expected.txt:
              * platform/mac/editing/deleting/5156801-2-expected.txt:
              * platform/mac/editing/deleting/5168598-expected.txt:
              * platform/mac/editing/deleting/5272440-expected.txt:
              * platform/mac/editing/deleting/5300379-expected.txt:
              * platform/mac/editing/deleting/5390681-expected.txt:
              * platform/mac/editing/deleting/5408255-expected.txt:
              * platform/mac/editing/deleting/5433862-2-expected.txt:
              * platform/mac/editing/deleting/5483370-expected.txt:
              * platform/mac/editing/deleting/delete-at-start-or-end-expected.txt:
              * platform/mac/editing/deleting/delete-block-table-expected.txt:
              * platform/mac/editing/deleting/delete-hr-expected.txt:
              * platform/mac/editing/deleting/delete-mixed-editable-content-001-expected.txt:
              * platform/mac/editing/deleting/delete-to-select-table-expected.txt:
              * platform/mac/editing/deleting/deletionUI-single-instance-expected.txt:
              * platform/mac/editing/deleting/merge-endOfParagraph-expected.txt:
              * platform/mac/editing/deleting/merge-no-br-expected.txt:
              * platform/mac/editing/deleting/merge-whitespace-pre-expected.txt:
              * platform/mac/editing/execCommand/4641880-1-expected.txt:
              * platform/mac/editing/execCommand/4641880-2-expected.txt:
              * platform/mac/editing/execCommand/4747450-expected.txt:
              * platform/mac/editing/execCommand/4786404-1-expected.txt:
              * platform/mac/editing/execCommand/4786404-2-expected.txt:
              * platform/mac/editing/execCommand/4916402-expected.txt:
              * platform/mac/editing/execCommand/4916541-expected.txt:
              * platform/mac/editing/execCommand/4916583-expected.txt:
              * platform/mac/editing/execCommand/4920488-expected.txt:
              * platform/mac/editing/execCommand/4920742-1-expected.txt:
              * platform/mac/editing/execCommand/4924441-expected.txt:
              * platform/mac/editing/execCommand/5049671-expected.txt:
              * platform/mac/editing/execCommand/5080333-1-expected.txt:
              * platform/mac/editing/execCommand/5080333-2-expected.txt:
              * platform/mac/editing/execCommand/5119244-expected.txt:
              * platform/mac/editing/execCommand/5120591-expected.txt:
              * platform/mac/editing/execCommand/5136770-expected.txt:
              * platform/mac/editing/execCommand/5142012-1-expected.txt:
              * platform/mac/editing/execCommand/5142012-2-expected.txt:
              * platform/mac/editing/execCommand/5142012-3-expected.txt:
              * platform/mac/editing/execCommand/5144139-1-expected.txt:
              * platform/mac/editing/execCommand/5164796-expected.txt:
              * platform/mac/editing/execCommand/5207369-expected.txt:
              * platform/mac/editing/execCommand/5210032-expected.txt:
              * platform/mac/editing/execCommand/5432254-1-expected.txt:
              * platform/mac/editing/execCommand/5432254-2-expected.txt:
              * platform/mac/editing/execCommand/5481523-expected.txt:
              * platform/mac/editing/execCommand/5482524-expected.txt:
              * platform/mac/editing/execCommand/5569741-expected.txt:
              * platform/mac/editing/execCommand/5573879-expected.txt:
              * platform/mac/editing/execCommand/5700414-1-expected.txt:
              * platform/mac/editing/execCommand/5700414-2-expected.txt:
              * platform/mac/editing/execCommand/insert-list-empty-div-expected.txt:
              * platform/mac/editing/input/5576619-expected.txt:
              * platform/mac/editing/inserting/12882-expected.txt:
              * platform/mac/editing/inserting/4840662-expected.txt:
              * platform/mac/editing/inserting/4875189-1-expected.txt:
              * platform/mac/editing/inserting/4875189-2-expected.txt:
              * platform/mac/editing/inserting/4959067-expected.txt:
              * platform/mac/editing/inserting/4960120-1-expected.txt:
              * platform/mac/editing/inserting/4960120-2-expected.txt:
              * platform/mac/editing/inserting/5002441-expected.txt:
              * platform/mac/editing/inserting/5058163-2-expected.txt:
              * platform/mac/editing/inserting/5156401-2-expected.txt:
              * platform/mac/editing/inserting/5549929-2-expected.txt:
              * platform/mac/editing/inserting/5549929-3-expected.txt:
              * platform/mac/editing/inserting/5607069-2-expected.txt:
              * platform/mac/editing/inserting/5607069-3-expected.txt:
              * platform/mac/editing/inserting/editable-html-element-expected.txt:
              * platform/mac/editing/inserting/editable-inline-element-expected.txt:
              * platform/mac/editing/inserting/edited-whitespace-1-expected.txt:
              * platform/mac/editing/inserting/editing-empty-divs-expected.txt:
              * platform/mac/editing/inserting/typing-tab-designmode-forms-expected.txt:
              * platform/mac/editing/pasteboard/4806874-expected.txt:
              * platform/mac/editing/pasteboard/4861080-expected.txt:
              * platform/mac/editing/pasteboard/4944770-1-expected.txt:
              * platform/mac/editing/pasteboard/4944770-2-expected.txt:
              * platform/mac/editing/pasteboard/4947130-expected.txt:
              * platform/mac/editing/pasteboard/4989774-expected.txt:
              * platform/mac/editing/pasteboard/5027857-expected.txt:
              * platform/mac/editing/pasteboard/5032095-expected.txt:
              * platform/mac/editing/pasteboard/5065605-expected.txt:
              * platform/mac/editing/pasteboard/5071074-2-expected.txt:
              * platform/mac/editing/pasteboard/5071074-expected.txt:
              * platform/mac/editing/pasteboard/5075944-2-expected.txt:
              * platform/mac/editing/pasteboard/5075944-3-expected.txt:
              * platform/mac/editing/pasteboard/5075944-expected.txt:
              * platform/mac/editing/pasteboard/5134759-expected.txt:
              * platform/mac/editing/pasteboard/5156401-1-expected.txt:
              * platform/mac/editing/pasteboard/5247341-expected.txt:
              * platform/mac/editing/pasteboard/5387578-expected.txt:
              * platform/mac/editing/pasteboard/5478250-expected.txt:
              * platform/mac/editing/pasteboard/5483567-expected.txt:
              * platform/mac/editing/pasteboard/5601583-1-expected.txt:
              * platform/mac/editing/pasteboard/copy-paste-bidi-expected.txt:
              * platform/mac/editing/pasteboard/input-field-1-expected.txt:
              * platform/mac/editing/pasteboard/merge-after-delete-1-expected.txt:
              * platform/mac/editing/pasteboard/merge-after-delete-2-expected.txt:
              * platform/mac/editing/pasteboard/merge-after-delete-expected.txt:
              * platform/mac/editing/pasteboard/merge-start-blockquote-expected.txt:
              * platform/mac/editing/pasteboard/paste-unrendered-select-expected.txt:
              * platform/mac/editing/pasteboard/prevent-block-nesting-01-expected.txt:
              * platform/mac/editing/pasteboard/select-element-1-expected.txt:
              * platform/mac/editing/selection/13804-expected.txt:
              * platform/mac/editing/selection/14971-expected.txt:
              * platform/mac/editing/selection/4397952-expected.txt:
              * platform/mac/editing/selection/4818145-expected.txt:
              * platform/mac/editing/selection/4866671-expected.txt:
              * platform/mac/editing/selection/4889598-expected.txt:
              * platform/mac/editing/selection/4895428-1-expected.txt:
              * platform/mac/editing/selection/4895428-2-expected.txt:
              * platform/mac/editing/selection/4895428-3-expected.txt:
              * platform/mac/editing/selection/4895428-4-expected.txt:
              * platform/mac/editing/selection/4932260-1-expected.txt:
              * platform/mac/editing/selection/4932260-2-expected.txt:
              * platform/mac/editing/selection/4932260-3-expected.txt:
              * platform/mac/editing/selection/4947387-expected.txt:
              * platform/mac/editing/selection/4960116-expected.txt:
              * platform/mac/editing/selection/4975120-expected.txt:
              * platform/mac/editing/selection/4983858-expected.txt:
              * platform/mac/editing/selection/5007143-2-expected.txt:
              * platform/mac/editing/selection/5007143-expected.txt:
              * platform/mac/editing/selection/5057506-2-expected.txt:
              * platform/mac/editing/selection/5057506-expected.txt:
              * platform/mac/editing/selection/5076323-1-expected.txt:
              * platform/mac/editing/selection/5076323-2-expected.txt:
              * platform/mac/editing/selection/5076323-3-expected.txt:
              * platform/mac/editing/selection/5081257-1-expected.txt:
              * platform/mac/editing/selection/5081257-2-expected.txt:
              * platform/mac/editing/selection/5099303-expected.txt:
              * platform/mac/editing/selection/5109817-expected.txt:
              * platform/mac/editing/selection/5136696-expected.txt:
              * platform/mac/editing/selection/5195166-1-expected.txt:
              * platform/mac/editing/selection/5195166-2-expected.txt:
              * platform/mac/editing/selection/5234383-1-expected.txt:
              * platform/mac/editing/selection/5234383-2-expected.txt:
              * platform/mac/editing/selection/5240265-expected.txt:
              * platform/mac/editing/selection/5333725-expected.txt:
              * platform/mac/editing/selection/5354455-1-expected.txt:
              * platform/mac/editing/selection/addRange-expected.txt:
              * platform/mac/editing/selection/caret-before-select-expected.txt:
              * platform/mac/editing/selection/contains-boundaries-expected.txt:
              * platform/mac/editing/selection/drag-select-1-expected.txt:
              * platform/mac/editing/selection/editable-html-element-expected.txt:
              * platform/mac/editing/selection/inconsistent-in-removeChildNode-expected.txt:
              * platform/mac/editing/selection/inline-closest-leaf-child-expected.txt:
              * platform/mac/editing/selection/mixed-editability-6-expected.txt:
              * platform/mac/editing/selection/mixed-editability-7-expected.txt:
              * platform/mac/editing/selection/move-by-sentence-linebreak-expected.txt:
              * platform/mac/editing/selection/select-all-005-expected.txt:
              * platform/mac/editing/selection/table-caret-1-expected.txt:
              * platform/mac/editing/selection/table-caret-2-expected.txt:
              * platform/mac/editing/selection/table-caret-3-expected.txt:
              * platform/mac/editing/selection/wrapped-line-caret-1-expected.txt:
              * platform/mac/editing/selection/wrapped-line-caret-2-expected.txt:
              * platform/mac/editing/style/4916887-expected.txt:
              * platform/mac/editing/style/5017613-1-expected.txt:
              * platform/mac/editing/style/5017613-2-expected.txt:
              * platform/mac/editing/style/5046875-1-expected.txt:
              * platform/mac/editing/style/5046875-2-expected.txt:
              * platform/mac/editing/style/5065910-expected.txt:
              * platform/mac/editing/style/5084241-expected.txt:
              * platform/mac/editing/style/5091898-expected.txt:
              * platform/mac/editing/style/5228141-expected.txt:
              * platform/mac/editing/style/5279521-expected.txt:
              * platform/mac/editing/style/font-family-with-space-expected.txt:
              * platform/mac/editing/style/fontsize-1-expected.txt:
              * platform/mac/editing/style/highlight-expected.txt:
              * platform/mac/editing/style/non-inheritable-styles-expected.txt:
              * platform/mac/editing/undo/5378473-expected.txt:
              * platform/mac/fast/block/float/relative-painted-twice-expected.txt:
              * platform/mac/fast/dom/delete-contents-expected.txt:
              * platform/mac/fast/events/context-no-deselect-expected.txt:
              * platform/mac/fast/events/label-focus-expected.txt:
              * platform/mac/fast/forms/input-appearance-focus-expected.txt:
              * platform/mac/fast/forms/input-text-click-inside-expected.txt:
              * platform/mac/fast/forms/input-text-click-outside-expected.txt:
              * platform/mac/fast/forms/input-text-double-click-expected.txt:
              * platform/mac/fast/forms/input-text-drag-down-expected.txt:
              * platform/mac/fast/forms/input-text-option-delete-expected.txt:
              * platform/mac/fast/forms/input-text-scroll-left-on-blur-expected.txt:
              * platform/mac/fast/forms/input-text-self-emptying-click-expected.txt:
              * platform/mac/fast/forms/textfield-drag-into-disabled-expected.txt:
              * platform/mac/fast/forms/textfield-overflow-expected.txt:
              * platform/mac/fast/inline/25277-2-expected.txt:
              * platform/mac/fast/inline/25277-expected.txt:
              * platform/mac/fast/lists/drag-into-marker-expected.txt:
              * platform/mac/fast/overflow/overflow-focus-ring-expected.txt:
              * platform/mac/fast/repaint/4776765-expected.txt:
              * platform/mac/fast/repaint/selection-after-delete-expected.txt:
              * platform/mac/fast/repaint/selection-after-remove-expected.txt:
              * platform/qt/editing/deleting/4845371-expected.txt:
              * platform/qt/editing/deleting/4866671-expected.txt:
              * platform/qt/editing/deleting/4875189-expected.txt:
              * platform/qt/editing/deleting/5026848-1-expected.txt:
              * platform/qt/editing/deleting/5026848-2-expected.txt:
              * platform/qt/editing/deleting/5026848-3-expected.txt:
              * platform/qt/editing/deleting/5032066-expected.txt:
              * platform/qt/editing/deleting/5091898-expected.txt:
              * platform/qt/editing/deleting/5099303-expected.txt:
              * platform/qt/editing/deleting/5115601-expected.txt:
              * platform/qt/editing/deleting/5126166-expected.txt:
              * platform/qt/editing/deleting/5144139-2-expected.txt:
              * platform/qt/editing/deleting/5156801-2-expected.txt:
              * platform/qt/editing/deleting/5168598-expected.txt:
              * platform/qt/editing/deleting/5272440-expected.txt:
              * platform/qt/editing/deleting/5300379-expected.txt:
              * platform/qt/editing/deleting/5390681-expected.txt:
              * platform/qt/editing/deleting/5408255-expected.txt:
              * platform/qt/editing/deleting/delete-at-start-or-end-expected.txt:
              * platform/qt/editing/deleting/delete-block-table-expected.txt:
              * platform/qt/editing/deleting/delete-hr-expected.txt:
              * platform/qt/editing/deleting/delete-link-1-expected.txt:
              * platform/qt/editing/deleting/delete-mixed-editable-content-001-expected.txt:
              * platform/qt/editing/deleting/delete-to-select-table-expected.txt:
              * platform/qt/editing/deleting/deletionUI-single-instance-expected.txt:
              * platform/qt/editing/deleting/merge-endOfParagraph-expected.txt:
              * platform/qt/editing/deleting/merge-no-br-expected.txt:
              * platform/qt/editing/deleting/merge-whitespace-pre-expected.txt:
              * platform/qt/editing/execCommand/4641880-1-expected.txt:
              * platform/qt/editing/execCommand/4641880-2-expected.txt:
              * platform/qt/editing/execCommand/4747450-expected.txt:
              * platform/qt/editing/execCommand/4786404-1-expected.txt:
              * platform/qt/editing/execCommand/4786404-2-expected.txt:
              * platform/qt/editing/execCommand/4916402-expected.txt:
              * platform/qt/editing/execCommand/4916541-expected.txt:
              * platform/qt/editing/execCommand/4916583-expected.txt:
              * platform/qt/editing/execCommand/4920488-expected.txt:
              * platform/qt/editing/execCommand/4920742-1-expected.txt:
              * platform/qt/editing/execCommand/4924441-expected.txt:
              * platform/qt/editing/execCommand/5049671-expected.txt:
              * platform/qt/editing/execCommand/5062376-expected.txt:
              * platform/qt/editing/execCommand/5080333-1-expected.txt:
              * platform/qt/editing/execCommand/5080333-2-expected.txt:
              * platform/qt/editing/execCommand/5119244-expected.txt:
              * platform/qt/editing/execCommand/5120591-expected.txt:
              * platform/qt/editing/execCommand/5136770-expected.txt:
              * platform/qt/editing/execCommand/5142012-1-expected.txt:
              * platform/qt/editing/execCommand/5142012-2-expected.txt:
              * platform/qt/editing/execCommand/5142012-3-expected.txt:
              * platform/qt/editing/execCommand/5144139-1-expected.txt:
              * platform/qt/editing/execCommand/5164796-expected.txt:
              * platform/qt/editing/execCommand/5207369-expected.txt:
              * platform/qt/editing/execCommand/5210032-expected.txt:
              * platform/qt/editing/execCommand/5432254-1-expected.txt:
              * platform/qt/editing/execCommand/5432254-2-expected.txt:
              * platform/qt/editing/execCommand/insert-list-empty-div-expected.txt:
              * platform/qt/editing/inserting/12882-expected.txt:
              * platform/qt/editing/inserting/4840662-expected.txt:
              * platform/qt/editing/inserting/4875189-1-expected.txt:
              * platform/qt/editing/inserting/4875189-2-expected.txt:
              * platform/qt/editing/inserting/4959067-expected.txt:
              * platform/qt/editing/inserting/4960120-1-expected.txt:
              * platform/qt/editing/inserting/4960120-2-expected.txt:
              * platform/qt/editing/inserting/5002441-expected.txt:
              * platform/qt/editing/inserting/5058163-2-expected.txt:
              * platform/qt/editing/inserting/5156401-2-expected.txt:
              * platform/qt/editing/inserting/editable-html-element-expected.txt:
              * platform/qt/editing/inserting/editable-inline-element-expected.txt:
              * platform/qt/editing/inserting/edited-whitespace-1-expected.txt:
              * platform/qt/editing/inserting/editing-empty-divs-expected.txt:
              * platform/qt/editing/inserting/insert-before-link-1-expected.txt:
              * platform/qt/editing/pasteboard/4806874-expected.txt:
              * platform/qt/editing/pasteboard/4840662-expected.txt:
              * platform/qt/editing/pasteboard/4944770-1-expected.txt:
              * platform/qt/editing/pasteboard/4989774-expected.txt:
              * platform/qt/editing/pasteboard/5027857-expected.txt:
              * platform/qt/editing/pasteboard/5032095-expected.txt:
              * platform/qt/editing/pasteboard/5065605-expected.txt:
              * platform/qt/editing/pasteboard/5071074-2-expected.txt:
              * platform/qt/editing/pasteboard/5071074-expected.txt:
              * platform/qt/editing/pasteboard/5075944-2-expected.txt:
              * platform/qt/editing/pasteboard/5075944-3-expected.txt:
              * platform/qt/editing/pasteboard/5075944-expected.txt:
              * platform/qt/editing/pasteboard/5134759-expected.txt:
              * platform/qt/editing/pasteboard/5156401-1-expected.txt:
              * platform/qt/editing/pasteboard/5245519-expected.txt:
              * platform/qt/editing/pasteboard/5247341-expected.txt:
              * platform/qt/editing/pasteboard/5387578-expected.txt:
              * platform/qt/editing/pasteboard/5478250-expected.txt:
              * platform/qt/editing/pasteboard/5483567-expected.txt:
              * platform/qt/editing/pasteboard/copy-paste-bidi-expected.txt:
              * platform/qt/editing/pasteboard/merge-after-delete-1-expected.txt:
              * platform/qt/editing/pasteboard/merge-after-delete-2-expected.txt:
              * platform/qt/editing/pasteboard/merge-after-delete-expected.txt:
              * platform/qt/editing/pasteboard/merge-start-blockquote-expected.txt:
              * platform/qt/editing/pasteboard/paste-unrendered-select-expected.txt:
              * platform/qt/editing/pasteboard/prevent-block-nesting-01-expected.txt:
              * platform/qt/editing/selection/13804-expected.txt:
              * platform/qt/editing/selection/4397952-expected.txt:
              * platform/qt/editing/selection/4818145-expected.txt:
              * platform/qt/editing/selection/4866671-expected.txt:
              * platform/qt/editing/selection/4889598-expected.txt:
              * platform/qt/editing/selection/4895428-2-expected.txt:
              * platform/qt/editing/selection/4895428-3-expected.txt:
              * platform/qt/editing/selection/4932260-1-expected.txt:
              * platform/qt/editing/selection/4932260-2-expected.txt:
              * platform/qt/editing/selection/4932260-3-expected.txt:
              * platform/qt/editing/selection/4960116-expected.txt:
              * platform/qt/editing/selection/4983858-expected.txt:
              * platform/qt/editing/selection/5007143-2-expected.txt:
              * platform/qt/editing/selection/5007143-expected.txt:
              * platform/qt/editing/selection/5076323-1-expected.txt:
              * platform/qt/editing/selection/5076323-2-expected.txt:
              * platform/qt/editing/selection/5076323-3-expected.txt:
              * platform/qt/editing/selection/5081257-1-expected.txt:
              * platform/qt/editing/selection/5081257-2-expected.txt:
              * platform/qt/editing/selection/5099303-expected.txt:
              * platform/qt/editing/selection/5136696-expected.txt:
              * platform/qt/editing/selection/5195166-1-expected.txt:
              * platform/qt/editing/selection/5195166-2-expected.txt:
              * platform/qt/editing/selection/5234383-1-expected.txt:
              * platform/qt/editing/selection/5234383-2-expected.txt:
              * platform/qt/editing/selection/5240265-expected.txt:
              * platform/qt/editing/selection/addRange-expected.txt:
              * platform/qt/editing/selection/caret-before-select-expected.txt:
              * platform/qt/editing/selection/editable-html-element-expected.txt:
              * platform/qt/editing/selection/mixed-editability-6-expected.txt:
              * platform/qt/editing/selection/mixed-editability-7-expected.txt:
              * platform/qt/editing/selection/move-by-sentence-linebreak-expected.txt:
              * platform/qt/editing/selection/select-all-005-expected.txt:
              * platform/qt/editing/selection/table-caret-1-expected.txt:
              * platform/qt/editing/selection/table-caret-2-expected.txt:
              * platform/qt/editing/selection/table-caret-3-expected.txt:
              * platform/qt/editing/style/4916887-expected.txt:
              * platform/qt/editing/style/5017613-1-expected.txt:
              * platform/qt/editing/style/5017613-2-expected.txt:
              * platform/qt/editing/style/5046875-1-expected.txt:
              * platform/qt/editing/style/5046875-2-expected.txt:
              * platform/qt/editing/style/5065910-expected.txt:
              * platform/qt/editing/style/5084241-expected.txt:
              * platform/qt/editing/style/5228141-expected.txt:
              * platform/qt/editing/style/5279521-expected.txt:
              * platform/qt/editing/style/font-family-with-space-expected.txt:
              * platform/qt/editing/style/fontsize-1-expected.txt:
              * platform/qt/editing/style/highlight-expected.txt:
              * platform/qt/editing/style/non-inheritable-styles-expected.txt:
              * platform/qt/editing/undo/5378473-expected.txt:
              * platform/qt/fast/dom/delete-contents-expected.txt:
              * platform/qt/fast/events/label-focus-expected.txt:
              * platform/qt/fast/forms/input-appearance-focus-expected.txt:
              * platform/qt/fast/forms/input-maxlength-2-expected.txt:
              * platform/qt/fast/forms/input-text-click-inside-expected.txt:
              * platform/qt/fast/forms/input-text-option-delete-expected.txt:
              * platform/qt/fast/forms/input-text-self-emptying-click-expected.txt:
              * platform/qt/fast/forms/textfield-drag-into-disabled-expected.txt:
              * platform/qt/fast/forms/textfield-overflow-expected.txt:
              * platform/qt/fast/overflow/overflow-focus-ring-expected.txt:
              * platform/qt/fast/repaint/4776765-expected.txt:
              * platform/qt/fast/repaint/selection-after-delete-expected.txt:
              * platform/qt/fast/repaint/selection-after-remove-expected.txt:
              * platform/win/editing/deleting/5168598-expected.txt:
              * platform/win/editing/inserting/4960120-1-expected.txt:
              * platform/win/editing/inserting/5607069-2-expected.txt:
              * platform/win/editing/inserting/5607069-3-expected.txt:
              * platform/win/editing/inserting/typing-tab-designmode-forms-expected.txt:
              * platform/win/editing/pasteboard/4806874-expected.txt:
              * platform/win/editing/selection/4895428-3-expected.txt:
              * platform/win/editing/selection/5136696-expected.txt:
              * platform/win/editing/selection/drag-select-1-expected.txt:
              * platform/win/fast/events/context-no-deselect-expected.txt:
              * platform/win/fast/events/label-focus-expected.txt:
              * platform/win/fast/forms/input-appearance-focus-expected.txt:
              * platform/win/fast/forms/input-text-click-inside-expected.txt:
              * platform/win/fast/forms/input-text-click-outside-expected.txt:
              * platform/win/fast/forms/input-text-double-click-expected.txt:
              * platform/win/fast/forms/input-text-drag-down-expected.txt:
              * platform/win/fast/forms/input-text-option-delete-expected.txt:
              * platform/win/fast/forms/input-text-scroll-left-on-blur-expected.txt:
              * platform/win/fast/forms/input-text-self-emptying-click-expected.txt:
              * platform/win/fast/forms/textfield-drag-into-disabled-expected.txt:
              * platform/win/fast/forms/textfield-overflow-expected.txt:
              Updated BODY element index in test output (for some tests, it increased because of the
              implicitly added <head>, and for others, it decreased because mispositoned <script> is being
              moved into <head>).
      
              * webarchive/adopt-attribute-styled-body-webarchive-expected.webarchive:
              * webarchive/archive-empty-frame-dom-expected.webarchive:
              Updated to include the implicitly added <head> elements.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@43215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d0295906
  2. 21 Apr, 2009 2 commits
  3. 16 Apr, 2009 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 16c21cba
      justin.garcia@apple.com authored
      2009-04-16  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Dan Bernstein.
      
              Performing a block style change in an editable root that contains only a br adds a newline
              https://bugs.webkit.org/show_bug.cgi?id=25256
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Fix a bad check for an root
              block that didn't handle a root that contained a placeholder.
      
      LayoutTests:
      
      2009-04-16  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Dan Bernstein.
              
              Performing a block style change in an editable root that contains only a br adds a newline
              https://bugs.webkit.org/show_bug.cgi?id=25256
      
              * editing/execCommand/25256-expected.txt: Added.
              * editing/execCommand/25256.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@42600 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      16c21cba
  4. 16 Feb, 2009 2 commits
    • justin.garcia@apple.com's avatar
      WebCore: · 66fb4b04
      justin.garcia@apple.com authored
      2009-02-16  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Mark Rowe.
      
              https://bugs.webkit.org/show_bug.cgi?id=16309
              HTML5: The third execCommand argument for insert{un}orderedlist should be ignored
              
              When we originally implemented this command, MSDN documentation said that IE set the
              id attribute of inserted lists to the third argument to execCommand, but IE doesn't
              do this nor do any other browsers.
      
              * editing/EditorCommand.cpp:
              (WebCore::executeInsertOrderedList):
              (WebCore::executeInsertUnorderedList):
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::outdentParagraph):
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::insertList):
              (WebCore::InsertListCommand::InsertListCommand):
              (WebCore::InsertListCommand::doApply):
              * editing/InsertListCommand.h:
              (WebCore::InsertListCommand::create):
      
      LayoutTests:
      
      2009-02-16  Just...
      66fb4b04
    • justin.garcia@apple.com's avatar
      WebCore: · e5d0a05b
      justin.garcia@apple.com authored
      2009-02-16  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Eric Seidel.
      
              https://bugs.webkit.org/show_bug.cgi?id=15381
              execCommand justify modifies the contentEditable node
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Avoid modifying not just
              the body element, but any root editable element.
      
      LayoutTests:
      
      2009-02-16  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Eric Seidel.
              
              https://bugs.webkit.org/show_bug.cgi?id=15381
              execCommand justify modifies the contentEditable node
      
              * editing/execCommand/15381-expected.txt: Added.
              * editing/execCommand/15381.html: Added.
              
              Made this test cross platform and changed it to reflect the fix:
              * editing/execCommand/5062376-expected.txt: Added.
              * editing/execCommand/5062376.html:
              * platform/mac/editing/execCommand/5062376-expected.checksum: Removed.
              * platform/mac/editing/execCommand/5062376-expected.png: Removed.
              * platform/mac/editing/execCommand/5062376-expected.txt: Removed.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@41026 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e5d0a05b
  5. 06 Feb, 2009 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 1315ac1f
      justin.garcia@apple.com authored
      2009-02-06  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Oliver Hunt.
              
              https://bugs.webkit.org/show_bug.cgi?id=23800
              Header elements are not always preserved during paste
              
              At paste time, don't merge out of header elements.  At copy time, be sure to include
              headers in the list of special common ancestor blocks, so that copying a paragraph or less
              of content inside a header will include the header element in the copied markup.
      
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::areSameHeaderElements):
              (WebCore::ReplaceSelectionCommand::shouldMerge):
              * editing/markup.cpp:
              (WebCore::isSpecialAncestorBlock):
              (WebCore::createMarkup):
      
      LayoutTests:
      
      2009-02-06  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Oliver Hunt.
              
              https://bugs.webkit.org/show_bug.cgi?id=23800
              Header elements are not always preserved during paste
      
              * editing/execCommand/4128080-1-expected.txt: Added.
              * editing/execCommand/4128080-1.html: Added.
              * editing/execCommand/4128080-2-expected.txt: Added.
              * editing/execCommand/4128080-2.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1315ac1f
  6. 03 Feb, 2009 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 8a921b93
      justin.garcia@apple.com authored
      2009-02-03  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin Adler.
      
              https://bugs.webkit.org/show_bug.cgi?id=13490
              Implement execCommand("styleWithCSS", ...)
              
              Determine whether or not to use HTML formatting tags for styling on the new
              boolean on Editor instead of whether or not the document is quirks mode.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::StyleChange::StyleChange):
              (WebCore::StyleChange::init):
              (WebCore::ApplyStyleCommand::applyBlockStyle):
              (WebCore::ApplyStyleCommand::applyTextDecorationStyle):
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
              * editing/Editor.cpp:
              (WebCore::Editor::Editor):
              (WebCore::Editor::clear):
              * editing/Editor.h:
              (WebCore::Editor::setShouldStyleWithCSS):
              (WebCore::Editor::shouldStyleWithCSS):
              * editing/EditorCommand.cpp:
              (WebCore::executeStyleWithCSS):
              (WebCore::stateStyleWithCSS):
              (WebCore::CommandEntry::):
      
      LayoutTests:
      
      2009-02-03  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin Adler.
              
              https://bugs.webkit.org/show_bug.cgi?id=13490
              Implement execCommand("styleWithCSS", ...)
      
              * editing/execCommand/5685604-1-expected.txt: Added.
              * editing/execCommand/5685604-1.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40560 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8a921b93
  7. 29 Jan, 2009 1 commit
  8. 22 Jan, 2009 1 commit
    • eric@webkit.org's avatar
      Reviewed by Justin Garcia. · e9f74e01
      eric@webkit.org authored
              Remove <span> turds left by editing commands
              https://bugs.webkit.org/show_bug.cgi?id=23466
      
              Tests:
              * editing/execCommand/empty-span-removal.html
              * editing/execCommand/toggle-styles.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::styleSpanClassString):
              (WebCore::isStyleSpan):
              (WebCore::isUnstyledStyleSpan):
              (WebCore::isSpanWithoutAttributesOrUnstyleStyleSpan):
              (WebCore::ApplyStyleCommand::applyRelativeFontStyleChange):
              (WebCore::ApplyStyleCommand::removeEmbeddingUpToEnclosingBlock):
              (WebCore::ApplyStyleCommand::removeHTMLBidiEmbeddingStyle):
              (WebCore::ApplyStyleCommand::removeCSSStyle):
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e9f74e01
  9. 21 Jan, 2009 2 commits
    • eric@webkit.org's avatar
      Reviewed by Justin Garcia. · 9199e852
      eric@webkit.org authored
              Remove the style='' turds left by some editing commands
              https://bugs.webkit.org/show_bug.cgi?id=23463
      
              Test: editing/execCommand/toggle-styles.html
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::removeCSSStyle): check if we just removed the last CSS property and remove the style attribute as well
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::removeNodeAttribute): remove extra ;
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      9199e852
    • eric@webkit.org's avatar
      Reviewed by Justin Garcia. · 2d6cf090
      eric@webkit.org authored
              Fix execCommand() 'super' and 'sub' commands to add <sup> and <sub> in quirks mode, and to toggle when called twice
              https://bugs.webkit.org/show_bug.cgi?id=17733
      
              Test changed: editing/execCommand/toggle-styles-expected.txt
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::StyleChange::applySubscript):
              (WebCore::StyleChange::applySuperscript):
              (WebCore::StyleChange::StyleChange):
              (WebCore::StyleChange::init):
              (WebCore::StyleChange::checkForLegacyHTMLStyleChange):
              (WebCore::ApplyStyleCommand::isHTMLStyleNode):
              (WebCore::ApplyStyleCommand::addInlineStyleIfNeeded):
              * editing/EditorCommand.cpp:
              (WebCore::executeSubscript):
              (WebCore::executeSuperscript):
              * editing/htmlediting.cpp:
              (WebCore::createHTMLElement):
              * editing/htmlediting.h:
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@40097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      2d6cf090
  10. 16 Jan, 2009 1 commit
  11. 15 Jan, 2009 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 1eab8f39
      justin.garcia@apple.com authored
      2009-01-15  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Oliver Hunt.
              
              <rdar://problem/6444148> Styling a selection that ends in a line break can sometimes style what's after the break
      
              If the range to style ended at [node, 0] or inside node (and if for some reason the node didn't get split),
              applyInlineStyle would style node.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyInlineStyle): Rename pastLast to pastEndNode, since it doesn't come from 
              Range::pastLastNode() anymore.  pastEndNode is the node after the last one that is fully selected, since
              the work done in the loop that follows should only be performed on fully selected nodes.
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply): Explicitly handle insertion into containers and after non-text nodes.
              Those were handled accidently before.
              * editing/htmlediting.cpp:
              (WebCore::caretMaxOffset): In various places we call this with a container and expect to be given the number 
              of children in that container, so I changed it to match that.  RenderBR and RenderObject::caretMaxOffset() should 
              also be eliminated since maxDeepOffset handles non-text nodes.
      
      LayoutTests:
      
      2009-01-15  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Oliver Hunt.
              
              <rdar://problem/6444148> Styling a selection that ends in a line break can sometimes style what's after the break
      
              * editing/execCommand/6444148-expected.txt: Added.
              * editing/execCommand/6444148.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      1eab8f39
  12. 07 Jan, 2009 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 43f300cf
      justin.garcia@apple.com authored
      2009-01-07  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin Adler.
      
              <rdar://problem/6355786> Find fails for queries that contain a line break
      
              * editing/TextIterator.cpp:
              (WebCore::findPlainText): Allow find with queries that contain newlines.
      
      LayoutTests:
      
      2009-01-07  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin Adler.
              
              <rdar://problem/6355786> Find fails for queries that contain a line break
      
              * editing/execCommand/6355786-expected.txt: Added.
              * editing/execCommand/6355786.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39693 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      43f300cf
  13. 01 Jan, 2009 1 commit
    • darin@apple.com's avatar
      WebCore: · 6366d465
      darin@apple.com authored
      2009-01-01  Darin Adler  <darin@apple.com>
      
              Reviewed by Dan Bernstein.
      
              Bug 23051: web page searching should use ICU's search so it can ignore diacritical differences
              https://bugs.webkit.org/show_bug.cgi?id=23051
              rdar://problem/3574497
      
              Test: editing/execCommand/findString-diacriticals.html
      
              * editing/TextIterator.cpp: Changed the CircularSearchBuffer class to have a new
              name, since it doesn't always use a circular buffer any more. Changed the interface
              so it can work well in the new chunky comparison mode for ICU search, and also
              added private data members for both the ICU-search and non-ICU-search code paths.
              (WebCore::TextIterator::TextIterator): Use the versions of the Range functions
              that don't take an exception code.
              (WebCore::TextIterator::handleTextBox): Added a special case to handle the position
              of a collapsed-away space better. This is not needed for search mechanism, but was
              helpful in an earlier version of this patch, and is still an improvement.
              (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): Use the
              versions of the Range functions that don't take an exception code.
              (WebCore::CharacterIterator::range): Ditto.
              (WebCore::characterSubrange): Added. Helper function used in both places below where
              we want to convert a range and character offsets into a subrange.
              (WebCore::WordAwareIterator::advance): Use the versions of the Range functions that
              don't take an exception code.
              (WebCore::createSearcher): Added.
              (WebCore::searcher): Added.
              (WebCore::lockSearcher): Added.
              (WebCore::unlockSearcher): Added.
              (WebCore::SearchBuffer::SearchBuffer): Added.
              (WebCore::SearchBuffer::~SearchBuffer): Added.
              (WebCore::SearchBuffer::append): Added.
              (WebCore::SearchBuffer::atBreak): Added.
              (WebCore::SearchBuffer::reachedBreak): Added.
              (WebCore::SearchBuffer::search): Added.
              (WebCore::SearchBuffer::length): Added.
              (WebCore::TextIterator::subrange): Changed to call the characterSubrange
              function above.
              (WebCore::TextIterator::rangeFromLocationAndLength): Use the versions of the
              Range functions that don't take an exception code. Also tweak some other details
              of the code.
              (WebCore::isAllCollapsibleWhitespace): Added.
              (WebCore::collapsedToBoundary): Added.
              (WebCore::findPlainText): Rewrote to use new interface and streamline the
              logic a bit.
      
              Add the relevant files in the icu directory. As icu/README says, the "icu"
              directory is really just for Mac OS X, where we have the ICU library but not
              the headers installed. It should be moved inside platform/mac at some point
              to make this more clear (and the copy in JavaScriptCore should be moved
              somewhere similar for the same reason).
      
              * icu/unicode/ucoleitr.h: Added.
              * icu/unicode/usearch.h: Added.
      
      LayoutTests:
      
      2009-01-01  Darin Adler  <darin@apple.com>
      
              Reviewed by Dan Bernstein.
      
              Bug 23051: web page searching should use ICU's search so it can ignore diacritical differences
              https://bugs.webkit.org/show_bug.cgi?id=23051
              rdar://problem/3574497
      
              Currently this is only activated on the Mac platform, not including Tiger.
      
              * editing/execCommand/findString-diacriticals-expected.txt: Added. Expect failure.
              * editing/execCommand/findString-diacriticals.html: Added.
              * platform/mac-tiger/editing/execCommand: Added.
              * platform/mac-tiger/editing/execCommand/findString-diacriticals-expected.txt: Added. Expect failure.
              * platform/mac/editing/execCommand/findString-diacriticals-expected.txt: Added. Expect success.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39536 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      6366d465
  14. 08 Dec, 2008 1 commit
    • darin@apple.com's avatar
      WebCore: · 7bcc5185
      darin@apple.com authored
      2008-12-03  Darin Adler  <darin@apple.com>
      
              Reviewed by John Sullivan.
      
              - fix https://bugs.webkit.org/show_bug.cgi?id=22409
                REGRESSION: cmd-shift-left/right don't switch tabs, instead select text
      
              Tests: editing/execCommand/enabling-and-selection-2.html
                     editing/execCommand/enabling-and-selection.html
      
              * editing/EditorCommand.cpp: Updated table to use these functions by their new names.
              (WebCore::enabledVisibleSelection): Renamed this to reflect its new algorithm.
              An invisible selection with a position that selects no characters doesn't count
              as a visible selection.
              (WebCore::enabledVisibleSelectionAndMark): Ditto.
      
      WebKitTools:
      
      2008-12-08  Darin Adler  <darin@apple.com>
      
              Reviewed by John Sullivan.
      
              - test machinery for https://bugs.webkit.org/show_bug.cgi?id=22409
                REGRESSION: cmd-shift-left/right don't switch tabs, instead select text
      
              * DumpRenderTree/LayoutTestController.cpp:
              (isCommandEnabledCallback): Added.
              (LayoutTestController::staticFunctions): Added "isCommandEnabled".
              * DumpRenderTree/LayoutTestController.h: Ditto.
              * DumpRenderTree/gtk/LayoutTestControllerGtk.cpp:
              (LayoutTestController::isCommandEnabled): Ditto.
              * DumpRenderTree/mac/LayoutTestControllerMac.mm:
              (-[CommandValidationTarget initWithAction:]): Added. Used to get the
              command validation system to tell us if a comment is enabled.
              (-[CommandValidationTarget action]): Ditto.
              (-[CommandValidationTarget tag]): Ditto.
              (LayoutTestController::isCommandEnabled): Ditto.
              * DumpRenderTree/win/LayoutTestControllerWin.cpp:
              (LayoutTestController::isCommandEnabled): Ditto.
      
      LayoutTests:
      
      2008-12-08  Darin Adler  <darin@apple.com>
      
              Reviewed by John Sullivan.
      
              - tests for https://bugs.webkit.org/show_bug.cgi?id=22409
                REGRESSION: cmd-shift-left/right don't switch tabs, instead select text
      
              * editing/execCommand/enabling-and-selection-2-expected.txt: Added.
              * editing/execCommand/enabling-and-selection-2.html: Added.
              * editing/execCommand/enabling-and-selection-expected.txt: Added.
              * editing/execCommand/enabling-and-selection.html: Added.
              * editing/execCommand/resources: Added.
              * editing/execCommand/resources/TEMPLATE.html: Copied from LayoutTests/fast/js/resources/TEMPLATE.html.
              * editing/execCommand/resources/enabling-and-selection-2.js: Added.
              * editing/execCommand/resources/enabling-and-selection.js: Added.
      
              * fast/canvas/canvas-setTransform.html: Let make-js-test-wrappers update this.
              * fast/canvas/canvas-strokeRect.html: Ditto.
      
              * platform/qt/Skipped: Added enabling-and-selection-2 to the skipped list.
              * platform/win/Skipped: Ditto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@39114 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      7bcc5185
  15. 21 Nov, 2008 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · e248230a
      justin.garcia@apple.com authored
      2008-11-21  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin Adler.
      
              <rdar://problem/5381788> Match NSTextView editing behavior at the end of hyperlink text
              
              Change link editing behavior to match TextEdit and MS Word when editing before and after 
              a link (Pages has two caret positions at link boundaries, Thunderbird and FF behave like we 
              used to, so it's difficult to get out of link editing mode):
              When inserting before or after a link, always insert content outside of the link.  This
              makes it impossible to get stuck in link editing mode, while making it slightly more 
              difficult to edit link labels.  WebKit editors that care about this can add UI for editing 
              link labels, like GMail and GoogleDocs have done.  We never actually had any bugs complaining
              about how it was difficult to edit link labels at the start/end, the code was just introduced 
              with another bug fix without much thought.
              
              Don't remember removed links anymore, no other editor does this and it made it 
              difficult/impossible to get out of link editing mode.  This code was added to fix
              <rdar://problem/4069359>, which is fixed instead by removing the styles from an 
              enclosing anchor element from those styles that we remember when we delete content.
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::positionAvoidingSpecialElementBoundary):
              * editing/CompositeEditCommand.h:
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::removeEnclosingAnchorStyle):
              (WebCore::DeleteSelectionCommand::saveTypingStyleState):
              (WebCore::DeleteSelectionCommand::doApply):
              * editing/DeleteSelectionCommand.h:
              * editing/EditCommand.cpp:
              (WebCore::EditCommand::apply):
              * editing/Editor.cpp:
              (WebCore::Editor::appliedEditing):
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::prepareForTextInsertion):
              (WebCore::InsertTextCommand::input):
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply):
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::setSelection):
              * editing/SelectionController.h:
      
      LayoutTests:
      
      2008-11-21  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin Adler.
              
              <rdar://problem/5381788> Match NSTextView editing behavior at the end of hyperlink text
              
              Removed tests for behaviors that we're no longer interested in:
              * editing/deleting/delete-link-1.html: Removed.
              * platform/mac/editing/deleting/delete-link-1-expected.checksum: Removed.
              * platform/mac/editing/deleting/delete-link-1-expected.png: Removed.
              * platform/mac/editing/deleting/delete-link-1-expected.txt: Removed.
              * editing/execCommand/19653-4-expected.txt: Removed.
              * editing/execCommand/19653-4.html: Removed.
              
              Reflects new behavior (don't remember removed anchors):
              * platform/mac/editing/deleting/5168598-expected.txt:
              
              Reflects new behavior.  Also made this test cross-platform:
              * editing/inserting/insert-before-link-1-expected.txt: Added.
              * editing/inserting/insert-before-link-1.html:
              * platform/mac/editing/inserting/insert-before-link-1-expected.checksum: Removed.
              * platform/mac/editing/inserting/insert-before-link-1-expected.png: Removed.
              * platform/mac/editing/inserting/insert-before-link-1-expected.txt: Removed.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@38683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      e248230a
  16. 19 Jun, 2008 2 commits
    • justin.garcia@apple.com's avatar
      WebCore: · c04d36ef
      justin.garcia@apple.com authored
      2008-06-19  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Oliver.
      
              <https://bugs.webkit.org/show_bug.cgi?id=16049>
              execCommand('backColor') fails on collapsed selections
      
              * editing/EditorCommand.cpp:
              (WebCore::CommandEntry::): Enable BackColor for caret selections, and
              disable ForeColor in plaintext-only regions.
      
      LayoutTests:
      
      2008-06-19  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Oliver.
              
              <https://bugs.webkit.org/show_bug.cgi?id=16049>
              execCommand('backColor') fails on collapsed selections
      
              * editing/execCommand/16049-expected.txt: Added.
              * editing/execCommand/16049.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34682 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c04d36ef
    • justin.garcia@apple.com's avatar
      WebCore: · d1eac9a5
      justin.garcia@apple.com authored
      2008-06-19  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by John.
      
              <https://bugs.webkit.org/show_bug.cgi?id=19653>
              Typing style lost when creating list from, indenting or outdenting an empty paragraph
              
              There were two problems.  First, moveParagraphs didn't preserve the style of empty paragraphs.
              Second, indent, outdent and list creation returned false from preservesTypingStyle.
              The second problem couldn't be fixed by just adding preservesTypingStyle() { return true; }
              to those commands, though, because of other bugs.
              
              Cleaned up the implementation of typing style enough to remove FIXMEs for:
              
              <rdar://problem/3769899> Implementation of typing style needs improvement 
              
              which has actually been closed for some time now anyway.
              
              * dom/Document.cpp: Removed an unused header.
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::moveParagraphs): Preserve the style of an empty paragraph, too.
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::saveTypingStyleState): Removed FIXME.
              (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): 
              Removed FIXME.  
              If there is a typing style to apply after a delete, apply it to any line break that acts as a paragraph
              placeholder, not only one that was inserted by deletion.  This fixes a bug where deleting
              <div><b>Bold</b><br></div>, changing the selection and then coming back and typing wouldn't 
              produce bold text.  
              Don't set the EditCommand's typingStyle, it has been removed (more on that later).
              (WebCore::DeleteSelectionCommand::doApply): We don't need to pass calculateTypingStyleAfterDelete
              the inserted placeholder because it will find it.
              (WebCore::DeleteSelectionCommand::preservesTypingStyle): Normally deletion doesn't preserve the 
              typing style that was present before it.  For example, type a character, Bold, then delete the 
              character and start typing.  The Bold typing style shouldn't stick around.  We got this right before 
              purely by chance. Deletion should preserve a typing style that *it* sets, however.
              * editing/DeleteSelectionCommand.h: No longer need to pass calculateTypingStyleAfterDelete
              the inserted placeholder.
              * editing/EditCommand.cpp:
              (WebCore::EditCommand::apply): 
              Clearing or not clearing a removed anchor should not be determined by whether or not a command 
              preservesTypingStyle().  For example, the deletion that removed an anchor (and stored it), may 
              not preserve the typing style, but that doesn't mean that it should then go and clear the removed 
              anchor.  All high level commands, and all commands that a TypingCommand spawns, except for
              text insertions, which should restore a removed anchor, should clear it.
              There is no longer a typing style on EditCommand, removed code that cleared it.  Code that clears the 
              *actual* typing style is now in Editor::appliedEditing, just like before.
              There is no longer a typing style on EditCommand, removed code to set one.
              (WebCore::EditCommand::styleAtPosition): Removed FIXME.
              * editing/EditCommand.h: 
              Removed code assosiated with m_typingStyle.
              Made preservesTypingStyle() public, so that we can call it from Editor::appliedEditing().
              * editing/Editor.cpp:
              (WebCore::Editor::appliedEditing):
              Removed code to preserve the removedAnchor during the call to setSelection, because we no longer
              request to clear the typing style with that call.  Also removed the FIXME about this.
              Before, a command would set the Frame's typing style by setting its own typingStyle, and then 
              letting code here, in appliedEditing pick that up and set it on the Frame.  Now, the command 
              itself sets the Frame's typing style.  Deletion is the only command that does this right now.
              * editing/IndentOutdentCommand.h:
              (WebCore::IndentOutdentCommand::preservesTypingStyle): Added, returns true.
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply): Removed FIXME.
              * editing/InsertListCommand.h:
              (WebCore::InsertListCommand::preservesTypingStyle): Added.
              * editing/InsertParagraphSeparatorCommand.cpp:
              (WebCore::InsertParagraphSeparatorCommand::applyStyleAfterInsertion): Removed FIXME.
              * editing/InsertTextCommand.cpp:
              (WebCore::InsertTextCommand::input): Removed FIXME.
              * editing/ReplaceSelectionCommand.cpp:
              (WebCore::ReplaceSelectionCommand::doApply): Removed FIXME and also added one about clearing
              the typing style here.  It seems like it's something that could wait until after the command
              has been performed, since there is no code between this point and the end of the operation
              that queries or uses the typing style.
      
      LayoutTests:
      
      2008-06-19  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by John.
              
              https://bugs.webkit.org/show_bug.cgi?id=19653
              Typing style lost when creating list from, indenting or outdenting an empty paragraph
      
              These demonstrate fixes:
              * editing/execCommand/19653-1-expected.txt: Added.
              * editing/execCommand/19653-1.html: Added.
              * editing/execCommand/19653-2-expected.txt: Added.
              * editing/execCommand/19653-2.html: Added.
              * editing/execCommand/19653-3-expected.txt: Added.
              * editing/execCommand/19653-3.html: Added.
              * editing/execCommand/19653-4-expected.txt: Added.
              * editing/execCommand/19653-4.html: Added.
              Changed to an equivalent but more bloated DOM because of a pre-existing bug in ApplyStyleCommand:
              * platform/mac/editing/deleting/delete-br-011-expected.txt:
              Fixed a bug where the typing style wasn't applied to the placeholder in an empty paragraph,
              so typing would create text with the right style, but if you were to change the selection
              and then come back and start typing, the style would be wrong.  The size of the caret was
              also wrong as a result:
              * platform/mac/editing/deleting/delete-br-012-expected.txt:
              * platform/mac/editing/deleting/delete-br-012-expected.png:
              * platform/mac/editing/deleting/delete-br-012-expected.checksum:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34681 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d1eac9a5
  17. 11 Jun, 2008 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 312e5395
      justin.garcia@apple.com authored
      2008-06-11  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Eric.
      
              <https://bugs.webkit.org/show_bug.cgi?id=19455>
              Crash at RenderObject::childAt during JustifyCenter
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::surroundNodeRangeWithElement): Added a FIXME.
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::moveParagraphs): If we're removing a line
              break that consists of a single '\n' in a text node by itself, remove
              the whole text node instead of just emptying it out.
              * editing/Selection.cpp:
              (WebCore::Selection::validate): Added a FIXME about canonicalizing
              to positions that aren't candidates.
              * editing/SelectionController.cpp:
              (WebCore::SelectionController::nodeWillBeRemoved): When the base and/or
              extent are about to be removed but the start and end aren't, change the 
              base and extent to the start and end, but don't re-validate the selection, 
              since doing so could move the start and end into the node that is about 
              to be removed.
      
      LayoutTests:
      
      2008-06-11  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Eric.
      
              <https://bugs.webkit.org/show_bug.cgi?id=19455>
              Crash at RenderObject::childAt during JustifyCenter
      
              * editing/execCommand/19455-expected.txt: Added.
              * editing/execCommand/19455.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34495 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      312e5395
  18. 06 Jun, 2008 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 84069e78
      justin.garcia@apple.com authored
      2008-06-06  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin.
      
              <https://bugs.webkit.org/show_bug.cgi?id=19087>
              Editing crash in IndentOutdentCommand::prepareBlockquoteLevelForInsertion, ASSERT in debug mode
      
              * editing/DeleteSelectionCommand.cpp:
              (WebCore::DeleteSelectionCommand::calculateTypingStyleAfterDelete): applyStyle
              can destroy insertedPlaceholder if it needs to move it, but it will set an
              endingSelection() at [movedPlaceholder, 0] if it does so.  Re-fetch insertedPlaceholder
              if that happens.  The long term solution for these crashes is to make moveParagraphs
              not copy/destroy/move content, and to make VisiblePositions update themselves on DOM 
              mutations.
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::indentRegion): Early return to avoid crashes like this
              in the future, but ASSERT to catch them in debug builds.
      
      LayoutTests:
      
      2008-06-06  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin.
      
              <https://bugs.webkit.org/show_bug.cgi?id=19087>
              Editing crash in IndentOutdentCommand::prepareBlockquoteLevelForInsertion, ASSERT in debug mode
              
              * editing/execCommand/19087-expected.txt: Added.
              * editing/execCommand/19087.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34403 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      84069e78
  19. 05 Jun, 2008 3 commits
    • justin.garcia@apple.com's avatar
      WebCore: · fb7e9f83
      justin.garcia@apple.com authored
      2008-06-05  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Eric.
      
              <https://bugs.webkit.org/show_bug.cgi?id=19403>
              ASSERT in InsertIntoTextNodeCommand::InsertIntoTextNodeCommand during RemoveFormat call
      
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply): If the selection was all
              formatting (like an empty list) the format-less text will be empty.
              Early return to avoid the ASSERT that fires if input(...) is called
              with an empty String.
      
      LayoutTests:
      
      2008-06-05  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Eric.
              
              <https://bugs.webkit.org/show_bug.cgi?id=19403>
              ASSERT in InsertIntoTextNodeCommand::InsertIntoTextNodeCommand during RemoveFormat call
              
              * editing/execCommand/19403-expected.txt: Added.
              * editing/execCommand/19403.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34399 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      fb7e9f83
    • justin.garcia@apple.com's avatar
      WebCore: · 36f15aff
      justin.garcia@apple.com authored
      2008-06-05  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Eric.
      
              <https://bugs.webkit.org/show_bug.cgi?id=19089> Editing ASSERT in Range::compareBoundaryPoints
              
              ApplyStyleCommand::applyInlineStyle does some work and then checks to see
              if the start offset of the Range it's operating on is now past the caretMaxOffset
              of the start container.  If it is, applyInlineStyle updates the position to 
              [startContainer->traverseNextNode(), 0] and then operates on that new start
              position.
              
              caretMaxOffset was incorrect for horizontal rules.  It should be 1 and it was 0.  So,
              if the horizontal rule was the last node in the document, applyInlineStyle would update
              its start position to [0, 0] and then try to operate on that position, assuming it was
              non-null, leading to the ASSERT.
              
              * rendering/RenderObject.cpp:
              (WebCore::RenderObject::caretMaxOffset):
      
      LayoutTests:
      
      2008-06-05  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Eric.
              
              <https://bugs.webkit.org/show_bug.cgi?id=19089> Editing ASSERT in Range::compareBoundaryPoints
      
              * editing/execCommand/19089-expected.txt: Added.
              * editing/execCommand/19089.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34390 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      36f15aff
    • justin.garcia@apple.com's avatar
      WebCore: · d66addb7
      justin.garcia@apple.com authored
      2008-06-05  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Harrison.
      
              <rdar://problem/5658933> GoogleDocs: Crash indenting a particular selection twice
              <rdar://problem/5831310> CrashTracer: [USER] 4 crashes in Mail at WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion
              <rdar://problem/5480141> GoogleDocs: Attempting to indent content in <td> closes <table> element
              
              A crash would occur when indenting a selection that started just before a table
              and ended inside that table.  With a selection like this, we'd indent the entire
              table, then try and indent paragraphs inside it, but the stored position for the
              next paragraph to indent was inside content that had been removed from the document 
              during the first Indent.
              
              Fixed the crash adjusting the selection to perform the indent on to prepare it
              for paragraph iteration using selectionForParagraphIteration.  We do this adjustment
              for paragraph iteration in InsertList as well.
              
              Also, indenting paragraphs inside table cells would break table structure because 
              we were splitting the DOM all the way up to the root editable element to insert
              a blockquote.  Fixed this by only splitting up to the enclosing table cell.  This 
              matches FF.  Lastly, fixed a bug where indenting several paragraphs inside different 
              table cells would move all the selected text into the same table cell. FF still has 
              this bug.
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::indentRegion):
      
      LayoutTests:
      
      2008-06-05  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Harrison.
              
              <rdar://problem/5658933> GoogleDocs: Crash indenting a particular selection twice
      
              * editing/execCommand/5658933-1-expected.txt: Added.
              * editing/execCommand/5658933-1.html: Added.
              * editing/execCommand/5658933-2-expected.txt: Added.
              * editing/execCommand/5658933-2.html: Added.
              * editing/execCommand/5658933-3-expected.txt: Added.
              * editing/execCommand/5658933-3.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34385 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      d66addb7
  20. 03 Jun, 2008 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · aed9c451
      justin.garcia@apple.com authored
      2008-06-03  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by John.
      
              <rdar://problem/5763082> GMail: Hang when removing indent from nested list
              <rdar://problem/5775449> In Gmail and GoogleDocs, a hang occurs when I attempt to apply a list style to a large selection of text
              <rdar://problem/5937624> 9D32: Hang in Safari. Using 100% of processor
      
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::modifyRange): doApply() may operate on and remove 
              the last paragraph of the selection from the document if it's in the same list 
              item as startOfCurrentParagraph.  Return early to avoid an infinite loop and 
              because there is no more work to be done.  Added a FIXME (<rdar://problem/5983974>)
              about the incorrect endingSelection()s.
      
      LayoutTests:
      
      2008-06-03  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by John.
              
              <rdar://problem/5763082> GMail: Hang when removing indent from nested list
      
              * editing/execCommand/5763082-expected.txt: Added.
              * editing/execCommand/5763082.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34354 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      aed9c451
  21. 23 May, 2008 2 commits
    • justin.garcia@apple.com's avatar
      Check Paste, instead of checking Copy twice. · b4cf8d28
      justin.garcia@apple.com authored
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34098 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      b4cf8d28
    • justin.garcia@apple.com's avatar
      WebCore: · 805cd8c9
      justin.garcia@apple.com authored
      2008-05-23  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin.
      
              <rdar://problem/5939887> REGRESSION: With no selection, copy does not fire oncopy handler (affects CIFilterBrowser widget)
              
              Execute cut, copy and paste if they are invoked explicitly, via execCommand or -[WebView copy:], even
              if they are disabled.  This will fire oncopy, oncut and onpaste, but won't perform any other work, like
              writing to the pasteboard during cut/copy or deleting the selection during cut/paste.  This matches FF3,
              which actually goes further and fires oncopy on any Command-C.
              
              * editing/EditorCommand.cpp:
              (WebCore::CommandEntry::):
              (WebCore::Editor::Command::execute):
      
      LayoutTests:
      
      2008-05-23  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin.
      
              <rdar://problem/5939887> REGRESSION: With no selection, copy does not fire oncopy handler (affects CIFilterBrowser widget)
      
              * editing/execCommand/5939887-expected.txt: Added.
              * editing/execCommand/5939887.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34097 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      805cd8c9
  22. 24 Apr, 2008 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · a6442859
      justin.garcia@apple.com authored
      2008-04-24  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin Adler.
      
              <rdar://problem/5604313> FormatBlock to apply an h1 also inserts a style span around the first letter (16004)
              
              * editing/TextIterator.cpp:
              (WebCore::TextIterator::advance): We emit an extra newline when leaving a
              block element that has atypical margin/padding. When we emit the extra newline, 
              it needs to be positioned after that block's contents, not after the block. 
              This is how we position the first newline, too, since the range for emitted newlines 
              should start where the line break begins visually.
      
      LayoutTests:
      
      2008-04-24  Justin Garcia  <justin.garcia@apple.com>
      
              Reviewed by Darin Adler.
      
              <rdar://problem/5604313> FormatBlock leaves first letter incorrectly styled (16004)
      
              * editing/execCommand/5604313-expected.txt: Added.
              * editing/execCommand/5604313.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32497 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      a6442859
  23. 15 Mar, 2008 1 commit
    • darin@apple.com's avatar
      WebCore: · f28fa1b0
      darin@apple.com authored
              Reviewed by Sam.
      
              - fix http://bugs.webkit.org/show_bug.cgi?id=11997
                Ranges are not fixed after mutation (affects Acid3 test 13)
      
              Test: fast/dom/Range/mutation.html
      
              * WebCore.xcodeproj/project.pbxproj: Added NodeWithIndex.h, NodeWithIndexAfter.h,
              and NodeWithIndexBefore.h.
      
              * dom/CharacterData.cpp:
              (WebCore::CharacterData::setData): Replaced call to Document::removeMarkers
              with call to Document::textRemoved.
              (WebCore::CharacterData::insertData): Replaced call to Document::shiftMarkers
              with call to Document::textInserted.
              (WebCore::CharacterData::deleteData): Replaced call to Document::removeMarkers
              and Document::shiftMarkers with call to Document::textRemoved.
              (WebCore::CharacterData::replaceData): Replaced call to Document::removeMarkers
              and Document::shiftMarkers with call to Document::textRemoved and
              Document::textInserted.
              (WebCore::CharacterData::containsOnlyWhitespace): Tweaked a bit.
      
              * dom/ContainerNode.cpp:
              (WebCore::ContainerNode::childrenChanged): Added a call to
              Document::nodeChildrenChanged when the nmber of children was changed (and not
              by the parser).
              (WebCore::dispatchChildRemovalEvents): Updated for name change.
      
              * dom/Document.cpp:
              (WebCore::Document::~Document): Assert that all ranges are gone.
              (WebCore::Document::nodeChildrenChanged): Added. Calls nodeChildrenChanged on
              all ranges.
              (WebCore::Document::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
              Added code to call nodeWillBeRemoved on all ranges.
              (WebCore::Document::textInserted): Added. Calls textInserted on all ranges and
              also calls shiftMarkers.
              (WebCore::Document::textRemoved): Added. Calls textRemoved on all ranges and also
              calls removeMarkers and shiftMarkers.
              (WebCore::Document::textNodesMerged): Added. Calls textNodesMerged on all ranges.
              (WebCore::Document::textNodeSplit): Added. Calls textNodeSplit on all ranges.
              (WebCore::Document::attachRange): Added. Adds range to the HashSet of all ranges
              for this document.
              (WebCore::Document::detachRange): Added. Removes range from the HashSet.
              * dom/Document.h: Added the new functions and the data member.
      
              * dom/Element.cpp:
              (WebCore::Element::normalizeAttributes): Added. Contains the part of the
              normalize function that's specific to Element. Better encapsulation to have it
              here rather than in Node::normalize.
              * dom/Element.h: Added the new function.
      
              * dom/Node.cpp:
              (WebCore::Node::normalize): Rewrote so it's no longer recursive. Also added
              a call to textNodesMerged after each pair of nodes is merged but before the
              second node is removed.
              (WebCore::Node::traverseNextNodePostOrder): Added. Helper function used by
              normalize, but also useful elsewhere.
              * dom/Node.h: Added the new function.
      
              * dom/NodeIterator.cpp:
              (WebCore::NodeIterator::nodeWillBeRemoved): Renamed from notifyBeforeNodeRemoval.
              * dom/NodeIterator.h: Ditto.
      
              * dom/ProcessingInstruction.cpp:
              (WebCore::ProcessingInstruction::setData): Call textRemoved.
      
              * dom/Range.cpp:
              (WebCore::NodeWithIndex::index): Added. Computes and stores index.
              (WebCore::NodeWithIndexBefore::indexBefore): Added. Computes and stores index.
              (WebCore::NodeWithIndexAfter::indexAfter): Added. Computes and stores index.
              (WebCore::Range::Range): Call attachRange.
              (WebCore::Range::~Range): Call detachRange unless the range is already detached.
              (WebCore::Range::commonAncestorContainer): Removed check for WRONG_DOCUMENT_ERR.
              It's no longer possible to create a range where the two containers are non-zero
              and have no common ancestor.
              (WebCore::Range::isPointInRange): Rewrote expression to be more readable.
              (WebCore::Range::compareNode): Changed local variable to use int for consistency.
              (WebCore::Range::compareBoundaryPoints): Replaced ASSERT with ASSERT_NOT_REACHED.
              (WebCore::Range::deleteContents): Removed check for INVALID_STATE_ERR and
              initialization of ec to 0; both are now inside checkDeleteExtract.
              (WebCore::Range::intersectsNode): Changed local variable to use int for consistency.
              Also changed comparison to use < 0 and >= 0 rather than checking explicitly for 1
              and -1.
              (WebCore::Range::processContents): Changed code to not get the nodeType multiple
              times on the same node, and tweaked formatting. Removed code to update the range
              on deletion, because the normal delete logic will take care of that now.
              (WebCore::Range::extractContents): Removed check for INVALID_STATE_ERR and
              initialization of ec to 0; both are now inside checkDeleteExtract.
              (WebCore::Range::insertNode): Changed local variable to use int for consistency.
              (WebCore::Range::toString): Changed variable name to pastLast.
              (WebCore::Range::detach): Call detachRange.
              (WebCore::Range::checkDeleteExtract): Added check for detached range and code to
              set ec to 0; moved here from the two callers. Also changed variable name to pastLast.
              (WebCore::endpointNodeChildrenChanged): Added.
              (WebCore::Range::nodeChildrenChanged): Added.
              (WebCore::endpointNodeWillBeRemoved): Added.
              (WebCore::Range::nodeWillBeRemoved): Added.
              (WebCore::endpointTextInserted): Added.
              (WebCore::Range::textInserted): Added.
              (WebCore::endpointTextRemoved): Added.
              (WebCore::Range::textRemoved): Added.
              (WebCore::endpointTextNodesMerged): Added.
              (WebCore::Range::textNodesMerged): Added.
              (WebCore::endpointTextNodesSplit): Added.
              (WebCore::Range::textNodeSplit): Added.
      
              * dom/Range.h: Added new member functions.
      
              * dom/NodeWithIndex.h: Added. Makes it so we won't find the index for the same
              node more than once.
              * dom/NodeWithIndexAfter.h: Added. Similar to NodeWithIndex but gives the index after a
              node and treats a node pointer of 0 as meaning "before first node in parent container".
              * dom/NodeWithIndexBefore.h: Added.  Similar to NodeWithIndex but treats a node pointer of 0
              as meaning "after last node in parent container".
      
              * dom/Text.cpp:
              (WebCore::Text::splitText): Call textNodeSplit.
      
              * editing/ApplyStyleCommand.cpp:
              (WebCore::ApplyStyleCommand::applyInlineStyle): Changed variable name to pastLast.
      
      LayoutTests:
      
              Reviewed by Sam.
      
              - test changes for http://bugs.webkit.org/show_bug.cgi?id=11997
                Ranges are not fixed after mutation (affects Acid3 test 13)
      
              * fast/dom/Range/mutation-expected.txt: Added.
              * fast/dom/Range/mutation.html: Added.
              * fast/dom/Range/resources/mutation.js: Added.
      
              * editing/execCommand/4920742-2-expected.txt: Updated.
              * editing/execCommand/4920742-2.html: Updated this test. It was testing for a crash in a
              case that's no longer possible -- you can't make a range where one endpoint is in the
              document and the other is not.
      
              * platform/mac/editing/execCommand/4920488-expected.txt: Removed WRONG_DOCUMENT_ERR.
              The fact that a test was getting this exception was a bug, similar to the case above.
              * platform/qt/editing/execCommand/4920488-expected.txt: Ditto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@31075 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      f28fa1b0
  24. 12 Mar, 2008 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 07178e16
      justin.garcia@apple.com authored
              Reviewed by Oliver.
              
              <rdar://problem/5770834> Crash at InsertTextCommand::prepareForTextInsertion() doing RemoveFormat in a certain list
              
              Fixes some (but not all) of the instances of:
              <rdar://problem/5659795> CrashTracer: [REGRESSION] 187 crashes in Safari at com.apple.WebCore: WebCore::InsertTextCommand::prepareForTextInsertion + 241
              <rdar://problem/5779631> CrashTracer: [USER] 25 crashes in Mail at WebCore::InsertTextCommand::prepareForTextInsertion
      
              * editing/InsertLineBreakCommand.cpp:
              (WebCore::InsertLineBreakCommand::doApply): applyStyle may have destroyed content that held
              the old endingSelection(), so we must recompute it.  Added a FIXME.  Added a few comments.
              * editing/RemoveFormatCommand.cpp:
              (WebCore::RemoveFormatCommand::doApply): Added a FIXME.
      
      LayoutTests:
      
              Reviewed by Oliver.
              
              <rdar://problem/5770834> Crash at InsertTextCommand::prepareForTextInsertion() doing RemoveFormat in a certain list
      
              * editing/execCommand/5770834-1-expected.txt: Added.
              * editing/execCommand/5770834-1.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@30987 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      07178e16
  25. 28 Feb, 2008 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 131b4fd5
      justin.garcia@apple.com authored
              Reviewed by Darin Adler.
      
              <rdar://problem/4930986> REGRESSION: Paste As Quotation pastes black text instead of blue
              
              Add a second style span at copy time to hold document default styles.  This helps us
              differentiate between those and user applied styles at paste time, where we'll want
              to let Mail's Paste As Quotation blockquote override document default styles, but
              not others.
      
              * css/CSSComputedStyleDeclaration.cpp:
              (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): Changed the unit type used 
              for -webkit-text-stroke-width from CSS_NUMBER to CSS_PX, to match other properties that 
              are thick | medium | thin | <length>.  Before, there was a mismatch between the unit 
              type of -webkit-text-stroke-width property values in a CSSComputedStyleDeclaration for 
              an element and that element's inlineStyleDecl(), causing identical values to always appear 
              different to diff().
              * edit...
      131b4fd5
  26. 30 Jan, 2008 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · c2c4e923
      justin.garcia@apple.com authored
              Reviewed by Darin Adler.
      
              <rdar://problem/5700414> REGRESSION (Adama-ToT): Selecting "Header 1" style in Leopard Server wiki inserts newline
      
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::doApply): If the selected paragraph was empty,
              we may still need to call moveParagrah to remove the line break that holds that
              paragraph open because the new block of the requested type needs to to replace it.
      
      LayoutTests:
      
              Reviewed by Darin Adler.
              
              <rdar://problem/5700414> REGRESSION (Adama-ToT): Selecting "Header 1" style in Leopard Server wiki inserts newline
      
              * editing/execCommand/5700414-1.html: Added.
              * editing/execCommand/5700414-2.html: Added.
              * platform/mac/editing/execCommand/5700414-1-expected.checksum: Added.
              * platform/mac/editing/execCommand/5700414-1-expected.png: Added.
              * platform/mac/editing/execCommand/5700414-1-expected.txt: Added.
              * platform/mac/editing/execCommand/5700414-2-expected.checksum: Added.
              * platform/mac/editing/execCommand/5700414-2-expected.png: Added.
              * platform/mac/editing/execCommand/5700414-2-expected.txt: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      c2c4e923
  27. 02 Jan, 2008 1 commit
    • ap@webkit.org's avatar
      Reviewed by Darin. · ca5240db
      ap@webkit.org authored
              Resolved several FIXMEs in EditorCommand.
              Made recently added commands hidden from JS again.
              Removed BackwardDelete implementation, which used to be dead code, but got exposed now.
      
              Tests: editing/execCommand/delete-no-scroll.html
                     editing/execCommand/forward-delete-no-scroll.html
                     editing/execCommand/insert-line-break-no-scroll.html
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@29087 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      ca5240db
  28. 20 Dec, 2007 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 8d84be1f
      justin.garcia@apple.com authored
              Reviewed by Oliver Hunt.
      
              <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
              
              Still need to fix similar issues with the other operations that iterate 
              over selected paragraphs, like FormatBlock, Indent and Outdent (<rdar://problem/5658933>).
      
              * editing/IndentOutdentCommand.cpp:
              (WebCore::IndentOutdentCommand::indentRegion): Added a FIXME.
              * editing/IndentOutdentCommand.h: Removed an unused function.
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::modifyRange): 
              Renamed visibleStart to startOfSelection and visibleEnd to endOfSelection.
              Call the new selectionForParagraphIteration, which a) prevents operations like this
              one from being performed on a table that isn't fully selected (where the selection
              starts just before the table and ends inside it), and b) helps prevent paragraph
              iteration from going past the end of the selection.
              Call the new startOfNextParagraph, instead of using endOfParagraph(v).next(),
              since when v is in the last paragraph of the last cell of a table, that expression 
              will return the position after the table, not the start of the next paragraph.
              * editing/htmlediting.cpp:
              (WebCore::enclosingListChild): Don't go above a table cell, so that list operations
              take effect inside the table cell where they are performed.
              (WebCore::selectionForParagraphIteration): Added, see above.
              (WebCore::indexForVisiblePosition): Moved from IndentOutdentCommand.cpp.
              * editing/htmlediting.h:
              * editing/visible_units.cpp:
              (WebCore::startOfNextParagraph): Added, see above.
              * editing/visible_units.h:
              * editing/TextIterator.h:
              (WebCore::TextIterator::exitNode): Added a FIXME.
      
      LayoutTests:
      
              Reviewed by Oliver Hunt.
              
              <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
      
              * editing/execCommand/5543472-1-expected.txt: Added.
              * editing/execCommand/5543472-1.html: Added.
              * editing/execCommand/5543472-2-expected.txt: Added.
              * editing/execCommand/5543472-2.html: Added.
              * editing/execCommand/5543472-3-expected.txt: Added.
              * editing/execCommand/5543472-3.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28924 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      8d84be1f
  29. 14 Dec, 2007 2 commits
    • darin@apple.com's avatar
      WebCore: · 77ebec82
      darin@apple.com authored
              Reviewed by Alexey.
      
              - http://bugs.webkit.org/show_bug.cgi?id=16420
                change regression tests to use document.execCommand instead of textInputController.doCommand
      
              Add a few more operations to document.execCommand.
      
              Finished up the transition to the new Editor::Command, including removing
              the Editor::execCommand function.
      
              * WebCore.base.exp: Added Editor::Command::isSupported.
              * editing/Editor.h: Removed execCommand.
              * editing/EditorCommand.cpp:
              (WebCore::expandSelectionToGranularity): Added.
              (WebCore::verticalScrollDistance): Added; replaces canScroll.
              (WebCore::executeDeleteBackward): Added. Moved code here from WebHTMLView.
              (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
              (WebCore::executeDeleteForward): Ditto.
              (WebCore::executeDeleteToBeginningOfLine): Ditto.
              (WebCore::executeDeleteToBeginningOfParagraph): Ditto.
              (WebCore::executeDeleteToEndOfLine): Ditto.
              (WebCore::executeDeleteToEndOfParagraph): Ditto.
              (WebCore::executeMovePageDown): Renamed this command to be consistent with all the other
              Move commands. They all modify the caret. Reimplemented to match the Mac OS X version by
              removing the explicit scrolling, and letting it be done automatically by code that makes
              the caret visible. In some cases the old code would scroll twice which was harmless but
              unnecessary.
              (WebCore::executeMovePageDownAndModifySelection): Added. Moved code here from WebHTMLView.
              (WebCore::executeMovePageUp): See MovePageDown above.
              (WebCore::executeMovePageUpAndModifySelection): Added. Moved code here from WebHTMLView.
              (WebCore::executeSelectLine): Ditto.
              (WebCore::executeSelectParagraph): Ditto.
              (WebCore::executeSelectSentence): Ditto.
              (WebCore::executeSelectWord): Ditto.
              (WebCore::executeSwapWithMark): Some small tweaks.
      
              * page/ContextMenuController.cpp:
              (WebCore::ContextMenuController::contextMenuItemSelected): Changed to use Editor::command()
              instead of Editor::execCommand(). This code could be changed to use Editor::Command quite a
              bit more, but I didn't do that this time.
      
              - Removed some obsolete unused code.
      
              * page/mac/EventHandlerMac.mm:
              (WebCore::EventHandler::passMouseDownEventToWidget): Removed the special case code for
              NSTextView. This was left over from when we used NSTextField and NSTextView for form
              elements and is no longer used at all.
      
              * page/mac/WebCoreFrameBridge.h: Removed 20 unused methods that were still on one side
              of the bridge or another. We really need to find a time to tear down the rest of the
              bridge, but that's not this patch.
      
              * page/mac/WebCoreFrameBridge.mm:
              (-[WebCoreFrameBridge addData:]): Changed to get at the _shouldCreateRenderers field directly
              instead of using a method.
              (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
              Took out obsolete comment about matching enums (we use a single enum now and have for some
              time).
              (-[WebCoreFrameBridge selectionGranularity]): Ditto.
      
      WebKit:
      
              * StringsNotToBeLocalized.txt: Updated.
      
      WebKit/gtk:
      
              Reviewed by Alexey.
      
              * WebCoreSupport/EditorClientGtk.cpp:
              (WebKit::EditorClient::handleKeyboardEvent): Changed to use Editor::command
              instead of Editor::execCommand.
              * WebView/webkitwebview.cpp: Ditto.
      
      WebKit/mac:
      
              Reviewed by Alexey.
      
              - Changed a few more editing operations to use WebCore instead of WebKit.
              - Removed some obsolete unused code.
      
              * WebCoreSupport/WebFrameBridge.h: Moved declarations of methods that are both
              defined and used on the WebKit side to here. These no longer belong on the bridge
              and should be moved to the WebFrame class (or elsewhere).
              * WebCoreSupport/WebFrameBridge.mm: Removed some unused methods.
      
              * WebView/WebFrameView.mm:
              (+[WebFrameView _viewTypesAllowImageTypeOmission:]): Fix typo in comment.
      
              * WebView/WebHTMLView.mm:
              (-[WebHTMLViewPrivate dealloc]): Removed unused firstResponderTextViewAtMouseDownTime.
              (-[WebHTMLViewPrivate clear]): Ditto.
              (-[WebHTMLView _setMouseDownEvent:]): Ditto.
              (commandNameForSelector): Added special cases for pageDown:, pageDownAndModifySelection:,
              pageUp:, and pageUpAndModifySelection:, since those names probably aren't specific enough
              to be used in WebCore (what AppKit calls scrollPageDown: vs. pageDown: needs to be
              disambiguated with the word "Move"). Added deleteBackward:,
              deleteBackwardByDecomposingPreviousCharacter:, deleteForward:, deleteToBeginningOfLine:,
              deleteToBeginningOfParagraph:, deleteToEndOfLine:, deleteToEndOfParagraph:, pageDown:,
              pageDownAndModifySelection:, pageUp:, pageUpAndModifySelection:, selectLine:,
              selectParagraph:, selectSentence:, and selectWord: to the list of commands that are
              forwarded to WebCore.
              (-[WebHTMLView validateUserInterfaceItemWithoutDelegate:]): Eliminated the long list of
              operations that we forward to WebCore. Instead, look up any command that WebCore can
              handle, after any that we handle specially in WebHTMLView. Also fixed a bug where
              an item that's not a menu item with changeBaseWritingDirection:NSWritingDirectionNatural
              would end up enabled instead of disabled and streamlined the logic for toggleGrammarChecking:.
              (-[WebHTMLView mouseDown:]): Removed unused firstResponderTextViewAtMouseDownTime.
              (-[WebHTMLView becomeFirstResponder]): Removed unused willBecomeFirstResponderForNodeFocus.
              (-[WebHTMLView resignFirstResponder]): Ditto.
              (-[WebHTMLView checkSpelling:]): Took unneeded extra initialization of NSSpellChecker.
      
              * WebView/WebHTMLViewInternal.h: Removed unused willBecomeFirstResponderForNodeFocus,
              firstResponderTextViewAtMouseDownTime, _textViewWasFirstResponderAtMouseDownTime: and
              _willMakeFirstResponderForNodeFocus.
      
      WebKit/qt:
      
              Reviewed by Alexey.
      
              * Api/qwebpage.cpp:
              (QWebPage::triggerAction): Removed some use of Editor member functions we plan
              to eventually eliminate. Switch from Editor::execCommand to Editor::command.
              * WebCoreSupport/EditorClientQt.cpp:
              (WebCore::EditorClientQt::handleKeyboardEvent): Ditto. Also updated name from
              MoveUpByPageAndModifyCaret to MovePageUp and from MoveDownByPageAndModifyCaret
              to MovePageDown.
      
      WebKit/win:
      
              Reviewed by Alexey.
      
              * WebView.cpp:
              (WebView::execCommand): Switched from Editor::execCommand to Editor:command.
              Updated name from MoveUpByPageAndModifyCaret to MovePageUp and from
              MoveDownByPageAndModifyCaret to MovePageDown.
              (WebView::copy): Switched from Editor::execCommand to Editor:command.
              (WebView::cut): Ditto.
              (WebView::paste): Ditto.
              (WebView::delete_): Ditto.
      
      WebKit/wx:
      
              Reviewed by Alexey.
      
              * WebKitSupport/EditorClientWx.cpp:
              (WebCore::EditorClientWx::handleKeyboardEvent): Switched from Editor::execCommand
              to Edtor::command.
      
      LayoutTests:
      
              Reviewed by Alexey.
      
              - http://bugs.webkit.org/show_bug.cgi?id=16420
                change regression tests to use document.execCommand instead of textInputController.doCommand
      
              To avoid changing results at this time, I didn't correct the many tests that now have
              misleading "this test cannot be run manually" text or references to "NSResponder" or
              uneeded instructions for running the test manually. We can do that on a later pass.
      
              * editing/deleting/5300379.html: Use execCommand instead of doCommand.
              * editing/deleting/delete-to-end-of-paragraph.html: Ditto.
              * editing/deleting/smart-delete-003.html: Ditto.
              * editing/deleting/smart-delete-004.html: Ditto.
              * editing/execCommand/nsresponder-indent.html: Ditto.
              * editing/execCommand/nsresponder-outdent.html: Ditto.
              * editing/selection/4947387.html: Ditto.
              * editing/selection/5195166-1.html: Ditto.
              * editing/selection/5195166-2.html: Ditto.
              * editing/selection/select-line.html: Ditto.
              * editing/selection/selection-actions.html: Ditto.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      77ebec82
    • justin.garcia@apple.com's avatar
      WebCore: · 0d139513
      justin.garcia@apple.com authored
              Reviewed by Darin Adler.
      
              <rdar://problem/5575101> GoogleDocs: Hang in SplitElementCommand::doApply when outdenting a list item in a particular list
      
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::splitTreeToNode): Moved here.
              * editing/CompositeEditCommand.h:
              * editing/IndentOutdentCommand.cpp: Moved splitTreeToNode.
              * editing/IndentOutdentCommand.h: Ditto, and removed unimplemented splitTreeTo.
              * editing/InsertListCommand.cpp:
              (WebCore::InsertListCommand::doApply): Split ancestors of listChildNode between
              it and listNode, if they exists, so that moving listChildNode doesn't put it out
              of order.  Added a test case to cover each change.
              * editing/SplitElementCommand.cpp:
              (WebCore::SplitElementCommand::doApply): Added an ASSERT to catch code that
              tries to split a container at a bogus child, and an early return to avoid a
              hang in that case.
      
      LayoutTests:
      
              Reviewed by Darin Adler.
              
              <rdar://problem/5575101> Hang in SplitElementCommand::doApply when outdenting a list item in a particular list
      
              * editing/execCommand/5575101-1-expected.txt: Added.
              * editing/execCommand/5575101-1.html: Added.
              * editing/execCommand/5575101-2-expected.txt: Added.
              * editing/execCommand/5575101-2.html: Added.
              * editing/execCommand/5575101-3-expected.txt: Added.
              * editing/execCommand/5575101-3.html: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28716 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0d139513
  30. 11 Dec, 2007 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 08b1c80d
      justin.garcia@apple.com authored
              Reviewed by Oliver Hunt.
      
              <rdar://problem/5482023> GoogleDocs: After FormatBlock in an empty document, certain functions are disabled
              
              We were trying to insert a block of the requested type before the body element.
              
              * editing/FormatBlockCommand.cpp:
              (WebCore::FormatBlockCommand::doApply): 
              Removed unnecessary ()s in the if condition.
              Removed "|| !upstreamStart.node()->isDescendantOf(root)" from the if condition, since
              a) upstreamStart will never be outside the root editable element, since in that case
              there would be no block inside the editable root to Format, and b) if upstreamStart.node() 
              *is* the root, then refNode is the root, and we shouldn't insert before the root, we should insert
              at [root, 0].
              Added comments to explain the use of upstream() in the second if-clause.
              Added an early return for case where there is nothing selected, in that case, there is nothing
              to move.
      
      LayoutTests:
      
              Reviewed by Oliver Hunt.
              
              <rdar://problem/5482023> GoogleDocs: After performing FormatBlock in an empty document, certain functions are disabled
      
              * editing/execCommand/5482023.html: Added.
              * platform/mac/editing/execCommand/5482023-expected.checksum: Added.
              * platform/mac/editing/execCommand/5482023-expected.png: Added.
              * platform/mac/editing/execCommand/5482023-expected.txt: Added.
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28611 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      08b1c80d
  31. 28 Nov, 2007 1 commit
    • justin.garcia@apple.com's avatar
      WebCore: · 0ca5d705
      justin.garcia@apple.com authored
              Reviewed by Darin Adler.
      
              <rdar://problem/5573879> GMail Beta: Crash in when undoing Remove Formating
              
              In the new beta, Google has added some custom code on top of our RemoveFormat
              to work around a bug where fully selected lists aren't removed.  This code corrupts
              the undo stack and causes crashes.  This change fixes two problems with RemoveFormat
              so that Google doesn't have to have any custom code. After checking this in I'll 
              work on bulletproofing the undo stack
      
              * WebCore.xcodeproj/project.pbxproj: 
              * editing/CompositeEditCommand.cpp:
              (WebCore::CompositeEditCommand::insertLineBreak): Added this convenience method.
              (WebCore::CompositeEditCommand::inputText): Added code to select all inserted text, not
              just the last paragraph.  Added code to support an input string with '\n's.
              * editing/CompositeEditCommand.h:
              * editing/Editor.cpp:
              (WebCore::Editor::removeFormattingAndStyle): Moved code to its own EditCommand.
              * editing/RemoveFormatCommand.cpp: Added. Moved code from removeFormattingAndStyle here.
              (WebCore::RemoveFormatCommand::RemoveFormatCommand):
              (WebCore::RemoveFormatCommand::doApply): Added code to remove fully selected lists.
              * editing/RemoveFormatCommand.h: Added.
              (WebCore::RemoveFormatCommand::editingAction):
      
      LayoutTests:
      
              Reviewed by Darin Adler.
              
              <rdar://problem/5573879> GMail Beta: Crash in when undoing Remove Formating
      
              Added to demonstrate fixes:
              * editing/execCommand/5573879.html: Added.
              * platform/mac/editing/execCommand/5573879-expected.checksum: Added.
              * platform/mac/editing/execCommand/5573879-expected.png: Added.
              * platform/mac/editing/execCommand/5573879-expected.txt: Added.
              
              Fixes (RemoveFormat now preserves the selection correctly):
              * platform/mac/editing/execCommand/4920742-1-expected.checksum:
              * platform/mac/editing/execCommand/4920742-1-expected.png:
              * platform/mac/editing/execCommand/4920742-1-expected.txt:
              * platform/mac/editing/execCommand/remove-formatting-2-expected.checksum:
              * platform/mac/editing/execCommand/remove-formatting-2-expected.png:
              * platform/mac/editing/execCommand/remove-formatting-2-expected.txt:
              * platform/mac/editing/execCommand/remove-formatting-expected.checksum:
              * platform/mac/editing/execCommand/remove-formatting-expected.png:
              * platform/mac/editing/execCommand/remove-formatting-expected.txt:
      
      
      
      git-svn-id: http://svn.webkit.org/repository/webkit/trunk@28126 268f45cc-cd09-0410-ab3c-d52691b4dbfc
      0ca5d705
  32. 20 Nov, 2007 1 commit