LayoutTests:
authorharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Nov 2006 01:24:47 +0000 (01:24 +0000)
committerharrison <harrison@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Nov 2006 01:24:47 +0000 (01:24 +0000)
        Reviewed by Adele.

        <rdar://problem/4852804> selection color does not get drawn over the missing image rectangle

        * editing/selection/select-missing-image-expected.checksum: Added.
        * editing/selection/select-missing-image-expected.png: Added.
        * editing/selection/select-missing-image-expected.txt: Added.
        * editing/selection/select-missing-image.html: Added.

WebCore:

        Reviewed by Adele.

        <rdar://problem/4852804> selection color does not get drawn over the missing image rectangle

        Test:
        * editing/selection/select-missing-image.html: Added.

        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paint):
        Draw the selection tint even if the image itself is not available.

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

LayoutTests/ChangeLog
LayoutTests/editing/selection/select-missing-image-expected.checksum [new file with mode: 0644]
LayoutTests/editing/selection/select-missing-image-expected.png [new file with mode: 0644]
LayoutTests/editing/selection/select-missing-image-expected.txt [new file with mode: 0644]
LayoutTests/editing/selection/select-missing-image.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderImage.cpp

index 3f1bf69c2c1f5e1c1f921cfc276d775e01ca840f..7ee799dfab585e5250b8ac6e1d1ed461273f58a6 100644 (file)
@@ -1,3 +1,14 @@
+2006-11-28  David Harrison  <harrison@apple.com>
+
+        Reviewed by Adele.
+
+        <rdar://problem/4852804> selection color does not get drawn over the missing image rectangle
+
+        * editing/selection/select-missing-image-expected.checksum: Added.
+        * editing/selection/select-missing-image-expected.png: Added.
+        * editing/selection/select-missing-image-expected.txt: Added.
+        * editing/selection/select-missing-image.html: Added.
+
 2006-11-28  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
diff --git a/LayoutTests/editing/selection/select-missing-image-expected.checksum b/LayoutTests/editing/selection/select-missing-image-expected.checksum
new file mode 100644 (file)
index 0000000..5b85f34
--- /dev/null
@@ -0,0 +1 @@
+fea7562387d7e11889f46838db5b328b
\ No newline at end of file
diff --git a/LayoutTests/editing/selection/select-missing-image-expected.png b/LayoutTests/editing/selection/select-missing-image-expected.png
new file mode 100644 (file)
index 0000000..2108872
Binary files /dev/null and b/LayoutTests/editing/selection/select-missing-image-expected.png differ
diff --git a/LayoutTests/editing/selection/select-missing-image-expected.txt b/LayoutTests/editing/selection/select-missing-image-expected.txt
new file mode 100644 (file)
index 0000000..9074c26
--- /dev/null
@@ -0,0 +1,14 @@
+EDITING DELEGATE: shouldChangeSelectedDOMRange:(null) toDOMRange:range from 1 of DIV > BODY > HTML > #document to 2 of DIV > BODY > HTML > #document affinity:NSSelectionAffinityDownstream stillSelecting:FALSE
+EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of DIV > BODY > HTML > #document to 3 of DIV > BODY > HTML > #document
+EDITING DELEGATE: webViewDidBeginEditing:WebViewDidBeginEditingNotification
+EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 784x128 [border: (2px solid #FF0000)]
+        RenderImage {IMG} at (14,14) size 550x100
+        RenderText {#text} at (0,0) size 0x0
+selection start: position 0 of child 1 {IMG} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
+selection end:   position 1 of child 1 {IMG} of child 1 {DIV} of child 1 {BODY} of child 0 {HTML} of document
diff --git a/LayoutTests/editing/selection/select-missing-image.html b/LayoutTests/editing/selection/select-missing-image.html
new file mode 100644 (file)
index 0000000..b7376da
--- /dev/null
@@ -0,0 +1,33 @@
+<html> 
+<head>
+
+<style>
+.editing { 
+    border: 2px solid red; 
+    padding: 12px; 
+    font-size: 24px; 
+}
+</style>
+<script src=../editing.js language="JavaScript" type="text/JavaScript" ></script>
+
+<script>
+
+function editingTest() {
+    selectAllCommand();
+}
+
+</script>
+
+<title>Editing Test</title> 
+</head> 
+<body>
+<div contenteditable id="root" class="editing">
+<img title="Should see selection tint over this missing image." src="../noneSuch.jpg" height="100" width="550"> 
+</div>
+
+<script>
+runEditingTest();
+</script>
+
+</body>
+</html>
index f2dc94ba7f96ee1cc0c46e23e44ab405e1a74357..0c820763680c413b8bf22b0a06ef940dde562b1f 100644 (file)
@@ -1,3 +1,16 @@
+2006-11-28  David Harrison  <harrison@apple.com>
+
+        Reviewed by Adele.
+
+        <rdar://problem/4852804> selection color does not get drawn over the missing image rectangle
+
+        Test:
+        * editing/selection/select-missing-image.html: Added.
+
+        * rendering/RenderImage.cpp:
+        (WebCore::RenderImage::paint):
+        Draw the selection tint even if the image itself is not available.
+
 2006-11-28  Anders Carlsson  <acarlsson@apple.com>
 
         Reviewed by Maciej.
         (WebCore::Page::chrome):
         (WebCore::Page::contextMenuController):
 
+>>>>>>> .r17911
 2006-11-28  Alice Liu  <alice.liu@apple.com>
 
         Reviewed by Justin and Adam.
         Added select portions of this file from WebKit because the pasteboard needed the following function:
         (-[NSAttributedString _web_attributedStringByStrippingAttachmentCharacters]):
 
+>>>>>>> .r17909
 2006-11-28  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by harrison
index 64e852cb0bb899f9148e30fecc579b5ac39acb8f..f3bd2dc67cbb02d985534879e53cade1bf9315ce 100644 (file)
@@ -277,10 +277,11 @@ void RenderImage::paint(PaintInfo& paintInfo, int tx, int ty)
         HTMLImageElement* imageElt = (element() && element()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(element()) : 0;
         CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
         context->drawImage(image(), rect, compositeOperator);
-
-        if (drawSelectionTint)
-            context->fillRect(selectionRect(), selectionBackgroundColor());
     }
+
+    // draw the selection tint even if the image itself is not available
+    if (drawSelectionTint)
+        context->fillRect(selectionRect(), selectionBackgroundColor());
 }
 
 void RenderImage::layout()