[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 07:46:57 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit b6b42d3db318160627fbfb030d7d0b4505061b29
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jul 11 17:55:42 2003 +0000
An initial implementation of the CSS opacity property. Seems
to work perfectly except for native widgetry (NSViews). Images,
text, borders, and underlines are all properly blended.
Reviewed by rjw
* config.h:
* khtml/css/cssparser.cpp:
(CSSParser::parseValue):
* khtml/css/cssproperties.c:
(hash_prop):
(findProp):
* khtml/css/cssproperties.h:
* khtml/css/cssproperties.in:
* khtml/css/cssstyleselector.cpp:
* khtml/rendering/render_block.h:
* khtml/rendering/render_box.cpp:
(RenderBox::setStyle):
(RenderBox::adjustZIndex):
* khtml/rendering/render_box.h:
* khtml/rendering/render_inline.h:
* khtml/rendering/render_layer.cpp:
(RenderLayer::transparentAncestor):
(RenderLayer::isTransparent):
(commonTransparentAncestor):
(RenderLayer::updateTransparentState):
(RenderLayer::beginTransparencyLayers):
(RenderLayer::endTransparencyLayers):
(RenderLayer::paint):
* khtml/rendering/render_layer.h:
* khtml/rendering/render_object.h:
* khtml/rendering/render_style.cpp:
(StyleVisualData::StyleVisualData):
(RenderStyle::diff):
* khtml/rendering/render_style.h:
* kwq/KWQPainter.h:
* kwq/KWQPainter.mm:
(QPainter::beginTransparencyLayer):
(QPainter::endTransparencyLayer):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@4626 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 7fe413e..943ba42 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,45 @@
+2003-07-11 Dave Hyatt <hyatt at apple.com>
+
+ An initial implementation of the CSS opacity property. Seems
+ to work perfectly except for native widgetry (NSViews). Images,
+ text, borders, and underlines are all properly blended.
+
+ Reviewed by rjw
+
+ * config.h:
+ * khtml/css/cssparser.cpp:
+ (CSSParser::parseValue):
+ * khtml/css/cssproperties.c:
+ (hash_prop):
+ (findProp):
+ * khtml/css/cssproperties.h:
+ * khtml/css/cssproperties.in:
+ * khtml/css/cssstyleselector.cpp:
+ * khtml/rendering/render_block.h:
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::setStyle):
+ (RenderBox::adjustZIndex):
+ * khtml/rendering/render_box.h:
+ * khtml/rendering/render_inline.h:
+ * khtml/rendering/render_layer.cpp:
+ (RenderLayer::transparentAncestor):
+ (RenderLayer::isTransparent):
+ (commonTransparentAncestor):
+ (RenderLayer::updateTransparentState):
+ (RenderLayer::beginTransparencyLayers):
+ (RenderLayer::endTransparencyLayers):
+ (RenderLayer::paint):
+ * khtml/rendering/render_layer.h:
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_style.cpp:
+ (StyleVisualData::StyleVisualData):
+ (RenderStyle::diff):
+ * khtml/rendering/render_style.h:
+ * kwq/KWQPainter.h:
+ * kwq/KWQPainter.mm:
+ (QPainter::beginTransparencyLayer):
+ (QPainter::endTransparencyLayer):
+
2003-07-11 Darin Adler <darin at apple.com>
Reviewed by Chris.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 7fe413e..943ba42 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,45 @@
+2003-07-11 Dave Hyatt <hyatt at apple.com>
+
+ An initial implementation of the CSS opacity property. Seems
+ to work perfectly except for native widgetry (NSViews). Images,
+ text, borders, and underlines are all properly blended.
+
+ Reviewed by rjw
+
+ * config.h:
+ * khtml/css/cssparser.cpp:
+ (CSSParser::parseValue):
+ * khtml/css/cssproperties.c:
+ (hash_prop):
+ (findProp):
+ * khtml/css/cssproperties.h:
+ * khtml/css/cssproperties.in:
+ * khtml/css/cssstyleselector.cpp:
+ * khtml/rendering/render_block.h:
+ * khtml/rendering/render_box.cpp:
+ (RenderBox::setStyle):
+ (RenderBox::adjustZIndex):
+ * khtml/rendering/render_box.h:
+ * khtml/rendering/render_inline.h:
+ * khtml/rendering/render_layer.cpp:
+ (RenderLayer::transparentAncestor):
+ (RenderLayer::isTransparent):
+ (commonTransparentAncestor):
+ (RenderLayer::updateTransparentState):
+ (RenderLayer::beginTransparencyLayers):
+ (RenderLayer::endTransparencyLayers):
+ (RenderLayer::paint):
+ * khtml/rendering/render_layer.h:
+ * khtml/rendering/render_object.h:
+ * khtml/rendering/render_style.cpp:
+ (StyleVisualData::StyleVisualData):
+ (RenderStyle::diff):
+ * khtml/rendering/render_style.h:
+ * kwq/KWQPainter.h:
+ * kwq/KWQPainter.mm:
+ (QPainter::beginTransparencyLayer):
+ (QPainter::endTransparencyLayer):
+
2003-07-11 Darin Adler <darin at apple.com>
Reviewed by Chris.
diff --git a/WebCore/config.h b/WebCore/config.h
index fb565f3..631388c 100644
--- a/WebCore/config.h
+++ b/WebCore/config.h
@@ -18,7 +18,7 @@
#define HAVE_FORK 1
/* Define if Foundation source tree exists */
-#define HAVE_FOUNDATION_SOURCES 1
+/* #undef HAVE_FOUNDATION_SOURCES */
/* Define if you have finite */
#define HAVE_FUNC_FINITE 1
diff --git a/WebCore/khtml/css/cssparser.cpp b/WebCore/khtml/css/cssparser.cpp
index 6eff8d2..43bb398 100644
--- a/WebCore/khtml/css/cssparser.cpp
+++ b/WebCore/khtml/css/cssparser.cpp
@@ -972,6 +972,9 @@ bool CSSParser::parseValue( int propId, bool important )
break;
/* CSS3 properties */
+ case CSS_PROP_OPACITY:
+ valid_primitive = validUnit(value, FNumber, strict);
+ break;
case CSS_PROP_BOX_ALIGN:
if (id == CSS_VAL_STRETCH || id == CSS_VAL_START || id == CSS_VAL_END ||
id == CSS_VAL_CENTER || id == CSS_VAL_BASELINE)
diff --git a/WebCore/khtml/css/cssproperties.c b/WebCore/khtml/css/cssproperties.c
index 11b06e2..87a7f32 100644
--- a/WebCore/khtml/css/cssproperties.c
+++ b/WebCore/khtml/css/cssproperties.c
@@ -7,7 +7,7 @@ struct props {
const char *name;
int id;
};
-/* maximum key range = 894, duplicates = 0 */
+/* maximum key range = 832, duplicates = 0 */
#ifdef __GNUC__
__inline
@@ -21,32 +21,32 @@ hash_prop (register const char *str, register unsigned int len)
{
static const unsigned short asso_values[] =
{
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 0, 897, 897, 897, 897,
- 897, 5, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 15, 230, 0,
- 0, 0, 75, 0, 45, 0, 10, 65, 0, 70,
- 120, 0, 0, 10, 0, 130, 0, 35, 0, 145,
- 35, 160, 10, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897, 897, 897, 897, 897,
- 897, 897, 897, 897, 897, 897
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 0, 835, 835, 835, 835,
+ 835, 5, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 15, 230, 0,
+ 0, 0, 75, 0, 45, 0, 0, 30, 0, 70,
+ 120, 0, 0, 5, 0, 125, 0, 0, 0, 150,
+ 35, 160, 5, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835, 835, 835, 835, 835,
+ 835, 835, 835, 835, 835, 835
};
register int hval = len;
@@ -118,11 +118,11 @@ findProp (register const char *str, register unsigned int len)
{
enum
{
- TOTAL_KEYWORDS = 120,
+ TOTAL_KEYWORDS = 121,
MIN_WORD_LENGTH = 3,
MAX_WORD_LENGTH = 26,
MIN_HASH_VALUE = 3,
- MAX_HASH_VALUE = 896
+ MAX_HASH_VALUE = 834
};
static const struct props wordlist_prop[] =
@@ -136,22 +136,23 @@ findProp (register const char *str, register unsigned int len)
{"left", CSS_PROP_LEFT},
{"float", CSS_PROP_FLOAT},
{"height", CSS_PROP_HEIGHT},
+ {"outline", CSS_PROP_OUTLINE},
{"direction", CSS_PROP_DIRECTION},
- {"padding", CSS_PROP_PADDING},
+ {"cursor", CSS_PROP_CURSOR},
+ {"outline-color", CSS_PROP_OUTLINE_COLOR},
{"size", CSS_PROP_SIZE},
+ {"quotes", CSS_PROP_QUOTES},
+ {"padding", CSS_PROP_PADDING},
{"padding-top", CSS_PROP_PADDING_TOP},
- {"outline", CSS_PROP_OUTLINE},
{"vertical-align", CSS_PROP_VERTICAL_ALIGN},
- {"outline-color", CSS_PROP_OUTLINE_COLOR},
- {"cursor", CSS_PROP_CURSOR},
{"z-index", CSS_PROP_Z_INDEX},
{"text-align", CSS_PROP_TEXT_ALIGN},
- {"quotes", CSS_PROP_QUOTES},
+ {"opacity", CSS_PROP_OPACITY},
{"text-decoration", CSS_PROP_TEXT_DECORATION},
{"text-decoration-color", CSS_PROP_TEXT_DECORATION_COLOR},
{"padding-right", CSS_PROP_PADDING_RIGHT},
- {"width", CSS_PROP_WIDTH},
{"font", CSS_PROP_FONT},
+ {"width", CSS_PROP_WIDTH},
{"margin", CSS_PROP_MARGIN},
{"margin-top", CSS_PROP_MARGIN_TOP},
{"max-height", CSS_PROP_MAX_HEIGHT},
@@ -164,6 +165,7 @@ findProp (register const char *str, register unsigned int len)
{"border-top-color", CSS_PROP_BORDER_TOP_COLOR},
{"content", CSS_PROP_CONTENT},
{"position", CSS_PROP_POSITION},
+ {"counter-reset", CSS_PROP_COUNTER_RESET},
{"margin-right", CSS_PROP_MARGIN_RIGHT},
{"caption-side", CSS_PROP_CAPTION_SIDE},
{"letter-spacing", CSS_PROP_LETTER_SPACING},
@@ -172,81 +174,80 @@ findProp (register const char *str, register unsigned int len)
{"min-height", CSS_PROP_MIN_HEIGHT},
{"margin-left", CSS_PROP_MARGIN_LEFT},
{"border-right-color", CSS_PROP_BORDER_RIGHT_COLOR},
- {"counter-reset", CSS_PROP_COUNTER_RESET},
{"bottom", CSS_PROP_BOTTOM},
{"display", CSS_PROP_DISPLAY},
- {"border-left", CSS_PROP_BORDER_LEFT},
{"orphans", CSS_PROP_ORPHANS},
- {"max-width", CSS_PROP_MAX_WIDTH},
+ {"border-left", CSS_PROP_BORDER_LEFT},
+ {"box-pack", CSS_PROP_BOX_PACK},
{"border-left-color", CSS_PROP_BORDER_LEFT_COLOR},
+ {"max-width", CSS_PROP_MAX_WIDTH},
+ {"outline-width", CSS_PROP_OUTLINE_WIDTH},
{"font-size", CSS_PROP_FONT_SIZE},
{"white-space", CSS_PROP_WHITE_SPACE},
- {"box-pack", CSS_PROP_BOX_PACK},
{"font-variant", CSS_PROP_FONT_VARIANT},
- {"outline-width", CSS_PROP_OUTLINE_WIDTH},
+ {"unicode-bidi", CSS_PROP_UNICODE_BIDI},
{"empty-cells", CSS_PROP_EMPTY_CELLS},
- {"text-shadow", CSS_PROP_TEXT_SHADOW},
{"font-stretch", CSS_PROP_FONT_STRETCH},
+ {"text-shadow", CSS_PROP_TEXT_SHADOW},
{"box-flex", CSS_PROP_BOX_FLEX},
- {"min-width", CSS_PROP_MIN_WIDTH},
{"border-collapse", CSS_PROP_BORDER_COLLAPSE},
+ {"box-flex-group", CSS_PROP_BOX_FLEX_GROUP},
+ {"min-width", CSS_PROP_MIN_WIDTH},
{"box-orient", CSS_PROP_BOX_ORIENT},
- {"font-weight", CSS_PROP_FONT_WEIGHT},
- {"unicode-bidi", CSS_PROP_UNICODE_BIDI},
+ {"page-break-after", CSS_PROP_PAGE_BREAK_AFTER},
{"box-direction", CSS_PROP_BOX_DIRECTION},
+ {"font-weight", CSS_PROP_FONT_WEIGHT},
+ {"marker-offset", CSS_PROP_MARKER_OFFSET},
+ {"background", CSS_PROP_BACKGROUND},
{"box-align", CSS_PROP_BOX_ALIGN},
+ {"background-color", CSS_PROP_BACKGROUND_COLOR},
+ {"box-ordinal-group", CSS_PROP_BOX_ORDINAL_GROUP},
+ {"outline-style", CSS_PROP_OUTLINE_STYLE},
+ {"list-style", CSS_PROP_LIST_STYLE},
{"word-spacing", CSS_PROP_WORD_SPACING},
- {"box-flex-group", CSS_PROP_BOX_FLEX_GROUP},
+ {"background-repeat", CSS_PROP_BACKGROUND_REPEAT},
{"widows", CSS_PROP_WIDOWS},
- {"list-style", CSS_PROP_LIST_STYLE},
- {"page-break-after", CSS_PROP_PAGE_BREAK_AFTER},
+ {"table-layout", CSS_PROP_TABLE_LAYOUT},
+ {"scrollbar-track-color", CSS_PROP_SCROLLBAR_TRACK_COLOR},
{"border-width", CSS_PROP_BORDER_WIDTH},
{"border-top-width", CSS_PROP_BORDER_TOP_WIDTH},
- {"marker-offset", CSS_PROP_MARKER_OFFSET},
{"scrollbar-3dlight-color", CSS_PROP_SCROLLBAR_3DLIGHT_COLOR},
+ {"counter-increment", CSS_PROP_COUNTER_INCREMENT},
{"padding-bottom", CSS_PROP_PADDING_BOTTOM},
- {"box-ordinal-group", CSS_PROP_BOX_ORDINAL_GROUP},
- {"outline-style", CSS_PROP_OUTLINE_STYLE},
{"text-transform", CSS_PROP_TEXT_TRANSFORM},
- {"table-layout", CSS_PROP_TABLE_LAYOUT},
- {"background", CSS_PROP_BACKGROUND},
- {"scrollbar-track-color", CSS_PROP_SCROLLBAR_TRACK_COLOR},
- {"background-color", CSS_PROP_BACKGROUND_COLOR},
- {"counter-increment", CSS_PROP_COUNTER_INCREMENT},
- {"border-right-width", CSS_PROP_BORDER_RIGHT_WIDTH},
+ {"-konq-flow-mode", CSS_PROP__KONQ_FLOW_MODE},
{"scrollbar-face-color", CSS_PROP_SCROLLBAR_FACE_COLOR},
+ {"font-size-adjust", CSS_PROP_FONT_SIZE_ADJUST},
+ {"border-right-width", CSS_PROP_BORDER_RIGHT_WIDTH},
{"font-style", CSS_PROP_FONT_STYLE},
- {"background-repeat", CSS_PROP_BACKGROUND_REPEAT},
- {"-konq-flow-mode", CSS_PROP__KONQ_FLOW_MODE},
+ {"background-image", CSS_PROP_BACKGROUND_IMAGE},
{"border-spacing", CSS_PROP_BORDER_SPACING},
+ {"list-style-image", CSS_PROP_LIST_STYLE_IMAGE},
{"border-left-width", CSS_PROP_BORDER_LEFT_WIDTH},
{"margin-bottom", CSS_PROP_MARGIN_BOTTOM},
- {"list-style-image", CSS_PROP_LIST_STYLE_IMAGE},
{"box-lines", CSS_PROP_BOX_LINES},
- {"font-family", CSS_PROP_FONT_FAMILY},
{"visibility", CSS_PROP_VISIBILITY},
+ {"font-family", CSS_PROP_FONT_FAMILY},
{"border-style", CSS_PROP_BORDER_STYLE},
{"scrollbar-highlight-color", CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR},
{"border-top-style", CSS_PROP_BORDER_TOP_STYLE},
- {"font-size-adjust", CSS_PROP_FONT_SIZE_ADJUST},
{"border-bottom", CSS_PROP_BORDER_BOTTOM},
{"border-bottom-color", CSS_PROP_BORDER_BOTTOM_COLOR},
+ {"page-break-inside", CSS_PROP_PAGE_BREAK_INSIDE},
{"scrollbar-arrow-color", CSS_PROP_SCROLLBAR_ARROW_COLOR},
- {"background-image", CSS_PROP_BACKGROUND_IMAGE},
{"border-right-style", CSS_PROP_BORDER_RIGHT_STYLE},
- {"page-break-inside", CSS_PROP_PAGE_BREAK_INSIDE},
{"list-style-type", CSS_PROP_LIST_STYLE_TYPE},
{"border-left-style", CSS_PROP_BORDER_LEFT_STYLE},
{"page-break-before", CSS_PROP_PAGE_BREAK_BEFORE},
- {"list-style-position", CSS_PROP_LIST_STYLE_POSITION},
- {"scrollbar-shadow-color", CSS_PROP_SCROLLBAR_SHADOW_COLOR},
{"background-position", CSS_PROP_BACKGROUND_POSITION},
- {"border-bottom-width", CSS_PROP_BORDER_BOTTOM_WIDTH},
+ {"list-style-position", CSS_PROP_LIST_STYLE_POSITION},
{"background-attachment", CSS_PROP_BACKGROUND_ATTACHMENT},
{"background-position-x", CSS_PROP_BACKGROUND_POSITION_X},
+ {"scrollbar-shadow-color", CSS_PROP_SCROLLBAR_SHADOW_COLOR},
+ {"border-bottom-width", CSS_PROP_BORDER_BOTTOM_WIDTH},
{"scrollbar-darkshadow-color", CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR},
- {"border-bottom-style", CSS_PROP_BORDER_BOTTOM_STYLE},
- {"background-position-y", CSS_PROP_BACKGROUND_POSITION_Y}
+ {"background-position-y", CSS_PROP_BACKGROUND_POSITION_Y},
+ {"border-bottom-style", CSS_PROP_BORDER_BOTTOM_STYLE}
};
static const signed char lookup[] =
@@ -263,84 +264,78 @@ findProp (register const char *str, register unsigned int len)
-1, -1, -1, -1, -1, 7, 8, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 9,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 10, -1, 11, -1, 12, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 13, -1, 14, -1, -1, -1, 15, -1,
- -1, 16, 17, -1, -1, -1, -1, -1, -1, -1,
- 18, 19, -1, -1, -1, 20, -1, -1, -1, -1,
- -1, 21, -1, 22, -1, 23, -1, -1, -1, 24,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 25, -1, -1, -1, 26, -1, -1, -1, -1,
- 27, 28, 29, -1, -1, -1, -1, -1, 30, -1,
- -1, -1, -1, -1, -1, -1, 31, -1, -1, -1,
- 32, -1, 33, -1, -1, -1, 34, 35, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 36, -1,
- -1, -1, 37, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 38, -1, 39,
- -1, -1, -1, -1, -1, -1, 40, 41, -1, -1,
- 42, 43, -1, 44, -1, -1, -1, -1, 45, -1,
- -1, -1, -1, -1, -1, -1, 46, -1, -1, -1,
- -1, -1, 47, -1, -1, -1, 48, 49, -1, 50,
- -1, -1, 51, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 52, -1, 53, -1, -1, -1,
- -1, -1, -1, 54, -1, -1, -1, 55, 56, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 57, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 58, 59, 60, -1, -1, -1, -1, -1, 61,
- 62, -1, -1, -1, -1, 63, 64, 65, 66, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 67,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 68, -1, 69, -1, 70, -1, -1, -1,
- 71, 72, 73, -1, -1, -1, 74, -1, -1, -1,
- -1, -1, -1, 75, -1, -1, -1, -1, 76, 77,
- -1, -1, 78, -1, -1, -1, -1, -1, 79, 80,
- -1, -1, -1, -1, -1, -1, -1, 81, -1, -1,
- -1, -1, -1, -1, -1, 82, 83, -1, -1, -1,
- -1, 84, 85, 86, -1, 87, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 88, -1, 89, -1, -1,
- 90, -1, -1, -1, -1, -1, -1, -1, -1, 91,
- -1, -1, 92, -1, -1, -1, -1, -1, 93, -1,
- -1, 94, -1, -1, 95, -1, 96, -1, -1, -1,
- 97, -1, 98, -1, -1, 99, 100, -1, -1, -1,
- -1, 101, -1, 102, -1, -1, -1, -1, -1, 103,
- -1, -1, -1, -1, -1, -1, 104, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 105, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 106, -1, -1, -1, -1, -1, -1,
- -1, -1, 107, -1, -1, 108, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 109, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 9, -1, 10,
+ -1, 11, -1, 12, 13, -1, 14, -1, -1, -1,
+ -1, -1, 15, -1, -1, -1, 16, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 17, -1, -1, 18, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 19, -1, 20, -1, -1, 21, -1, -1, -1, -1,
+ -1, 22, -1, 23, -1, -1, -1, -1, -1, 24,
+ 25, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 26, -1, -1, -1, 27, -1, -1, -1, -1,
+ 28, 29, 30, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 31, -1, -1, 32, -1, -1, -1,
+ 33, -1, 34, -1, -1, -1, 35, 36, -1, -1,
+ -1, -1, -1, 37, -1, -1, -1, -1, 38, -1,
+ -1, -1, 39, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 40, -1, 41, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 42, 43, -1, -1,
+ 44, 45, -1, 46, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 47, 48, -1, -1,
+ -1, -1, 49, -1, -1, -1, 50, -1, 51, -1,
+ -1, -1, 52, -1, 53, -1, -1, -1, 54, -1,
+ -1, -1, -1, -1, 55, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 56, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 57, -1, -1,
+ -1, -1, 58, -1, -1, -1, 59, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 60, -1, -1,
+ -1, 61, -1, 62, -1, 63, -1, -1, -1, 64,
+ -1, -1, -1, -1, 65, 66, 67, -1, 68, -1,
+ -1, 69, -1, 70, -1, 71, -1, -1, -1, 72,
+ -1, 73, -1, -1, -1, -1, -1, 74, 75, -1,
+ 76, -1, 77, -1, -1, -1, -1, 78, -1, -1,
+ -1, 79, 80, -1, -1, -1, 81, 82, -1, -1,
+ -1, 83, -1, 84, -1, -1, -1, 85, -1, 86,
+ -1, -1, -1, -1, 87, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 88, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 89, 90, -1, -1, -1, -1, -1, -1, 91, -1,
+ 92, -1, -1, -1, -1, -1, 93, -1, -1, -1,
+ -1, -1, -1, -1, 94, -1, -1, -1, -1, -1,
+ -1, 95, -1, -1, -1, -1, -1, 96, 97, 98,
+ -1, -1, -1, -1, -1, 99, 100, 101, -1, -1,
+ 102, 103, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 104, -1, -1, -1, -1, -1, 105,
+ -1, -1, 106, -1, -1, -1, 107, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 108, -1,
+ -1, -1, -1, -1, -1, 109, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 110, -1, -1,
+ -1, -1, 111, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 111,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 112, -1, 113, -1, -1, -1, -1, 114,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 115, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 112,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 116, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 113, -1, -1, -1, -1, -1,
+ -1, 114, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 115, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 116, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 117, -1, -1, -1,
+ -1, -1, -1, -1, 117, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 118,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 118, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 119
+ -1, 119, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 120
};
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -429,6 +424,7 @@ static const char * const propertyList[] = {
"max-width",
"min-height",
"min-width",
+"opacity",
"orphans",
"outline-color",
"outline-style",
diff --git a/WebCore/khtml/css/cssproperties.h b/WebCore/khtml/css/cssproperties.h
index a7e2a02..09c0dab 100644
--- a/WebCore/khtml/css/cssproperties.h
+++ b/WebCore/khtml/css/cssproperties.h
@@ -72,63 +72,64 @@
#define CSS_PROP_MAX_WIDTH 63
#define CSS_PROP_MIN_HEIGHT 64
#define CSS_PROP_MIN_WIDTH 65
-#define CSS_PROP_ORPHANS 66
-#define CSS_PROP_OUTLINE_COLOR 67
-#define CSS_PROP_OUTLINE_STYLE 68
-#define CSS_PROP_OUTLINE_WIDTH 69
-#define CSS_PROP_OVERFLOW 70
-#define CSS_PROP_PADDING_TOP 71
-#define CSS_PROP_PADDING_RIGHT 72
-#define CSS_PROP_PADDING_BOTTOM 73
-#define CSS_PROP_PADDING_LEFT 74
-#define CSS_PROP_PAGE 75
-#define CSS_PROP_PAGE_BREAK_AFTER 76
-#define CSS_PROP_PAGE_BREAK_BEFORE 77
-#define CSS_PROP_PAGE_BREAK_INSIDE 78
-#define CSS_PROP_POSITION 79
-#define CSS_PROP_QUOTES 80
-#define CSS_PROP_RIGHT 81
-#define CSS_PROP_SIZE 82
-#define CSS_PROP_TABLE_LAYOUT 83
-#define CSS_PROP_TEXT_ALIGN 84
-#define CSS_PROP_TEXT_DECORATION 85
-#define CSS_PROP_TEXT_DECORATION_COLOR 86
-#define CSS_PROP_TEXT_INDENT 87
-#define CSS_PROP_TEXT_SHADOW 88
-#define CSS_PROP_TEXT_TRANSFORM 89
-#define CSS_PROP_TOP 90
-#define CSS_PROP_UNICODE_BIDI 91
-#define CSS_PROP_VERTICAL_ALIGN 92
-#define CSS_PROP_VISIBILITY 93
-#define CSS_PROP_WHITE_SPACE 94
-#define CSS_PROP_WIDOWS 95
-#define CSS_PROP_WIDTH 96
-#define CSS_PROP_WORD_SPACING 97
-#define CSS_PROP_Z_INDEX 98
-#define CSS_PROP_BACKGROUND 99
-#define CSS_PROP_BORDER 100
-#define CSS_PROP_BORDER_COLOR 101
-#define CSS_PROP_BORDER_STYLE 102
-#define CSS_PROP_BORDER_TOP 103
-#define CSS_PROP_BORDER_RIGHT 104
-#define CSS_PROP_BORDER_BOTTOM 105
-#define CSS_PROP_BORDER_LEFT 106
-#define CSS_PROP_BORDER_WIDTH 107
-#define CSS_PROP_FONT 108
-#define CSS_PROP_LIST_STYLE 109
-#define CSS_PROP_MARGIN 110
-#define CSS_PROP_OUTLINE 111
-#define CSS_PROP_PADDING 112
-#define CSS_PROP_SCROLLBAR_FACE_COLOR 113
-#define CSS_PROP_SCROLLBAR_SHADOW_COLOR 114
-#define CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR 115
-#define CSS_PROP_SCROLLBAR_3DLIGHT_COLOR 116
-#define CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR 117
-#define CSS_PROP_SCROLLBAR_TRACK_COLOR 118
-#define CSS_PROP_SCROLLBAR_ARROW_COLOR 119
-#define CSS_PROP__KONQ_FLOW_MODE 120
+#define CSS_PROP_OPACITY 66
+#define CSS_PROP_ORPHANS 67
+#define CSS_PROP_OUTLINE_COLOR 68
+#define CSS_PROP_OUTLINE_STYLE 69
+#define CSS_PROP_OUTLINE_WIDTH 70
+#define CSS_PROP_OVERFLOW 71
+#define CSS_PROP_PADDING_TOP 72
+#define CSS_PROP_PADDING_RIGHT 73
+#define CSS_PROP_PADDING_BOTTOM 74
+#define CSS_PROP_PADDING_LEFT 75
+#define CSS_PROP_PAGE 76
+#define CSS_PROP_PAGE_BREAK_AFTER 77
+#define CSS_PROP_PAGE_BREAK_BEFORE 78
+#define CSS_PROP_PAGE_BREAK_INSIDE 79
+#define CSS_PROP_POSITION 80
+#define CSS_PROP_QUOTES 81
+#define CSS_PROP_RIGHT 82
+#define CSS_PROP_SIZE 83
+#define CSS_PROP_TABLE_LAYOUT 84
+#define CSS_PROP_TEXT_ALIGN 85
+#define CSS_PROP_TEXT_DECORATION 86
+#define CSS_PROP_TEXT_DECORATION_COLOR 87
+#define CSS_PROP_TEXT_INDENT 88
+#define CSS_PROP_TEXT_SHADOW 89
+#define CSS_PROP_TEXT_TRANSFORM 90
+#define CSS_PROP_TOP 91
+#define CSS_PROP_UNICODE_BIDI 92
+#define CSS_PROP_VERTICAL_ALIGN 93
+#define CSS_PROP_VISIBILITY 94
+#define CSS_PROP_WHITE_SPACE 95
+#define CSS_PROP_WIDOWS 96
+#define CSS_PROP_WIDTH 97
+#define CSS_PROP_WORD_SPACING 98
+#define CSS_PROP_Z_INDEX 99
+#define CSS_PROP_BACKGROUND 100
+#define CSS_PROP_BORDER 101
+#define CSS_PROP_BORDER_COLOR 102
+#define CSS_PROP_BORDER_STYLE 103
+#define CSS_PROP_BORDER_TOP 104
+#define CSS_PROP_BORDER_RIGHT 105
+#define CSS_PROP_BORDER_BOTTOM 106
+#define CSS_PROP_BORDER_LEFT 107
+#define CSS_PROP_BORDER_WIDTH 108
+#define CSS_PROP_FONT 109
+#define CSS_PROP_LIST_STYLE 110
+#define CSS_PROP_MARGIN 111
+#define CSS_PROP_OUTLINE 112
+#define CSS_PROP_PADDING 113
+#define CSS_PROP_SCROLLBAR_FACE_COLOR 114
+#define CSS_PROP_SCROLLBAR_SHADOW_COLOR 115
+#define CSS_PROP_SCROLLBAR_HIGHLIGHT_COLOR 116
+#define CSS_PROP_SCROLLBAR_3DLIGHT_COLOR 117
+#define CSS_PROP_SCROLLBAR_DARKSHADOW_COLOR 118
+#define CSS_PROP_SCROLLBAR_TRACK_COLOR 119
+#define CSS_PROP_SCROLLBAR_ARROW_COLOR 120
+#define CSS_PROP__KONQ_FLOW_MODE 121
#define CSS_PROP_MAX CSS_PROP_Z_INDEX
-#define CSS_PROP_TOTAL 121
+#define CSS_PROP_TOTAL 122
#endif
diff --git a/WebCore/khtml/css/cssproperties.in b/WebCore/khtml/css/cssproperties.in
index 3ac2555..8951bd7 100644
--- a/WebCore/khtml/css/cssproperties.in
+++ b/WebCore/khtml/css/cssproperties.in
@@ -83,6 +83,7 @@ max-height
max-width
min-height
min-width
+opacity
orphans
outline-color
outline-style
diff --git a/WebCore/khtml/css/cssstyleselector.cpp b/WebCore/khtml/css/cssstyleselector.cpp
index cd235bc..8b72868 100644
--- a/WebCore/khtml/css/cssstyleselector.cpp
+++ b/WebCore/khtml/css/cssstyleselector.cpp
@@ -3102,6 +3102,17 @@ void CSSStyleSelector::applyRule( int id, DOM::CSSValueImpl *value )
break;
// CSS3 Properties
+ case CSS_PROP_OPACITY:
+ if (value->cssValueType() == CSSValue::CSS_INHERIT) {
+ if (!parentNode) return;
+ style->setOpacity(parentStyle->opacity());
+ }
+ if (!primitiveValue || primitiveValue->primitiveType() != CSSPrimitiveValue::CSS_NUMBER)
+ return; // Error case.
+
+ // Clamp opacity to the range 0-1
+ style->setOpacity(QMIN(1.0f, QMAX(0, primitiveValue->getFloatValue(CSSPrimitiveValue::CSS_NUMBER))));
+ return;
case CSS_PROP_BOX_ALIGN:
if (value->cssValueType() == CSSValue::CSS_INHERIT) {
if(!parentNode) return;
diff --git a/WebCore/khtml/rendering/render_block.h b/WebCore/khtml/rendering/render_block.h
index b3733ae..234a9e0 100644
--- a/WebCore/khtml/rendering/render_block.h
+++ b/WebCore/khtml/rendering/render_block.h
@@ -166,8 +166,12 @@ public:
virtual InlineFlowBox* getFirstLineBox();
// overrides RenderObject
- virtual bool requiresLayer() { return isRoot() || (!isTableCell() &&
- (isPositioned() || isRelPositioned() || style()->hidesOverflow())); }
+ // FIXME: The bogus table cell check is only here until we figure out how to position
+ // table cells properly when they have layers.
+ // Note that we also restrict overflow to blocks for now.
+ virtual bool requiresLayer() {
+ return !isTableCell() && (RenderObject::requiresLayer() || style()->hidesOverflow());
+ }
#ifndef NDEBUG
virtual void printTree(int indent=0) const;
diff --git a/WebCore/khtml/rendering/render_box.cpp b/WebCore/khtml/rendering/render_box.cpp
index d686d49..fce419e 100644
--- a/WebCore/khtml/rendering/render_box.cpp
+++ b/WebCore/khtml/rendering/render_box.cpp
@@ -117,16 +117,27 @@ void RenderBox::setStyle(RenderStyle *_style)
m_layer = 0;
}
+ adjustZIndex();
+}
+
+void RenderBox::adjustZIndex()
+{
if (m_layer) {
// Make sure our z-index values are only applied if we're positioned or
- // relpositioned.
- if (!isPositioned() && !isRelPositioned()) {
+ // relpositioned or transparent.
+ if (!isPositioned() && !isRelPositioned() && style()->opacity() == 1.0f) {
// Set the auto z-index flag.
if (isRoot())
style()->setZIndex(0);
else
style()->setHasAutoZIndex();
}
+
+ // Auto z-index becomes 0 for transparent objects. This prevents cases where
+ // objects that should be blended as a single unit end up with a non-transparent object
+ // wedged in between them.
+ if (style()->opacity() < 1.0f && style()->hasAutoZIndex())
+ style()->setZIndex(0);
}
}
diff --git a/WebCore/khtml/rendering/render_box.h b/WebCore/khtml/rendering/render_box.h
index 1023b82..a18711f 100644
--- a/WebCore/khtml/rendering/render_box.h
+++ b/WebCore/khtml/rendering/render_box.h
@@ -137,6 +137,9 @@ protected:
virtual QRect getOverflowClipRect(int tx, int ty);
virtual QRect getClipRect(int tx, int ty);
+ // Called to correct the z-index after the style has been changed.
+ void adjustZIndex();
+
// the actual height of the contents + borders + padding
int m_height;
diff --git a/WebCore/khtml/rendering/render_inline.h b/WebCore/khtml/rendering/render_inline.h
index 023c138..1bc9c78 100644
--- a/WebCore/khtml/rendering/render_inline.h
+++ b/WebCore/khtml/rendering/render_inline.h
@@ -61,7 +61,7 @@ public:
virtual void calcMinMaxWidth();
// overrides RenderObject
- virtual bool requiresLayer() { return isRelPositioned(); }
+ virtual bool requiresLayer() { return isRelPositioned() || style()->opacity() < 1.0f; }
virtual short width() const;
virtual int height() const;
diff --git a/WebCore/khtml/rendering/render_layer.cpp b/WebCore/khtml/rendering/render_layer.cpp
index 69be117..1298e9e 100644
--- a/WebCore/khtml/rendering/render_layer.cpp
+++ b/WebCore/khtml/rendering/render_layer.cpp
@@ -149,6 +149,81 @@ RenderLayer::enclosingPositionedAncestor()
return curr;
}
+RenderLayer*
+RenderLayer::transparentAncestor()
+{
+ RenderLayer* curr = parent();
+ for ( ; curr && curr->m_object->style()->opacity() == 1.0f; curr = curr->parent());
+ return curr;
+}
+
+bool
+RenderLayer::isTransparent()
+{
+ return m_object->style()->opacity() < 1.0f;
+}
+
+static RenderLayer* commonTransparentAncestor(RenderLayer* layer1, RenderLayer* layer2)
+{
+ if (!layer1 || !layer2)
+ return 0;
+
+ for (RenderLayer* currLayer1 = layer1; currLayer1; currLayer1 = currLayer1->transparentAncestor())
+ for (RenderLayer* currLayer2 = layer2; currLayer2; currLayer2 = currLayer2->transparentAncestor())
+ if (currLayer1 == currLayer2)
+ return currLayer1;
+
+ return 0;
+}
+
+void RenderLayer::updateTransparentState(QPainter* painter, RenderLayer* newLayer, RenderLayer*& currLayer)
+{
+ RenderLayer* transparentLayer = (!newLayer || newLayer->isTransparent()) ? newLayer :
+ newLayer->transparentAncestor();
+ if (transparentLayer == currLayer)
+ return;
+
+ RenderLayer* commonAncestor = commonTransparentAncestor(currLayer, transparentLayer);
+ endTransparencyLayers(painter, currLayer, commonAncestor);
+ beginTransparencyLayers(painter, transparentLayer, commonAncestor);
+
+ // Update our current layer.
+ currLayer = transparentLayer;
+}
+
+void RenderLayer::beginTransparencyLayers(QPainter* painter, RenderLayer* newLayer, RenderLayer* ancestorLayer)
+{
+ if (!newLayer || newLayer == ancestorLayer)
+ return;
+
+ // We need to open from the outside in, so begin ancestor layers first.
+ beginTransparencyLayers(painter, newLayer->transparentAncestor(), ancestorLayer);
+
+ // Konqueror should add its own code for setting up the opacity layer here.
+ // Safari uses a custom extension to QPainter to communicate with CoreGraphics.
+#ifdef APPLE_CHANGES
+ // Begin the layer
+ painter->beginTransparencyLayer(newLayer->renderer()->style()->opacity());
+#endif
+}
+
+void RenderLayer::endTransparencyLayers(QPainter* painter, RenderLayer* newLayer, RenderLayer* ancestorLayer)
+{
+ if (!newLayer || newLayer == ancestorLayer)
+ return;
+
+ // We need to close from the inside out.
+
+ // Konqueror should add its own code for popping opacity layers here.
+ // Safari uses a custom extension to QPainter to communicate with CoreGraphics.
+#ifdef APPLE_CHANGES
+ // End the layer
+ painter->endTransparencyLayer();
+#endif
+
+ endTransparencyLayers(painter, newLayer->transparentAncestor(), ancestorLayer);
+}
+
void* RenderLayer::operator new(size_t sz, RenderArena* renderArena) throw()
{
return renderArena->allocate(sz);
@@ -535,6 +610,7 @@ RenderLayer::paint(QPainter *p, int x, int y, int w, int h, bool selectionOnly)
// Walk the list and paint each layer, adding in the appropriate offset.
QRect paintRect(x, y, w, h);
QRect currRect(paintRect);
+ RenderLayer* currentTransparentLayer = 0;
uint count = layerList.count();
for (uint i = 0; i < count; i++) {
@@ -546,6 +622,9 @@ RenderLayer::paint(QPainter *p, int x, int y, int w, int h, bool selectionOnly)
// position after you call into it). -dwh
//printf("Painting layer at %d %d\n", elt->absBounds.x(), elt->absBounds.y());
+ // This is called to update our transparency state.
+ updateTransparentState(p, elt->layer, currentTransparentLayer);
+
if (elt->clipOriginator) {
// We originated a clip (we're either positioned or an element with
// overflow: hidden). We need to paint our background and border, subject
@@ -652,6 +731,8 @@ RenderLayer::paint(QPainter *p, int x, int y, int w, int h, bool selectionOnly)
if (currRect != paintRect)
p->restore(); // Pop the clip.
+ updateTransparentState(p, 0, currentTransparentLayer); // End any open transparency layers.
+
node->detach(renderer()->renderArena());
}
diff --git a/WebCore/khtml/rendering/render_layer.h b/WebCore/khtml/rendering/render_layer.h
index fa2db5e..35b14a4 100644
--- a/WebCore/khtml/rendering/render_layer.h
+++ b/WebCore/khtml/rendering/render_layer.h
@@ -90,6 +90,12 @@ public:
void addChild(RenderLayer *newChild, RenderLayer* beforeChild = 0);
RenderLayer* removeChild(RenderLayer *oldChild);
+ RenderLayer* transparentAncestor();
+ bool isTransparent();
+ void updateTransparentState(QPainter* painter, RenderLayer* newLayer, RenderLayer*& currLayer);
+ void beginTransparencyLayers(QPainter* painter, RenderLayer* newLayer, RenderLayer* ancestorLayer);
+ void endTransparencyLayers(QPainter* painter, RenderLayer* newLayer, RenderLayer* ancestorLayer);
+
void removeOnlyThisLayer();
void insertOnlyThisLayer();
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index 24eb904..692554a 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -118,7 +118,7 @@ public:
bool checkParent=true);
virtual void positionChildLayers() { }
virtual bool requiresLayer() {
- return isRoot() || (!isTableCell() && (isPositioned() || isRelPositioned()));
+ return isRoot() || isPositioned() || isRelPositioned() || style()->opacity() < 1.0f;
}
virtual QRect getOverflowClipRect(int tx, int ty) { return QRect(0,0,0,0); }
diff --git a/WebCore/khtml/rendering/render_style.cpp b/WebCore/khtml/rendering/render_style.cpp
index f5f7d04..479e452 100644
--- a/WebCore/khtml/rendering/render_style.cpp
+++ b/WebCore/khtml/rendering/render_style.cpp
@@ -88,7 +88,7 @@ bool StyleBoxData::operator==(const StyleBoxData& o) const
StyleVisualData::StyleVisualData()
: hasClip(false), textDecoration(TDNONE), colspan( 1 ), counter_increment( 0 ), counter_reset( 0 ),
- palette( QApplication::palette() )
+ opacity(1.0f), palette( QApplication::palette() )
{
}
@@ -99,7 +99,7 @@ StyleVisualData::StyleVisualData(const StyleVisualData& o )
: Shared<StyleVisualData>(),
clip( o.clip ), hasClip( o.hasClip ), textDecoration(o.textDecoration), colspan( o.colspan ),
counter_increment( o.counter_increment ), counter_reset( o.counter_reset ),
- palette( o.palette )
+ opacity( o.opacity ), palette( o.palette )
{
}
@@ -463,6 +463,7 @@ RenderStyle::Diff RenderStyle::diff( const RenderStyle *other ) const
!(visual->clip == other->visual->clip) ||
visual->hasClip != other->visual->hasClip ||
visual->textDecoration != other->visual->textDecoration ||
+ visual->opacity != other->visual->opacity ||
!(visual->palette == other->visual->palette)
)
return Visible;
diff --git a/WebCore/khtml/rendering/render_style.h b/WebCore/khtml/rendering/render_style.h
index 91bed6b..d5f11b0 100644
--- a/WebCore/khtml/rendering/render_style.h
+++ b/WebCore/khtml/rendering/render_style.h
@@ -348,8 +348,9 @@ public:
short counter_increment; //ok, so these are not visual mode spesific
short counter_reset; //can't go to inherited, since these are not inherited
+ float opacity; // Whether or not we're transparent.
+
QPalette palette; //widget styling with IE attributes
-
};
//------------------------------------------------
@@ -831,6 +832,7 @@ public:
CachedImage *cursorImage() const { return inherited->cursor_image; }
// CSS3 Getter Methods
+ float opacity() { return visual->opacity; }
EBoxAlignment boxAlign() { return flexible_box->align; }
EBoxDirection boxDirection() { return inherited_flags._box_direction; }
float boxFlex() { return flexible_box->flex; }
@@ -981,6 +983,7 @@ public:
void setZIndex(int v) { SET_VAR(box, z_auto, false); SET_VAR(box,z_index,v) }
// CSS3 Setters
+ void setOpacity(float f) { SET_VAR(visual, opacity, f); }
void setBoxAlign(EBoxAlignment a) { SET_VAR(flexible_box, align, a); }
void setBoxDirection(EBoxDirection d) { inherited_flags._box_direction = d; }
void setBoxFlex(float f) { SET_VAR(flexible_box, flex, f); }
diff --git a/WebCore/kwq/KWQPainter.h b/WebCore/kwq/KWQPainter.h
index 2735b08..c7f51cf 100644
--- a/WebCore/kwq/KWQPainter.h
+++ b/WebCore/kwq/KWQPainter.h
@@ -105,6 +105,9 @@ public:
bool paintingDisabled() const;
void setPaintingDisabled(bool);
+ void beginTransparencyLayer(float opacity);
+ void endTransparencyLayer();
+
private:
// no copying or assignment
QPainter(const QPainter &);
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index e9a0783..275fb38 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -567,3 +567,17 @@ bool QPainter::paintingDisabled() const
{
return data->state.paintingDisabled;
}
+
+void QPainter::beginTransparencyLayer(float opacity)
+{
+ CGContextRef context = (CGContextRef)([[NSGraphicsContext currentContext] graphicsPort]);
+ CGContextBeginTransparencyLayer(context, 0);
+ CGContextSetAlpha(context, opacity);
+}
+
+void QPainter::endTransparencyLayer()
+{
+ CGContextRef context = (CGContextRef)([[NSGraphicsContext currentContext] graphicsPort]);
+ CGContextEndTransparencyLayer(context);
+}
+
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list