[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
kocienda
kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:34:44 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 80885859a426ad4017eb150990e352ce39719ada
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Apr 16 22:24:41 2004 +0000
Rolling out last change. Tree was closed.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/editing/deleting/delete-line-end-ws-001-expected.txt b/LayoutTests/editing/deleting/delete-line-end-ws-001-expected.txt
deleted file mode 100644
index 1e5e595..0000000
--- a/LayoutTests/editing/deleting/delete-line-end-ws-001-expected.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-layer at (0,0) size 820x585
- RenderCanvas at (0,0) size 800x585
-layer at (0,0) size 820x372
- RenderBlock {HTML} at (0,0) size 800x372
- RenderBody {BODY} at (8,64) size 784x244
- RenderBlock {DIV} at (64,0) size 748x244 [border: (50px solid #FF0000)]
- RenderInline {SPAN} at (0,0) size 540x76
- RenderText {TEXT} at (74,84) size 540x96
- text run at (74,84) width 540: "Fourscore and seven years ago our fathers brought forth"
- text run at (74,132) width 304: "onthis continent a new nation..."
- RenderText {TEXT} at (0,0) size 0x0
-selection is CARET:
-start: position 58 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
-upstream: position 58 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
-downstream: position 58 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-line-end-ws-001.html b/LayoutTests/editing/deleting/delete-line-end-ws-001.html
deleted file mode 100644
index 473985e..0000000
--- a/LayoutTests/editing/deleting/delete-line-end-ws-001.html
+++ /dev/null
@@ -1,39 +0,0 @@
-<html>
-<head>
-
-<style>
-.editing {
- border: solid red 50px;
- font-size: 24px;
- line-height: 48px;
- padding: 24px;
- margin: 64px;
- width: 600px;
-}
-</style>
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
-<script>
-
-function editingTest() {
- for (i = 0; i < 59; i++) {
- moveSelectionForwardByCharacterCommand();
- }
- deleteCommand();
-}
-
-</script>
-
-<title>Editing Test</title>
-</head>
-<body>
-<div contenteditable id="root" class="editing">
-<span id="test">Fourscore and seven years ago our fathers brought forth on this continent a new nation...</span>
-</div>
-
-<script>
-runEditingTest();
-</script>
-
-</body>
-</html>
diff --git a/LayoutTests/editing/deleting/delete-line-end-ws-002-expected.txt b/LayoutTests/editing/deleting/delete-line-end-ws-002-expected.txt
deleted file mode 100644
index 1e5e595..0000000
--- a/LayoutTests/editing/deleting/delete-line-end-ws-002-expected.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-layer at (0,0) size 820x585
- RenderCanvas at (0,0) size 800x585
-layer at (0,0) size 820x372
- RenderBlock {HTML} at (0,0) size 800x372
- RenderBody {BODY} at (8,64) size 784x244
- RenderBlock {DIV} at (64,0) size 748x244 [border: (50px solid #FF0000)]
- RenderInline {SPAN} at (0,0) size 540x76
- RenderText {TEXT} at (74,84) size 540x96
- text run at (74,84) width 540: "Fourscore and seven years ago our fathers brought forth"
- text run at (74,132) width 304: "onthis continent a new nation..."
- RenderText {TEXT} at (0,0) size 0x0
-selection is CARET:
-start: position 58 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
-upstream: position 58 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
-downstream: position 58 of child 1 {TEXT} of child 2 {SPAN} of root {DIV}
diff --git a/LayoutTests/editing/deleting/delete-line-end-ws-002.html b/LayoutTests/editing/deleting/delete-line-end-ws-002.html
deleted file mode 100644
index 2e94548..0000000
--- a/LayoutTests/editing/deleting/delete-line-end-ws-002.html
+++ /dev/null
@@ -1,42 +0,0 @@
-<html>
-<head>
-
-<style>
-.editing {
- border: solid red 50px;
- font-size: 24px;
- line-height: 48px;
- padding: 24px;
- margin: 64px;
- width: 600px;
-}
-</style>
-<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
-
-<script>
-
-function editingTest() {
- for (i = 0; i < 59; i++) {
- moveSelectionForwardByCharacterCommand();
- }
- deleteCommand();
-}
-
-</script>
-
-<title>Editing Test</title>
-</head>
-<body>
-<div contenteditable id="root" class="editing">
-<span id="test">Fourscore and seven years ago our fathers brought forth on
-
-
-this continent a new nation...</span>
-</div>
-
-<script>
-runEditingTest();
-</script>
-
-</body>
-</html>
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 6df38f9..0dce54d 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,17 +1,3 @@
-2004-04-16 Ken Kocienda <kocienda at apple.com>
-
- Reviewed by Hyatt
-
- * khtml/editing/htmlediting_impl.cpp:
- (DeleteSelectionCommandImpl::containsOnlyWhitespace): New helper.
- (DeleteSelectionCommandImpl::doApply): Fix deleting collapsed whitespace at the end of a line
- where text has flowed to the next line and the caret is at the beginning of the next line.
- * khtml/editing/htmlediting_impl.h: Updated for new helper.
- * layout-tests/editing/deleting/delete-line-end-ws-001-expected.txt: Added.
- * layout-tests/editing/deleting/delete-line-end-ws-001.html: Added.
- * layout-tests/editing/deleting/delete-line-end-ws-002-expected.txt: Added.
- * layout-tests/editing/deleting/delete-line-end-ws-002.html: Added.
-
2004-04-16 Richard Williamson <rjw at apple.com>
Added an SPI to allow ObjC instances to be easily bound to
diff --git a/WebCore/khtml/editing/htmlediting_impl.cpp b/WebCore/khtml/editing/htmlediting_impl.cpp
index 1dfc336..29940a7 100644
--- a/WebCore/khtml/editing/htmlediting_impl.cpp
+++ b/WebCore/khtml/editing/htmlediting_impl.cpp
@@ -811,27 +811,6 @@ void DeleteSelectionCommandImpl::joinTextNodesWithSameStyle()
}
}
-bool DeleteSelectionCommandImpl::containsOnlyWhitespace(const DOMPosition &start, const DOMPosition &end)
-{
- // Returns whether the range contains only whitespace characters.
- // This is inclusive of the start, but not of the end.
- EditIterator it(start);
- while (!it.atEnd()) {
- if (!it.current().node()->isTextNode())
- return false;
- const DOMString &text = static_cast<TextImpl *>(it.current().node())->data();
- // EDIT FIXME: signed/unsigned mismatch
- if (text.length() > INT_MAX)
- return false;
- if (it.current().offset() < (int)text.length() && !isWS(text[it.current().offset()]))
- return false;
- it.next();
- if (it.current() == end)
- break;
- }
- return true;
-}
-
void DeleteSelectionCommandImpl::doApply()
{
if (m_selectionToDelete.state() != KHTMLSelection::RANGE)
@@ -848,17 +827,15 @@ void DeleteSelectionCommandImpl::doApply()
DOMPosition upstreamEnd = selection.endPosition().equivalentUpstreamPosition();
DOMPosition downstreamEnd = selection.endPosition().equivalentDownstreamPosition();
- bool onlyWhitespace = containsOnlyWhitespace(upstreamStart, downstreamEnd);
-
- bool startCompletelySelected = !onlyWhitespace &&
- (downstreamStart.offset() <= downstreamStart.node()->caretMinOffset() &&
+ bool startCompletelySelected =
+ downstreamStart.offset() <= downstreamStart.node()->caretMinOffset() &&
((downstreamStart.node() != upstreamEnd.node()) ||
- (upstreamEnd.offset() >= upstreamEnd.node()->caretMaxOffset())));
+ (upstreamEnd.offset() >= upstreamEnd.node()->caretMaxOffset()));
- bool endCompletelySelected = !onlyWhitespace &&
- (upstreamEnd.offset() >= upstreamEnd.node()->caretMaxOffset() &&
+ bool endCompletelySelected =
+ upstreamEnd.offset() >= upstreamEnd.node()->caretMaxOffset() &&
((downstreamStart.node() != upstreamEnd.node()) ||
- (downstreamStart.offset() <= downstreamStart.node()->caretMinOffset())));
+ (downstreamStart.offset() <= downstreamStart.node()->caretMinOffset()));
unsigned long startRenderedOffset = downstreamStart.renderedOffset();
@@ -875,7 +852,6 @@ void DeleteSelectionCommandImpl::doApply()
LOG(Editing, "at start block: %s", startAtStartOfBlock ? "YES" : "NO");
LOG(Editing, "at start root block: %s", startAtStartOfRootEditableBlock ? "YES" : "NO");
LOG(Editing, "at end block: %s", endAtEndOfBlock ? "YES" : "NO");
- LOG(Editing, "only whitespace: %s", onlyWhitespace ? "YES" : "NO");
// Start is not completely selected
if (startAtStartOfBlock) {
@@ -940,23 +916,9 @@ void DeleteSelectionCommandImpl::doApply()
// work on start node
if (startCompletelySelected) {
- LOG(Editing, "start node delete case 1");
removeNodeAndPrune(downstreamStart.node());
}
- else if (onlyWhitespace) {
- // Selection only contains whitespace. This is really a special-case to
- // handle significant whitespace that is collapsed at the end of a line,
- // but also handles deleting a space in mid-line.
- LOG(Editing, "start node delete case 2");
- ASSERT(upstreamStart.node()->isTextNode());
- TextImpl *text = static_cast<TextImpl *>(upstreamStart.node());
- int length = downstreamStart.node() == upstreamStart.node() ?
- kMax(downstreamStart.offset() - upstreamStart.offset(), 1L) :
- text->length() - upstreamStart.offset();
- deleteText(text, upstreamStart.offset(), length);
- }
else if (downstreamStart.node()->isTextNode()) {
- LOG(Editing, "start node delete case 3");
TextImpl *text = static_cast<TextImpl *>(downstreamStart.node());
int endOffset = text == upstreamEnd.node() ? upstreamEnd.offset() : text->length();
if (endOffset > downstreamStart.offset()) {
@@ -966,11 +928,10 @@ void DeleteSelectionCommandImpl::doApply()
else {
// we have clipped the end of a non-text element
// the offset must be 1 here. if it is, do nothing and move on.
- LOG(Editing, "start node delete case 4");
ASSERT(downstreamStart.offset() == 1);
}
- if (!onlyWhitespace && downstreamStart.node() != upstreamEnd.node()) {
+ if (downstreamStart.node() != upstreamEnd.node()) {
// work on intermediate nodes
while (n != upstreamEnd.node()) {
NodeImpl *d = n;
diff --git a/WebCore/khtml/editing/htmlediting_impl.h b/WebCore/khtml/editing/htmlediting_impl.h
index 5d20e39..10bd78b 100644
--- a/WebCore/khtml/editing/htmlediting_impl.h
+++ b/WebCore/khtml/editing/htmlediting_impl.h
@@ -197,7 +197,6 @@ public:
private:
void deleteDownstreamWS(const DOM::DOMPosition &start);
- bool containsOnlyWhitespace(const DOM::DOMPosition &start, const DOM::DOMPosition &end);
void joinTextNodesWithSameStyle();
KHTMLSelection m_selectionToDelete;
diff --git a/WebCore/khtml/html/html_elementimpl.cpp b/WebCore/khtml/html/html_elementimpl.cpp
index a0476ea..2d8c634 100644
--- a/WebCore/khtml/html/html_elementimpl.cpp
+++ b/WebCore/khtml/html/html_elementimpl.cpp
@@ -821,6 +821,8 @@ bool HTMLElementImpl::isFocusable() const
bool HTMLElementImpl::isContentEditable() const
{
+ getDocument()->updateRendering();
+
if (!renderer()) {
if (parentNode())
return parentNode()->isContentEditable();
@@ -831,7 +833,10 @@ bool HTMLElementImpl::isContentEditable() const
return renderer()->style()->userModify() == READ_WRITE;
}
-DOMString HTMLElementImpl::contentEditable() const {
+DOMString HTMLElementImpl::contentEditable() const
+{
+ getDocument()->updateRendering();
+
if (!renderer())
return "false";
@@ -849,7 +854,7 @@ DOMString HTMLElementImpl::contentEditable() const {
void HTMLElementImpl::setContentEditable(HTMLAttributeImpl* attr)
{
const AtomicString& enabled = attr->value();
- if (strcasecmp(enabled, "true") == 0 || enabled.isEmpty())
+ if (enabled.isEmpty() || strcasecmp(enabled, "true") == 0)
addCSSProperty(attr, CSS_PROP__KHTML_USER_MODIFY, CSS_VAL_READ_WRITE);
else if (strcasecmp(enabled, "false") == 0)
addCSSProperty(attr, CSS_PROP__KHTML_USER_MODIFY, CSS_VAL_READ_ONLY);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list