Web Inspector: draw pie-chart based on memory data received from backend
https://bugs.webkit.org/show_bug.cgi?id=87737

Reviewed by Pavel Feldman.

Added pie chart for memory data received from inspector memory agent.

* WebCore.gypi:
* WebCore.vcproj/WebCore.vcproj:
* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.NativeMemorySnapshotView):
(WebInspector.NativeMemoryProfileType):
(WebInspector.NativeMemoryProfileType.prototype.buttonClicked.didReceiveMemorySnapshot):
(WebInspector.NativeMemoryProfileType.prototype.buttonClicked):
(WebInspector.NativeMemoryProfileHeader):
(WebInspector.MemoryBlockViewProperties):
(WebInspector.MemoryBlockViewProperties._initialize):
(WebInspector.MemoryBlockViewProperties._forMemoryBlock):
(WebInspector.NativeMemoryPieChart):
(WebInspector.NativeMemoryPieChart.prototype.onResize):
(WebInspector.NativeMemoryPieChart.prototype._updateSize):
(WebInspector.NativeMemoryPieChart.prototype._addBlockLabels):
(WebInspector.NativeMemoryPieChart.prototype._paint.paintPercentAndLabel):
(WebInspector.NativeMemoryPieChart.prototype._paint):
(WebInspector.NativeMemoryPieChart.prototype._clear):
* inspector/front-end/WebKit.qrc:
* inspector/front-end/nativeMemoryProfiler.css: Added.
(.memory-pie-chart-container):
(.memory-pie-chart):
(.memory-blocks-list .swatch):
(.memory-blocks-list):
(.memory-blocks-list .item):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119197 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: change type of injected script id from long to int
https://bugs.webkit.org/show_bug.cgi?id=87837

Reviewed by Pavel Feldman.

Changed injected script id type from long to int so that we don't
lose precision when sending the id over the protocol.

* bindings/js/JSInjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::createInjectedScript):
(WebCore::InjectedScriptManager::injectedScriptFor):
* bindings/v8/custom/V8InjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::createInjectedScript):
(WebCore::InjectedScriptManager::injectedScriptFor):
* inspector/InjectedScriptManager.cpp:
(WebCore::InjectedScriptManager::injectedScriptForId):
(WebCore::InjectedScriptManager::injectedScriptIdFor):
(WebCore::InjectedScriptManager::injectScript):
* inspector/InjectedScriptManager.h:
(InjectedScriptManager):
* inspector/PageRuntimeAgent.cpp:
(WebCore::PageRuntimeAgent::notifyContextCreated):

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

* platform/gtk/fast/dom/gc-attribute-node-expected.txt: Added.
* platform/gtk/test_expectations.txt: Also mark fast/replaced/border-radius-clip.html as flaky.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119200 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: add RenderArena sizes to the memory pie-chart
https://bugs.webkit.org/show_bug.cgi?id=87971

Reviewed by Pavel Feldman.

Added allocated and used sizes of page render arenas to the memory
report returned by the InspectorMemoryAgent. Total allocated size of
the inspected page's render arenas will be displayed on the memory
pie-chart.

* inspector/InspectorMemoryAgent.cpp:
(MemoryBlockName):
(WebCore):
(WebCore::renderTreeInfo):
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.MemoryBlockViewProperties._initialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119201 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed GTK gardening, add missing text and image baselines for
fast/images/png-suite/test.html. Add MISSING expectations for two
placeholder-in-text-area tests - the placeholder text does not appear
in text areas (known bug).

* platform/gtk/fast/images/png-suite: Added.
* platform/gtk/fast/images/png-suite/test-expected.png: Added.
* platform/gtk/fast/images/png-suite/test-expected.txt: Added.
* platform/gtk/test_expectations.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119202 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: expose MemoryCache statistics in the inspector protocol
https://bugs.webkit.org/show_bug.cgi?id=87984

Reviewed by Pavel Feldman.

Added MemoryCache statistics to Memory.getProcessMemoryDistribution command
result. Corresponding sector is added to the memory pie-chart.

* inspector/InspectorMemoryAgent.cpp:
(MemoryBlockName):
(WebCore):
(WebCore::addMemoryBlockFor):
(WebCore::memoryCacheInfo):
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):
* inspector/front-end/NativeMemorySnapshotView.js:
(WebInspector.MemoryBlockViewProperties._initialize):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
sandbox directive in X-WebKit-CSP header unable to create a unique origin
https://bugs.webkit.org/show_bug.cgi?id=88014

Reviewed by Ryosuke Niwa.

Source/WebCore:

We process the HTTP headers for a response after we create a document
object for the response. Previously, the SecurityOrigin of a document
was determined when the document was created, which meant that the
sandbox directive in CSP couldn't create a unique origin.

In this patch, we transition to a unique origin when we start enforcing
the SandboxOrigin bit. This patch is more complicated than you might
expect because we redundantly store the SecurityOrigin object in
DOMWindow. Removing that redundant state is
https://bugs.webkit.org/show_bug.cgi?id=75793.

The CSP sandbox directive is defined in
http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-1.0-specification.html
by reference to
http://www.whatwg.org/specs/web-apps/current-work/#forced-sandboxing-flag-set.
The relation between sandbox and unique origin arises from
http://www.whatwg.org/specs/web-apps/current-work/#origin-0.

Test: http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header-control.html
      http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header.html
      http/tests/security/contentSecurityPolicy/sandbox-in-http-header-control.html
      http/tests/security/contentSecurityPolicy/sandbox-in-http-header.html

* dom/Document.cpp:
(WebCore::Document::didUpdateSecurityOrigin):
(WebCore::Document::initContentSecurityPolicy):
* dom/Document.h:
(Document):
* dom/SecurityContext.cpp:
(WebCore::SecurityContext::enforceSandboxFlags):
(WebCore):
(WebCore::SecurityContext::didUpdateSecurityOrigin):
* dom/SecurityContext.h:
(SecurityContext):

LayoutTests:

* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header-control.html: Added.
* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header.html: Added.
* http/tests/security/contentSecurityPolicy/sandbox-in-http-header-control-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/sandbox-in-http-header-control.html: Added.
* http/tests/security/contentSecurityPolicy/resources/sandbox.php: Added.
* http/tests/security/contentSecurityPolicy/sandbox-in-http-header-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/sandbox-in-http-header.html: Added.
* http/tests/security/contentSecurityPolicy/sandbox-allow-scripts-in-http-header-control-expected.txt: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119204 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Platform][Decimal] UInt128::operator/= calls makeUInt128 with wrong argument order
https://bugs.webkit.org/show_bug.cgi?id=88044

Reviewed by Kent Tamura.

Source/WebCore:

This patch fixed wrong argument of makeUInt128 in UInt128::operator/= to get right
result for decimal multiplication.

Test: WebKit/chromium/tests/DecimalTest.cpp: Add new a new test case.

* platform/Decimal.cpp:
(WebCore::DecimalPrivate::UInt128::operator/=):

Source/WebKit/chromium:

* tests/DecimalTest.cpp:
(TEST_F): Add a new test for multiplication.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119205 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening, update expected files.

* platform/qt-5.0/fast/forms/HTMLOptionElement_label06-expected.png:
* platform/qt-5.0/fast/forms/HTMLOptionElement_label06-expected.txt:
* platform/qt-5.0/fast/forms/HTMLOptionElement_label07-expected.png:
* platform/qt-5.0/fast/forms/HTMLOptionElement_label07-expected.txt:
* platform/qt-5.0/fast/forms/form-element-geometry-expected.png:
* platform/qt-5.0/fast/forms/form-element-geometry-expected.txt:
* platform/qt-5.0/fast/forms/menulist-separator-painting-expected.png:
* platform/qt-5.0/fast/forms/menulist-separator-painting-expected.txt:
* platform/qt-5.0/fast/forms/select-baseline-expected.png:
* platform/qt-5.0/fast/forms/select-baseline-expected.txt:
* platform/qt-5.0/fast/forms/selectlist-minsize-expected.png:
* platform/qt-5.0/fast/forms/selectlist-minsize-expected.txt:
* platform/qt-5.0/fast/replaced/three-selects-break-expected.png:
* platform/qt-5.0/fast/replaced/three-selects-break-expected.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ASSERT(m_fontSelector->document()) is bogus and should be removed
https://bugs.webkit.org/show_bug.cgi?id=88053

Reviewed by Abhishek Arya.

This ASSERT was introduced in http://trac.webkit.org/changeset/97402
together with a branch that handled the case of the ASSERT firing.
This ASSERT fires when running tests on Android (which runs with
ASSERTs enabled). The ASSERT appears to be bogus, so this patch removes
it.

* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::getFontData):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119207 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Implement PlatformStrategies
https://bugs.webkit.org/show_bug.cgi?id=86946

Source/WebCore:

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-06-01
Reviewed by Carlos Garcia Campos.

* PlatformEfl.cmake: Add PlatformStrategies.cpp file to the build system.
Also, remove PluginDataEfl.cpp because the same functionality is now
implemented in PlatformStrategiesEfl.cpp.

Source/WebKit:

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-06-01
Reviewed by Carlos Garcia Campos.

* PlatformEfl.cmake: Add PlatformStrategiesEfl file to the build
system.

Source/WebKit/efl:

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-06-01
Reviewed by Carlos Garcia Campos.

Enable PLATFORM_STRATEGIES for EFL platform.

* WebCoreSupport/PlatformStrategiesEfl.cpp: Added, code was moved
from platform/PluginDataEfl.
(PlatformStrategiesEfl::initialize): Initialize platform strategies.
(PlatformStrategiesEfl::PlatformStrategiesEfl):
(PlatformStrategiesEfl::createCookiesStrategy): Return this.
(PlatformStrategiesEfl::createPluginStrategy): Ditto.
(PlatformStrategiesEfl::createVisitedLinkStrategy): Ditto.
(PlatformStrategiesEfl::createPasteboardStrategy): Return 0, since
PasteboardStrategy is only used by mac code for now.
(PlatformStrategiesEfl::notifyCookiesChanged):
(PlatformStrategiesEfl::refreshPlugins): Refresh the plugin
database. Code executes only when NETSCAPE_PLUGIN_API is ON.
(PlatformStrategiesEfl::getPluginInfo): Initialize plugins and
populate the given vector with plugins information. Code executes
only when NETSCAPE_PLUGIN_API is ON.
(PlatformStrategiesEfl::isLinkVisited): Return whether the given
hash is a visited link of the page group.
(PlatformStrategiesEfl::addVisitedLink): Add the given hash to the
page group visited links.
* WebCoreSupport/PlatformStrategiesEfl.h: Added.
(PlatformStrategiesEfl):
* ewk/ewk_main.cpp: Initialize PlatformStrategiesEfl.
(_ewk_init_body):

Source/WTF:

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-06-01
Reviewed by Carlos Garcia Campos.

* wtf/Platform.h: Enable PLATFORM_STRATEGIES for EFL platform.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119208 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Move input element's spinner style tests to test_expectations.txt
https://bugs.webkit.org/show_bug.cgi?id=88054

Unreviewed EFL gardening.

Patch by Alexander Shalamov <alexander.shalamov@intel.com> on 2012-06-01

* platform/efl/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119209 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Clean up our viewport handling mess
https://bugs.webkit.org/show_bug.cgi?id=87977

Reviewed by Simon Hausmann.

Consolidated functionality from QQuickWebViewPrivate* into
ViewportInteractionEngine that belongs there, in preparation for
renaming ViewportInteractionEngine in the future.

Remove unneeded methods and move others to private.

* UIProcess/API/qt/qquickwebview.cpp:
(QQuickWebViewFlickablePrivate::QQuickWebViewFlickablePrivate):
(QQuickWebViewFlickablePrivate::onComponentComplete):
(QQuickWebViewFlickablePrivate::didChangeViewportProperties):
(QQuickWebViewFlickablePrivate::updateViewportSize):
(QQuickWebViewFlickablePrivate::_q_resume):
(QQuickWebViewFlickablePrivate::pageDidRequestScroll):
* UIProcess/API/qt/qquickwebview_p.h:
* UIProcess/API/qt/qquickwebview_p_p.h:
(QQuickWebViewPrivate):
(QQuickWebViewFlickablePrivate):
* UIProcess/qt/QtViewportInteractionEngine.cpp:
(WebKit::ViewportUpdateDeferrer::~ViewportUpdateDeferrer):
(WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
(WebKit::QtViewportInteractionEngine::viewportAttributesChanged):
(WebKit::QtViewportInteractionEngine::pageContentsSizeChanged):
(WebKit::QtViewportInteractionEngine::pageItemPositionChanged):
(WebKit::QtViewportInteractionEngine::pageContentPositionRequested):
(WebKit::QtViewportInteractionEngine::visibleContentsRect):
(WebKit):
(WebKit::QtViewportInteractionEngine::informVisibleContentChange):
(WebKit::QtViewportInteractionEngine::viewportItemSizeChanged):
* UIProcess/qt/QtViewportInteractionEngine.h:
(WebKit):
(QtViewportInteractionEngine):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119210 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Make Qt Creator aware of files in webkitpy/perl for easy editing

Reviewed by Simon Hausmann.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119211 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [REGRESSION] Bad layout of "Override device metrics" controls in the Settings dialog
https://bugs.webkit.org/show_bug.cgi?id=88074

Reviewed by Yury Semikhatsky.

The "Override device metrics" controls are placed in a table, which gets too narrow. Give it a
"white-space: nowrap" to avoid wrapping individual cells.

* inspector/front-end/SettingsScreen.js:
(WebInspector.SettingsScreen.prototype._createDeviceMetricsElement):
* inspector/front-end/elementsPanel.css:
* inspector/front-end/inspector.css:
(.nowrap):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119212 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION(r109729) [Form] Rendering of select/optgroup/option combination is too slow.
https://bugs.webkit.org/show_bug.cgi?id=88059

Reviewed by Kent Tamura.

This patch changes to share RenderStyle object among the "option"
elements to improve rendering performance and reducing memory usage
of RenderStyle.

No new tests. This patch doesn't change behavior but rendering performance.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::canShareStyleWithElement): Check attribute value
mismatching for "option" element.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed.  Rolled DEPS.

* DEPS:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119214 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Gardening failure case on EFL build bot
https://bugs.webkit.org/show_bug.cgi?id=88067

Unreviewed EFL gardening after r119196.

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-06-01

* platform/efl/test_expectations.txt:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119215 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Support drawing a pattern with a translation.
https://bugs.webkit.org/show_bug.cgi?id=87025

Source/WebCore:

Drawing an SVG pattern that has its x or y attribute set
works by setting a transform on the Pattern.
We would ignore this by only taking into account the texture and
target rect.

Reviewed by Kenneth Rohde Christiansen.

test: svg/W3C-SVG-1.1-SE/pservers-pattern-04-f.svg

* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::drawRepeatPattern): refactored to take into account the translation set on the brush.
(WebCore::GraphicsContext::fillRect):

LayoutTests:

Reviewed by Kenneth Rohde Christiansen.

* platform/qt-5.0/svg/W3C-SVG-1.1-SE/pservers-pattern-04-f-expected.png: fix the expected pixel result

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@119216 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Make conversion from QString to WTF::String (and back again) ~free

https://bugs.webkit.org/show_bug.cgi?id=87847

Instead of copying the QString data when converting to a WTF::String we
make the WTF::String adopt the QString data by introducing a new buffer
ownership type, and pointing the internal WTF::StringImpl 16-bit data
member to the string data managed by QStringData.

We make sure to reference the QStringData when adopting, so that the
data will stay alive, and then dereference it when the WTF::StringImpl
is deleted, which will free the QStringData (either straight away, if
we're the only one holding a reference still, or later, when the ref
count goes to 0).

In the case of going back from a WTF::String to a QString we can cheat
a bit (avoid a copy), if we know that the WTF::String was adopted from
a QString, since it's then just a matter of having the QString adopt
the existing QStringData (just like a regular QString copy).

If the WTF::String buffer is not owned by QStringData, eg a regular
8-bit or 16-bit string/substring, we have to fall back to copying,
as before (though there are potential optimization tricks we can
apply here later on).

Reviewed by Gavin Barraclough.

* wtf/qt/StringQt.cpp:
* wtf/text/StringImpl.cpp:
* wtf/text/StringImpl.h:

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