- Revision
- 127463
- Author
- [email protected]
- Date
- 2012-09-04 06:30:35 -0700 (Tue, 04 Sep 2012)
Log Message
[EFL][WK2] CSS3 Media Queries functionality is broken
https://bugs.webkit.org/show_bug.cgi?id=95680
Patch by Alexander Shalamov <[email protected]> on 2012-09-04
Reviewed by Kenneth Rohde Christiansen.
Source/WebCore:
In WK2, WebProcess doesn't have access to ewk_view evas object.
Methods that get screen rect or screen depth either return incorrect value or crash.
This patch removes dependency to ewk_view evas object and relies on ecore_x_* functions
to get screen rectangle or color depth of the screen.
* platform/efl/EflScreenUtilities.cpp: removed unused getPixelDepth method definition
* platform/efl/EflScreenUtilities.h: removed unsused getPixelDepth method declaration
(WebCore):
* platform/efl/PlatformScreenEfl.cpp:
(WebCore):
(WebCore::screenHorizontalDPI):
(WebCore::screenVerticalDPI):
(WebCore::screenDepth):
(WebCore::screenDepthPerComponent):
(WebCore::screenIsMonochrome):
(WebCore::screenRect):
LayoutTests:
Unskipped passing CSS3 Media Query tests.
* platform/efl-wk2/TestExpectations:
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (127462 => 127463)
--- trunk/LayoutTests/ChangeLog 2012-09-04 13:13:08 UTC (rev 127462)
+++ trunk/LayoutTests/ChangeLog 2012-09-04 13:30:35 UTC (rev 127463)
@@ -1,3 +1,14 @@
+2012-09-04 Alexander Shalamov <[email protected]>
+
+ [EFL][WK2] CSS3 Media Queries functionality is broken
+ https://bugs.webkit.org/show_bug.cgi?id=95680
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Unskipped passing CSS3 Media Query tests.
+
+ * platform/efl-wk2/TestExpectations:
+
2012-09-04 Andrey Adaikin <[email protected]>
Web Inspector: Skip inspector WebGL tests where WebGL is disabled
Modified: trunk/LayoutTests/platform/efl-wk2/TestExpectations (127462 => 127463)
--- trunk/LayoutTests/platform/efl-wk2/TestExpectations 2012-09-04 13:13:08 UTC (rev 127462)
+++ trunk/LayoutTests/platform/efl-wk2/TestExpectations 2012-09-04 13:30:35 UTC (rev 127463)
@@ -245,7 +245,6 @@
BUGWKEFL : fast/block/float/float-in-float-hit-testing.html = TEXT
BUGWKEFL : fast/cookies/local-file-can-set-cookies.html = TEXT
BUGWKEFL : fast/css/bidi-override-in-anonymous-block.html = TEXT
-BUGWKEFL : fast/css/media-rule-screenDepthPerComponent.html = TEXT
BUGWKEFL : fast/css/relative-positioned-block-crash.html = TEXT
BUGWKEFL : fast/dom/Window/mozilla-focus-blur.html = TEXT
BUGWKEFL : fast/dom/Window/timer-resume-on-navigation-back.html = TEXT
@@ -268,18 +267,6 @@
BUGWKEFL : fast/frames/flattening/iframe-tiny.html = TEXT
BUGWKEFL : fast/harness/use-page-cache.html = TEXT
BUGWKEFL : fast/history/timed-refresh-in-cached-frame.html = TEXT
-BUGWKEFL : fast/media/color-does-not-include-alpha.html = TEXT
-BUGWKEFL : fast/media/implicit-media-all.html = TEXT
-BUGWKEFL : fast/media/mq-compound-query-01.html = TEXT
-BUGWKEFL : fast/media/mq-compound-query-02.html = TEXT
-BUGWKEFL : fast/media/mq-compound-query-03.html = TEXT
-BUGWKEFL : fast/media/mq-compound-query-04.html = TEXT
-BUGWKEFL : fast/media/mq-js-media-except-01.html = TEXT
-BUGWKEFL : fast/media/mq-js-stylesheet-media-01.html = TEXT
-BUGWKEFL : fast/media/mq-js-stylesheet-media-02.html = TEXT
-BUGWKEFL : fast/media/mq-js-stylesheet-media-03.html = TEXT
-BUGWKEFL : fast/media/mq-simple-query-05.html = TEXT
-BUGWKEFL : fast/media/mq-valueless.html = TEXT
BUGWKEFL : fast/repaint/fixed-move-after-keyboard-scroll.html = TEXT
BUGWKEFL : fast/replaced/no-focus-ring-embed.html = TEXT
BUGWKEFL : fast/replaced/no-focus-ring-object.html = TEXT
Modified: trunk/Source/WebCore/ChangeLog (127462 => 127463)
--- trunk/Source/WebCore/ChangeLog 2012-09-04 13:13:08 UTC (rev 127462)
+++ trunk/Source/WebCore/ChangeLog 2012-09-04 13:30:35 UTC (rev 127463)
@@ -1,3 +1,27 @@
+2012-09-04 Alexander Shalamov <[email protected]>
+
+ [EFL][WK2] CSS3 Media Queries functionality is broken
+ https://bugs.webkit.org/show_bug.cgi?id=95680
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ In WK2, WebProcess doesn't have access to ewk_view evas object.
+ Methods that get screen rect or screen depth either return incorrect value or crash.
+ This patch removes dependency to ewk_view evas object and relies on ecore_x_* functions
+ to get screen rectangle or color depth of the screen.
+
+ * platform/efl/EflScreenUtilities.cpp: removed unused getPixelDepth method definition
+ * platform/efl/EflScreenUtilities.h: removed unsused getPixelDepth method declaration
+ (WebCore):
+ * platform/efl/PlatformScreenEfl.cpp:
+ (WebCore):
+ (WebCore::screenHorizontalDPI):
+ (WebCore::screenVerticalDPI):
+ (WebCore::screenDepth):
+ (WebCore::screenDepthPerComponent):
+ (WebCore::screenIsMonochrome):
+ (WebCore::screenRect):
+
2012-09-04 Michał Pakuła vel Rutka <[email protected]>
[EFL] Context menu restore.
Modified: trunk/Source/WebCore/platform/efl/EflScreenUtilities.cpp (127462 => 127463)
--- trunk/Source/WebCore/platform/efl/EflScreenUtilities.cpp 2012-09-04 13:13:08 UTC (rev 127462)
+++ trunk/Source/WebCore/platform/efl/EflScreenUtilities.cpp 2012-09-04 13:30:35 UTC (rev 127463)
@@ -127,23 +127,6 @@
#endif
}
-int getPixelDepth(const Evas* evas)
-{
-#ifdef HAVE_ECORE_X
- Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(evas);
- // FIXME: ecore_evas_software_x11_window_get() can't get Ecore_X_Window during the layout test.
- // Because, EFL DumpRenderTree doesn't use X11 window by default.
- // See also, http://trac.webkit.org/browser/trunk/Tools/DumpRenderTree/efl/DumpRenderTree.cpp#L69
- Ecore_X_Window window = ecore_evas_software_x11_window_get(ecoreEvas);
- if (!window)
- return 8;
-
- return ecore_x_window_depth_get(window);
-#else
- return 8;
-#endif
-}
-
bool isUsingEcoreX(const Evas* evas)
{
#ifdef HAVE_ECORE_X
Modified: trunk/Source/WebCore/platform/efl/EflScreenUtilities.h (127462 => 127463)
--- trunk/Source/WebCore/platform/efl/EflScreenUtilities.h 2012-09-04 13:13:08 UTC (rev 127462)
+++ trunk/Source/WebCore/platform/efl/EflScreenUtilities.h 2012-09-04 13:30:35 UTC (rev 127463)
@@ -27,7 +27,6 @@
void applyFallbackCursor(Ecore_Evas*, const char*);
int getDPI();
-int getPixelDepth(const Evas*);
bool isUsingEcoreX(const Evas*);
} // namespace WebCore
Modified: trunk/Source/WebCore/platform/efl/PlatformScreenEfl.cpp (127462 => 127463)
--- trunk/Source/WebCore/platform/efl/PlatformScreenEfl.cpp 2012-09-04 13:13:08 UTC (rev 127462)
+++ trunk/Source/WebCore/platform/efl/PlatformScreenEfl.cpp 2012-09-04 13:30:35 UTC (rev 127463)
@@ -5,6 +5,7 @@
* Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
* Copyright (C) 2009-2010 ProFUSION embedded systems
* Copyright (C) 2009-2010 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,7 +35,6 @@
#include "config.h"
#include "PlatformScreen.h"
-#include "EflScreenUtilities.h"
#include "NotImplemented.h"
#include "PlatformString.h"
#include "Widget.h"
@@ -42,56 +42,89 @@
#include <Ecore_Evas.h>
#include <wtf/text/CString.h>
+#ifdef HAVE_ECORE_X
+#include <Ecore_X.h>
+#endif
+
namespace WebCore {
-
-int screenHorizontalDPI(Widget* widget)
+
+#ifdef HAVE_ECORE_X
+
+#define CALL_WITH_ECORE_X(ECORE_X_CALL) \
+ do { \
+ int success = ecore_x_init(0); \
+ if (success) { \
+ Ecore_X_Screen* screen = ecore_x_default_screen_get(); \
+ if (screen) \
+ ECORE_X_CALL; \
+ ecore_x_shutdown(); \
+ } \
+ } while (0) \
+
+#endif
+
+int screenHorizontalDPI(Widget*)
{
notImplemented();
return 0;
}
-int screenVerticalDPI(Widget* widget)
+int screenVerticalDPI(Widget*)
{
notImplemented();
return 0;
}
-int screenDepth(Widget* widget)
+int screenDepth(Widget*)
{
- if (!widget || !widget->evas())
- return 0;
-
- return getPixelDepth(widget->evas());
+#ifdef HAVE_ECORE_X
+ int depth = 24;
+ CALL_WITH_ECORE_X(depth = ecore_x_default_depth_get(ecore_x_display_get(), screen));
+ return depth;
+#else
+ return 24;
+#endif
}
int screenDepthPerComponent(Widget* widget)
{
- if (!widget || !widget->evas())
- return 0;
+ if (!widget)
+ return 8;
- // FIXME: How to support this functionality based on EFL library ?
- return getPixelDepth(widget->evas());
+ int depth = screenDepth(widget);
+
+ switch (depth) {
+ // Special treat 0 as an error, and return 8 bit per component.
+ case 0:
+ case 24:
+ case 32:
+ return 8;
+ case 8:
+ return 2;
+ default:
+ return depth / 3;
+ }
}
-bool screenIsMonochrome(Widget*)
+bool screenIsMonochrome(Widget* widget)
{
- notImplemented();
- return false;
+ return screenDepth(widget) < 2;
}
FloatRect screenRect(Widget* widget)
{
- if (!widget)
+#ifdef HAVE_ECORE_X
+ int width = 0, height = 0;
+ CALL_WITH_ECORE_X(ecore_x_screen_size_get(screen, &width, &height));
+ return FloatRect(0, 0, width, height);
+#else
+ if (!widget || !widget->evas())
return FloatRect();
int x, y, w, h;
- Evas* e = widget->evas();
- if (!e)
- return FloatRect();
-
- ecore_evas_screen_geometry_get(ecore_evas_ecore_evas_get(e), &x, &y, &w, &h);
-
+ ecore_evas_screen_geometry_get(ecore_evas_ecore_evas_get(widget->evas()), &x, &y, &w, &h);
return FloatRect(x, y, w, h);
+#endif
}
FloatRect screenAvailableRect(Widget* widget)