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
+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
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
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
+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.
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}"
echo "Copying zlib1.dll"
cp ../zlib/bin/zlib1.dll "$WebKitOutputConfigDirUnix" || exit 1
fi
-
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 */
{
// 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
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
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();
}
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()) {
if (linePlaceholder->inDocument()) {
VisiblePosition placeholderPos(linePlaceholder, linePlaceholder->renderer()->caretMinOffset(), DOWNSTREAM);
if (placeholderPos.next().isNull() ||
- !(isStartOfLine(placeholderPos) && isEndOfLine(placeholderPos))) {
+ !(isStartOfParagraph(placeholderPos) && isEndOfParagraph(placeholderPos))) {
removeNodeAndPruneAncestors(linePlaceholder);
}
+++ /dev/null
-#!/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"
}
}
-void Frame::handleMouseMoveEventPart2(const MouseEventWithHitTestResults& event)
+void Frame::handleMouseMoveEvent(const MouseEventWithHitTestResults& event)
{
// Mouse not pressed. Do nothing.
if (!d->m_bMousePressed)
setSelection(sel);
}
-void Frame::handleMouseMoveEvent(const MouseEventWithHitTestResults& event)
-{
- handleMouseMoveEventPart2(event);
-}
-
void Frame::handleMouseReleaseEvent(const MouseEventWithHitTestResults& event)
{
stopAutoscrollTimer();
void receivedFirstData();
- bool deleteMe1(const MouseEventWithHitTestResults&);
- bool deleteMe2(const MouseEventWithHitTestResults&);
- void handleMouseMoveEventPart2(const MouseEventWithHitTestResults&);
-
/**
* @internal Extracts anchor and tries both encoded and decoded form.
*/