Extend WKRenderObject and WKRenderLayer with some more useful data
https://bugs.webkit.org/show_bug.cgi?id=139006

Reviewed by Sam Weinig.
Source/WebCore:

Export WebCore::RenderLayerBacking::backingStoreMemoryEstimate() const.

* WebCore.exp.in:

Source/WebKit2:

Implement WKRenderLayerGetBackingStoreMemoryEstimate,
WKRenderObjectCopyTextSnippet and WKRenderObjectGetTextLength for improved
RenderLayer and RenderTree display in clients of the C SPI.

* Shared/API/c/WKRenderLayer.cpp:
(WKRenderLayerGetBackingStoreMemoryEstimate):
* Shared/API/c/WKRenderLayer.h:
* Shared/API/c/WKRenderObject.cpp:
(WKRenderObjectCopyTextSnippet):
(WKRenderObjectGetTextLength):
* Shared/API/c/WKRenderObject.h:
* Shared/UserMessageCoders.h:
(WebKit::UserMessageEncoder::baseEncode):
(WebKit::UserMessageDecoder::baseDecode):
* Shared/WebRenderLayer.cpp:
(WebKit::WebRenderLayer::create):
(WebKit::WebRenderLayer::WebRenderLayer):
* Shared/WebRenderLayer.h:
(WebKit::WebRenderLayer::backingStoreMemoryEstimate):
* Shared/WebRenderObject.cpp:
(WebKit::WebRenderObject::create):
(WebKit::WebRenderObject::WebRenderObject):
* Shared/WebRenderObject.h:
(WebKit::WebRenderObject::textSnippet):
(WebKit::WebRenderObject::textLength):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Use segment vector for FlowContents
https://bugs.webkit.org/show_bug.cgi?id=139015

Reviewed by Zalan Bujtas.

And FlowContents::Segment struct and use it.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::removeTrailingWhitespace):
(WebCore::SimpleLineLayout::createLineRuns):
(WebCore::SimpleLineLayout::splitRunsAtRendererBoundary):

    Use segments.
    If there is only one segment there is nothing to do. Bail out.

* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::initializeSegments):

    Move initialization to a function so m_segments can be const.
    Don't add empty end segment, handle the end case in code.

(WebCore::SimpleLineLayout::FlowContents::FlowContents):
(WebCore::SimpleLineLayout::FlowContents::textWidth):

    Simplify and use segments.

(WebCore::SimpleLineLayout::FlowContents::segmentForPositionSlow):

    Replace hand-rolled binary search with std::lower_bounds.

(WebCore::SimpleLineLayout::FlowContents::segmentForRenderer):
(WebCore::SimpleLineLayout::FlowContents::appendNextRendererContentIfNeeded):
(WebCore::SimpleLineLayout::FlowContents::renderer): Deleted.
(WebCore::SimpleLineLayout::FlowContents::resolveRendererPositions): Deleted.
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::hasOneSegment):
(WebCore::SimpleLineLayout::FlowContents::length):
(WebCore::SimpleLineLayout::FlowContents::isEnd):
(WebCore::SimpleLineLayout::FlowContents::isEndOfContent): Deleted.

    Renamed.

(WebCore::SimpleLineLayout::FlowContents::segmentForPosition):

    Inline the fast path.

* rendering/SimpleLineLayoutResolver.cpp:
(WebCore::SimpleLineLayout::RunResolver::Run::text):
(WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176510 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Page previews should have titles
https://bugs.webkit.org/show_bug.cgi?id=139020

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKViewPrivate.h:
Declare -_titleForPreviewOfURL:.

* UIProcess/API/mac/WKView.mm:
(-[WKView _titleForPreviewOfURL:]):
Stub implementation.

* UIProcess/mac/WKActionMenuController.mm:
(+[WKPagePreviewViewController previewPadding]):
Account for the title height.
(-[WKPagePreviewViewController loadView]):
Set correct autoresize masks on some views; create and configure a title view that is
horizontally and vertically centered.
(-[WKActionMenuController pagePreviewViewController:titleForPreviewOfURL:]):
WKPagePreviewViewControllerDelegate method; wrap -[WKView _titleForPreviewOfURL:].

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176511 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] Add API to override the default local storage directory
https://bugs.webkit.org/show_bug.cgi?id=138828

Reviewed by Gustavo Noronha Silva.

Source/WebKit2:

Add WebKitWebContext:local-storage-directory construct-only
property. If not provided the default will be used.

* UIProcess/API/gtk/WebKitWebContext.cpp:
(webkitWebContextGetProperty):
(webkitWebContextSetProperty):
(webkitWebContextConstructed):
(webkit_web_context_class_init):

Tools:

Add test to check that the local storage directory is created at
the path given on construction.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebContext.cpp:
(testWebContextConfiguration):
(beforeAll):
* TestWebKitAPI/gtk/WebKit2Gtk/TestMain.h:
(Test::Test):
(Test::~Test): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176512 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] WebKitWebView is created with the wrong web context when using webkit_web_view_new_with_related_view()
https://bugs.webkit.org/show_bug.cgi?id=139023

Reviewed by Sergio Villar Senin.

Source/WebKit2:

The WebKitWebContext is a construct only property, so it's always
set to the default value when not provided, during the
construction. When a related-view is used to create a new web view
we should ensure that the same web context is used for the new web
view, instead of the default. We should also ignore any web
context given as construct parameter if a related view is alos provided.

* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewConstructed): Do not set the context to the default
one when not given during construction.
(webkitWebViewSetProperty): Only use the default web context when
not provided as construct parameter and there isn't a related view.

Tools:

Rename WebKitWebView/default-context as WebKitWebView/web-context
and check we are always using the right context for new web views.

* TestWebKitAPI/Tests/WebKit2Gtk/TestWebKitWebView.cpp:
(testWebViewWebContext):
(beforeAll):
(testWebViewDefaultContext): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176513 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Utilize Eail library to support accessibility in EFL
https://bugs.webkit.org/show_bug.cgi?id=137742

Reviewed by Gyuyoung Kim.

Source/WebKit2:

Initialize EAIL module so that all the listeners and atk-bridge started properly.
Dynamic loading of EAIL help us to avoid elementary dependencies in WebKit.

* WebProcess/efl/WebProcessMainEfl.cpp:
(eailLibraryPath): reads path provided by ACCESSIBILITY_EAIL_LIBRARY_PATH variable.
(eail):

Tools:

Eail, atk-bridge, at-spi2 are not mandatory modules for webkit-efl. They are rather optional.

* efl/jhbuild-optional.modules: Added.
* efl/jhbuild.modules:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176514 268f45cc-cd09-0410-ab3c-d52691b4dbfc
AX: [ATK] Unskip the skipped ATK tests in roles-exposed.html
https://bugs.webkit.org/show_bug.cgi?id=139016

Reviewed by Chris Fleizach.

Source/WebCore:

There was one test that could not be unskipped without making a change
for that one to pass: mapping DocumentRegionRole to ATK_ROLE_PANEL. The
rest of the "fix" is just unskipping tests for ATK and updating the test
expectations.

No new tests needed.

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):

LayoutTests:

* accessibility/roles-exposed.html: Unskipped a bunch of tests.
* platform/efl/accessibility/roles-exposed-expected.txt: Updated for unskipped tests.
* platform/gtk/accessibility/roles-exposed-expected.txt: Updated for unskipped tests.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176515 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed. Fix GTK+ make distcheck.

* gtk/manifest.txt: Remove deleted files.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
.:
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.1 release.

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit2:
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.7.2 release.

* gtk/NEWS: Add release notes for 2.7.2.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176517 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Webkit2 doesnt build on powerpc 32 bits
https://bugs.webkit.org/show_bug.cgi?id=130837

Reviewed by Carlos Garcia Campos.

Check if libatomic is needed in order to use std::atomic, and add
it to the list of WebKit2 libraries.

* PlatformGTK.cmake:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176519 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Curl] Compile error in ResourceHandleManager.cpp.
https://bugs.webkit.org/show_bug.cgi?id=139026

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-11-24
Reviewed by Brent Fulgham.

The parameter types of the constructor of the Timer class has changed.

* platform/network/curl/ResourceHandleManager.cpp:
(WebCore::ResourceHandleManager::ResourceHandleManager):
(WebCore::ResourceHandleManager::downloadTimerCallback):
* platform/network/curl/ResourceHandleManager.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176520 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove unused Style struct from SimpleLineLayout.cpp
https://bugs.webkit.org/show_bug.cgi?id=139027

Reviewed by Sam Weinig.

It was moved to FlowContents.

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::Style::Style): Deleted.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] REGRESSION(176066): It made all performance tests fail
https://bugs.webkit.org/show_bug.cgi?id=138865

Reviewed by Csaba Osztrogonác.

Since r176066, there are crash because evas_gl_surface is destroyed with
invalid evas_gl instance after evas_gl is destroyed.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::~EwkView):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176522 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Stub out user content WebView member functions on Windows
https://bugs.webkit.org/show_bug.cgi?id=139033

Reviewed by Sam Weinig.

These functions aren't used by any clients and hinder getting rid of PageGroup.
If it turns out they're still needed we can copy the user content controller code from Mac Legacy WebKit.

* WebView.cpp:
(WebView::addUserScriptToGroup):
(WebView::addUserStyleSheetToGroup):
(WebView::removeUserScriptFromGroup):
(WebView::removeUserStyleSheetFromGroup):
(WebView::removeUserScriptsFromGroup):
(WebView::removeUserStyleSheetsFromGroup):
(WebView::removeAllUserContentFromGroup):
(toStringVector): Deleted.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176523 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move the '-webkit-box-reflext' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=139008

Reviewed by Anders Carlsson.

* css/CSSPropertyNames.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertReflection):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176524 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Simple line layout: fast/text/simple-lines-multiple-renderers test has the wrong content.
https://bugs.webkit.org/show_bug.cgi?id=139036

Swap simple-lines-multiple-renderers.html and simple-lines-multiple-renderers-expected.html

* fast/text/simple-lines-multiple-renderers-expected.html:
* fast/text/simple-lines-multiple-renderers.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176525 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] update-webkitgtk-libs fails to build fontconfig
https://bugs.webkit.org/show_bug.cgi?id=139032

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2014-11-24
Reviewed by Martin Robinson.

On Fedora, if docbook-utils is installed but docbook-utils-pdf is not,
fontconfig will try to generate documentation and fail.

* gtk/install-dependencies:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176526 268f45cc-cd09-0410-ab3c-d52691b4dbfc
SimpleLineLayout::canUseFor() should iterate through RenderTexts to check if their content is eligible for simple line layout.
https://bugs.webkit.org/show_bug.cgi?id=139007

Reviewed by Antti Koivisto.

Source/WebCore:

Tests: fast/text/simple-line-layout-multiple-renderers-non-breaking-space.html
       fast/text/simple-line-layout-multiple-renderers-with-float.html

* rendering/SimpleLineLayout.cpp:
(WebCore::SimpleLineLayout::canUseFor):

LayoutTests:

* fast/text/simple-line-layout-multiple-renderers-non-breaking-space-expected.html: Added.
* fast/text/simple-line-layout-multiple-renderers-non-breaking-space.html: Added.
* fast/text/simple-line-layout-multiple-renderers-with-float-expected.html: Added.
* fast/text/simple-line-layout-multiple-renderers-with-float.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176527 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Avoid String concatenation with line break iterator
https://bugs.webkit.org/show_bug.cgi?id=139034

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: fast/text/simple-lines-multiple-renderers-break.html

* rendering/SimpleLineLayoutFlowContents.cpp:
(WebCore::SimpleLineLayout::initializeSegments):

    Include String too so it doesn't need to be fetched from the renderer.

(WebCore::SimpleLineLayout::FlowContents::FlowContents):
(WebCore::SimpleLineLayout::FlowContents::findNextBreakablePosition):

    Make this iterative instead of recursive.
    Uset setPriorContext to provide previous characters instead of concatenating
    the string from all the previous segments.

(WebCore::SimpleLineLayout::findNextNonWhitespace):
(WebCore::SimpleLineLayout::FlowContents::findNextNonWhitespacePosition):

    Search using segments instead of the concatenated string.

(WebCore::SimpleLineLayout::FlowContents::textWidth):
(WebCore::SimpleLineLayout::FlowContents::segmentIndexForPositionSlow):
(WebCore::SimpleLineLayout::FlowContents::runWidth):
(WebCore::SimpleLineLayout::FlowContents::segmentForPositionSlow): Deleted.
(WebCore::SimpleLineLayout::FlowContents::appendNextRendererContentIfNeeded): Deleted.
(WebCore::SimpleLineLayout::FlowContents::nextNonWhitespacePosition): Deleted.
* rendering/SimpleLineLayoutFlowContents.h:
(WebCore::SimpleLineLayout::FlowContents::characterAt):
(WebCore::SimpleLineLayout::FlowContents::isNewlineCharacter):
(WebCore::SimpleLineLayout::FlowContents::segmentIndexForPosition):
(WebCore::SimpleLineLayout::FlowContents::segmentForPosition):

LayoutTests:

Test that there is no implicit break point between Text nodes.

* fast/text/simple-lines-multiple-renderers-break-expected.html: Added.
* fast/text/simple-lines-multiple-renderers-break.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@176528 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move :placeholder-shown out of experimental
https://bugs.webkit.org/show_bug.cgi?id=138998

Reviewed by Andreas Kling.

The pseudo class :placeholder-shown is used by the inspector, disabling it breaks
the sidebar.

The implementation has been stable for a while, we can move it to stable.

* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText):
* css/CSSSelector.h:
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOne):
* css/SelectorPseudoClassAndCompatibilityElementMap.in:
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::addPseudoClassType):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementHasPlaceholderShown):


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