[GTK] WebKitWebView doesn't notify of favicon changes for known favicons but new pages
https://bugs.webkit.org/show_bug.cgi?id=98874

Reviewed by Martin Robinson.

If the page is unknown (not registered in the icon database) but
the icon is known (registered by another page) favicon-ready
signal is not emitted because the icon has already been imported
from the database. The view always asks for the favicon when the
load has been committed, but it's usually too early and the
favicon of the page is still unkown. We can use
didChangeIconForPageURLCallback to know when to ask for the
favicon emitting a favicon-changed signal. The callback
iconDataReadyForPageURLCallback is still useful to process pending
icon requests, but the favicon-ready signal can be removed in
favor of favicon-changed.

* UIProcess/API/gtk/WebKitFaviconDatabase.cpp:
(_WebKitFaviconDatabasePrivate): Keep a map of page icons that has
been imported to make sure we only emit favicon-changed signal
when the favicon URI has actually changed, because
didChangeIconForPageURLCallback can be called multiple times for
the same favicon URI in some cases.
(webkit_favicon_database_class_init): Remove favicon-ready signal
and add favicon-changed that includes the new favicon URI for the
given page URI.
(didChangeIconForPageURLCallback): Emit favicon-changed signal if
the favicon URI is new or has changed for the given page URI.
(iconDataReadyForPageURLCallback): Process pending icon requests.
(webkitFaviconDatabaseCreate): Add implementation for
didChangeIconForPageURLCallback.
* UIProcess/API/gtk/WebKitFaviconDatabasePrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(_WebKitWebViewPrivate): Add favicon URI to make sure we only ask for a
new favicon when the favicon URI has changed.
(webkitWebViewUpdateFavicon): Update the favicon and emit
notify::favicon if it has changed.
(gotFaviconCallback): Update the favicon if the request hasn't
been cancelled.
(webkitWebViewRequestFavicon): Ask for the page favicon.
(webkitWebViewUpdateFaviconURI): Updated the favicon URI and
request the page favicon if the favicon URI has changed.
(faviconChangedCallback): Call webkitWebViewUpdateFaviconURI() with
the given favicon URI.
(webkitWebViewWatchForChangesInFavicon): Connect to
WebKitFaviconDatabase::favicon-changed.
(webkitWebViewDisconnectFaviconDatabaseSignalHandlers): Disconnect
WebKitFaviconDatabase::favicon-changed signal.
(webkitWebViewLoadChanged): Call webkitWebViewUpdateFaviconURI()
with the current favicon URI when the load has been committed.
* UIProcess/API/gtk/tests/TestWebKitFaviconDatabase.cpp:
(serverCallback):
(testNotInitialized):
(testGetFavicon):
(testGetFaviconURI):
(testWebViewFavicon):
(beforeAll):
* UIProcess/API/gtk/webkit2marshal.list: Add new marshaler.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133867 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Warn when parsing an invalid X-Frame-Options header.
https://bugs.webkit.org/show_bug.cgi?id=101447

Reviewed by Adam Barth.

Source/WebCore:

An 'X-Frame-Options' header that contains an invalid option (that is,
neither 'DENY' nor 'SAMEORIGIN') is ignored. This patch adds a console
warning to notify developers that they've made a mistake.

Test: http/tests/security/XFrameOptions/x-frame-options-invalid.html

* dom/Document.cpp:
(WebCore::Document::processHttpEquiv):
    Move the request identifier generation out of the failure block in
    order to pass it into 'shouldInterruptLoadForXFrameOptions'. This
    ensures that the console message is properly tied to a request.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions):
* loader/FrameLoader.h:
(FrameLoader):
    'shouldInterruptLoadForXFrameOptions' now accepts a request
    identifier as a parameter, and generates a console message if the
    load is blocked.
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::didReceiveResponse):
    Pass the request identifier into 'shouldInterruptLoadForXFrameOptions'.

LayoutTests:

* http/tests/security/XFrameOptions/resources/x-frame-options-invalid.cgi: Added.
* http/tests/security/XFrameOptions/x-frame-options-invalid-expected.txt: Added.
* http/tests/security/XFrameOptions/x-frame-options-invalid.html: Added.
    New test with an invalid frame option value.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133868 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] DumpRenderTree does not honor the shouldDumpPixels boolean argument of dumpAsText
https://bugs.webkit.org/show_bug.cgi?id=101485

Reviewed by Csaba Osztrogonác.

[Qt] DumpRenderTree does not honor the shouldDumpPixels boolean argument of dumpAsText

Support dumpAsText(true) which means we should not dump a render tree
but should dump pixels. All other platforms already support it.

* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::DumpRenderTree::dump):
* DumpRenderTree/qt/TestRunnerQt.cpp:
(TestRunner::reset):
(TestRunner::dumpAsText):
* DumpRenderTree/qt/TestRunnerQt.h:
(TestRunner::shouldDumpPixels):
(TestRunner):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133869 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

Adding a failure expectation for editing/execCommand/switch-list-type-with-orphaned-li.html,
the test regressed in r133820
Further rebaselining after r133834.

* platform/gtk/TestExpectations:
* platform/gtk/fast/canvas/fillText-shadow-expected.txt:
* platform/gtk/svg/css/group-with-shadow-expected.png:
* platform/gtk/svg/css/group-with-shadow-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133870 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][MiniBrowser] Add encoding detector option.
https://bugs.webkit.org/show_bug.cgi?id=100931

Patch by Kangil Han <kangil.han@samsung.com> on 2012-11-08
Reviewed by Gyuyoung Kim.

Source/WebKit2:

Add triggering Settings::setUsesEncodingDetector for WK2 UI process.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

Add a runtime option to enable/disable encoding detector.

* MiniBrowser/efl/main.c:
(window_create):
(elm_main):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133871 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed Gardening.

Skip a failing after r133820. Added new baseline after 133834. Update expectation after 133638.

* platform/qt/TestExpectations:
* platform/qt/css3/filters/effect-reference-expected.png:
* platform/qt/css3/filters/effect-reference-expected.txt:
* platform/qt/svg/css/group-with-shadow-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133872 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Reduce the number of clean builds
https://bugs.webkit.org/show_bug.cgi?id=100844

Reviewed by Tor Arne Vestbø.

A change in any Qt project file shouldn't trigger clean
build always, but only if the incremental build failed.

* Scripts/webkitdirs.pm:
(buildQMakeProjects):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133873 268f45cc-cd09-0410-ab3c-d52691b4dbfc
GraphicsSurfaceGLX needs to query the drawable for YInversion.
https://bugs.webkit.org/show_bug.cgi?id=101472

After r133049 the WebGL content is now displayed upside down
for the Qt port. We cannot just apply a generic rule, that
the content needs to be flipped upside down.
Instead we have to query GLX to tell us, if the drawable's
framebuffer is y-inverted.

Reviewed by Kenneth Rohde Christiansen.

* platform/graphics/surfaces/qt/GraphicsSurfaceGLX.cpp:
(WebCore::GraphicsSurfacePrivate::textureIsYInverted):
(GraphicsSurfacePrivate):
(WebCore::GraphicsSurface::platformPaintToTextureMapper):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r133859.
http://trac.webkit.org/changeset/133859
https://bugs.webkit.org/show_bug.cgi?id=101526

Breaks EFL bots test execution.

.:

* Source/cmake/OptionsEfl.cmake:

Tools:

* Scripts/webkitperl/FeatureList.pm:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133875 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r133865.
http://trac.webkit.org/changeset/133865
https://bugs.webkit.org/show_bug.cgi?id=101579

dependent patch has been rolled out. (Requested by drott on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-11-08

* Source/cmake/OptionsEfl.cmake:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133876 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed fixed inspector frontend compilation

* inspector/front-end/DataGrid.js:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133877 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Use smart pointers in EwkContext more actively
https://bugs.webkit.org/show_bug.cgi?id=101565

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-11-08
Reviewed by Gyuyoung Kim.

Since we're using WebContext instead of WKContext starting r133844 we should
use smart pointers accordingly including PassRefPtr.

* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::EwkContext):
(EwkContext::~EwkContext):
(EwkContext::create):
(EwkContext::cookieManager):
(EwkContext::ensureFaviconDatabase):
(EwkContext::setFaviconDatabaseDirectoryPath):
(EwkContext::addVisitedLink):
(EwkContext::setCacheModel):
(EwkContext::cacheModel):
* UIProcess/API/efl/ewk_context_private.h:
(EwkContext):
(EwkContext::webContext):
* UIProcess/API/efl/ewk_database_manager_private.h:
(Ewk_Database_Manager::create):
* UIProcess/API/efl/ewk_storage_manager_private.h:
(Ewk_Storage_Manager::create):
* UIProcess/efl/DownloadManagerEfl.cpp:
(WebKit::DownloadManagerEfl::DownloadManagerEfl):
* UIProcess/efl/RequestManagerClientEfl.cpp:
(WebKit::RequestManagerClientEfl::RequestManagerClientEfl):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133878 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Use explicit constructor in BatteryProvider, DownloadManagerEfl, NetworkInfoProvider
https://bugs.webkit.org/show_bug.cgi?id=101567

Patch by Jinwoo Song <jinwoo7.song@samsung.com> on 2012-11-08
Reviewed by Kentaro Hara.

Added explicit keyword in constructors of BatteryProvider, DownloadManagerEfl,
and NetworkInfoProvider in order to avoid implicit type conversion.

* UIProcess/efl/BatteryProvider.h:
(BatteryProvider):
* UIProcess/efl/DownloadManagerEfl.h:
(DownloadManagerEfl):
* UIProcess/efl/NetworkInfoProvider.h:
(NetworkInfoProvider):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Add ewk_context_additional_plugin_path_set API
https://bugs.webkit.org/show_bug.cgi?id=101530

Patch by KwangYong Choi <ky0.choi@samsung.com> on 2012-11-08
Reviewed by Gyuyoung Kim.

Add ewk_context_additional_plugin_path_set() to set additional plugin directory.

* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::setAdditionalPluginPath):
(ewk_context_additional_plugin_path_set):
* UIProcess/API/efl/ewk_context.h:
* UIProcess/API/efl/ewk_context_private.h:
(EwkContext):
* UIProcess/API/efl/tests/test_ewk2_context.cpp:
(TEST_F):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Console: "time" and "timeEnd" should have same number of required arguments
https://bugs.webkit.org/show_bug.cgi?id=101451

Patch by Eugene Klyuchnikov <eustas.bug@gmail.com> on 2012-11-08
Reviewed by Yury Semikhatsky.

Solution: make console.time "title" parameter mandatory.

* page/Console.idl: Changed parameter specification.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133881 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Unreviewed build fix after r133880.

* UIProcess/API/efl/ewk_context.cpp:
(EwkContext::setAdditionalPluginPath):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133882 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening.

Adding a platform-specific baseline for the test added in r133868.

* platform/gtk/http/tests/security/XFrameOptions: Added.
* platform/gtk/http/tests/security/XFrameOptions/x-frame-options-invalid-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133883 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Warn in the inspector console when using dpi and dpcm units outside of media="print"
https://bugs.webkit.org/show_bug.cgi?id=100865

Patch by Alexander Shalamov <alexander.shalamov@intel.com> on 2012-11-08
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

Added function that prints warning to inspector console whenever dpi or dpcm CSS units
are used for screen media.

Test: fast/media/mq-resolution-dpi-dpcm-warning.html

* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::setMediaQueries):
* css/MediaList.cpp:
(WebCore):
(WebCore::addResolutionWarningMessageToConsole):
(WebCore::reportMediaQueryWarningIfNeeded):
* css/MediaList.h:
(WebCore):
* css/MediaQueryMatcher.cpp:
(WebCore::MediaQueryMatcher::matchMedia):
* css/StyleSheetContents.cpp:
(WebCore::StyleSheetContents::parserAppendRule):

LayoutTests:

Added layout test that checks if warning is printed to console when dpi or dpcm CSS
units are used for resolution media feature.

* fast/media/mq-resolution-dpi-dpcm-warning-expected.txt: Added.
* fast/media/mq-resolution-dpi-dpcm-warning.html: Added.

Skip tests for platforms that doesn't support resolution media feature.

* platform/chromium/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133884 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Add option to disable rulers (Elements panel)
https://bugs.webkit.org/show_bug.cgi?id=101554

Reviewed by Pavel Feldman.

A new setting, showMetricsRulers, has been introduced (off by default, so users need to opt in to see the rulers).
The setting value is passed into InspectorDOMAgent, down to the InspectorOverlayPage, which affects the drawGrid() and
drawRulers() calls. As a side effect, the issue when the rulers were painted for elements having no renderers has been fixed.

No new tests, a UI change.

* English.lproj/localizedStrings.js: Add "Show rulers" string.
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject): Copy over the showRulers value.
* inspector/InspectorOverlay.cpp:
(WebCore::buildObjectForHighlight): Copy over the showRulers value.
* inspector/InspectorOverlay.h:
(HighlightConfig): Add |bool showRulers|.
(WebCore::Highlight::Highlight): Initialize fields.
(Highlight): Add |bool showRulers|.
(WebCore::Highlight::setDataFromConfig):
* inspector/InspectorOverlayPage.html:
* inspector/front-end/DOMAgent.js: Make use of WebInspector.settings.showMetricsRulers when building the highlight DTO.
* inspector/front-end/Settings.js: Add showMetricsRulers.
* inspector/front-end/SettingsScreen.js:
(WebInspector.GenericSettingsTab): Add "Show rulers" checkbox in the Elements panel section.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133885 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Rebaseline svg/css/group-with-shadow.svg
https://bugs.webkit.org/show_bug.cgi?id=101592

Unreviewed gardening.

Test svg/css/group-with-shadow.svg has to be rebaselined after r133834.

Patch by Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com> on 2012-11-08

* platform/efl-wk1/svg/css/group-with-shadow-expected.png: Removed.
* platform/efl/svg/css/group-with-shadow-expected.png: Added.
* platform/efl/svg/css/group-with-shadow-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@133886 268f45cc-cd09-0410-ab3c-d52691b4dbfc