CSP directives containing invalid characters should log an error.
https://bugs.webkit.org/show_bug.cgi?id=92487

Patch by Mike West <mkwst@chromium.org> on 2012-07-27
Reviewed by Adam Barth.

Source/WebCore:

Unknown directive names are currently logged, but we exit the directive
parser early without logging if we hit an invalid character inside a
directive. `script-src: ...`, for example, was ignored without letting
the developer know what happened. This patch changes that behavior,
logging the whole name (in this case `script-src:`) as an unknown
directive.

Test: http/tests/security/contentSecurityPolicy/directive-parsing-04.html

* page/ContentSecurityPolicy.cpp:
(WebCore::CSPDirectiveList::parseDirective):

LayoutTests:

* http/tests/security/contentSecurityPolicy/directive-parsing-03-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/directive-parsing-04-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/directive-parsing-04.html: Added.
    Adding a test specifically for `script-src: ...` which bit me, and
    updating test #3, which now has a better error message.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium-Android] NRWT better handling of DRT deadlocks and crashes
https://bugs.webkit.org/show_bug.cgi?id=92299

Patch by Xianzhu Wang <wangxianzhu@chromium.org> on 2012-07-27
Reviewed by Dirk Pranke.

1. Changed the deadlock detector thread target from a method of driver to a function to avoid its reference to the
   current driver (see the bug for the problem of the reference.
2. Let the deadlock detector thread exit early when the normal_startup_event is set to avoid it from blocking the main thread when the main thread is exiting.
3. Extracted common loop until timeout logic into ChromiumAndroidDriver._loop_with_timeout().
4. Use the "for i in range(n)" style suggested by dpranke in https://bugs.webkit.org/show_bug.cgi?id=89124 in several functions.

* Scripts/webkitpy/layout_tests/port/chromium_android.py:
(ChromiumAndroidPort.__init__):
(ChromiumAndroidPort._run_adb_command): Reduced the verbose output.
(ChromiumAndroidDriver.__init__):
(ChromiumAndroidDriver._loop_with_timeout): Extracted common loop until timeout logic here.
(ChromiumAndroidDriver._all_pipes_created):
(ChromiumAndroidDriver._remove_all_pipes):
(ChromiumAndroidDriver._start): Changed the retry loop style.
(ChromiumAndroidDriver._start_once): Changed the loop style and code related to deadlock detector.
(ChromiumAndroidDriver._start_once.deadlock_detector): Moved the original ChromiumAndroidDriver._deadlock_detector() here.
(ChromiumAndroidDriver.stop): Changed the loop style.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123900 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: InspectorPageAgent should ascertain document to be non-null in updateViewMetrics()
https://bugs.webkit.org/show_bug.cgi?id=92476

Patch by Vivek Galatage <vivekgalatage@gmail.com> on 2012-07-27
Reviewed by Pavel Feldman.

InspectorPageAgent should check for document object being null. As pages created with blank URL might
not have the document object, this causes a crash.

No new tests as added null check.

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::updateViewMetrics):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Allow front_end to be loaded into an iframe
https://bugs.webkit.org/show_bug.cgi?id=92437

Patch by John J. Barton <johnjbarton@johnjbarton.com> on 2012-07-27
Reviewed by Pavel Feldman.

This change only affects 'embedders' of the inspector/front_end. No change of function for WebKit ports.

* inspector/front-end/ExtensionAPI.js:
Replace window.top with window.parent two places. When WebInspector is loaded as the main window content,
then extension iframes have window.top === window.parent; when WebInspector is loaded as an iframe, then
extensions are iframes in iframes and we need to use a relative address window.parent.
(injectedExtensionAPI.ExtensionViewImpl.dispatchShowEvent):
(injectedExtensionAPI.ExtensionViewImpl):
(injectedExtensionAPI.ExtensionServerClient):
WebKit/chromium/scripts/generate_devtools_extension_api.py:
The current number of frames is used in a dynamically created identifier. Again we replace 'top' by
window.parent.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123902 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Fix build warning in WebEventConversion.cpp
https://bugs.webkit.org/show_bug.cgi?id=92517

Patch by Gyuyoung Kim <gyuyoung.kim@samsung.com> on 2012-07-27
Reviewed by Darin Adler.

There is a build warning related to comparison between signed and unsigned integer expressions.

* Shared/WebEventConversion.cpp:
(WebKit::WebKit2PlatformTouchEvent::WebKit2PlatformTouchEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Hit testing near a column break can return a result from an adjacent column when there is leading
https://bugs.webkit.org/show_bug.cgi?id=92524

Reviewed by Anders Carlsson.

Source/WebCore: 

The fix for <http://webkit.org/b/92311> relied on the existence of a pagination strut for
detecting that a line was at the beginning of a new column. However, when a line naturally
falls at the beginning of a column, there is no pagination strut, and the check failed.

Test: fast/multicol/hit-test-end-of-column-with-line-height.html

* rendering/InlineFlowBox.h:
(WebCore::InlineFlowBox::InlineFlowBox): Added initializer for new member variable.
(InlineFlowBox): Added m_isFirstAfterPageBreak member variable.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::positionForPointWithInlineChildren): Changed the test for whether a
line was at the beginning of a column from relying on a pagination strut to checking
isFirstAfterPageBreak(). Also refined the hit test itself to include the leading above such
a line.
(WebCore::RenderBlock::adjustLinePositionForPagination): Added calls to
setIsFirstAfterPageBreak() to first reset this flag, then set it to true if necessary.
* rendering/RootInlineBox.h:
(WebCore::RootInlineBox::isFirstAfterPageBreak): Added this accessor.
(WebCore::RootInlineBox::setIsFirstAfterPageBreak): Ditto.

LayoutTests: 

* fast/multicol/hit-test-end-of-column-with-line-height-expected.txt: Added.
* fast/multicol/hit-test-end-of-column-with-line-height.html: Added.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123904 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Increase inline storage for JSFinalObjects by one
https://bugs.webkit.org/show_bug.cgi?id=92526

Reviewed by Geoffrey Garen.

Now that we've removed the inheritorID from objects, we can increase our inline storage for JSFinalObjects on 
64-bit platforms by 1.

* llint/LowLevelInterpreter.asm: Change the constant.
* runtime/PropertyOffset.h: Change the constant.
(JSC):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123905 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed build fix.

Source/WTF:

Use MathExtras.h and the non std:: versions of isnan and signbit.

* wtf/MediaTime.cpp:
(WTF::MediaTime::createWithFloat):
(WTF::MediaTime::createWithDouble):

Tools:

Wrap MSVC-specific fixes is a COMPILER() check, not a PLATFORM() check.

* TestWebKitAPI/Tests/WTF/MediaTime.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123906 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Show the unavailable plug-in indicator for Java applets as well
https://bugs.webkit.org/show_bug.cgi?id=92521

Reviewed by Sam Weinig.

Source/WebCore:

Now that <applet> behaves more like <embed> and <object>, make sure that we show the unavailable plug-in indicator
and call the correct error callbacks if we fail to instantiate the plug-in.

* WebCore.exp.in:
Export a symbol needed by WebKit2.

* html/HTMLAppletElement.cpp:
(WebCore::HTMLAppletElement::HTMLAppletElement):
Set the correct service type.

* loader/SubframeLoader.cpp:
(WebCore::SubframeLoader::createJavaAppletWidget):
Enable the unavailable plug-in indicator if we fail to create the java applet widget.

Source/WebKit/mac:

Check if the Java plug-in is blocked before trying to instantiate it.

* WebCoreSupport/WebFrameLoaderClient.mm:

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::unavailablePluginButtonClicked):
This can now be called on applet elements as well.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::createJavaAppletWidget):
Get the MIME type from the applet element.

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