'self' in a CSP directive should match blob: and filesystem: URLs.
https://bugs.webkit.org/show_bug.cgi?id=94918

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

Source/WebCore:

'blob:' and 'filesystem:' URLs are same-origin with the page on which
they were created. Currently, we're using the wrong URL for comparison
when matching against CSP directive source lists. This patch adjusts the
matching logic to compare against the blob's inner URL, rather than
directly against the blob itself.

Tests: http/tests/security/contentSecurityPolicy/blob-urls-match-self.html
       http/tests/security/contentSecurityPolicy/filesystem-urls-match-self.html
       http/tests/security/contentSecurityPolicy/source-list-parsing-08.html

* page/ContentSecurityPolicy.cpp:
(WebCore::CSPSourceList::matches):
    If we should use the inner URL of a given resource, extract it into
    a local variable, and pass that into CSPSource for comparison.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::shouldUseInnerURL):
(WebCore::SecurityOrigin::extractInnerURL):
    Move shouldUseInnerURL and extractInnerURL to SecurityOrigin's
    public signature.
(WebCore::shouldTreatAsUniqueOrigin):
(WebCore::SecurityOrigin::create):
(WebCore::SecurityOrigin::isSecure):
    shouldUseInnerURL and extractInnerURL are now static methods of
    SecurityOrigin: updating calls to mathc.
* page/SecurityOrigin.h:

LayoutTests:

* http/tests/security/contentSecurityPolicy/blob-urls-match-self-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/blob-urls-match-self.html: Added.
* http/tests/security/contentSecurityPolicy/filesystem-urls-match-self-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/filesystem-urls-match-self.html: Added.
    Test the new functionality.
* http/tests/security/contentSecurityPolicy/resources/multiple-iframe-test.js:
(test):
    Adding support for data: URLs.
* http/tests/security/contentSecurityPolicy/source-list-parsing-08-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/source-list-parsing-08.html: Added.
    Adding data: URL tests to ensure that grabbing the inner URL of the
    URL to test doesn't inadvertently regress that behavior.
* platform/efl/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
    Skipping filessytem test on ports where it's not enabled.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126785 268f45cc-cd09-0410-ab3c-d52691b4dbfc
TextTrack modes are strings
https://bugs.webkit.org/show_bug.cgi?id=85050

Reviewed by Eric Carlson.

The spec recently changed away from enumeration to string for the type
of TextTrack mode.
http://dev.w3.org/html5/spec/media-elements.html#texttrackmode

Source/WebCore:

No new tests. Updates to existing tests.

* html/HTMLMediaElement.cpp:

Use the new string mode rather than the old enum.  Also, TextTrack::setMode()
no longer requires an ExceptionCode:
(WebCore::HTMLMediaElement::loadInternal):
(WebCore::HTMLMediaElement::textTrackModeChanged):
(WebCore::HTMLMediaElement::textTrackKindChanged):
(WebCore::HTMLMediaElement::addTextTrack):
(WebCore::HTMLMediaElement::showingTrackWithSameKind):
(WebCore::HTMLMediaElement::configureTextTrackGroup):
(WebCore::HTMLMediaElement::configureNewTextTracks):
(WebCore::HTMLMediaElement::configureTextTrackDisplay):

* html/track/TextTrack.cpp:

Update these methods to use ConstructFromLiteral for efficiency:
(WebCore::TextTrack::subtitlesKeyword):
(WebCore::TextTrack::captionsKeyword):
(WebCore::TextTrack::descriptionsKeyword):
(WebCore::TextTrack::chaptersKeyword):
(WebCore::TextTrack::metadataKeyword):

New methods to use for the mode string (replacing the enum):
(WebCore::TextTrack::disabledKeyword):
(WebCore::TextTrack::hiddenKeyword):
(WebCore::TextTrack::showingKeyword):

(WebCore::TextTrack::TextTrack): Initialize mode to disabled.
(WebCore::TextTrack::setMode): Remove ExceptionCode and no longer throw an
INVALID_ACCESS_ERR.
(WebCore::TextTrack::mode): Return a keyword string instead of an enum.

Use the new string mode rather than the old enum:
(WebCore::TextTrack::cues):
(WebCore::TextTrack::activeCues):
(WebCore::TextTrack::isRendered):

* html/track/TextTrack.h: Remove old enum, add new string keyword methods,
and update mode() and setMode() accordingly.

* html/track/TextTrack.idl: Remove old enum and make mode attribute be a string.

Use the new string mode rather than the old enum:
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::dispatchEvent):
(WebCore::TextTrackCue::isActive):

LayoutTests:

Remove check for mode constants as we are no longer using an enum:
* media/track/track-constants-expected.txt:
* media/track/track-constants.html:

Update tests to use the new strings rather than the enums:
* media/track/track-delete-during-setup-expected.txt:
* media/track/track-delete-during-setup.html:
* media/track/track-element-dom-change-crash-expected.txt:
* media/track/track-element-dom-change-crash.html:
* media/track/track-load-from-src-readyState.html:
* media/track/track-mode-expected.txt:
* media/track/track-mode-not-changed-by-new-track-expected.txt:
* media/track/track-mode-not-changed-by-new-track.html:
* media/track/track-mode-triggers-loading-expected.txt:
* media/track/track-mode-triggers-loading.html:
* media/track/track-mode.html:
* media/track/track-texttracks-expected.txt:
* media/track/track-texttracks.html:
* media/video-test.js:
(enableAllTextTracks):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Fixing infinite recursion in Canvas2DLayerManager
https://bugs.webkit.org/show_bug.cgi?id=95110

Patch by Justin Novosad <junov@chromium.org> on 2012-08-27
Reviewed by Stephen White.

Source/WebCore:

Fixed infinite recursion by not reporting a change in memory allocation
when Canvas2DLayerBridge::freeMemoryIfPossible fails to free memory.
Also modified Canvas2DLayerManager::layerAllocatedStorageChanged to
only initiate a memory eviction pass if memory consumption has
increased.

Test: webkit_unit_tests Canvas2DLayerManagerTest*

* platform/graphics/chromium/Canvas2DLayerBridge.cpp:
(WebCore::Canvas2DLayerBridge::freeMemoryIfPossible):
* platform/graphics/chromium/Canvas2DLayerManager.cpp:
(WebCore::Canvas2DLayerManager::layerAllocatedStorageChanged):

Source/WebKit/chromium:

Breaking recursion cycle by not reporting a change in memory allocation
when no memory is freed in FakeCanvas2DLayer::freeMemoryIfPossible.

* tests/Canvas2DLayerManagerTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@126787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] Free Url_Bar on program exit
https://bugs.webkit.org/show_bug.cgi?id=95086

Patch by Sudarsana Nagineni <sudarsana.nagineni@linux.intel.com> on 2012-08-27
Reviewed by Eric Seidel.

Fix a memory leak by freeing the Url_Bar on program exit.

* MiniBrowser/efl/main.c:
(main): Call url_bar_del() to free the Url_Bar.

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