Changeset 29888 in webkit
- Timestamp:
- Jan 31, 2008, 10:50:43 AM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r29887 r29888 1 2008-01-31 Adam Roben <aroben@apple.com> 2 3 Add line box drawing code to InspectorController::drawNodeHighlight 4 5 This makes drawNodeHighlight a complete replacement for the painting 6 code in WebKit/mac/WebNodeHighlightView.mm, and also brings line box 7 rects to Windows for the first time. 8 9 Reviewed by Darin. 10 11 * dom/Node.h: Changed isSVGElement to always exist, but to only be 12 virtual when ENABLE(SVG) is true. This way you can always call 13 node->isSVGElement() without checking ENABLE(SVG). 14 * page/InspectorController.cpp: 15 (WebCore::InspectorController::drawNodeHighlight): Ported line box 16 rect code from the Mac implementation in WebNodeHighlightView.mm. 17 1 18 2008-01-31 Adam Roben <aroben@apple.com> 2 19 -
trunk/WebCore/dom/Node.h
r29481 r29888 143 143 virtual bool isElementNode() const { return false; } 144 144 virtual bool isHTMLElement() const { return false; } 145 145 146 #if ENABLE(SVG) 146 virtual bool isSVGElement() const { return false; }147 virtual 147 148 #endif 149 bool isSVGElement() const { return false; } 150 148 151 virtual bool isStyledElement() const { return false; } 149 152 virtual bool isFrameOwnerElement() const { return false; } -
trunk/WebCore/page/InspectorController.cpp
r29887 r29888 1598 1598 IntRect nodeRect(renderer->absoluteBoundingBoxRect()); 1599 1599 1600 Vector<IntRect> rects; 1601 if (renderer->isInline() || (renderer->isText() && !m_highlightedNode->isSVGElement())) 1602 renderer->addLineBoxRects(rects); 1603 if (rects.isEmpty()) 1604 rects.append(nodeRect); 1605 1600 1606 if (!overlayRect.contains(nodeRect) && !nodeRect.contains(enclosingIntRect(overlayRect))) { 1601 1607 Element* element; … … 1607 1613 } 1608 1614 1609 context.clipOut(nodeRect); 1610 1615 // Draw translucent gray fill, out of which we will cut holes. 1611 1616 context.fillRect(overlayRect, overlayFillColor); 1612 1617 1613 IntRect outlineRect(nodeRect); 1614 outlineRect.inflate(outlineThickness); 1615 context.fillRect(outlineRect, Color::white); 1618 // Draw white frames around holes in first pass, so they will be erased in 1619 // places where holes overlap or abut. 1620 for (size_t i = 0; i < rects.size(); ++i) { 1621 IntRect rect = rects[i]; 1622 rect.inflate(outlineThickness); 1623 context.fillRect(rect, Color::white); 1624 } 1625 1626 // Erase holes in second pass. 1627 for (size_t i = 0; i < rects.size(); ++i) 1628 context.clearRect(rects[i]); 1616 1629 } 1617 1630
Note:
See TracChangeset
for help on using the changeset viewer.