[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
hyatt
hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:18:45 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 9d00487dbfdc935ee78b3b53a512227571368ec7
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Dec 13 00:23:54 2003 +0000
Fix for 3254534, CSS background-image style should be loaded lazily only when used.
Reviewed by rjw
* ChangeLog:
* khtml/css/css_valueimpl.cpp:
(CSSImageValueImpl::CSSImageValueImpl):
(CSSImageValueImpl::~CSSImageValueImpl):
(CSSImageValueImpl::image):
* khtml/css/css_valueimpl.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 0f565b7..9486b8c 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,42 @@
+2003-12-12 David Hyatt <hyatt at apple.com>
+
+ Fix for 3254534, CSS background-image style should be loaded lazily only when used.
+
+ Reviewed by rjw
+
+ * ChangeLog:
+ * khtml/css/css_valueimpl.cpp:
+ (CSSImageValueImpl::CSSImageValueImpl):
+ (CSSImageValueImpl::~CSSImageValueImpl):
+ (CSSImageValueImpl::image):
+ * khtml/css/css_valueimpl.h:
+
+2003-12-11 David Hyatt <hyatt at apple.com>
+
+ WebCore part of 3453214. This ensures that all outline styles except for auto (which has a CG bug) will
+ be displayed properly during the PaintActionOutline phase.
+
+ Reviewed by john and darin
+
+ * khtml/rendering/render_block.cpp:
+ (khtml::RenderBlock::paint):
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::setStyle):
+ * khtml/rendering/render_canvas.cpp:
+ (RenderCanvas::RenderCanvas):
+ * khtml/rendering/render_canvas.h:
+ (khtml::RenderCanvas::setMaximalOutlineSize):
+ (khtml::RenderCanvas::maximalOutlineSize):
+ * khtml/rendering/render_object.cpp:
+ (RenderObject::maximalOutlineSize):
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_replaced.cpp:
+ (RenderReplaced::paint):
+ * khtml/rendering/render_table.cpp:
+ (RenderTable::paint):
+ (RenderTableSection::paint):
+ (RenderTableCell::paint):
+
2003-12-12 John Sullivan <sullivan at apple.com>
- fixed <rdar://problem/3508825>: REGRESSION (100-116): crash in
diff --git a/WebCore/khtml/css/css_valueimpl.cpp b/WebCore/khtml/css/css_valueimpl.cpp
index 92eb23a..5fce7d3 100644
--- a/WebCore/khtml/css/css_valueimpl.cpp
+++ b/WebCore/khtml/css/css_valueimpl.cpp
@@ -826,27 +826,18 @@ void RectImpl::setLeft( CSSPrimitiveValueImpl *left )
// -----------------------------------------------------------------
CSSImageValueImpl::CSSImageValueImpl(const DOMString &url, StyleBaseImpl *style)
- : CSSPrimitiveValueImpl(url, CSSPrimitiveValue::CSS_URI)
+ : CSSPrimitiveValueImpl(url, CSSPrimitiveValue::CSS_URI), m_loader(0), m_image(0), m_accessedImage(false)
{
- khtml::DocLoader *docLoader = 0;
StyleBaseImpl *root = style;
while (root->parent())
- root = root->parent();
+ root = root->parent();
if (root->isCSSStyleSheet())
- docLoader = static_cast<CSSStyleSheetImpl*>(root)->docLoader();
-
- if (docLoader)
- m_image = docLoader->requestImage(url);
- else
- m_image = khtml::Cache::requestImage(0, url);
-
- if(m_image) m_image->ref(this);
+ m_loader = static_cast<CSSStyleSheetImpl*>(root)->docLoader();
}
CSSImageValueImpl::CSSImageValueImpl()
- : CSSPrimitiveValueImpl(CSS_VAL_NONE)
+ : CSSPrimitiveValueImpl(CSS_VAL_NONE), m_loader(0), m_image(0), m_accessedImage(true)
{
- m_image = 0;
}
CSSImageValueImpl::~CSSImageValueImpl()
@@ -854,6 +845,22 @@ CSSImageValueImpl::~CSSImageValueImpl()
if(m_image) m_image->deref(this);
}
+khtml::CachedImage* CSSImageValueImpl::image()
+{
+ if (!m_accessedImage) {
+ m_accessedImage = true;
+
+ if (m_loader)
+ m_image = m_loader->requestImage(getStringValue());
+ else
+ m_image = khtml::Cache::requestImage(0, getStringValue());
+
+ if(m_image) m_image->ref(this);
+ }
+
+ return m_image;
+}
+
// ------------------------------------------------------------------------
FontFamilyValueImpl::FontFamilyValueImpl( const QString &string)
diff --git a/WebCore/khtml/css/css_valueimpl.h b/WebCore/khtml/css/css_valueimpl.h
index 90ee609..4ea6491 100644
--- a/WebCore/khtml/css/css_valueimpl.h
+++ b/WebCore/khtml/css/css_valueimpl.h
@@ -35,6 +35,7 @@
namespace khtml {
class RenderStyle;
class CachedImage;
+ class DocLoader;
}
namespace DOM {
@@ -289,9 +290,12 @@ public:
CSSImageValueImpl();
virtual ~CSSImageValueImpl();
- khtml::CachedImage *image() { return m_image; }
+ khtml::CachedImage *image();
+
protected:
- khtml::CachedImage *m_image;
+ khtml::DocLoader* m_loader;
+ khtml::CachedImage* m_image;
+ bool m_accessedImage;
};
class FontFamilyValueImpl : public CSSPrimitiveValueImpl
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 36a4529..aef4ec7 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -1156,7 +1156,8 @@ void RenderBlock::paint(QPainter* p, int _x, int _y, int _w, int _h, int _tx, in
if (m_firstLineBox && m_firstLineBox->topOverflow() < 0)
yPos += m_firstLineBox->topOverflow();
- if( (yPos >= _y + _h) || (_ty + h <= _y))
+ int os = 2*maximalOutlineSize(paintAction);
+ if( (yPos >= _y + _h + os) || (_ty + h <= _y - os))
return;
}
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index 1332b5c..fbb55f7 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -107,6 +107,9 @@ void RenderBox::setStyle(RenderStyle *_style)
// Set the text color if we're the body.
if (isBody())
element()->getDocument()->setTextColor(_style->color());
+
+ if (style()->outlineWidth() > 0 && style()->outlineSize() > maximalOutlineSize(PaintActionOutline))
+ static_cast<RenderCanvas*>(document()->renderer())->setMaximalOutlineSize(style()->outlineSize());
}
RenderBox::~RenderBox()
diff --git a/WebCore/khtml/rendering/render_canvas.cpp b/WebCore/khtml/rendering/render_canvas.cpp
index 802c86c..2a4e319 100644
--- a/WebCore/khtml/rendering/render_canvas.cpp
+++ b/WebCore/khtml/rendering/render_canvas.cpp
@@ -61,6 +61,8 @@ RenderCanvas::RenderCanvas(DOM::NodeImpl* node, KHTMLView *view)
m_printingMode = false;
m_printImages = true;
+ m_maximalOutlineSize = 0;
+
m_selectionStart = 0;
m_selectionEnd = 0;
m_selectionStartPos = -1;
diff --git a/WebCore/khtml/rendering/render_canvas.h b/WebCore/khtml/rendering/render_canvas.h
index fe57aae..b73abfe 100644
--- a/WebCore/khtml/rendering/render_canvas.h
+++ b/WebCore/khtml/rendering/render_canvas.h
@@ -95,6 +95,9 @@ public:
QRect selectionRect() const;
+ void setMaximalOutlineSize(int o) { m_maximalOutlineSize = o; }
+ int maximalOutlineSize() const { return m_maximalOutlineSize; }
+
protected:
virtual void selectionStartEnd(int& spos, int& epos);
@@ -118,6 +121,8 @@ protected:
bool m_printingMode;
bool m_printImages;
int m_truncatedAt;
+
+ int m_maximalOutlineSize; // Used to apply a fudge factor to dirty-rect checks on blocks/tables.
};
};
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 9ef7962..e837b26 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -1993,3 +1993,10 @@ void RenderObject::setPixmap(const QPixmap&, const QRect&, CachedImage *image)
repaint(); // repaint object, which is a box or a container with boxes inside it
}
}
+
+int RenderObject::maximalOutlineSize(PaintAction p) const
+{
+ if (p != PaintActionOutline)
+ return 0;
+ return static_cast<RenderCanvas*>(document()->renderer())->maximalOutlineSize();
+}
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 0dc3a6d..2393b27 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -639,6 +639,9 @@ public:
// positioning of inline children (bidi)
virtual void position(InlineBox*, int, int, bool) {}
+ // Applied as a "slop" to dirty rect checks during the outline painting phase's dirty-rect checks.
+ int maximalOutlineSize(PaintAction p) const;
+
enum SelectionState {
SelectionNone,
SelectionStart,
diff --git a/WebCore/khtml/rendering/render_replaced.cpp b/WebCore/khtml/rendering/render_replaced.cpp
index 12b7a14..a0a42ab 100644
--- a/WebCore/khtml/rendering/render_replaced.cpp
+++ b/WebCore/khtml/rendering/render_replaced.cpp
@@ -66,9 +66,10 @@ void RenderReplaced::paint(QPainter *p, int _x, int _y, int _w, int _h,
_ty += m_y;
// Early exit if the element touches the edges.
- if((_tx >= _x + _w) || (_tx + m_width <= _x))
+ int os = 2*maximalOutlineSize(paintAction);
+ if((_tx >= _x + _w + os) || (_tx + m_width <= _x - os))
return;
- if((_ty >= _y + _h) || (_ty + m_height <= _y))
+ if((_ty >= _y + _h + os) || (_ty + m_height <= _y - os))
return;
if(shouldPaintBackgroundOrBorder() && paintAction != PaintActionOutline)
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index 4be9d27..ef2f298 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -420,8 +420,9 @@ void RenderTable::paint( QPainter *p, int _x, int _y,
#endif
if (!overhangingContents() && !isRelPositioned() && !isPositioned())
{
- if((_ty >= _y + _h) || (_ty + height() <= _y)) return;
- if((_tx >= _x + _w) || (_tx + width() <= _x)) return;
+ int os = 2*maximalOutlineSize(paintAction);
+ if((_ty >= _y + _h + os) || (_ty + height() <= _y - os)) return;
+ if((_tx >= _x + _w + os) || (_tx + width() <= _x - os)) return;
}
#ifdef TABLE_PRINT
@@ -1397,25 +1398,26 @@ void RenderTableSection::paint( QPainter *p, int x, int y, int w, int h,
// check which rows and cols are visible and only paint these
// ### fixme: could use a binary search here
+ int os = 2*maximalOutlineSize(paintAction);
unsigned int startrow = 0;
unsigned int endrow = totalRows;
for ( ; startrow < totalRows; startrow++ ) {
- if ( ty + rowPos[startrow+1] > y )
+ if ( ty + rowPos[startrow+1] >= y - os)
break;
}
for ( ; endrow > 0; endrow-- ) {
- if ( ty + rowPos[endrow-1] < y + h )
+ if ( ty + rowPos[endrow-1] <= y + h + os)
break;
}
unsigned int startcol = 0;
unsigned int endcol = totalCols;
if ( style()->direction() == LTR ) {
for ( ; startcol < totalCols; startcol++ ) {
- if ( tx + table()->columnPos[startcol+1] > x )
+ if ( tx + table()->columnPos[startcol+1] >= x - os)
break;
}
for ( ; endcol > 0; endcol-- ) {
- if ( tx + table()->columnPos[endcol-1] < x + w )
+ if ( tx + table()->columnPos[endcol-1] <= x + w + os)
break;
}
}
@@ -2080,8 +2082,9 @@ void RenderTableCell::paint(QPainter *p, int _x, int _y,
_ty += m_y + _topExtra;
// check if we need to do anything at all...
- if(!overhangingContents() && ((_ty-_topExtra > _y + _h)
- || (_ty + m_height + _bottomExtra < _y))) return;
+ int os = 2*maximalOutlineSize(paintAction);
+ if(!overhangingContents() && ((_ty-_topExtra >= _y + _h + os)
+ || (_ty + m_height + _bottomExtra <= _y - os))) return;
paintObject(p, _x, _y, _w, _h, _tx, _ty, paintAction);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list