Reviewed by Dave Hyatt.

        <rdar://problem/4624203> -webkit-highlight should be behind images

        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paint):
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::paint):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paint):
        Call custom highlighter before painting the image, marker, or widget.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@15415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/rendering/RenderImage.cpp b/WebCore/rendering/RenderImage.cpp
index 4ea7776..e039116 100644
--- a/WebCore/rendering/RenderImage.cpp
+++ b/WebCore/rendering/RenderImage.cpp
@@ -262,17 +262,17 @@
             }
         }
     } else if (m_cachedImage) {
+#if PLATFORM(MAC)
+        if (style()->highlight() != nullAtom && !i.p->paintingDisabled())
+            paintCustomHighlight(_tx - m_x, _ty - m_y, style()->highlight(), true);
+#endif
+
         IntRect rect(IntPoint(_tx + leftBorder + leftPad, _ty + topBorder + topPad), IntSize(cWidth, cHeight));
         
         HTMLImageElement* imageElt = (element() && element()->hasTagName(imgTag)) ? static_cast<HTMLImageElement*>(element()) : 0;
         CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver;
         p->drawImage(image(), rect, compositeOperator);
 
-#if PLATFORM(MAC)
-        if (style()->highlight() != nullAtom && !i.p->paintingDisabled())
-            paintCustomHighlight(_tx - m_x, _ty - m_y, style()->highlight(), false);
-#endif
-
         if (drawSelectionTint)
             p->fillRect(selectionRect(), selectionBackgroundColor());
     }