[EFL][WK2] Add APIs to create, delete and get ewk_context.
https://bugs.webkit.org/show_bug.cgi?id=89186

Patch by Eunmi Lee <eunmi15.lee@samsung.com> on 2012-09-20
Reviewed by Kenneth Rohde Christiansen.

Provide APIs to create ewk_context with or without injected bundle path
and delete created ewk_context.
Additionally, the ewk_view can be created with ewk_context which is not
default context, so we have to get ewk_context from ewk_view.

* PlatformEfl.cmake:
* UIProcess/API/efl/PageClientImpl.cpp:
(WebKit::PageClientImpl::handleDownloadRequest):
* UIProcess/API/efl/ewk_context.cpp:
(_Ewk_Context):
(_Ewk_Context::_Ewk_Context):
(ewk_context_ref):
(ewk_context_unref):
(ewk_context_new):
(ewk_context_new_with_injected_bundle_path):
* UIProcess/API/efl/ewk_context.h:
* UIProcess/API/efl/ewk_view.cpp:
(_Ewk_View_Private_Data):
(_Ewk_View_Private_Data::_Ewk_View_Private_Data):
(_ewk_view_priv_del):
(_ewk_view_initialize):
(ewk_view_context_get):
* UIProcess/API/efl/ewk_view.h:
* UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp: Added.
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp:
(EWK2UnitTest::EWK2UnitTestEnvironment::injectedBundleSample):
(EWK2UnitTest):
* UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h:
(EWK2UnitTestEnvironment):
* UIProcess/API/efl/tests/test_ewk2_context.cpp:
(TEST_F):
* UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp:
(TEST_F):
* UIProcess/API/efl/tests/test_ewk2_view.cpp:
(TEST_F):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129134 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Unreviewed gardening. Unskip fast/exclusions tests, because they pass now.

* platform/qt/Skipped:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove isStartColumn in the border collapsing code
https://bugs.webkit.org/show_bug.cgi?id=97024

Reviewed by Abhishek Arya.

isStartColumn is embedding the same information as prevCell. As we need to compute it
in most of the cases, we may as well just reuse them.

While touching this code, I cleaned up the code by removing some unneeded checks and renaming
some variables in preparation for bug 79272.

Refactoring covered by existing collapsing borders tests.

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeCollapsedStartBorder):
Removed |isStartColumn|.

(WebCore::RenderTableCell::computeCollapsedEndBorder):
Added a comment about why |isEndColumn| is needed. Also cleaned up this code to be
consistent with computeCollapsedStartBorder.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] run-api-tests should not buffer test stdout
https://bugs.webkit.org/show_bug.cgi?id=88474

Reviewed by Philippe Normand.

* Scripts/run-gtk-tests:
(TestRunner._run_test_command): Use os.forkpty() instead of
subprocess.Popen() so that gtest sends the output with colors to
stdout. Use common.parse_output_lines() to parse the output and
write it to stdout while it's read.
(TestRunner._run_test_command.parse_line): Parse the line to get
the test pid and write the line to stdout.
(TestRunner._run_test_command.waitpid): Helper function to call
waitpid handling EINTR.
(TestRunner._run_test_command.return_code_from_exit_status):
Helper function to convert exit status of test commands to a
return code.
* gtk/common.py:
(parse_output_lines): Helper function that uses select to read
the given file descriptor and call the given callback for every
line read.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129138 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] DRT does not support --dump-all-pixels flag
https://bugs.webkit.org/show_bug.cgi?id=95098

Reviewed by Dirk Pranke.

Add support for the --pixel-tests and shorthand -p option in Chromium DumpRenderTree. Use
of this flag causes pixel results to be created for all tests, regardless of
individual test options. If an individual test provides a pixel hash it will be used,
otherwise the hash will be empty. This replaces a previously defined but unused option
--dump-all-pixels, and is useful primarily when debugging DRT instances.

* DumpRenderTree/chromium/DumpRenderTree.cpp:
(runTest): Add a parameter and code to force pixel results for the test.
(main): Add parameter handling for --pixels-test and -p, and remove --dump-all-pixels.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129139 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Safari 6 notifications' onclick handlers can't call window.open()
https://bugs.webkit.org/show_bug.cgi?id=96959
<rdar://problem/12132427>

Reviewed by Darin Adler.

Source/WebKit2:

The click is not being treated as a user gesture when the message is sent to the web process.

* WebProcess/Notifications/WebNotificationManager.cpp:
(WebKit::WebNotificationManager::didClickNotification): Gets called when the user clicks on the
platform notification. Set UserGestureIndicator to show the click event is due to user gesture.

LayoutTests:

The test shows and clicks a platform notification. The onclick handler calls window.open(),
which in turn calls a function on the main page to confirm that a window was opened.

* http/tests/notifications/legacy/window-show-on-click-expected.txt: Added.
* http/tests/notifications/legacy/window-show-on-click.html: Added.
* http/tests/notifications/resources/window-show-on-click.html: Added.
* http/tests/notifications/window-show-on-click-expected.txt: Added.
* http/tests/notifications/window-show-on-click.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129140 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] ControlsPanel string is not localized in LocalizedStringsGtk
https://bugs.webkit.org/show_bug.cgi?id=96502

Patch by Joanmarie Diggs <jdiggs@igalia.com> on 2012-09-20
Reviewed by Chris Fleizach.

Source/WebCore:

Adds the ControlsPanel string to the strings localized in LocalizedStringsGtk.

Test: platform/gtk/accessibility/media-controls-panel-title.html

* platform/gtk/LocalizedStringsGtk.cpp:
(WebCore::localizedMediaControlElementString):

LayoutTests:

Added a new test to verify that the accessible object associated with the
MediaControlsPanel has the expected accessible name.

* platform/gtk/accessibility/media-controls-panel-title-expected.txt: Added.
* platform/gtk/accessibility/media-controls-panel-title.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129141 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Rewrite confusing call sequence layout tests
https://bugs.webkit.org/show_bug.cgi?id=97051

Reviewed by Tony Chang.

Rewrite some convoluted and hard to understand/maintain tests in a more idiomatic fashion.
This patch maintains the bulk of the non-standard output to verify that the tests have not
changed in behavior; follow-ups will make the output more standard and split the tests
into separate files.

* storage/indexeddb/factory-deletedatabase-interactions-expected.txt:
* storage/indexeddb/open-close-version-expected.txt:
* storage/indexeddb/resources/factory-deletedatabase-interactions.js:
* storage/indexeddb/resources/open-close-version.js:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129142 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Support paths in Content Security Policy directives.
https://bugs.webkit.org/show_bug.cgi?id=89750

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

Source/WebCore:

In CSP 1.0, paths are simply ignored: 'script-src
http://example.com/path/to/a/file' would allow script to be loaded from
http://example.com/path/to/a/file/javascript.js, but also from
http://example.com/javascript.js.

This patch is an experimental implementation of more granular path
support in CSP source lists as proposed in the current editor's draft of
CSP 1.1. Paths are treated as specifying directories in which resources
can be found, and are implicitly terminated with a '/': in other words,
'script-src http://a.com/path' is the same as
'script-src http://a.com/path/'. Moreover, paths cannot contain either
'?' or '#' characters.

This is implemented outside the CSP_NEXT flag. All ports will be
effected.

Spec: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#matching

Tests: http/tests/security/contentSecurityPolicy/source-list-parsing-paths-01.html
       http/tests/security/contentSecurityPolicy/source-list-parsing-paths-02.html

* page/ContentSecurityPolicy.cpp:
(WebCore::CSPSource::CSPSource):
    Store a path along with each CSP source.
(WebCore::CSPSource::matches):
    Check the path when comparing a URL to the source.
(WebCore::CSPSource::pathMatches):
    Compare the URL-decoded version of the resource to validate against
    the source's stored path. If the resource's path begins with the
    stored path, then it matches! If not, it doesn't.
(CSPSource):
    Store a path along with each CSP source.
(WebCore::CSPSourceList::parse):
    Pass a 'path' in when creating CSPSource objects.
(WebCore::CSPSourceList::parsePath):
    Actually parse the path, flagging errors if '?' or '#' are present,
    URL-decoding the result, and ensuring that a terminal '/' is
    added if necessary.
(WebCore::CSPSourceList::addSourceSelf):
    Ensure that 'self' sources have an empty path.
* page/ContentSecurityPolicy.h:
    Dropping the "ignored path component" console warning.

LayoutTests:

* http/tests/security/contentSecurityPolicy/source-list-parsing-05-expected.txt:
* http/tests/security/contentSecurityPolicy/source-list-parsing-05.html:
* http/tests/security/contentSecurityPolicy/source-list-parsing-06-expected.txt:
* http/tests/security/contentSecurityPolicy/source-list-parsing-06.html:
    The behavior of these tests changes based on the new functionality.
* http/tests/security/contentSecurityPolicy/source-list-parsing-paths-01-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/source-list-parsing-paths-01.html: Added.
* http/tests/security/contentSecurityPolicy/source-list-parsing-paths-02-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/source-list-parsing-paths-02.html: Added.
    New tests for various path cases.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129143 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Prevent reading stale data from InlineTextBoxes
https://bugs.webkit.org/show_bug.cgi?id=94750

Reviewed by Eric Seidel.

Text from dirty InlineTextBoxes should never be read or used. This change enforces this
design goal by forcefully zero-ing out the start and length of InlineTextBoxes when 
they're being marked dirty. It also adds asserts to accessors for those members.

This change involves making markDirty virtual. Running the line-layout performance test
as well as profiling resizing the html5 spec showed negligable impact with this change.

No new tests as this doesn't change any proper behavior.

* rendering/InlineBox.h:
(WebCore::InlineBox::markDirty): Making virtual to allow InlineTextBox to overload and
zero out its start and length.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::markDirty): Zeroing out start and length when we mark the box dirty.
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::start): Adding an assert when we hit this case.
(WebCore::InlineTextBox::end): Ditto.
(WebCore::InlineTextBox::len): Ditto.
(WebCore::InlineTextBox::offsetRun): Ditto.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129144 268f45cc-cd09-0410-ab3c-d52691b4dbfc
MediaStream API: Extend UserMediaRequest with a ownerDocument method
https://bugs.webkit.org/show_bug.cgi?id=97095

Reviewed by Adam Barth.

Source/WebCore:

Chromium need to know exactly which frame called getUserMedia so that it can
clean away the stream when the frame goes away.
Since that information is available in webkit add an accessor method.

Chromium mock class extended to test the added method.

* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::ownerDocument):
(WebCore):
* Modules/mediastream/UserMediaRequest.h:
(WebCore):
(UserMediaRequest):

Source/WebKit/chromium:

Chromium need to know exactly which frame called getUserMedia so that it can clean
away the stream when the frame goes away.
Since that information is available in webkit add an accessor method.

Also taking the opportunity to remove an unused deprecated method,
and adding asserts in case the object is empty.

* public/WebUserMediaRequest.h:
(WebKit):
(WebUserMediaRequest):
* src/WebUserMediaRequest.cpp:
(WebKit::WebUserMediaRequest::ownerDocument):

Tools:

Extending WebUserMediaClientMock to check that the owning document is valid,
and that the document has a frame.

* DumpRenderTree/chromium/WebUserMediaClientMock.cpp:
(WebKit::WebUserMediaClientMock::requestUserMedia):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129145 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[MathML] Increase visual space around fraction parts, italic variables, and operators
https://bugs.webkit.org/show_bug.cgi?id=97228

Reviewed by Eric Seidel.

Source/WebCore: 

This makes MathML more readable, and more in agreement with Firefox and TeX.

Tested by existing tests.

* css/mathml.css:
(mfrac > :first-child):
(mfrac > :last-child):
(mfrac):
(mi):
(msub > mi:first-child, msubsup > mi:first-child):
    - Subscripts don't need to move right after an italic <mi>.
(msubsup > mi:first-child + * + *):
    - Superscripts do need to move right after an italic <mi>.
(math > mo, mrow > mo, msqrt > mo, mtd > mo):
    - These are ok values for now. It will be better to use different values for different operators, as the FIXME says.
(math > mo:last-child, mrow > mo:last-child, msqrt > mo:last-child, mtd > mo:last-child):
    - Prefix and postfix operators, including fences, generally get less spacing than infix operators.
        
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::createMathMLOperator):
    - Usually the separator is a comma or semicolon, so we only put space after it for now.
(WebCore::RenderMathMLFenced::makeFences):
(WebCore::RenderMathMLFenced::addChild):
(WebCore::RenderMathMLFenced::styleDidChange):
* rendering/mathml/RenderMathMLFenced.h:
(RenderMathMLFenced):
        
* rendering/mathml/RenderMathMLFraction.cpp:
(WebCore):
(WebCore::RenderMathMLFraction::updateFromElement):
    - gDenominatorPad is now handled by mathml.css.
        
* rendering/mathml/RenderMathMLSubSup.cpp:
(WebCore):
(WebCore::RenderMathMLSubSup::fixScriptsStyle):
    - gSubsupScriptMargin is now handled by mathml.css.

LayoutTests: 

* platform/mac/mathml/presentation/attributes-expected.png:
* platform/mac/mathml/presentation/attributes-expected.txt:
* platform/mac/mathml/presentation/fenced-expected.png:
* platform/mac/mathml/presentation/fenced-expected.txt:
* platform/mac/mathml/presentation/fenced-mi-expected.png:
* platform/mac/mathml/presentation/fenced-mi-expected.txt:
* platform/mac/mathml/presentation/fractions-expected.png:
* platform/mac/mathml/presentation/fractions-expected.txt:
* platform/mac/mathml/presentation/fractions-vertical-alignment-expected.png:
* platform/mac/mathml/presentation/fractions-vertical-alignment-expected.txt:
* platform/mac/mathml/presentation/mo-expected.png:
* platform/mac/mathml/presentation/mo-expected.txt:
* platform/mac/mathml/presentation/mo-stretch-expected.png:
* platform/mac/mathml/presentation/mo-stretch-expected.txt:
* platform/mac/mathml/presentation/mroot-pref-width-expected.png:
* platform/mac/mathml/presentation/mroot-pref-width-expected.txt:
* platform/mac/mathml/presentation/over-expected.png:
* platform/mac/mathml/presentation/over-expected.txt:
* platform/mac/mathml/presentation/roots-expected.png:
* platform/mac/mathml/presentation/roots-expected.txt:
* platform/mac/mathml/presentation/row-alignment-expected.png:
* platform/mac/mathml/presentation/row-alignment-expected.txt:
* platform/mac/mathml/presentation/row-expected.png:
* platform/mac/mathml/presentation/row-expected.txt:
* platform/mac/mathml/presentation/style-expected.png:
* platform/mac/mathml/presentation/style-expected.txt:
* platform/mac/mathml/presentation/sub-expected.txt:
* platform/mac/mathml/presentation/subsup-expected.png:
* platform/mac/mathml/presentation/subsup-expected.txt:
* platform/mac/mathml/presentation/sup-expected.png:
* platform/mac/mathml/presentation/sup-expected.txt:
* platform/mac/mathml/presentation/tokenElements-expected.png:
* platform/mac/mathml/presentation/tokenElements-expected.txt:
* platform/mac/mathml/presentation/under-expected.txt:
* platform/mac/mathml/presentation/underover-expected.png:
* platform/mac/mathml/presentation/underover-expected.txt:
* platform/mac/mathml/xHeight-expected.png:
* platform/mac/mathml/xHeight-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION: layout test results doesn't show diffs
https://bugs.webkit.org/show_bug.cgi?id=97182

Reviewed by Ojan Vafai.

Go back to storing TEXT, AUDIO, and IMAGE+TEXT in results.json
so that results.html (and hopefully garden-o-matic) can
determine which things actually failed. However, we keep mapping
these results to Failure so that we still only have a single
expectation type for them.

* Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py:
(JSONLayoutResultsGenerator):
* Scripts/webkitpy/layout_tests/models/test_expectations.py:
(TestExpectationParser):
(TestExpectations):
(TestExpectations.result_was_expected):
* Scripts/webkitpy/layout_tests/models/test_failures.py:
(determine_result_type):
* Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py:
(MainTest.test_missing_and_unexpected_results):
(MainTest.test_retrying_and_flaky_tests):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129148 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Add WK2-specific result for this frame-flattening test (seems to be a scrollbars difference).
Tracked by https://bugs.webkit.org/show_bug.cgi?id=97240.

* platform/mac-wk2/fast/frames/flattening/frameset-flattening-simple-expected.txt: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129149 268f45cc-cd09-0410-ab3c-d52691b4dbfc
CSP reports should send an empty 'referrer' rather than nothing.
https://bugs.webkit.org/show_bug.cgi?id=97233

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

Source/WebCore:

Currently, if a protected resource doesn't have a referrer, then any
Content Security Policy violations send a report that doesn't contain
a referrer attribute. It's arguably friendlier to developers to include
an explicitly empty attribute.

This new behavior is covered by updates to existing test expectations
around the reporting functionality.

* page/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation):
    Drop the 'if', and always write out a referrer.

LayoutTests:

* http/tests/security/contentSecurityPolicy/report-and-enforce-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-uri-cross-origin-expected.txt:
* http/tests/security/contentSecurityPolicy/report-blocked-uri-expected.txt:
* http/tests/security/contentSecurityPolicy/report-only-expected.txt:
* http/tests/security/contentSecurityPolicy/report-only-from-header-expected.txt:
* http/tests/security/contentSecurityPolicy/report-uri-expected.txt:
    Adding the empty 'referrer' attribute to the expectations.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129150 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Marking http/tests/media/video-referer.html as flakey in TestExpectations
https://bugs.webkit.org/show_bug.cgi?id=34331

* platform/mac/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, rolling out r129144.
http://trac.webkit.org/changeset/129144
https://bugs.webkit.org/show_bug.cgi?id=97244

causing lots of assertions in tests (Requested by smfr on
#webkit).

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

* rendering/InlineBox.h:
(WebCore::InlineBox::markDirty):
* rendering/InlineTextBox.cpp:
* rendering/InlineTextBox.h:
(WebCore::InlineTextBox::start):
(WebCore::InlineTextBox::end):
(WebCore::InlineTextBox::len):
(WebCore::InlineTextBox::offsetRun):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129152 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Remove now passing test.
* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129153 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement absolutely positioned flex items
https://bugs.webkit.org/show_bug.cgi?id=93798

Reviewed by Ojan Vafai.

Source/WebCore:

Previously, we treated absolutely positioned flex items as a 0x0 placeholder element.
Now we position the 0x0 placeholder where the next item would go. This causes the
following changes:
- justify-content: space-{around,between} no longer change due to the existence of absolutely positioned flex items.
- alignment doesn't change the placement of absolutely positioned flex items.
- auto margins in the alignment direction don't do anything on absolutely positioned flex items.

Test: css3/flexbox/position-absolute-children.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::availableAlignmentSpaceForChild): Absolutely positioned flex items should not use this.
(WebCore::RenderFlexibleBox::updateAutoMarginsInCrossAxis): Absolutely positioned flex items should not use this.
(WebCore::initialJustifyContentOffset): If there are no flex items, space-around should center an absolutely positioned flex item.
(WebCore::RenderFlexibleBox::numberOfInFlowPositionedChildren): Helper method for helping to compute space-between and space-around.
(WebCore::RenderFlexibleBox::layoutAndPlaceChildren): Fix spacing when space-between or space-around.
(WebCore::RenderFlexibleBox::layoutColumnReverse): Fix spacing when space-between or space-around.
(WebCore::RenderFlexibleBox::alignChildren): Treat absolutely positioned children like flex-start.
* rendering/RenderFlexibleBox.h: numberOfInFlowPositionedChildren method.

LayoutTests:

Fix position of absolute flex items and add some additional tests.

* css3/flexbox/align-absolute-child-expected.txt:
* css3/flexbox/align-absolute-child.html: New test cases and update expectations.
* css3/flexbox/position-absolute-child.html: Update expectations.
* css3/flexbox/position-absolute-children-expected.txt: Added.
* css3/flexbox/position-absolute-children.html: Added. Tests having only absolutely positioned children.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@129154 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] Fix production builds

Unreviewed trivial fix: Follow up r129119 and avoid clobbering LIBS through the use of LIBS_PRIVATE.

Otherwise the libQtWebKit.prl file for example contains -lWebKit1 -lWebCore, etc.

* qmake/mkspecs/features/functions.prf:

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