Changeset 58949 in webkit
- Timestamp:
- May 7, 2010 8:13:36 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r58948 r58949 1 2010-05-07 Tor Arne Vestbø <tor.arne.vestbo@nokia.com> 2 3 Reviewed by Simon Hausmann. 4 5 [Qt] Fix rendering of -webkit-user-select: none 6 7 -webkit-user-select: none is implemented by filling 8 the area with an invalid default-constructed Color. 9 In most ports passing an invalid color down to the 10 graphics backend seems to produce transparent fills. 11 12 In Qt the behavior of painting with an invalid QColor 13 is undefined, and in practice it results in painting 14 black opaque areas. 15 16 One way to fix this would be to use Qt::transparent 17 when converting an undefined Color to a QColor, but 18 Qt does not have short circuits for fully transparent 19 painting, and we actually end up in slow code paths 20 due to the transparency. So, we're better of doing the 21 short circuit in WebKit. 22 23 https://bugs.webkit.org/show_bug.cgi?id=38523 24 25 * platform/graphics/qt/GraphicsContextQt.cpp: 26 1 27 2010-05-07 Ben Murdoch <benm@google.com> 2 28 -
trunk/WebCore/platform/graphics/qt/GraphicsContextQt.cpp
r56391 r58949 642 642 } 643 643 644 void GraphicsContext::fillRect(const FloatRect& rect, const Color& c , ColorSpace colorSpace)645 { 646 if (paintingDisabled() )647 return; 648 649 m_data->solidColor.setColor(c );644 void GraphicsContext::fillRect(const FloatRect& rect, const Color& color, ColorSpace colorSpace) 645 { 646 if (paintingDisabled() || !color.isValid()) 647 return; 648 649 m_data->solidColor.setColor(color); 650 650 QPainter* p = m_data->p(); 651 651 if (m_common->state.shadowColor.isValid()) … … 656 656 void GraphicsContext::fillRoundedRect(const IntRect& rect, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color& color, ColorSpace colorSpace) 657 657 { 658 if (paintingDisabled() || !color. alpha())658 if (paintingDisabled() || !color.isValid() || !color.alpha()) 659 659 return; 660 660 … … 718 718 void GraphicsContext::drawFocusRing(const Vector<IntRect>& rects, int /* width */, int /* offset */, const Color& color) 719 719 { 720 if (paintingDisabled() )720 if (paintingDisabled() || !color.isValid()) 721 721 return; 722 722 … … 1142 1142 void GraphicsContext::setPlatformStrokeColor(const Color& color, ColorSpace colorSpace) 1143 1143 { 1144 if (paintingDisabled()) 1145 return; 1144 if (paintingDisabled() || !color.isValid()) 1145 return; 1146 1146 1147 QPainter* p = m_data->p(); 1147 1148 QPen newPen(p->pen()); … … 1173 1174 void GraphicsContext::setPlatformFillColor(const Color& color, ColorSpace colorSpace) 1174 1175 { 1175 if (paintingDisabled()) 1176 return; 1176 if (paintingDisabled() || !color.isValid()) 1177 return; 1178 1177 1179 m_data->solidColor.setColor(color); 1178 1180 m_data->p()->setBrush(m_data->solidColor);
Note: See TracChangeset
for help on using the changeset viewer.