LayoutTests:
authordarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Apr 2006 03:55:40 +0000 (03:55 +0000)
committerdarin <darin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Apr 2006 03:55:40 +0000 (03:55 +0000)
        Reviewed by Justin and Adele.

        * fast/forms/plaintext-mode-2-expected.txt: Updated because there's no longer
        and extra <div> element added.

WebCore:

        Reviewed by Justin (editing parts) and Adele (the rest).

        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8182
          some text-field-related layout tests are failing

        The smart paste code was getting confused and adding extra spaces.

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::doApply): Use isStartOfParagraph instead of
        isStartOfLine.
        (WebCore::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): Ditto.

        * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::enclosingEmptyListItem):
        Change to call isStart/EndOfParagraph instead of Line.

        * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input):
        Add a comment about how isStartOfLine is almost certainly wrong here.

        - clean up some loose ends in the Frame class from the recent renaming

        * page/Frame.h: Removed declarations of deleteMe1, deleteMe2, and
        handleMouseMoveEventPart2.
        * page/Frame.cpp: (WebCore::Frame::handleMouseMoveEvent): Removed
        handleMouseMoveEventPart2 by renaming it to handleMouseMoveEvent and removing
        handleMouseMoveEvent itself.

        - invoke the makefile directly, removing the generate-derived-sources script

        * WebCore.vcproj/WebCore/build-generated-files.sh: Call make directly.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * generate-derived-sources: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13699 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/forms/plaintext-mode-2-expected.txt
WebCore/ChangeLog
WebCore/WebCore.vcproj/WebCore/build-generated-files.sh
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/editing/InsertParagraphSeparatorCommand.cpp
WebCore/editing/InsertTextCommand.cpp
WebCore/editing/ReplaceSelectionCommand.cpp
WebCore/generate-derived-sources [deleted file]
WebCore/page/Frame.cpp
WebCore/page/Frame.h

index 6bdd6706f426965839973483c3d46d4332f6c092..c2d718be21490dc78957683064bba2d899509438 100644 (file)
@@ -1,3 +1,10 @@
+2006-04-04  Darin Adler  <darin@apple.com>
+
+        Reviewed by Justin and Adele.
+
+        * fast/forms/plaintext-mode-2-expected.txt: Updated because there's no longer
+        and extra <div> element added.
+
 2006-04-04  Adele Peterson  <adele@apple.com>
 
         - Tests for http://bugzilla.opendarwin.org/show_bug.cgi?id=8158
index d485a02fd61814687c9370890bc288f9d0780b39..a13722c575a36385a2d628051c09af2d191ecbd8 100644 (file)
@@ -2,7 +2,7 @@ EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotificatio
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: shouldInsertNode:#document-fragment replacingDOMRange:range from 0 of DIV to 0 of DIV givenAction:WebViewInsertActionPasted
-EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 96 of #text > DIV to 96 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldChangeSelectedDOMRange:range from 0 of #text > DIV to 0 of #text > DIV toDOMRange:range from 94 of #text > DIV to 94 of #text > DIV affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
 EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
 EDITING DELEGATE: webViewDidChange:WebViewDidChangeNotification
 layer at (0,0) size 800x600
@@ -43,6 +43,6 @@ layer at (0,0) size 800x600
             text run at (0,0) width 326: "Success: document.execCommand(\"Paste\") == true"
 layer at (11,13) size 594x13
   RenderBlock {DIV} at (3,3) size 594x13
-    RenderText {TEXT} at (1,0) size 486x13
-      text run at (1,0) width 486: " This styled text, and link will be pasted into the textfield. All richness should be stripped. "
-caret: position 96 of child 0 {TEXT} of document
+    RenderText {TEXT} at (1,0) size 480x13
+      text run at (1,0) width 480: "This styled text, and link will be pasted into the textfield. All richness should be stripped."
+caret: position 94 of child 0 {TEXT} of document
index 8f4865612551dcb6d58d02ebd5069f2303d8f5b4..31ab1f1217ef07dcd9f662c08374b8b0defddd3c 100644 (file)
@@ -1,3 +1,37 @@
+2006-04-04  Darin Adler  <darin@apple.com>
+
+        Reviewed by Justin (editing parts) and Adele (the rest).
+
+        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8182
+          some text-field-related layout tests are failing
+
+        The smart paste code was getting confused and adding extra spaces.
+
+        * editing/ReplaceSelectionCommand.cpp:
+        (WebCore::ReplaceSelectionCommand::doApply): Use isStartOfParagraph instead of
+        isStartOfLine.
+        (WebCore::ReplaceSelectionCommand::removeLinePlaceholderIfNeeded): Ditto.
+
+        * editing/InsertParagraphSeparatorCommand.cpp: (WebCore::enclosingEmptyListItem):
+        Change to call isStart/EndOfParagraph instead of Line.
+
+        * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input):
+        Add a comment about how isStartOfLine is almost certainly wrong here.
+
+        - clean up some loose ends in the Frame class from the recent renaming
+
+        * page/Frame.h: Removed declarations of deleteMe1, deleteMe2, and
+        handleMouseMoveEventPart2.
+        * page/Frame.cpp: (WebCore::Frame::handleMouseMoveEvent): Removed
+        handleMouseMoveEventPart2 by renaming it to handleMouseMoveEvent and removing
+        handleMouseMoveEvent itself.
+
+        - invoke the makefile directly, removing the generate-derived-sources script
+
+        * WebCore.vcproj/WebCore/build-generated-files.sh: Call make directly.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * generate-derived-sources: Removed.
+
 2006-04-04  Adele Peterson  <adele@apple.com>
 
         Reviewed by Justin.
index 50c441c43b3d4f571d604efc1c93b83c84d90212..b82ef8e10697c21a64eb8072e8c092aaaef04aec 100755 (executable)
@@ -11,11 +11,18 @@ SRCROOT=`realpath "$SRCROOT"`
 SRCROOT=`cygpath -m -s "$SRCROOT"`
 SRCROOT=`cygpath -u "$SRCROOT"`
 export SRCROOT
+
 # FIXME: Eventually win32 might wish to generate to the Debug/Release output directories.
 export BUILT_PRODUCTS_DIR="$SRCROOT"
 export CREATE_HASH_TABLE="$SRCROOT/../JavaScriptCore/kjs/create_hash_table"
 
-"$SRCROOT/generate-derived-sources" || exit 1
+mkdir -p "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore"
+cd "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore"
+
+export WebCore="${SRCROOT}"
+export ENCODINGS_FILE="${WebCore}/platform/win/win-encodings.txt";
+export ENCODINGS_PREFIX=""
+make -f "$WebCore/DerivedSources.make" || exit 1
 
 cd "$SRCROOT"
 mkdir -p "${WebKitOutputConfigDirUnix}"
@@ -41,4 +48,3 @@ if [ ../zlib/bin/zlib1.dll -nt "$WebKitOutputConfigDirUnix/zlib1.dll" ]; then
     echo "Copying zlib1.dll"
     cp ../zlib/bin/zlib1.dll "$WebKitOutputConfigDirUnix" || exit 1
 fi
-
index 242b636175b9cf368a5baaa8603a6fe829d3161a..40c63696ffb6ccff468d6cfe8a3ac8e95344db18 100644 (file)
                55998A5C052B59CC0017A6C1 /* AccessibilityObjectCache.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityObjectCache.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                55998A5D052B59CC0017A6C1 /* AccessibilityObjectCache.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AccessibilityObjectCache.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                650F53DB09D15DDA00C9B0C8 /* CSSGrammar.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CSSGrammar.h; sourceTree = "<group>"; };
-               651B2B6209D12891008808C6 /* generate-derived-sources */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = "generate-derived-sources"; sourceTree = "<group>"; };
                651B4D8309AC83370029F1EF /* DeprecatedStringList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DeprecatedStringList.cpp; path = platform/DeprecatedStringList.cpp; sourceTree = "<group>"; };
                651B4D8409AC83370029F1EF /* DeprecatedStringList.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DeprecatedStringList.h; path = platform/DeprecatedStringList.h; sourceTree = "<group>"; };
                651B4D8E09AC859F0029F1EF /* QStringListMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = QStringListMac.mm; sourceTree = "<group>"; };
                        children = (
                                65C97AF208EA908800ACD273 /* config.h */,
                                9307061309E0CA8200B17FE4 /* DerivedSources.make */,
-                               651B2B6209D12891008808C6 /* generate-derived-sources */,
                                F58EF58E02DFDFB7018635CA /* WebCore.exp */,
                                BC1A3790097C6F970019F3D8 /* bindings */,
                                65BF021F097480EF00C43196 /* bridge */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                        shellPath = /bin/sh;
-                       shellScript = "if [ \"${BUILD_STYLE}\" = \"Release\" -o \"${BUILD_STYLE}\" = \"Debug\" ] ; then\n    export CREATE_HASH_TABLE=${BUILT_PRODUCTS_DIR}/JavaScriptCore.framework/PrivateHeaders/create_hash_table\nelse\n    export CREATE_HASH_TABLE=${NEXT_ROOT}${SYSTEM_LIBRARY_DIR}/Frameworks/WebKit.framework/Versions/A/Frameworks/JavaScriptCore.framework/PrivateHeaders/create_hash_table\nfi\n./generate-derived-sources\n";
+                       shellScript = "if [ \"${BUILD_STYLE}\" = \"Release\" -o \"${BUILD_STYLE}\" = \"Debug\" ] ; then\n    export CREATE_HASH_TABLE=\"${BUILT_PRODUCTS_DIR}/JavaScriptCore.framework/PrivateHeaders/create_hash_table\"\nelse\n    export CREATE_HASH_TABLE=\"${NEXT_ROOT}${SYSTEM_LIBRARY_DIR}/Frameworks/WebKit.framework/Versions/A/Frameworks/JavaScriptCore.framework/PrivateHeaders/create_hash_table\"\nfi\n\nmkdir -p \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\"\ncd \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore\"\n\nexport WebCore=\"${SRCROOT}\"\n\nexport ENCODINGS_FILE=\"${WebCore}/platform/mac/mac-encodings.txt\"\nexport ENCODINGS_PREFIX=\"kCFStringEncoding\"\n\nmake -f \"$WebCore/DerivedSources.make\"\n";
                };
 /* End PBXShellScriptBuildPhase section */
 
index 68f6ae6b517329fc807a62edb58a4639875e8e44..8b7543dfc2e382b7b34f789781c5326be81546a8 100644 (file)
@@ -118,7 +118,7 @@ static Node* enclosingEmptyListItem(const VisiblePosition& visiblePos)
 {
     // check that position is on a line by itself inside a list item
     Node* listChildNode = enclosingListChild(visiblePos.deepEquivalent().node());
-    if (!listChildNode || !isStartOfLine(visiblePos) || !isEndOfLine(visiblePos))
+    if (!listChildNode || !isStartOfParagraph(visiblePos) || !isEndOfParagraph(visiblePos))
         return 0;
     
     // check for sublist embedded in the list item
index b6b60a90dd010ad6b4fbe16dc6c9dc1230e93c56..86fa542999ed38c5ce326562937aa9786c5e276a 100644 (file)
@@ -94,6 +94,9 @@ void InsertTextCommand::input(const String &text, bool selectInsertedText)
     assert(text.find('\n') == -1);
 
     Selection selection = endingSelection();
+    // FIXME: I don't see how "start of line" could possibly be the right check here.
+    // It depends on line breaks which depends on the way things are current laid out,
+    // window width, etc. This needs to be rethought.
     bool adjustDownstream = isStartOfLine(VisiblePosition(selection.start().downstream(), DOWNSTREAM));
 
     // Delete the current selection, or collapse whitespace, as needed
index f46bdca9ba3074450f446095357fab3a369b5d11..a2cf0b7c36120157915cb9400c1adbb5ea3fc36e 100644 (file)
@@ -610,7 +610,7 @@ void ReplaceSelectionCommand::doApply()
         downstream = positionAvoidingSpecialElementBoundary(downstream);
         if (downstream.node()->hasTagName(brTag) && downstream.offset() == 0 && 
             fragment.hasInterchangeNewlineAtEnd() &&
-            isStartOfLine(VisiblePosition(downstream, VP_DEFAULT_AFFINITY)))
+            isStartOfParagraph(VisiblePosition(downstream, VP_DEFAULT_AFFINITY)))
             linePlaceholder = downstream.node();
     }
     
@@ -622,14 +622,14 @@ void ReplaceSelectionCommand::doApply()
     if (m_smartReplace) {
         VisiblePosition visiblePos = VisiblePosition(startPos, VP_DEFAULT_AFFINITY);
         assert(visiblePos.isNotNull());
-        addLeadingSpace = startPos.leadingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull() && !isStartOfLine(visiblePos);
+        addLeadingSpace = startPos.leadingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull() && !isStartOfParagraph(visiblePos);
         if (addLeadingSpace) {
             QChar previousChar = visiblePos.previous().character();
             if (!previousChar.isNull()) {
                 addLeadingSpace = !frame->isCharacterSmartReplaceExempt(previousChar, true);
             }
         }
-        addTrailingSpace = startPos.trailingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull() && !isEndOfLine(visiblePos);
+        addTrailingSpace = startPos.trailingWhitespacePosition(VP_DEFAULT_AFFINITY, true).isNull() && !isEndOfParagraph(visiblePos);
         if (addTrailingSpace) {
             QChar thisChar = visiblePos.character();
             if (!thisChar.isNull()) {
@@ -830,7 +830,7 @@ void ReplaceSelectionCommand::removeLinePlaceholderIfNeeded(Node *linePlaceholde
     if (linePlaceholder->inDocument()) {
         VisiblePosition placeholderPos(linePlaceholder, linePlaceholder->renderer()->caretMinOffset(), DOWNSTREAM);
         if (placeholderPos.next().isNull() ||
-            !(isStartOfLine(placeholderPos) && isEndOfLine(placeholderPos))) {
+            !(isStartOfParagraph(placeholderPos) && isEndOfParagraph(placeholderPos))) {
             
             removeNodeAndPruneAncestors(linePlaceholder);
         }
diff --git a/WebCore/generate-derived-sources b/WebCore/generate-derived-sources
deleted file mode 100755 (executable)
index 8f70858..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-#!/bin/sh
-
-# Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer. 
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution. 
-# 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
-#     its contributors may be used to endorse or promote products derived
-#     from this software without specific prior written permission. 
-#
-# THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
-# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-# DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
-# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
-# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-mkdir -p "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore"
-cd "${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore"
-
-WebCore="${SRCROOT}"
-export WebCore
-
-if which sw_vers 2>&1 > /dev/null; then
-    ENCODINGS_FILE="${WebCore}/platform/mac/mac-encodings.txt"
-    ENCODINGS_PREFIX="kCFStringEncoding"
-else
-    ENCODINGS_FILE="${WebCore}/platform/win/win-encodings.txt";
-    ENCODINGS_PREFIX=""
-fi
-export ENCODINGS_FILE
-export ENCODINGS_PREFIX
-
-make -f "$WebCore/DerivedSources.make"
index 23aafdc062e208169ebf8afbacba0ee39379988a..9ff1db117c6c16c6b07e8546b196295f3e12bece 100644 (file)
@@ -1824,7 +1824,7 @@ void Frame::handleMousePressEvent(const MouseEventWithHitTestResults& event)
     }
 }
 
-void Frame::handleMouseMoveEventPart2(const MouseEventWithHitTestResults& event)
+void Frame::handleMouseMoveEvent(const MouseEventWithHitTestResults& event)
 {
     // Mouse not pressed. Do nothing.
     if (!d->m_bMousePressed)
@@ -1861,11 +1861,6 @@ void Frame::handleMouseMoveEventPart2(const MouseEventWithHitTestResults& event)
         setSelection(sel);
 }
 
-void Frame::handleMouseMoveEvent(const MouseEventWithHitTestResults& event)
-{
-    handleMouseMoveEventPart2(event);
-}
-
 void Frame::handleMouseReleaseEvent(const MouseEventWithHitTestResults& event)
 {
     stopAutoscrollTimer();
index 55799463d4759cccea207ef0aec3b8981f74d0e8..bfa04743f3786937ee10687eb2498cfd57cfab82 100644 (file)
@@ -765,10 +765,6 @@ protected:
   
   void receivedFirstData();
 
-  bool deleteMe1(const MouseEventWithHitTestResults&);
-  bool deleteMe2(const MouseEventWithHitTestResults&);
-  void handleMouseMoveEventPart2(const MouseEventWithHitTestResults&);
-
   /**
    * @internal Extracts anchor and tries both encoded and decoded form.
    */