summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-09-20 21:53:03 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-09-20 21:53:03 +0200
commit171053e5e2efcdc6854d8b3a0d06934fb309e53d (patch)
treec85f2b00cea9c5b648ad9945be3155d29d96395f
parent0b3dc81d9701aea106543b49bde511a5697cdd6e (diff)
downloadqtwebkit-171053e5e2efcdc6854d8b3a0d06934fb309e53d.tar.gz
Imported WebKit commit f35955d976484e57fd83612794aefd58fdaa6337 (http://svn.webkit.org/repository/webkit/trunk@129155)
New snapshot with prospective build fix
-rw-r--r--Source/WebCore/ChangeLog241
-rw-r--r--Source/WebCore/Modules/mediastream/UserMediaRequest.cpp11
-rw-r--r--Source/WebCore/Modules/mediastream/UserMediaRequest.h2
-rw-r--r--Source/WebCore/css/mathml.css46
-rw-r--r--Source/WebCore/page/ContentSecurityPolicy.cpp49
-rw-r--r--Source/WebCore/page/ContentSecurityPolicy.h1
-rw-r--r--Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp2
-rw-r--r--Source/WebCore/rendering/RenderFlexibleBox.cpp49
-rw-r--r--Source/WebCore/rendering/RenderFlexibleBox.h3
-rw-r--r--Source/WebCore/rendering/RenderTableCell.cpp30
-rw-r--r--Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp20
-rw-r--r--Source/WebCore/rendering/mathml/RenderMathMLFenced.h4
-rw-r--r--Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp3
-rw-r--r--Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp4
-rw-r--r--Source/WebKit/chromium/ChangeLog20
-rw-r--r--Source/WebKit/chromium/public/WebUserMediaRequest.h6
-rw-r--r--Source/WebKit/chromium/src/WebUserMediaRequest.cpp32
-rw-r--r--Source/WebKit2/ChangeLog57
-rw-r--r--Source/WebKit2/PlatformEfl.cmake4
-rw-r--r--Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_context.cpp42
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_context.h61
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.cpp12
-rw-r--r--Source/WebKit2/UIProcess/API/efl/ewk_view.h9
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp38
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h1
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp34
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp8
-rw-r--r--Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp7
-rw-r--r--Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp3
-rw-r--r--Tools/ChangeLog89
-rw-r--r--Tools/DumpRenderTree/chromium/DumpRenderTree.cpp16
-rw-r--r--Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp6
-rwxr-xr-xTools/Scripts/run-gtk-tests54
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py8
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py14
-rw-r--r--Tools/Scripts/webkitpy/layout_tests/models/test_failures.py14
-rwxr-xr-xTools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py4
-rw-r--r--Tools/gtk/common.py31
-rw-r--r--Tools/qmake/mkspecs/features/functions.prf12
41 files changed, 902 insertions, 155 deletions
diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog
index 5ad2101fa..3d3589e67 100644
--- a/Source/WebCore/ChangeLog
+++ b/Source/WebCore/ChangeLog
@@ -1,3 +1,244 @@
+2012-09-20 Tony Chang <tony@chromium.org>
+
+ Implement absolutely positioned flex items
+ https://bugs.webkit.org/show_bug.cgi?id=93798
+
+ Reviewed by Ojan Vafai.
+
+ 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.
+
+2012-09-20 Sheriff Bot <webkit.review.bot@gmail.com>
+
+ 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).
+
+ * rendering/InlineBox.h:
+ (WebCore::InlineBox::markDirty):
+ * rendering/InlineTextBox.cpp:
+ * rendering/InlineTextBox.h:
+ (WebCore::InlineTextBox::start):
+ (WebCore::InlineTextBox::end):
+ (WebCore::InlineTextBox::len):
+ (WebCore::InlineTextBox::offsetRun):
+
+2012-09-20 Mike West <mkwst@chromium.org>
+
+ CSP reports should send an empty 'referrer' rather than nothing.
+ https://bugs.webkit.org/show_bug.cgi?id=97233
+
+ Reviewed by Adam Barth.
+
+ 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.
+
+2012-09-20 David Barton <dbarton@mathscribe.com>
+
+ [MathML] Increase visual space around fraction parts, italic variables, and operators
+ https://bugs.webkit.org/show_bug.cgi?id=97228
+
+ Reviewed by Eric Seidel.
+
+ 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.
+
+2012-09-20 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Extend UserMediaRequest with a ownerDocument method
+ https://bugs.webkit.org/show_bug.cgi?id=97095
+
+ Reviewed by Adam Barth.
+
+ 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):
+
+2012-09-20 Levi Weintraub <leviw@chromium.org>
+
+ 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.
+
+2012-09-20 Mike West <mkwst@chromium.org>
+
+ Support paths in Content Security Policy directives.
+ https://bugs.webkit.org/show_bug.cgi?id=89750
+
+ Reviewed by Adam Barth.
+
+ 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.
+
+2012-09-20 Joanmarie Diggs <jdiggs@igalia.com>
+
+ [GTK] ControlsPanel string is not localized in LocalizedStringsGtk
+ https://bugs.webkit.org/show_bug.cgi?id=96502
+
+ Reviewed by Chris Fleizach.
+
+ 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):
+
+2012-09-20 Julien Chaffraix <jchaffraix@webkit.org>
+
+ 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.
+
2012-09-20 Andrey Adaikin <aandrey@chromium.org>
Web Inspector: setPropertyValue does not work for non-finite numbers
diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
index 6c5faf4fe..e6fc2e715 100644
--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.cpp
@@ -36,6 +36,7 @@
#include "UserMediaRequest.h"
#include "Dictionary.h"
+#include "Document.h"
#include "LocalMediaStream.h"
#include "MediaStreamCenter.h"
#include "MediaStreamDescriptor.h"
@@ -69,6 +70,16 @@ UserMediaRequest::~UserMediaRequest()
{
}
+Document* UserMediaRequest::ownerDocument()
+{
+ if (m_scriptExecutionContext) {
+ ASSERT(m_scriptExecutionContext->isDocument());
+ return static_cast<Document*>(m_scriptExecutionContext);
+ }
+
+ return 0;
+}
+
void UserMediaRequest::start()
{
MediaStreamCenter::instance().queryMediaStreamSources(this);
diff --git a/Source/WebCore/Modules/mediastream/UserMediaRequest.h b/Source/WebCore/Modules/mediastream/UserMediaRequest.h
index 87ca89b7c..b53348d29 100644
--- a/Source/WebCore/Modules/mediastream/UserMediaRequest.h
+++ b/Source/WebCore/Modules/mediastream/UserMediaRequest.h
@@ -45,6 +45,7 @@
namespace WebCore {
class Dictionary;
+class Document;
class MediaStreamDescriptor;
class UserMediaController;
@@ -55,6 +56,7 @@ public:
NavigatorUserMediaSuccessCallback* successCallback() const { return m_successCallback.get(); }
NavigatorUserMediaErrorCallback* errorCallback() const { return m_errorCallback.get(); }
+ Document* ownerDocument();
void start();
diff --git a/Source/WebCore/css/mathml.css b/Source/WebCore/css/mathml.css
index 54fc8de7f..205f07688 100644
--- a/Source/WebCore/css/mathml.css
+++ b/Source/WebCore/css/mathml.css
@@ -26,18 +26,22 @@ math[display="block"] {
mo, mrow, mfenced, mfrac, msub, msup, msubsup, munder, mover, munderover, msqrt, mroot {
display: -webkit-inline-flex !important;
}
+
math, mrow, mfenced, msqrt, mroot {
-webkit-align-items: baseline;
}
msqrt > * { /* This rule is needed because of <msqrt>'s anonymous <mrow>. */
-webkit-align-self: baseline;
}
+
mo, mfrac, munder, mover, munderover {
-webkit-flex-direction: column;
}
+
munder, mover, munderover {
-webkit-align-items: center;
}
+
mfrac > * {
-webkit-align-self: center;
}
@@ -53,6 +57,17 @@ mfrac[denomalign="left"] > :last-child {
mfrac[denomalign="right"] > :last-child {
-webkit-align-self: flex-end;
}
+mfrac > :first-child {
+ -webkit-margin-after: 0.2em;
+}
+mfrac > :last-child {
+ -webkit-margin-before: 0.2em;
+}
+mfrac {
+ -webkit-margin-start: 1px;
+ -webkit-margin-end: 1px;
+}
+
msubsup > :last-child, mover > :last-child, munderover > :last-child {
-webkit-order: -1;
}
@@ -61,30 +76,27 @@ msub > * + *, msup > * + *, msubsup > * + *, munder > * + *, mover > * + *, mund
font-size: 0.75em; /* FIXME: MathML standard is 0.71em */
}
-mfenced {
- padding-left: 1px;
- padding-right: 1px;
-}
-
mi {
font-style: italic;
- padding-right: 0.1em;
+ -webkit-padding-end: 0.1em;
}
-
-mi + mrow {
- margin-left: 0.1em;
+msub > mi:first-child, msubsup > mi:first-child {
+ -webkit-padding-end: 0;
}
-
-msubsup > * {
- padding: 0px;
+msubsup > mi:first-child + * + * {
+ -webkit-margin-start: 0.14em; /* This is larger than 0.1em because the child's font-size is smaller than the <msubsup>'s. */
}
-mo, mn, mi, mtext {
- padding: 0px;
+/* FIXME: For a RenderMathMLOperator's margin-start and margin-end, or for a MathML "embellished operator", check the operator's lspace and rspace attributes,
+ and the MathML operator dictionary. */
+math > mo, mrow > mo, msqrt > mo, mtd > mo {
+ -webkit-margin-start: 0.2em;
+ -webkit-margin-end: 0.2em;
}
-
-math > mo, mrow > mo, mfenced > mo {
- padding-right: 0.1em;
+math > mo:first-child, mrow > mo:first-child, msqrt > mo:first-child, mtd > mo:first-child,
+math > mo:last-child, mrow > mo:last-child, msqrt > mo:last-child, mtd > mo:last-child {
+ -webkit-margin-start: 0.1em;
+ -webkit-margin-end: 0.1em;
}
mroot {
diff --git a/Source/WebCore/page/ContentSecurityPolicy.cpp b/Source/WebCore/page/ContentSecurityPolicy.cpp
index fbfbd7ba2..2577197a1 100644
--- a/Source/WebCore/page/ContentSecurityPolicy.cpp
+++ b/Source/WebCore/page/ContentSecurityPolicy.cpp
@@ -71,6 +71,11 @@ bool isSourceCharacter(UChar c)
return !isASCIISpace(c);
}
+bool isPathComponentCharacter(UChar c)
+{
+ return c != '?' && c != '#';
+}
+
bool isHostCharacter(UChar c)
{
return isASCIIAlphanumeric(c) || c == '-';
@@ -132,10 +137,11 @@ static void skipWhile(const UChar*& position, const UChar* end)
class CSPSource {
public:
- CSPSource(const String& scheme, const String& host, int port, bool hostHasWildcard, bool portHasWildcard)
+ CSPSource(const String& scheme, const String& host, int port, const String& path, bool hostHasWildcard, bool portHasWildcard)
: m_scheme(scheme)
, m_host(host)
, m_port(port)
+ , m_path(path)
, m_hostHasWildcard(hostHasWildcard)
, m_portHasWildcard(portHasWildcard)
{
@@ -147,7 +153,7 @@ public:
return false;
if (isSchemeOnly())
return true;
- return hostMatches(url) && portMatches(url);
+ return hostMatches(url) && portMatches(url) && pathMatches(url);
}
private:
@@ -165,6 +171,16 @@ private:
}
+ bool pathMatches(const KURL& url) const
+ {
+ if (m_path.isEmpty())
+ return true;
+
+ String path = decodeURLEscapeSequences(url.path());
+
+ return path.startsWith(m_path, false);
+ }
+
bool portMatches(const KURL& url) const
{
if (m_portHasWildcard)
@@ -189,6 +205,7 @@ private:
String m_scheme;
String m_host;
int m_port;
+ String m_path;
bool m_hostHasWildcard;
bool m_portHasWildcard;
@@ -287,9 +304,7 @@ void CSPSourceList::parse(const UChar* begin, const UChar* end)
continue;
if (scheme.isEmpty())
scheme = m_policy->securityOrigin()->protocol();
- if (!path.isEmpty())
- m_policy->reportIgnoredPathComponent(m_directiveName, String(beginSource, position - beginSource), path);
- m_list.append(CSPSource(scheme, host, port, hostHasWildcard, portHasWildcard));
+ m_list.append(CSPSource(scheme, host, port, path, hostHasWildcard, portHasWildcard));
} else
m_policy->reportInvalidSourceExpression(m_directiveName, String(beginSource, position - beginSource));
@@ -474,16 +489,23 @@ bool CSPSourceList::parseHost(const UChar* begin, const UChar* end, String& host
return true;
}
-// FIXME: Deal with an actual path. This just sucks up everything to the end of the string.
bool CSPSourceList::parsePath(const UChar* begin, const UChar* end, String& path)
{
ASSERT(begin <= end);
ASSERT(path.isEmpty());
- if (begin == end)
+ const UChar* position = begin;
+ skipWhile<isPathComponentCharacter>(position, end);
+ // path/to/file.js?query=string || path/to/file.js#anchor
+ // ^ ^
+ if (position < end)
return false;
- path = String(begin, end - begin);
+ path = decodeURLEscapeSequences(String(begin, end - begin));
+ if (!path.endsWith('/'))
+ path = path + '/';
+
+ ASSERT(position == end && path.endsWith('/'));
return true;
}
@@ -520,7 +542,7 @@ bool CSPSourceList::parsePort(const UChar* begin, const UChar* end, int& port, b
void CSPSourceList::addSourceSelf()
{
- m_list.append(CSPSource(m_policy->securityOrigin()->protocol(), m_policy->securityOrigin()->host(), m_policy->securityOrigin()->port(), false, false));
+ m_list.append(CSPSource(m_policy->securityOrigin()->protocol(), m_policy->securityOrigin()->host(), m_policy->securityOrigin()->port(), String(), false, false));
}
void CSPSourceList::addSourceStar()
@@ -1499,8 +1521,7 @@ void ContentSecurityPolicy::reportViolation(const String& directiveText, const S
RefPtr<InspectorObject> cspReport = InspectorObject::create();
cspReport->setString("document-uri", document->url().strippedForUseAsReferrer());
String referrer = document->referrer();
- if (!referrer.isEmpty())
- cspReport->setString("referrer", referrer);
+ cspReport->setString("referrer", referrer);
if (!directiveText.isEmpty())
cspReport->setString("violated-directive", directiveText);
cspReport->setString("original-policy", header);
@@ -1550,12 +1571,6 @@ void ContentSecurityPolicy::reportInvalidNonce(const String& nonce) const
logToConsole(message);
}
-void ContentSecurityPolicy::reportIgnoredPathComponent(const String& directiveName, const String& completeSource, const String& path) const
-{
- String message = makeString("The source list for Content Security Policy directive '", directiveName, "' contains the source '", completeSource, "'. Content Security Policy 1.0 supports only schemes, hosts, and ports. Paths might be supported in the future, but for now, '", path, "' is being ignored. Be careful.");
- logToConsole(message);
-}
-
void ContentSecurityPolicy::reportInvalidSourceExpression(const String& directiveName, const String& source) const
{
String message = makeString("The source list for Content Security Policy directive '", directiveName, "' contains an invalid source: '", source, "'. It will be ignored.");
diff --git a/Source/WebCore/page/ContentSecurityPolicy.h b/Source/WebCore/page/ContentSecurityPolicy.h
index bbbce6ad4..7fb751fbf 100644
--- a/Source/WebCore/page/ContentSecurityPolicy.h
+++ b/Source/WebCore/page/ContentSecurityPolicy.h
@@ -100,7 +100,6 @@ public:
void gatherReportURIs(DOMStringList&) const;
void reportDuplicateDirective(const String&) const;
- void reportIgnoredPathComponent(const String& directiveName, const String& completeSource, const String& path) const;
void reportInvalidDirectiveValueCharacter(const String& directiveName, const String& value) const;
void reportInvalidNonce(const String&) const;
void reportInvalidPluginTypes(const String&) const;
diff --git a/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp b/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
index 5d6429da2..91b35d04b 100644
--- a/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
+++ b/Source/WebCore/platform/gtk/LocalizedStringsGtk.cpp
@@ -558,6 +558,8 @@ String localizedMediaControlElementString(const String& name)
return String::fromUTF8(_("show closed captions"));
if (name == "HideClosedCaptionsButton")
return String::fromUTF8(_("hide closed captions"));
+ if (name == "ControlsPanel")
+ return String::fromUTF8(_("media controls"));
ASSERT_NOT_REACHED();
return String();
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.cpp b/Source/WebCore/rendering/RenderFlexibleBox.cpp
index 141769041..abc73dd83 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.cpp
+++ b/Source/WebCore/rendering/RenderFlexibleBox.cpp
@@ -689,14 +689,15 @@ bool RenderFlexibleBox::hasAutoMarginsInCrossAxis(RenderBox* child)
LayoutUnit RenderFlexibleBox::availableAlignmentSpaceForChild(LayoutUnit lineCrossAxisExtent, RenderBox* child)
{
- LayoutUnit childCrossExtent = 0;
- if (!child->isOutOfFlowPositioned())
- childCrossExtent = crossAxisMarginExtentForChild(child) + crossAxisExtentForChild(child);
+ ASSERT(!child->isOutOfFlowPositioned());
+ LayoutUnit childCrossExtent = crossAxisMarginExtentForChild(child) + crossAxisExtentForChild(child);
return lineCrossAxisExtent - childCrossExtent;
}
bool RenderFlexibleBox::updateAutoMarginsInCrossAxis(RenderBox* child, LayoutUnit availableAlignmentSpace)
{
+ ASSERT(!child->isOutOfFlowPositioned());
+
bool isHorizontal = isHorizontalFlow();
Length start = isHorizontal ? child->style()->marginTop() : child->style()->marginLeft();
Length end = isHorizontal ? child->style()->marginBottom() : child->style()->marginRight();
@@ -899,7 +900,7 @@ static LayoutUnit initialJustifyContentOffset(LayoutUnit availableFreeSpace, EJu
if (justifyContent == JustifySpaceAround) {
if (availableFreeSpace > 0 && numberOfChildren)
return availableFreeSpace / (2 * numberOfChildren);
- if (availableFreeSpace < 0)
+ else
return availableFreeSpace / 2;
}
return 0;
@@ -958,25 +959,37 @@ static EAlignItems alignmentForChild(RenderBox* child)
return align;
}
+size_t RenderFlexibleBox::numberOfInFlowPositionedChildren(const OrderedFlexItemList& children) const
+{
+ size_t count = 0;
+ for (size_t i = 0; i < children.size(); ++i) {
+ RenderBox* child = children[i];
+ if (!child->isOutOfFlowPositioned())
+ ++count;
+ }
+ return count;
+}
+
void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, const OrderedFlexItemList& children, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit availableFreeSpace, WTF::Vector<LineContext>& lineContexts)
{
ASSERT(childSizes.size() == children.size());
+ size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
LayoutUnit autoMarginOffset = autoMarginOffsetInMainAxis(children, availableFreeSpace);
LayoutUnit mainAxisOffset = flowAwareBorderStart() + flowAwarePaddingStart();
- mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), childSizes.size());
+ mainAxisOffset += initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
if (style()->flexDirection() == FlowRowReverse)
mainAxisOffset += isHorizontalFlow() ? verticalScrollbarWidth() : horizontalScrollbarHeight();
LayoutUnit totalMainExtent = mainAxisExtent();
LayoutUnit maxAscent = 0, maxDescent = 0; // Used when align-items: baseline.
LayoutUnit maxChildCrossAxisExtent = 0;
+ size_t seenInFlowPositionedChildren = 0;
bool shouldFlipMainAxis = !isColumnFlow() && !isLeftToRightFlow();
for (size_t i = 0; i < children.size(); ++i) {
RenderBox* child = children[i];
if (child->isOutOfFlowPositioned()) {
prepareChildForPositionedLayout(child, mainAxisOffset, crossAxisOffset, FlipForRowReverse);
- mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), childSizes.size());
continue;
}
LayoutUnit childPreferredSize = childSizes[i] + mainAxisBorderAndPaddingExtentForChild(child);
@@ -1012,7 +1025,9 @@ void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
setFlowAwareLocationForChild(child, childLocation);
mainAxisOffset += childMainExtent + flowAwareMarginEndForChild(child);
- mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), childSizes.size());
+ ++seenInFlowPositionedChildren;
+ if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
+ mainAxisOffset += justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
}
if (isColumnFlow())
@@ -1022,27 +1037,28 @@ void RenderFlexibleBox::layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, cons
// We have to do an extra pass for column-reverse to reposition the flex items since the start depends
// on the height of the flexbox, which we only know after we've positioned all the flex items.
updateLogicalHeight();
- layoutColumnReverse(children, childSizes, crossAxisOffset, availableFreeSpace);
+ layoutColumnReverse(children, crossAxisOffset, availableFreeSpace);
}
lineContexts.append(LineContext(crossAxisOffset, maxChildCrossAxisExtent, children.size(), maxAscent));
crossAxisOffset += maxChildCrossAxisExtent;
}
-void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace)
+void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children, LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace)
{
// This is similar to the logic in layoutAndPlaceChildren, except we place the children
// starting from the end of the flexbox. We also don't need to layout anything since we're
// just moving the children to a new position.
+ size_t numberOfChildrenForJustifyContent = numberOfInFlowPositionedChildren(children);
LayoutUnit mainAxisOffset = logicalHeight() - flowAwareBorderEnd() - flowAwarePaddingEnd();
- mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), childSizes.size());
+ mainAxisOffset -= initialJustifyContentOffset(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
mainAxisOffset -= isHorizontalFlow() ? verticalScrollbarWidth() : horizontalScrollbarHeight();
+ size_t seenInFlowPositionedChildren = 0;
for (size_t i = 0; i < children.size(); ++i) {
RenderBox* child = children[i];
if (child->isOutOfFlowPositioned()) {
child->layer()->setStaticBlockPosition(mainAxisOffset);
- mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), childSizes.size());
continue;
}
mainAxisOffset -= mainAxisExtentForChild(child) + flowAwareMarginEndForChild(child);
@@ -1053,7 +1069,10 @@ void RenderFlexibleBox::layoutColumnReverse(const OrderedFlexItemList& children,
child->repaintDuringLayoutIfMoved(oldRect);
mainAxisOffset -= flowAwareMarginStartForChild(child);
- mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), childSizes.size());
+
+ ++seenInFlowPositionedChildren;
+ if (seenInFlowPositionedChildren < numberOfChildrenForJustifyContent)
+ mainAxisOffset -= justifyContentSpaceBetweenChildren(availableFreeSpace, style()->justifyContent(), numberOfChildrenForJustifyContent);
}
}
@@ -1141,6 +1160,12 @@ void RenderFlexibleBox::alignChildren(OrderIterator& iterator, const WTF::Vector
for (size_t childNumber = 0; childNumber < lineContexts[lineNumber].numberOfChildren; ++childNumber, child = iterator.next()) {
ASSERT(child);
+ if (child->isOutOfFlowPositioned()) {
+ if (style()->flexWrap() == FlexWrapReverse)
+ adjustAlignmentForChild(child, lineCrossAxisExtent);
+ continue;
+ }
+
if (updateAutoMarginsInCrossAxis(child, availableAlignmentSpaceForChild(lineCrossAxisExtent, child)))
continue;
diff --git a/Source/WebCore/rendering/RenderFlexibleBox.h b/Source/WebCore/rendering/RenderFlexibleBox.h
index 7533c58d1..fafa8be51 100644
--- a/Source/WebCore/rendering/RenderFlexibleBox.h
+++ b/Source/WebCore/rendering/RenderFlexibleBox.h
@@ -130,8 +130,9 @@ private:
void setLogicalOverrideSize(RenderBox* child, LayoutUnit childPreferredSize);
void prepareChildForPositionedLayout(RenderBox* child, LayoutUnit mainAxisOffset, LayoutUnit crossAxisOffset, PositionedLayoutMode);
+ size_t numberOfInFlowPositionedChildren(const OrderedFlexItemList&) const;
void layoutAndPlaceChildren(LayoutUnit& crossAxisOffset, const OrderedFlexItemList&, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit availableFreeSpace, WTF::Vector<LineContext>&);
- void layoutColumnReverse(const OrderedFlexItemList&, const WTF::Vector<LayoutUnit>& childSizes, LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace);
+ void layoutColumnReverse(const OrderedFlexItemList&, LayoutUnit crossAxisOffset, LayoutUnit availableFreeSpace);
void alignFlexLines(OrderIterator&, WTF::Vector<LineContext>&);
void alignChildren(OrderIterator&, const WTF::Vector<LineContext>&);
void applyStretchAlignmentToChild(RenderBox*, LayoutUnit lineCrossAxisExtent);
diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp
index 8e0cd6ef2..3c0e3e3bd 100644
--- a/Source/WebCore/rendering/RenderTableCell.cpp
+++ b/Source/WebCore/rendering/RenderTableCell.cpp
@@ -412,7 +412,6 @@ CollapsedBorderValue RenderTableCell::collapsedStartBorder(IncludeBorderColorOrN
CollapsedBorderValue RenderTableCell::computeCollapsedStartBorder(IncludeBorderColorOrNot includeColor) const
{
RenderTable* table = this->table();
- bool isStartColumn = col() == 0;
// For the start border, we need to check, in order of precedence:
// (1) Our start border.
@@ -421,12 +420,14 @@ CollapsedBorderValue RenderTableCell::computeCollapsedStartBorder(IncludeBorderC
CollapsedBorderValue result(style()->borderStart(), includeColor ? style()->visitedDependentColor(startColorProperty) : Color(), BCELL);
// (2) The end border of the preceding cell.
- if (RenderTableCell* prevCell = table->cellBefore(this)) {
- CollapsedBorderValue prevCellBorder = CollapsedBorderValue(prevCell->borderAdjoiningCellAfter(this), includeColor ? prevCell->style()->visitedDependentColor(endColorProperty) : Color(), BCELL);
- result = chooseBorder(prevCellBorder, result);
+ RenderTableCell* cellBefore = table->cellBefore(this);
+ if (cellBefore) {
+ CollapsedBorderValue cellBeforeAdjoiningBorder = CollapsedBorderValue(cellBefore->borderAdjoiningCellAfter(this), includeColor ? cellBefore->style()->visitedDependentColor(endColorProperty) : Color(), BCELL);
+ // |result| should be the 2nd argument as |cellBefore| should win in case of equality per CSS 2.1 (Border conflict resolution, point 4).
+ result = chooseBorder(cellBeforeAdjoiningBorder, result);
if (!result.exists())
return result;
- } else if (isStartColumn) {
+ } else {
// (3) Our row's start border.
result = chooseBorder(result, CollapsedBorderValue(row()->borderAdjoiningStartCell(this), includeColor ? parent()->style()->visitedDependentColor(startColorProperty) : Color(), BROW));
if (!result.exists())
@@ -454,11 +455,11 @@ CollapsedBorderValue RenderTableCell::computeCollapsedStartBorder(IncludeBorderC
}
// (6) The end border of the preceding column.
- if (!isStartColumn) {
+ if (cellBefore) {
colElt = table->colElement(col() -1, &startColEdge, &endColEdge);
if (colElt && endColEdge) {
- CollapsedBorderValue endBorder = CollapsedBorderValue(colElt->borderAdjoiningCellAfter(this), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOL);
- result = chooseBorder(endBorder, result);
+ CollapsedBorderValue columnBeforeAdjoiningBorder = CollapsedBorderValue(colElt->borderAdjoiningCellAfter(this), includeColor ? colElt->style()->visitedDependentColor(endColorProperty) : Color(), BCOL);
+ result = chooseBorder(columnBeforeAdjoiningBorder, result);
if (!result.exists())
return result;
}
@@ -483,6 +484,8 @@ CollapsedBorderValue RenderTableCell::collapsedEndBorder(IncludeBorderColorOrNot
CollapsedBorderValue RenderTableCell::computeCollapsedEndBorder(IncludeBorderColorOrNot includeColor) const
{
RenderTable* table = this->table();
+ // Note: We have to use the effective column information instead of whether we have a cell after as a table doesn't
+ // have to be regular (any row can have less cells than the total cell count).
bool isEndColumn = table->colToEffCol(col() + colSpan() - 1) == table->numEffCols() - 1;
// For end border, we need to check, in order of precedence:
@@ -493,10 +496,9 @@ CollapsedBorderValue RenderTableCell::computeCollapsedEndBorder(IncludeBorderCol
// (2) The start border of the following cell.
if (!isEndColumn) {
- RenderTableCell* nextCell = table->cellAfter(this);
- if (nextCell && nextCell->style()) {
- CollapsedBorderValue startBorder = CollapsedBorderValue(nextCell->borderAdjoiningCellBefore(this), includeColor ? nextCell->style()->visitedDependentColor(startColorProperty) : Color(), BCELL);
- result = chooseBorder(result, startBorder);
+ if (RenderTableCell* cellAfter = table->cellAfter(this)) {
+ CollapsedBorderValue cellAfterAdjoiningBorder = CollapsedBorderValue(cellAfter->borderAdjoiningCellBefore(this), includeColor ? cellAfter->style()->visitedDependentColor(startColorProperty) : Color(), BCELL);
+ result = chooseBorder(result, cellAfterAdjoiningBorder);
if (!result.exists())
return result;
}
@@ -531,8 +533,8 @@ CollapsedBorderValue RenderTableCell::computeCollapsedEndBorder(IncludeBorderCol
if (!isEndColumn) {
colElt = table->colElement(col() + colSpan(), &startColEdge, &endColEdge);
if (colElt && startColEdge) {
- CollapsedBorderValue startBorder = CollapsedBorderValue(colElt->borderAdjoiningCellBefore(this), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOL);
- result = chooseBorder(result, startBorder);
+ CollapsedBorderValue columnAfterAdjoiningBorder = CollapsedBorderValue(colElt->borderAdjoiningCellBefore(this), includeColor ? colElt->style()->visitedDependentColor(startColorProperty) : Color(), BCOL);
+ result = chooseBorder(result, columnAfterAdjoiningBorder);
if (!result.exists())
return result;
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
index 7de06ffe0..f35c336eb 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFenced.cpp
@@ -42,7 +42,8 @@ using namespace MathMLNames;
enum Braces { OpeningBraceChar = 0x28, ClosingBraceChar = 0x29 };
-static const float gOperatorPadding = 0.1f;
+static const float gSeparatorMarginEndEms = 0.25f;
+static const float gFenceMarginEms = 0.1f;
RenderMathMLFenced::RenderMathMLFenced(Element* element)
: RenderMathMLRow(element)
@@ -81,11 +82,13 @@ void RenderMathMLFenced::updateFromElement()
makeFences();
}
-RenderMathMLOperator* RenderMathMLFenced::createMathMLOperator(UChar uChar)
+RenderMathMLOperator* RenderMathMLFenced::createMathMLOperator(UChar uChar, OperatorType operatorType)
{
RefPtr<RenderStyle> newStyle = RenderStyle::createAnonymousStyleWithDisplay(style(), FLEX);
newStyle->setFlexDirection(FlowColumn);
- newStyle->setPaddingRight(Length(static_cast<int>(gOperatorPadding * style()->fontSize()), Fixed));
+ newStyle->setMarginEnd(Length((operatorType == Fence ? gFenceMarginEms : gSeparatorMarginEndEms) * style()->fontSize(), Fixed));
+ if (operatorType == Fence)
+ newStyle->setMarginStart(Length(gFenceMarginEms * style()->fontSize(), Fixed));
RenderMathMLOperator* newOperator = new (renderArena()) RenderMathMLOperator(node() /* "almost anonymous" */, uChar);
newOperator->setStyle(newStyle.release());
return newOperator;
@@ -93,8 +96,8 @@ RenderMathMLOperator* RenderMathMLFenced::createMathMLOperator(UChar uChar)
void RenderMathMLFenced::makeFences()
{
- RenderMathMLRow::addChild(createMathMLOperator(m_open), firstChild());
- m_closeFenceRenderer = createMathMLOperator(m_close);
+ RenderMathMLRow::addChild(createMathMLOperator(m_open, Fence), firstChild());
+ m_closeFenceRenderer = createMathMLOperator(m_close, Fence);
RenderMathMLRow::addChild(m_closeFenceRenderer);
}
@@ -129,7 +132,7 @@ void RenderMathMLFenced::addChild(RenderObject* child, RenderObject* beforeChild
else
separator = (*m_separators.get())[count - 1];
- separatorRenderer = createMathMLOperator(separator);
+ separatorRenderer = createMathMLOperator(separator, Separator);
}
}
@@ -155,7 +158,10 @@ void RenderMathMLFenced::styleDidChange(StyleDifference diff, const RenderStyle*
if (child->node() == node()) {
ASSERT(child->style()->refCount() == 1);
child->style()->inheritFrom(style());
- child->style()->setPaddingRight(Length(static_cast<int>(gOperatorPadding * style()->fontSize()), Fixed));
+ bool isFence = child == firstChild() || child == lastChild();
+ child->style()->setMarginEnd(Length((isFence ? gFenceMarginEms : gSeparatorMarginEndEms) * style()->fontSize(), Fixed));
+ if (isFence)
+ child->style()->setMarginStart(Length(gFenceMarginEms * style()->fontSize(), Fixed));
}
}
}
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFenced.h b/Source/WebCore/rendering/mathml/RenderMathMLFenced.h
index 987bb1343..0f0cfff01 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFenced.h
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFenced.h
@@ -41,7 +41,9 @@ public:
private:
virtual const char* renderName() const { return "RenderMathMLFenced"; }
- RenderMathMLOperator* createMathMLOperator(UChar);
+ // FIXME: OperatorType here will go away when default operator margins are determined by the MathML operator dictionary.
+ enum OperatorType { Separator, Fence };
+ RenderMathMLOperator* createMathMLOperator(UChar, OperatorType);
void makeFences();
virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OVERRIDE;
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
index 4e4273dae..4f1008ff2 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLFraction.cpp
@@ -44,7 +44,6 @@ static const float gLineThin = 0.33f;
static const float gLineMedium = 1.f;
static const float gLineThick = 3.f;
static const float gFractionBarWidth = 0.05f;
-static const float gDenominatorPad = 0.1f;
RenderMathMLFraction::RenderMathMLFraction(Element* element)
: RenderMathMLBlock(element)
@@ -89,7 +88,7 @@ void RenderMathMLFraction::updateFromElement()
m_lineThickness = 0;
// Update the style for the padding of the denominator for the line thickness
- lastChild()->style()->setPaddingTop(Length(static_cast<int>(m_lineThickness + style()->fontSize() * gDenominatorPad), Fixed));
+ lastChild()->style()->setPaddingTop(Length(static_cast<int>(m_lineThickness), Fixed));
}
void RenderMathMLFraction::addChild(RenderObject* child, RenderObject* beforeChild)
diff --git a/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp b/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp
index ddeafef0b..45642be52 100644
--- a/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp
+++ b/Source/WebCore/rendering/mathml/RenderMathMLSubSup.cpp
@@ -35,8 +35,6 @@ namespace WebCore {
using namespace MathMLNames;
-static const int gSubsupScriptMargin = 1;
-
RenderMathMLSubSup::RenderMathMLSubSup(Element* element)
: RenderMathMLBlock(element)
, m_scripts(0)
@@ -69,8 +67,6 @@ void RenderMathMLSubSup::fixScriptsStyle()
RenderStyle* scriptsStyle = m_scripts->style();
scriptsStyle->setFlexDirection(FlowColumn);
scriptsStyle->setJustifyContent(m_kind == Sub ? JustifyFlexEnd : m_kind == Super ? JustifyFlexStart : JustifySpaceBetween);
- if (m_kind == SubSup)
- scriptsStyle->setMarginLeft(Length(gSubsupScriptMargin, Fixed));
// Set this wrapper's font-size for its line-height & baseline position, for its children.
scriptsStyle->setFontSize(static_cast<int>(0.75 * style()->fontSize()));
}
diff --git a/Source/WebKit/chromium/ChangeLog b/Source/WebKit/chromium/ChangeLog
index 7d7233c7d..074b551a7 100644
--- a/Source/WebKit/chromium/ChangeLog
+++ b/Source/WebKit/chromium/ChangeLog
@@ -1,3 +1,23 @@
+2012-09-20 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Extend UserMediaRequest with a ownerDocument method
+ https://bugs.webkit.org/show_bug.cgi?id=97095
+
+ Reviewed by Adam Barth.
+
+ 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):
+
2012-09-20 Mike West <mkwst@google.com>
[chromium] Adding the 'google_apis' directory to .gitignore.
diff --git a/Source/WebKit/chromium/public/WebUserMediaRequest.h b/Source/WebKit/chromium/public/WebUserMediaRequest.h
index 54949407f..660df5bc1 100644
--- a/Source/WebKit/chromium/public/WebUserMediaRequest.h
+++ b/Source/WebKit/chromium/public/WebUserMediaRequest.h
@@ -40,7 +40,7 @@ class UserMediaRequest;
}
namespace WebKit {
-
+class WebDocument;
class WebMediaStreamDescriptor;
class WebMediaStreamSource;
class WebString;
@@ -67,9 +67,7 @@ public:
WEBKIT_EXPORT bool video() const;
WEBKIT_EXPORT WebSecurityOrigin securityOrigin() const;
-
- // DEPRECATED
- WEBKIT_EXPORT void requestSucceeded(const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources);
+ WEBKIT_EXPORT WebDocument ownerDocument() const;
WEBKIT_EXPORT void requestSucceeded(const WebMediaStreamDescriptor&);
diff --git a/Source/WebKit/chromium/src/WebUserMediaRequest.cpp b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp
index c9c0eccb3..26f17c35b 100644
--- a/Source/WebKit/chromium/src/WebUserMediaRequest.cpp
+++ b/Source/WebKit/chromium/src/WebUserMediaRequest.cpp
@@ -35,12 +35,11 @@
#include "WebUserMediaRequest.h"
#include "Document.h"
-#include "Frame.h"
#include "MediaStreamDescriptor.h"
#include "MediaStreamSource.h"
-#include "Page.h"
#include "SecurityOrigin.h"
#include "UserMediaRequest.h"
+#include "WebDocument.h"
#include "WebSecurityOrigin.h"
#include "platform/WebMediaStreamDescriptor.h"
#include "platform/WebMediaStreamSource.h"
@@ -64,50 +63,37 @@ void WebUserMediaRequest::reset()
bool WebUserMediaRequest::audio() const
{
+ ASSERT(!isNull());
return m_private->audio();
}
bool WebUserMediaRequest::video() const
{
+ ASSERT(!isNull());
return m_private->video();
}
WebSecurityOrigin WebUserMediaRequest::securityOrigin() const
{
- ASSERT(m_private->scriptExecutionContext());
+ ASSERT(!isNull() && m_private->scriptExecutionContext());
return WebSecurityOrigin(m_private->scriptExecutionContext()->securityOrigin());
}
-void WebUserMediaRequest::requestSucceeded(const WebVector<WebMediaStreamSource>& audioSources, const WebVector<WebMediaStreamSource>& videoSources)
+WebDocument WebUserMediaRequest::ownerDocument() const
{
- if (m_private.isNull())
- return;
-
- MediaStreamSourceVector audio;
- for (size_t i = 0; i < audioSources.size(); ++i) {
- MediaStreamSource* curr = audioSources[i];
- audio.append(curr);
- }
- MediaStreamSourceVector video;
- for (size_t i = 0; i < videoSources.size(); ++i) {
- MediaStreamSource* curr = videoSources[i];
- video.append(curr);
- }
-
- m_private->succeed(audio, video);
+ ASSERT(!isNull());
+ return WebDocument(m_private->ownerDocument());
}
void WebUserMediaRequest::requestSucceeded(const WebMediaStreamDescriptor& streamDescriptor)
{
- ASSERT(!streamDescriptor.isNull());
- if (m_private.isNull())
- return;
-
+ ASSERT(!isNull() && !streamDescriptor.isNull());
m_private->succeed(streamDescriptor);
}
void WebUserMediaRequest::requestFailed()
{
+ ASSERT(!isNull());
m_private->fail();
}
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 310e5fe38..88a52a2fb 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,60 @@
+2012-09-17 Jon Lee <jonlee@apple.com>
+
+ 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.
+
+ 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.
+
+2012-09-20 Eunmi Lee <eunmi15.lee@samsung.com>
+
+ [EFL][WK2] Add APIs to create, delete and get ewk_context.
+ https://bugs.webkit.org/show_bug.cgi?id=89186
+
+ 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):
+
2012-09-20 KwangYong Choi <ky0.choi@samsung.com>
[EFL][WK2] Implemented color picker API
diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake
index 80210b9f4..1a3fa0cca 100644
--- a/Source/WebKit2/PlatformEfl.cmake
+++ b/Source/WebKit2/PlatformEfl.cmake
@@ -261,6 +261,7 @@ ENDIF()
SET(WEBKIT2_EFL_TEST_DIR "${WEBKIT2_DIR}/UIProcess/API/efl/tests")
SET(TEST_RESOURCES_DIR ${WEBKIT2_EFL_TEST_DIR}/resources)
+SET(TEST_INJECTED_BUNDLE_DIR ${WEBKIT2_EFL_TEST_DIR}/InjectedBundle)
ADD_DEFINITIONS(-DTEST_RESOURCES_DIR=\"${TEST_RESOURCES_DIR}\"
-DTEST_THEME_DIR=\"${THEME_BINARY_DIR}\"
@@ -300,6 +301,9 @@ IF (ENABLE_API_TESTS)
SET_TESTS_PROPERTIES(${testName} PROPERTIES TIMEOUT 60)
TARGET_LINK_LIBRARIES(${testName} ${EWK2UnitTests_LIBRARIES} ewk2UnitTestUtils)
ENDFOREACH ()
+
+ ADD_LIBRARY(ewk2UnitTestInjectedBundleSample SHARED ${TEST_INJECTED_BUNDLE_DIR}/injected_bundle_sample.cpp)
+ SET_TARGET_PROPERTIES(ewk2UnitTestInjectedBundleSample PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${TEST_RESOURCES_DIR}")
ENDIF ()
IF (ENABLE_INSPECTOR)
diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
index 100633962..ef2ce603f 100644
--- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
@@ -285,10 +285,7 @@ void PageClientImpl::countStringMatchesInCustomRepresentation(const String&, Fin
void PageClientImpl::handleDownloadRequest(DownloadProxy* download)
{
Ewk_Download_Job* ewkDownload = ewk_download_job_new(download, m_viewWidget);
- // For now we only support one default context, but once we support
- // multiple contexts, we will need to retrieve the context from the
- // view.
- ewk_context_download_job_add(ewk_context_default_get(), ewkDownload);
+ ewk_context_download_job_add(ewk_view_context_get(m_viewWidget), ewkDownload);
ewk_download_job_unref(ewkDownload);
}
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp
index e23f6b005..b34ff77df 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp
@@ -28,15 +28,18 @@
#include "WKNumber.h"
#include "WKRetainPtr.h"
#include "WKString.h"
+#include "WebContext.h"
#include "ewk_context_download_client_private.h"
#include "ewk_context_private.h"
#include "ewk_context_request_manager_client_private.h"
#include "ewk_cookie_manager_private.h"
#include "ewk_download_job.h"
#include "ewk_download_job_private.h"
+#include <WebCore/FileSystem.h>
#include <wtf/HashMap.h>
#include <wtf/text/WTFString.h>
+using namespace WebCore;
using namespace WebKit;
struct _Ewk_Url_Scheme_Handler {
@@ -57,6 +60,7 @@ struct _Ewk_Url_Scheme_Handler {
typedef HashMap<String, _Ewk_Url_Scheme_Handler> URLSchemeHandlerMap;
struct _Ewk_Context {
+ unsigned __ref; /**< the reference count of the object */
WKRetainPtr<WKContextRef> context;
Ewk_Cookie_Manager* cookieManager;
@@ -72,7 +76,8 @@ struct _Ewk_Context {
URLSchemeHandlerMap urlSchemeHandlers;
_Ewk_Context(WKRetainPtr<WKContextRef> contextRef)
- : context(contextRef)
+ : __ref(1)
+ , context(contextRef)
, cookieManager(0)
, requestManager(WKContextGetSoupRequestManager(contextRef.get()))
{
@@ -112,6 +117,25 @@ struct _Ewk_Context {
}
};
+Ewk_Context* ewk_context_ref(Ewk_Context* ewkContext)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
+ ++ewkContext->__ref;
+
+ return ewkContext;
+}
+
+void ewk_context_unref(Ewk_Context* ewkContext)
+{
+ EINA_SAFETY_ON_NULL_RETURN(ewkContext);
+ EINA_SAFETY_ON_FALSE_RETURN(ewkContext->__ref > 0);
+
+ if (--ewkContext->__ref)
+ return;
+
+ delete ewkContext;
+}
+
Ewk_Cookie_Manager* ewk_context_cookie_manager_get(const Ewk_Context* ewkContext)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, 0);
@@ -215,6 +239,22 @@ Ewk_Context* ewk_context_default_get()
return &defaultContext;
}
+Ewk_Context* ewk_context_new()
+{
+ return new Ewk_Context(adoptWK(WKContextCreate()));
+}
+
+Ewk_Context* ewk_context_new_with_injected_bundle_path(const char* path)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(path, 0);
+
+ WKRetainPtr<WKStringRef> pathRef(AdoptWK, WKStringCreateWithUTF8CString(path));
+ if (!fileExists(toImpl(pathRef.get())->string()))
+ return 0;
+
+ return new Ewk_Context(adoptWK(WKContextCreateWithInjectedBundlePath(pathRef.get())));
+}
+
Eina_Bool ewk_context_uri_scheme_register(Ewk_Context* ewkContext, const char* scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(ewkContext, false);
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context.h b/Source/WebKit2/UIProcess/API/efl/ewk_context.h
index 5e4d34262..e6e9e0c7b 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_context.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_context.h
@@ -22,8 +22,16 @@
* @brief Describes the context API.
*
* @note ewk_context encapsulates all pages related to specific use of WebKit.
- * All pages in this context share the same visited link set,
- * local storage set, and preferences.
+ *
+ * Applications have the option of creating a context different than the default one
+ * and use it for a group of pages. All pages in the same context share the same
+ * preferences, visited link set, local storage, etc.
+ *
+ * A process model can be specified per context. The default one is the shared model
+ * where the web-engine process is shared among the pages in the context. The second
+ * model allows each page to use a separate web-engine process. This latter model is
+ * currently not supported by WebKit2/EFL.
+ *
*/
#ifndef ewk_context_h
@@ -61,11 +69,58 @@ typedef void (*Ewk_Vibration_Client_Vibrate_Cb)(uint64_t vibration_time, void *u
typedef void (*Ewk_Vibration_Client_Vibration_Cancel_Cb)(void *user_data);
/**
+ * Increases the reference count of the given object.
+ *
+ * @param context context object to increase the reference count
+ *
+ * @return Ewk_Context object on success or @c NULL on failure
+ */
+EAPI Ewk_Context *ewk_context_ref(Ewk_Context *context);
+
+/**
+ * Decreases the reference count of the given object, possibly freeing it.
+ *
+ * When the reference count it's reached 0, the Ewk_Context is freed.
+ *
+ * @param context context object to decrease the reference count
+ */
+EAPI void ewk_context_unref(Ewk_Context *context);
+
+/**
* Gets default Ewk_Context instance.
*
+ * The returned Ewk_Context object @b should not be unref'ed if application
+ * does not call ewk_context_ref() for that.
+ *
* @return Ewk_Context object.
*/
-EAPI Ewk_Context *ewk_context_default_get();
+EAPI Ewk_Context *ewk_context_default_get(void);
+
+/**
+ * Creates a new Ewk_Context.
+ *
+ * The returned Ewk_Context object @b should be unref'ed after use.
+ *
+ * @return Ewk_Context object on success or @c NULL on failure
+ *
+ * @see ewk_context_unref
+ * @see ewk_context_new_with_injected_bundle_path
+ */
+EAPI Ewk_Context *ewk_context_new(void);
+
+/**
+ * Creates a new Ewk_Context.
+ *
+ * The returned Ewk_Context object @b should be unref'ed after use.
+ *
+ * @param path path of injected bundle library
+ *
+ * @return Ewk_Context object on success or @c NULL on failure
+ *
+ * @see ewk_context_unref
+ * @see ewk_context_new
+ */
+EAPI Ewk_Context *ewk_context_new_with_injected_bundle_path(const char *path);
/**
* Gets the cookie manager instance for this @a context.
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
index bbbfc18c1..0eab8b540 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
@@ -100,6 +100,7 @@ struct _Ewk_View_Private_Data {
OwnPtr<Ewk_Settings> settings;
bool areMouseEventsEnabled;
WKColorPickerResultListenerRef colorPickerResultListener;
+ Ewk_Context* context;
WebPopupMenuProxyEfl* popupMenuProxy;
Eina_List* popupMenuItems;
@@ -119,6 +120,7 @@ struct _Ewk_View_Private_Data {
, backForwardList(0)
, areMouseEventsEnabled(false)
, colorPickerResultListener(0)
+ , context(0)
, popupMenuProxy(0)
, popupMenuItems(0)
#ifdef HAVE_ECORE_X
@@ -384,6 +386,7 @@ static void _ewk_view_priv_loading_resources_clear(LoadingResourcesMap& loadingR
static void _ewk_view_priv_del(Ewk_View_Private_Data* priv)
{
+ ewk_context_unref(priv->context);
delete priv;
}
@@ -714,6 +717,7 @@ static void _ewk_view_initialize(Evas_Object* ewkView, Ewk_Context* context, WKP
priv->backForwardList = ewk_back_forward_list_new(toAPI(priv->pageProxy->backForwardList()));
priv->settings = adoptPtr(new Ewk_Settings(WKPageGroupGetPreferences(WKPageGetPageGroup(toAPI(priv->pageProxy.get())))));
+ priv->context = ewk_context_ref(context);
#if USE(COORDINATED_GRAPHICS)
priv->viewportHandler = EflViewportHandler::create(ewkView);
@@ -798,6 +802,14 @@ Evas_Object* ewk_view_add(Evas* canvas)
return ewk_view_add_with_context(canvas, ewk_context_default_get());
}
+Ewk_Context* ewk_view_context_get(const Evas_Object* ewkView)
+{
+ EWK_VIEW_SD_GET_OR_RETURN(ewkView, smartData, 0);
+ EWK_VIEW_PRIV_GET_OR_RETURN(smartData, priv, 0);
+
+ return priv->context;
+}
+
/**
* @internal
* The uri of view was changed by the frame loader.
diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.h b/Source/WebKit2/UIProcess/API/efl/ewk_view.h
index 13b8daf0b..314975196 100644
--- a/Source/WebKit2/UIProcess/API/efl/ewk_view.h
+++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.h
@@ -319,6 +319,15 @@ EAPI Evas_Object *ewk_view_add(Evas *e);
EAPI Evas_Object *ewk_view_add_with_context(Evas *e, Ewk_Context *context);
/**
+ * Gets the Ewk_Context of this view.
+ *
+ * @param o the view object to get the Ewk_Context
+ *
+ * @return the Ewk_Context of this view or @c NULL on failure
+ */
+EAPI Ewk_Context *ewk_view_context_get(const Evas_Object *o);
+
+/**
* Asks the object to load the given URI.
*
* @param o view object to load @a URI
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp b/Source/WebKit2/UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp
new file mode 100644
index 000000000..55f0f190c
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/efl/tests/InjectedBundle/injected_bundle_sample.cpp
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <WebKit2/WKBundleInitialize.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void WKBundleInitialize(WKBundleRef bundle, WKTypeRef initializationUserData)
+{
+}
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp
index 814f8c2cb..cd3c55d5f 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.cpp
@@ -43,6 +43,11 @@ const char* EWK2UnitTestEnvironment::defaultTheme() const
return TEST_THEME_DIR"/default.edj";
}
+const char* EWK2UnitTestEnvironment::injectedBundleSample() const
+{
+ return TEST_RESOURCES_DIR "/libewk2UnitTestInjectedBundleSample.so";
+}
+
CString EWK2UnitTestEnvironment::urlForResource(const char* resource)
{
return makeString("file://"TEST_RESOURCES_DIR"/", resource).utf8();
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h
index fb3a309f8..4255b01b4 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h
+++ b/Source/WebKit2/UIProcess/API/efl/tests/UnitTestUtils/EWK2UnitTestEnvironment.h
@@ -32,6 +32,7 @@ public:
bool useX11Window() const { return m_useX11Window; }
const char* defaultTestPageUrl() const;
const char* defaultTheme() const;
+ const char* injectedBundleSample() const;
CString urlForResource(const char* resource);
CString pathForResource(const char* resource);
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
index b5ce2ee57..82ded55da 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_context.cpp
@@ -1,5 +1,6 @@
/*
* Copyright (C) 2012 Intel Corporation. All rights reserved.
+ * Copyright (C) 2012 Samsung Electronics
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -46,9 +47,10 @@ TEST_F(EWK2UnitTestBase, ewk_context_default_get)
TEST_F(EWK2UnitTestBase, ewk_context_cookie_manager_get)
{
- Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(ewk_context_default_get());
+ Ewk_Context* context = ewk_view_context_get(webView());
+ Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(context);
ASSERT_TRUE(cookieManager);
- ASSERT_EQ(cookieManager, ewk_context_cookie_manager_get(ewk_context_default_get()));
+ ASSERT_EQ(cookieManager, ewk_context_cookie_manager_get(context));
}
static void schemeRequestCallback(Ewk_Url_Scheme_Request* request, void* userData)
@@ -64,7 +66,7 @@ static void schemeRequestCallback(Ewk_Url_Scheme_Request* request, void* userDat
TEST_F(EWK2UnitTestBase, ewk_context_uri_scheme_register)
{
- ewk_context_uri_scheme_register(ewk_context_default_get(), "fooscheme", schemeRequestCallback, 0);
+ ewk_context_uri_scheme_register(ewk_view_context_get(webView()), "fooscheme", schemeRequestCallback, 0);
loadUrlSync("fooscheme:MyPath");
ASSERT_STREQ(ewk_view_title_get(webView()), "Foo");
}
@@ -114,7 +116,7 @@ static void loadVibrationHTMLString(Evas_Object* webView, const char* vibrationP
TEST_F(EWK2UnitTestBase, ewk_context_vibration_client_callbacks_set)
{
VibrationCbData data = { false, false, 0, 5000 };
- ewk_context_vibration_client_callbacks_set(ewk_context_default_get(), vibrateCallback, cancelVibrationCallback, &data);
+ ewk_context_vibration_client_callbacks_set(ewk_view_context_get(webView()), vibrateCallback, cancelVibrationCallback, &data);
// Vibrate for 5 seconds.
loadVibrationHTMLString(webView(), "5000", true, &data);
@@ -134,7 +136,7 @@ TEST_F(EWK2UnitTestBase, ewk_context_vibration_client_callbacks_set)
ASSERT_TRUE(data.didReceiveCancelVibrationCallback);
// Stop listening for vibration events, by calling the function with null for the callbacks.
- ewk_context_vibration_client_callbacks_set(ewk_context_default_get(), 0, 0, &data);
+ ewk_context_vibration_client_callbacks_set(ewk_view_context_get(webView()), 0, 0, &data);
// Make sure we don't receive vibration event.
loadVibrationHTMLString(webView(), "[5000]", false, &data);
@@ -148,3 +150,25 @@ TEST_F(EWK2UnitTestBase, ewk_context_vibration_client_callbacks_set)
ASSERT_STREQ(ewk_view_title_get(webView()), "Loaded");
ASSERT_FALSE(data.didReceiveCancelVibrationCallback);
}
+
+TEST_F(EWK2UnitTestBase, ewk_context_new)
+{
+ Ewk_Context* context = ewk_context_new();
+ ASSERT_TRUE(context);
+ ewk_context_unref(context);
+}
+
+TEST_F(EWK2UnitTestBase, ewk_context_new_with_injected_bundle_path)
+{
+ Ewk_Context* context = ewk_context_new_with_injected_bundle_path(environment->injectedBundleSample());
+ ASSERT_TRUE(context);
+ ewk_context_unref(context);
+}
+
+TEST_F(EWK2UnitTestBase, ewk_context_ref)
+{
+ Ewk_Context* context = ewk_context_new();
+ ASSERT_EQ(context, ewk_context_ref(context));
+ ewk_context_unref(context);
+ ewk_context_unref(context);
+}
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp
index e0319f7ce..4353ced79 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_cookie_manager.cpp
@@ -121,7 +121,7 @@ TEST_F(EWK2UnitTestBase, ewk_cookie_manager_accept_policy)
OwnPtr<EWK2UnitTestServer> httpServer = adoptPtr(new EWK2UnitTestServer);
httpServer->run(serverCallback);
- Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(ewk_context_default_get());
+ Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(ewk_view_context_get(webView()));
ASSERT_TRUE(cookieManager);
// Default policy is EWK_COOKIE_ACCEPT_POLICY_NO_THIRD_PARTY.
@@ -164,7 +164,7 @@ TEST_F(EWK2UnitTestBase, ewk_cookie_manager_changes_watch)
OwnPtr<EWK2UnitTestServer> httpServer = adoptPtr(new EWK2UnitTestServer);
httpServer->run(serverCallback);
- Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(ewk_context_default_get());
+ Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(ewk_view_context_get(webView()));
ASSERT_TRUE(cookieManager);
ewk_cookie_manager_accept_policy_set(cookieManager, EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
@@ -227,7 +227,7 @@ TEST_F(EWK2UnitTestBase, ewk_cookie_manager_cookies_delete)
OwnPtr<EWK2UnitTestServer> httpServer = adoptPtr(new EWK2UnitTestServer);
httpServer->run(serverCallback);
- Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(ewk_context_default_get());
+ Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(ewk_view_context_get(webView()));
ASSERT_TRUE(cookieManager);
ewk_cookie_manager_accept_policy_set(cookieManager, EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
@@ -269,7 +269,7 @@ TEST_F(EWK2UnitTestBase, DISABLED_ewk_cookie_manager_permanent_storage)
char sqliteStorage[] = "/tmp/sqlite-cookie.XXXXXX";
ASSERT_TRUE(mktemp(sqliteStorage));
- Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(ewk_context_default_get());
+ Ewk_Cookie_Manager* cookieManager = ewk_context_cookie_manager_get(ewk_view_context_get(webView()));
ASSERT_TRUE(cookieManager);
ewk_cookie_manager_accept_policy_set(cookieManager, EWK_COOKIE_ACCEPT_POLICY_ALWAYS);
diff --git a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
index 25f62fcf8..8c258ba66 100644
--- a/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
+++ b/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_view.cpp
@@ -714,4 +714,11 @@ TEST_F(EWK2UnitTestBase, ewk_view_color_picker_color_set)
ecore_main_loop_iterate();
evas_object_smart_callback_del(webView(), "input,type,color,request", onColorPickerDone);
}
+
+TEST_F(EWK2UnitTestBase, ewk_view_context_get)
+{
+ Ewk_Context* context = ewk_view_context_get(webView());
+ ASSERT_TRUE(context);
+ ASSERT_EQ(context, ewk_view_context_get(webView()));
+}
#endif // ENABLE(INPUT_TYPE_COLOR)
diff --git a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
index ea3973699..5ac2cdc3e 100644
--- a/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
+++ b/Source/WebKit2/WebProcess/Notifications/WebNotificationManager.cpp
@@ -39,6 +39,7 @@
#include <WebCore/ScriptExecutionContext.h>
#include <WebCore/SecurityOrigin.h>
#include <WebCore/Settings.h>
+#include <WebCore/UserGestureIndicator.h>
#endif
using namespace WebCore;
@@ -243,6 +244,8 @@ void WebNotificationManager::didClickNotification(uint64_t notificationID)
if (!notification)
return;
+ // Indicate that this event is being dispatched in reaction to a user's interaction with a platform notification.
+ UserGestureIndicator indicator(DefinitelyProcessingUserGesture);
notification->dispatchClickEvent();
#else
UNUSED_PARAM(notificationID);
diff --git a/Tools/ChangeLog b/Tools/ChangeLog
index 6ae63d783..c9f63aa9d 100644
--- a/Tools/ChangeLog
+++ b/Tools/ChangeLog
@@ -1,5 +1,94 @@
2012-09-20 Simon Hausmann <simon.hausmann@digia.com>
+ [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:
+
+2012-09-20 Dirk Pranke <dpranke@chromium.org>
+
+ 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):
+
+2012-09-20 Tommy Widenflycht <tommyw@google.com>
+
+ MediaStream API: Extend UserMediaRequest with a ownerDocument method
+ https://bugs.webkit.org/show_bug.cgi?id=97095
+
+ Reviewed by Adam Barth.
+
+ Extending WebUserMediaClientMock to check that the owning document is valid,
+ and that the document has a frame.
+
+ * DumpRenderTree/chromium/WebUserMediaClientMock.cpp:
+ (WebKit::WebUserMediaClientMock::requestUserMedia):
+
+2012-09-20 Stephen Chenney <schenney@chromium.org>
+
+ [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.
+
+2012-09-20 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [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.
+
+2012-09-20 Simon Hausmann <simon.hausmann@digia.com>
+
[Qt] Fix initial build
Reviewed by Tor Arne Vestbø.
diff --git a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
index bee1777c6..0949aa7a6 100644
--- a/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
+++ b/Tools/DumpRenderTree/chromium/DumpRenderTree.cpp
@@ -43,7 +43,8 @@
using namespace std;
static const char optionComplexText[] = "--complex-text";
-static const char optionDumpAllPixels[] = "--dump-all-pixels";
+static const char optionDumpPixels[] = "--pixel-tests";
+static const char optionDumpPixelsShortForm[] = "-p";
static const char optionNotree[] = "--notree";
static const char optionThreaded[] = "--threaded";
static const char optionDebugRenderTree[] = "--debug-render-tree";
@@ -85,7 +86,7 @@ private:
OwnPtr<MockWebKitPlatformSupport> m_mockPlatform;
};
-static void runTest(TestShell& shell, TestParams& params, const string& inputLine)
+static void runTest(TestShell& shell, TestParams& params, const string& inputLine, const bool forceDumpPixels)
{
int oldTimeoutMsec = shell.layoutTestTimeout();
TestCommand command = parseInputLine(inputLine);
@@ -103,11 +104,11 @@ static void runTest(TestShell& shell, TestParams& params, const string& inputLin
bool isLastLoad = (i == (v8::Testing::GetStressRuns() - 1));
shell.setDumpWhenFinished(isLastLoad);
shell.resetTestController();
- shell.runFileTest(params, command.shouldDumpPixels);
+ shell.runFileTest(params, command.shouldDumpPixels || forceDumpPixels);
}
} else {
shell.resetTestController();
- shell.runFileTest(params, command.shouldDumpPixels);
+ shell.runFileTest(params, command.shouldDumpPixels || forceDumpPixels);
}
shell.setLayoutTestTimeout(oldTimeoutMsec);
}
@@ -120,6 +121,7 @@ int main(int argc, char* argv[])
TestParams params;
Vector<string> tests;
bool serverMode = false;
+ bool dumpAllPixels = false;
bool allowExternalPages = false;
bool startupDialog = false;
bool acceleratedCompositingForVideoEnabled = false;
@@ -139,6 +141,8 @@ int main(int argc, char* argv[])
string argument(argv[i]);
if (argument == "-")
serverMode = true;
+ else if (argument == optionDumpPixels || argument == optionDumpPixelsShortForm)
+ dumpAllPixels = true;
else if (argument == optionNotree)
params.dumpTree = false;
else if (argument == optionDebugRenderTree)
@@ -239,14 +243,14 @@ int main(int argc, char* argv[])
// Explicitly quit on platforms where EOF is not reliable.
if (!strcmp(testString, "QUIT"))
break;
- runTest(shell, params, testString);
+ runTest(shell, params, testString, dumpAllPixels);
}
} else if (!tests.size())
puts("#EOF");
else {
params.printSeparators = tests.size() > 1;
for (unsigned i = 0; i < tests.size(); i++)
- runTest(shell, params, tests[i]);
+ runTest(shell, params, tests[i], dumpAllPixels);
}
shell.callJSGC();
diff --git a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp
index 4efeb82d3..a373c3b30 100644
--- a/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp
+++ b/Tools/DumpRenderTree/chromium/WebUserMediaClientMock.cpp
@@ -33,6 +33,7 @@
#include "WebUserMediaClientMock.h"
+#include "WebDocument.h"
#include "WebMediaStreamRegistry.h"
#include "WebUserMediaRequest.h"
#include "platform/WebMediaStreamDescriptor.h"
@@ -57,6 +58,11 @@ void WebUserMediaClientMock::requestUserMedia(const WebUserMediaRequest& streamR
ASSERT(!streamRequest.isNull());
WebUserMediaRequest request = streamRequest;
+ if (request.ownerDocument().isNull() || !request.ownerDocument().frame()) {
+ request.requestFailed();
+ return;
+ }
+
const size_t zero = 0;
const size_t one = 1;
WebVector<WebMediaStreamSource> audioSources(request.audio() ? one : zero);
diff --git a/Tools/Scripts/run-gtk-tests b/Tools/Scripts/run-gtk-tests
index 776f4cde3..9d5b7119d 100755
--- a/Tools/Scripts/run-gtk-tests
+++ b/Tools/Scripts/run-gtk-tests
@@ -213,26 +213,60 @@ class TestRunner:
def alarm_handler(signum, frame):
raise TestTimeout
- p = subprocess.Popen(command, stdout=subprocess.PIPE, env=self._test_env)
+ child_pid = [-1]
+ def parse_line(line, child_pid = child_pid):
+ if child_pid[0] == -1:
+ child_pid[0] = self._get_child_pid_from_test_output(line)
+ sys.stdout.write(line)
+
+ def waitpid(pid):
+ while True:
+ try:
+ return os.waitpid(pid, 0)
+ except (OSError, IOError) as e:
+ if e.errno == errno.EINTR:
+ continue
+ raise
+
+ def return_code_from_exit_status(status):
+ if os.WIFSIGNALED(status):
+ return -os.WTERMSIG(status)
+ elif os.WIFEXITED(status):
+ return os.WEXITSTATUS(status)
+ else:
+ # Should never happen
+ raise RuntimeError("Unknown child exit status!")
+
+ pid, fd = os.forkpty()
+ if pid == 0:
+ os.execvpe(command[0], command, self._test_env)
+ sys.exit(0)
+
if timeout > 0:
signal(SIGALRM, alarm_handler)
alarm(timeout)
- stdout = ""
try:
- stdout = p.communicate()[0]
+ common.parse_output_lines(fd, parse_line)
if timeout > 0:
alarm(0)
- sys.stdout.write(stdout)
- sys.stdout.flush()
except TestTimeout:
- self._kill_process(p.pid)
- child_pid = self._get_child_pid_from_test_output(stdout)
- if child_pid > 0:
- self._kill_process(child_pid)
+ self._kill_process(pid)
+ if child_pid[0] > 0:
+ self._kill_process(child_pid[0])
raise
- return not p.returncode
+ try:
+ dummy, status = waitpid(pid)
+ except OSError as e:
+ if e.errno != errno.ECHILD:
+ raise
+ # This happens if SIGCLD is set to be ignored or waiting
+ # for child processes has otherwise been disabled for our
+ # process. This child is dead, we can't get the status.
+ status = 0
+
+ return not return_code_from_exit_status(status)
def _run_test_glib(self, test_program):
tester_command = ['gtester']
diff --git a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
index aa5cdc60f..f277c93de 100644
--- a/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
+++ b/Tools/Scripts/webkitpy/layout_tests/layout_package/json_layout_results_generator.py
@@ -40,15 +40,15 @@ class JSONLayoutResultsGenerator(json_results_generator.JSONResultsGeneratorBase
# Additional JSON fields.
WONTFIX = "wontfixCounts"
- # Note that there used to be an "A" for audio failures and a "Z" for IMAGE+TEXT failures.
-
FAILURE_TO_CHAR = {test_expectations.PASS: json_results_generator.JSONResultsGeneratorBase.PASS_RESULT,
test_expectations.SKIP: json_results_generator.JSONResultsGeneratorBase.SKIP_RESULT,
test_expectations.CRASH: "C",
test_expectations.TIMEOUT: "T",
- test_expectations.FAIL: "F",
test_expectations.IMAGE: "I",
- test_expectations.MISSING: "O"}
+ test_expectations.TEXT: "F",
+ test_expectations.AUDIO: "A",
+ test_expectations.MISSING: "O",
+ test_expectations.IMAGE_PLUS_TEXT: "Z"}
def __init__(self, port, builder_name, build_name, build_number,
results_file_base_path, builder_base_url,
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
index d4b9f9694..7890e980e 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
@@ -40,9 +40,6 @@ _log = logging.getLogger(__name__)
# Test expectation and modifier constants.
-# TEXT, IMAGE_PLUS_TEXT, and AUDIO are no longer used in new test runs but
-# we keep them around for now so we can parse old results.json entries and to
-# avoid changing the numbering for the constants.
#
# FIXME: range() starts with 0 which makes if expectation checks harder
# as PASS is 0.
@@ -286,7 +283,8 @@ class TestExpectationParser(object):
'WontFix': 'WONTFIX',
}
- _inverted_expectation_tokens = dict((value, name) for name, value in _expectation_tokens.iteritems())
+ _inverted_expectation_tokens = dict([(value, name) for name, value in _expectation_tokens.iteritems()] +
+ [('TEXT', 'Failure'), ('IMAGE+TEXT', 'Failure'), ('AUDIO', 'Failure')])
@classmethod
def _tokenize_line_using_new_format(cls, filename, expectation_string, line_number):
@@ -791,8 +789,11 @@ class TestExpectations(object):
# FIXME: Update to new syntax once the old format is no longer supported.
EXPECTATIONS = {'pass': PASS,
+ 'audio': AUDIO,
'fail': FAIL,
'image': IMAGE,
+ 'image+text': IMAGE_PLUS_TEXT,
+ 'text': TEXT,
'timeout': TIMEOUT,
'crash': CRASH,
'missing': MISSING}
@@ -802,6 +803,9 @@ class TestExpectations(object):
PASS: ('passes', 'passed', ''),
FAIL: ('failures', 'failed', ''),
IMAGE: ('image-only failures', 'failed', ' (image diff)'),
+ TEXT: ('text-only failures', 'failed', ' (text diff)'),
+ IMAGE_PLUS_TEXT: ('image and text failures', 'failed', ' (image and text diff)'),
+ AUDIO: ('audio failures', 'failed', ' (audio diff)'),
CRASH: ('crashes', 'crashed', ''),
TIMEOUT: ('timeouts', 'timed out', ''),
MISSING: ('no expected results found', 'no expected result found', '')}
@@ -839,6 +843,8 @@ class TestExpectations(object):
test_is_skipped: whether test was marked as SKIP"""
if result in expected_results:
return True
+ if result in (TEXT, IMAGE_PLUS_TEXT, AUDIO) and (FAIL in expected_results):
+ return True
if result == MISSING and test_needs_rebaselining:
return True
if result == SKIP and test_is_skipped:
diff --git a/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py b/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py
index 96628afc3..13d4001b5 100644
--- a/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py
+++ b/Tools/Scripts/webkitpy/layout_tests/models/test_failures.py
@@ -62,10 +62,18 @@ def determine_result_type(failure_list):
FailureMissingAudio in failure_types):
return test_expectations.MISSING
else:
- if FailureTextMismatch in failure_types or FailureAudioMismatch in failure_types:
- return test_expectations.FAIL
- elif FailureImageHashIncorrect in failure_types or FailureImageHashMismatch in failure_types or is_reftest_failure(failure_list):
+ is_text_failure = FailureTextMismatch in failure_types
+ is_image_failure = (FailureImageHashIncorrect in failure_types or
+ FailureImageHashMismatch in failure_types)
+ is_audio_failure = (FailureAudioMismatch in failure_types)
+ if is_text_failure and is_image_failure:
+ return test_expectations.IMAGE_PLUS_TEXT
+ elif is_text_failure:
+ return test_expectations.TEXT
+ elif is_image_failure or is_reftest_failure(failure_list):
return test_expectations.IMAGE
+ elif is_audio_failure:
+ return test_expectations.AUDIO
else:
raise ValueError("unclassifiable set of failures: "
+ str(failure_types))
diff --git a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
index 1abc3cada..17a12fc6b 100755
--- a/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
+++ b/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_integrationtest.py
@@ -549,7 +549,7 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
file_list = host.filesystem.written_files.keys()
file_list.remove('/tmp/layout-test-results/tests_run0.txt')
self.assertEquals(res, 1)
- expected_token = '"unexpected":{"text-image-checksum.html":{"expected":"PASS","actual":"FAIL"},"missing_text.html":{"expected":"PASS","is_missing_text":true,"actual":"MISSING"}'
+ expected_token = '"unexpected":{"text-image-checksum.html":{"expected":"PASS","actual":"TEXT"},"missing_text.html":{"expected":"PASS","is_missing_text":true,"actual":"MISSING"}'
json_string = host.filesystem.read_text_file('/tmp/layout-test-results/full_results.json')
self.assertTrue(json_string.find(expected_token) != -1)
self.assertTrue(json_string.find('"num_regressions":1') != -1)
@@ -764,7 +764,7 @@ class MainTest(unittest.TestCase, StreamTestingMixin):
self.assertEquals(res, 1)
self.assertTrue('Clobbering old results' in err.getvalue())
self.assertTrue('flaky/text.html' in err.getvalue())
- self.assertTrue('Unexpected failures' in out.getvalue())
+ self.assertTrue('Unexpected text-only failures' in out.getvalue())
self.assertFalse('Unexpected flakiness' in out.getvalue())
self.assertTrue(host.filesystem.exists('/tmp/layout-test-results/failures/flaky/text-actual.txt'))
self.assertFalse(host.filesystem.exists('retries'))
diff --git a/Tools/gtk/common.py b/Tools/gtk/common.py
index 7b057e7d1..e090efc6a 100644
--- a/Tools/gtk/common.py
+++ b/Tools/gtk/common.py
@@ -15,7 +15,9 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+import errno
import os
+import select
import subprocess
import sys
@@ -102,3 +104,32 @@ def gtk_version_of_pkg_config_file(pkg_config_path):
if 'gtk+-3.0' in stdout:
return 3
return 2
+
+
+def parse_output_lines(fd, parse_line_callback):
+ output = ''
+ read_set = [fd]
+ while read_set:
+ rlist, wlist, xlist = select.select(read_set, [], [])
+
+ if fd in rlist:
+ try:
+ chunk = os.read(fd, 1024)
+ except OSError as e:
+ if e.errno == errno.EIO:
+ # Child process finished.
+ chunk = ''
+ else:
+ raise e
+ if not chunk:
+ read_set.remove(fd)
+
+ output += chunk
+ while '\n' in output:
+ pos = output.find('\n')
+ parse_line_callback(output[:pos + 1])
+ output = output[pos + 1:]
+
+ if len(chunk) < 1024 and output:
+ parse_line_callback(output)
+ output = ''
diff --git a/Tools/qmake/mkspecs/features/functions.prf b/Tools/qmake/mkspecs/features/functions.prf
index c54a262be..bf827ada4 100644
--- a/Tools/qmake/mkspecs/features/functions.prf
+++ b/Tools/qmake/mkspecs/features/functions.prf
@@ -248,18 +248,18 @@ defineTest(linkAgainstLibrary) {
path = $$replace(source_dir, $${ROOT_WEBKIT_DIR}, $${ROOT_BUILD_DIR})/$$activeBuildConfig()
force_static_libs_as_shared {
- LIBS += -L$${ROOT_BUILD_DIR}/lib -l$$target
+ LIBS_PRIVATE += -L$${ROOT_BUILD_DIR}/lib -l$$target
} else {
mac {
- LIBS += -Wl,-force_load,$${path}$${QMAKE_DIR_SEP}lib$${target}.a
+ LIBS_PRIVATE += -Wl,-force_load,$${path}$${QMAKE_DIR_SEP}lib$${target}.a
} else:win32-msvc*|wince*|win32-icc {
- LIBS += /OPT:REF -l$$target
+ LIBS_PRIVATE += /OPT:REF -l$$target
} else {
- LIBS += -Wl,-whole-archive -l$$target -Wl,-no-whole-archive
+ LIBS_PRIVATE += -Wl,-whole-archive -l$$target -Wl,-no-whole-archive
}
- LIBS += -L$$path
+ LIBS_PRIVATE += -L$$path
win32-msvc*|wince*|win32-icc {
POST_TARGETDEPS += $${path}$${QMAKE_DIR_SEP}$${target}.lib
@@ -268,7 +268,7 @@ defineTest(linkAgainstLibrary) {
}
}
- export(LIBS)
+ export(LIBS_PRIVATE)
export(QMAKE_LIBDIR)
export(POST_TARGETDEPS)
export(CONFIG)