Changeset 15320 in webkit
- Timestamp:
- Jul 10, 2006 7:02:11 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r15319 r15320 1 2006-07-10 David Harrison <harrison@apple.com> 2 3 Reviewed by Dave Hyatt. 4 5 <rdar://problem/4602408> -webkit-highlight needs to support images and elements other than text 6 7 * rendering/RenderBox.cpp: 8 (WebCore::RenderBox::paintCustomHighlight): 9 * rendering/RenderBox.h: 10 Utility for subclasses. 11 12 * rendering/RenderImage.cpp: 13 (WebCore::RenderImage::paint): 14 Custom highlight in front of images. 15 16 * rendering/RenderListMarker.cpp: 17 (WebCore::RenderListMarker::paint): 18 Custom highlight in front of list markers. 19 20 * rendering/RenderWidget.cpp: 21 (WebCore::RenderWidget::paint): 22 Custom highlight in front of objects. 23 1 24 2006-07-10 David Hyatt <hyatt@apple.com> 2 25 -
trunk/WebCore/rendering/RenderBox.cpp
r15286 r15320 42 42 #include <algorithm> 43 43 #include <math.h> 44 45 #if PLATFORM(MAC) 46 #include "FrameMac.h" 47 #endif 44 48 45 49 using namespace std; … … 654 658 p->restore(); // Undo the border radius clip 655 659 } 660 661 #if PLATFORM(MAC) 662 void RenderBox::paintCustomHighlight(int tx, int ty, const AtomicString& type, bool behindText) 663 { 664 InlineBox* boxWrap = inlineBoxWrapper(); 665 RootInlineBox* r = boxWrap ? boxWrap->root() : 0; 666 if (r) { 667 FloatRect rootRect(tx + r->xPos(), ty + r->selectionTop(), r->width(), r->selectionHeight()); 668 FloatRect imageRect(tx + m_x, rootRect.y(), width(), rootRect.height()); 669 Mac(document()->frame())->paintCustomHighlight(type, imageRect, rootRect, behindText, false); 670 } else { 671 FloatRect imageRect(tx + m_x, ty + m_y, width(), height()); 672 Mac(document()->frame())->paintCustomHighlight(type, imageRect, imageRect, behindText, false); 673 } 674 } 675 #endif 656 676 657 677 void RenderBox::outlineBox(GraphicsContext* p, int _tx, int _ty, const char* color) -
trunk/WebCore/rendering/RenderBox.h
r15269 r15320 157 157 void paintBackgrounds(GraphicsContext*, const Color&, const BackgroundLayer*, int clipy, int cliph, int _tx, int _ty, int w, int h); 158 158 void paintBackground(GraphicsContext*, const Color&, const BackgroundLayer*, int clipy, int cliph, int _tx, int _ty, int w, int h); 159 #if PLATFORM(MAC) 160 void paintCustomHighlight(int tx, int ty, const AtomicString& type, bool behindText); 161 #endif 162 159 163 void outlineBox(GraphicsContext*, int _tx, int _ty, const char *color = "red"); 160 164 -
trunk/WebCore/rendering/RenderImage.cpp
r15299 r15320 262 262 } 263 263 } 264 } 265 else if (m_cachedImage) { 264 } else if (m_cachedImage) { 266 265 IntRect rect(IntPoint(_tx + leftBorder + leftPad, _ty + topBorder + topPad), IntSize(cWidth, cHeight)); 267 266 … … 269 268 CompositeOperator compositeOperator = imageElt ? imageElt->compositeOperator() : CompositeSourceOver; 270 269 p->drawImage(image(), rect, compositeOperator); 270 271 #if PLATFORM(MAC) 272 if (style()->highlight() != nullAtom && !i.p->paintingDisabled()) 273 paintCustomHighlight(_tx - m_x, _ty - m_y, style()->highlight(), false); 274 #endif 271 275 272 276 if (drawSelectionTint) -
trunk/WebCore/rendering/RenderListMarker.cpp
r15253 r15320 187 187 if (m_listImage && !m_listImage->isErrorImage()) { 188 188 p->drawImage(m_listImage->image(), marker.location()); 189 #if PLATFORM(MAC) 190 if (style()->highlight() != nullAtom && !i.p->paintingDisabled()) 191 paintCustomHighlight(_tx, _ty, style()->highlight(), false); 192 #endif 189 193 if (selectionState() != SelectionNone) 190 194 p->fillRect(selectionRect(), selectionBackgroundColor()); … … 195 199 p->setPen(red); 196 200 p->drawRect(box.x(), box.y(), box.width(), box.height()); 201 #endif 202 203 #if PLATFORM(MAC) 204 // FIXME: paint gap between marker and list item proper 205 if (style()->highlight() != nullAtom && !i.p->paintingDisabled()) 206 paintCustomHighlight(_tx, _ty, style()->highlight(), true); 197 207 #endif 198 208 -
trunk/WebCore/rendering/RenderWidget.cpp
r15253 r15320 191 191 } 192 192 193 #if PLATFORM(MAC) 194 if (style()->highlight() != nullAtom && !i.p->paintingDisabled()) 195 paintCustomHighlight(tx - m_x, ty - m_y, style()->highlight(), false); 196 #endif 197 193 198 // Paint a partially transparent wash over selected widgets. 194 199 if (isSelected() && !document()->printing())
Note: See TracChangeset
for help on using the changeset viewer.