Unify allowfullscreen logic in Document::webkitFullScreenEnabled and fullScreenIsAllowedForElement.
https://bugs.webkit.org/show_bug.cgi?id=91448

Reviewed by Adrienne Walker.

Unifies redundant traversal logic and static cast previously used
to determine if an element or document can be made fullscreen.
This clean up prepares for pointer lock, which will use the same logic.

Added a test to detect an edge case of an owning document with
fullscreen permision moving an iframe to fullscreen, while that iframe
does not have permision for its contents to be made fullscreen.

Source/WebCore:

Test: fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent.html

* dom/Document.cpp:
(WebCore::isAttributeOnAllOwners):
(WebCore::Document::fullScreenIsAllowedForElement):
(WebCore::Document::webkitFullscreenEnabled):

LayoutTests:

* fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent-expected.txt: Added.
* fullscreen/full-screen-iframe-without-allow-attribute-allowed-from-parent.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Fix up old name in RuleSet::addRulesFromSheet
https://bugs.webkit.org/show_bug.cgi?id=91646

Reviewed by Andreas Kling.

Simple parameter rename, no change in functionality.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRulesForList): Renamed styleSelector to resolver to reflect recent rename of the parameter type.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123006 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed, more compile fixes on Chromium Win.

Source/WebKit/chromium:

* tests/WebTransformationMatrixTest.cpp:
(WebKit::TEST):

Tools:

* DumpRenderTree/chromium/TestShellWin.cpp:
(TestShell::waitTestFinished):
* DumpRenderTree/chromium/WebThemeControlDRTWin.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123007 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make TextCodecLatin1 handle 8 bit data without converting to UChar's
https://bugs.webkit.org/show_bug.cgi?id=90319

Reviewed by Oliver Hunt.

Source/WebCore: 

Updated codec to create 8 bit strings where possible.
We assume that the incoming stream can all be decoded as 8-bit values.
If we find a 16-bit value, we take the already decoded data and
copy / convert it to a 16-bit buffer and then continue process the rest
of the stream as 16-bits.

No new tests, functionality covered with existing tests.

* platform/text/TextCodecASCIIFastPath.h:
(WebCore::copyASCIIMachineWord):
* platform/text/TextCodecLatin1.cpp:
(WebCore::TextCodecLatin1::decode):

Source/WTF: 

* wtf/text/StringImpl.h:
(StringImpl): Exported LChar variant of adopt().
* wtf/text/WTFString.h:
(WTF::String::createUninitialized): Exported LChar variant.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Chromium Mac: Add TEXTURE_RECTANGLE_ARB support to CCVideoLayerImpl
https://bugs.webkit.org/show_bug.cgi?id=91169

Patch by Sailesh Agrawal <sail@chromium.org> on 2012-07-18
Reviewed by Adrienne Walker.

Source/Platform:

Added a "orientation" field to WebCompositorIOSurfaceQuad. This is used at draw time to flip the texture if necessary.

* chromium/public/WebCompositorIOSurfaceQuad.h: Added orientation field to the constructor.
(WebKit::WebCompositorIOSurfaceQuad::orientation):
(WebCompositorIOSurfaceQuad): The new orientation field should be set to Flipped if the texture should be flipped when drawing.

Source/WebCore:

This extends CCVideoLayerImpl to support TEXTURE_RECTANGLE_ARB. This texture target is used by the Mac hardware accelerated video decoder.

No new tests (HW video decode on Mac is being tested manually.).

* platform/chromium/support/WebCompositorIOSurfaceQuad.cpp:
(WebKit::WebCompositorIOSurfaceQuad::create): Added an orientation argument.
(WebKit::WebCompositorIOSurfaceQuad::WebCompositorIOSurfaceQuad): Added an orientation argument.
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::drawIOSurfaceQuad): Added support for non-flipped IOSurface textures.
* platform/graphics/chromium/LayerRendererChromium.h:
(LayerRendererChromium): Changed TextureIOSurfaceProgram to be non-flipped. To draw flipped textures drawIOSurfaceQuad sets a different value for texTransformLocation.
* platform/graphics/chromium/cc/CCIOSurfaceLayerImpl.cpp:
(WebCore::CCIOSurfaceLayerImpl::appendQuads): Updated call to CCIOSurfaceDrawQuad constructor.
* platform/graphics/chromium/cc/CCVideoLayerImpl.cpp:
(WebCore::CCVideoLayerImpl::appendQuads): Added support for drawing TEXTURE_RECTANGLE_ARB textures.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123009 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] ewk_cookie_manager_persistent_storage_set is not exported
https://bugs.webkit.org/show_bug.cgi?id=91647

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-07-18
Reviewed by Gustavo Noronha Silva.

Properly export ewk_cookie_manager_persistent_storage_set in
ewk_cookie_manager.h by using EAPI.

* UIProcess/API/efl/ewk_cookie_manager.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123010 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make TextCodecUTF8 handle 8 bit data without converting to UChar's
https://bugs.webkit.org/show_bug.cgi?id=90320

Reviewed by Oliver Hunt.

Change UTF8 Codec to produce 8-bit strings when data fits in 8-bit range.
First we try decoding the string as all 8-bit and then fall back to 16 bit
when we find the first character that doesn't fit in 8 bits.  Then we take
the already decoded data and copy / convert it to a 16-bit buffer and then
continue process the rest of the stream as 16-bits.

No new tests, no change in functionality.

* platform/text/TextCodecUTF8.cpp:
(WebCore::TextCodecUTF8::handleError):
(WebCore::TextCodecUTF8::decode):
* platform/text/TextCodecUTF8.h:
(TextCodecUTF8):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123011 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed gardening.

Remove some test expectations with my name on it, they are currently passing.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123012 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebKit provides APIs that make it possible for JSC to attempt to initialise the heap without initialising threading
https://bugs.webkit.org/show_bug.cgi?id=91663

Reviewed by Filip Pizlo.

Initialising a JSGlobalData now requires us to have initialised JSC's threading
logic, as that also initialises the JSC VM runtime options.  WebKit provides a
number of routines that make use of commonJSGlobalData() that can be used before
webcore has called the appropriate initialisation routine.  This patch makes the
minimal change of ensuring that commonJSGlobalData initialises threading before
attempting to create the common heap.

* bindings/js/JSDOMWindowBase.cpp:
(WebCore::JSDOMWindowBase::commonJSGlobalData):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123013 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Call SQLiteFileSystem-related functions directly
https://bugs.webkit.org/show_bug.cgi?id=91631

Reviewed by Adam Barth.

Source/Platform:

Part of a refactoring series. See tracking bug 82948.

* chromium/public/Platform.h:
(Platform):
(WebKit::Platform::databaseOpenFile):
(WebKit::Platform::databaseDeleteFile):
(WebKit::Platform::databaseGetFileAttributes):
(WebKit::Platform::databaseGetFileSize):
(WebKit::Platform::databaseGetSpaceAvailableForOrigin):

Source/WebCore:

Part of a refactoring series. See tracking bug 82948.

* Modules/webdatabase/chromium/QuotaTracker.cpp:
(WebCore::QuotaTracker::getDatabaseSizeAndSpaceAvailableToOrigin):
* platform/chromium/PlatformSupport.h:
(PlatformSupport):
* platform/sql/chromium/SQLiteFileSystemChromium.cpp:
(WebCore::SQLiteFileSystem::deleteDatabaseFile):
(WebCore::SQLiteFileSystem::getDatabaseFileSize):
* platform/sql/chromium/SQLiteFileSystemChromiumPosix.cpp:
* platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp:

Source/WebKit/chromium:

Part of a refactoring series. See tracking bug 82948.

* public/platform/WebKitPlatformSupport.h:
(WebKitPlatformSupport):
* src/PlatformSupport.cpp:
(WebCore):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Update Chromium test expectations after filing the bug 91666.

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123015 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WK2] Add C API for Network Information API
https://bugs.webkit.org/show_bug.cgi?id=90762

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-07-18
Reviewed by Kenneth Rohde Christiansen.

Add C API for WKNetworkInfo and WKNetworkInfoManager
so that they can be used by the client.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* UIProcess/API/C/WKContext.cpp:
(WKContextGetNetworkInfoManager):
* UIProcess/API/C/WKContext.h:
* UIProcess/API/C/WKNetworkInfo.cpp: Copied from Source/WebKit2/UIProcess/API/C/WKNetworkInfoManager.cpp.
(WKNetworkInfoGetTypeID):
(WKNetworkInfoCreate):
* UIProcess/API/C/WKNetworkInfo.h: Copied from Source/WebKit2/UIProcess/API/C/WKNetworkInfoManager.cpp.
* UIProcess/API/C/WKNetworkInfoManager.cpp:
(WKNetworkInfoManagerSetProvider):
(WKNetworkInfoManagerProviderDidChangeNetworkInformation):
* UIProcess/API/C/WKNetworkInfoManager.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123016 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed, fix some MSVC compile warnings.

* tests/CCDamageTrackerTest.cpp:
(WebKitTests::TEST_F):
* tests/CCLayerTreeHostCommonTest.cpp:
* tests/TiledLayerChromiumTest.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123017 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed gardening.
http/tests/loading/307-after-303-after-post.html is flaky on win debug too.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123018 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL][WK2] EFL should use DownloadSoup instead of defining DownloadEfl
https://bugs.webkit.org/show_bug.cgi?id=91602

Patch by Christophe Dumez <christophe.dumez@intel.com> on 2012-07-18
Reviewed by Kenneth Rohde Christiansen.

Reuse WebProcess/Downloads/soup/DownloadSoup.cpp in EFL port
instead of redefining our own DownloadEfl.cpp. The EFL port
is also using libsoup so it is best to avoid code duplication.

* GNUmakefile.am:
* GNUmakefile.list.am:
* PlatformEfl.cmake:
* WebProcess/Downloads/Download.h:
(WebKit):
(Download):
* WebProcess/Downloads/efl/DownloadEfl.cpp: Removed.
* WebProcess/Downloads/efl/DownloadSoupErrorsEfl.cpp: Added.
(WebKit):
(WebKit::platformDownloadNetworkError):
(WebKit::platformDownloadDestinationError):
* WebProcess/Downloads/efl/FileDownloaderEfl.cpp: Removed.
* WebProcess/Downloads/efl/FileDownloaderEfl.h: Removed.
* WebProcess/Downloads/gtk/DownloadSoupErrorsGtk.cpp: Added.
(WebKit):
(WebKit::platformDownloadNetworkError):
(WebKit::platformDownloadDestinationError):
* WebProcess/Downloads/soup/DownloadSoup.cpp: Make the code
compile for other ports than GTK.
(WebKit::DownloadClient::didReceiveResponse):
(WebKit::DownloadClient::didReceiveData):
(WebKit::DownloadClient::didFail):
(WebKit::Download::continueWithoutCredential):
(WebKit):
(WebKit::Download::useCredential):
(WebKit::Download::cancelAuthenticationChallenge):
* WebProcess/Downloads/soup/DownloadSoupErrors.h: Added.
(WebKit):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123019 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Fix some coding style violations
https://bugs.webkit.org/show_bug.cgi?id=91565

Reviewed by Tony Chang.

Source/WebCore:

In declarations, put the * next to the type not the identifier.
Remove k as a prefix for various constants.

No new tests - no functional changes.

* Modules/indexeddb/IDBCursorBackendImpl.cpp:
(WebCore::IDBCursorBackendImpl::prefetchContinueInternal):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::computeFileIdentifier):
* Modules/indexeddb/IDBKey.h:
(WebCore::IDBKey::IDBKey):
* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore::IDBLevelDBBackingStore::getDatabaseNames):
(WebCore::IDBLevelDBBackingStore::getIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::createIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::updateIDBDatabaseMetaData):
(WebCore::IDBLevelDBBackingStore::deleteDatabase):
(WebCore::IDBLevelDBBackingStore::getObjectStores):
(WebCore::getNewObjectStoreId):
(WebCore::IDBLevelDBBackingStore::createObjectStore):
(WebCore::IDBLevelDBBackingStore::deleteObjectStore):
(WebCore::getNewVersionNumber):
(WebCore::IDBLevelDBBackingStore::nextAutoIncrementNumber):
(WebCore::IDBLevelDBBackingStore::forEachObjectStoreRecord):
(WebCore::IDBLevelDBBackingStore::getIndexes):
(WebCore::getNewIndexId):
(WebCore::IDBLevelDBBackingStore::createIndex):
(WebCore::IDBLevelDBBackingStore::putIndexDataForRecord):
(WebCore):
* Modules/indexeddb/IDBLevelDBCoding.cpp:
(IDBLevelDBCoding):
(WebCore::IDBLevelDBCoding::maxIDBKey):
(WebCore::IDBLevelDBCoding::minIDBKey):
(WebCore::IDBLevelDBCoding::decodeVarInt):
(WebCore::IDBLevelDBCoding::encodeIDBKey):
(WebCore::IDBLevelDBCoding::decodeIDBKey):
(WebCore::IDBLevelDBCoding::extractEncodedIDBKey):
(WebCore::IDBLevelDBCoding::keyTypeByteToKeyType):
(WebCore::IDBLevelDBCoding::compareEncodedIDBKeys):
(WebCore::IDBLevelDBCoding::encodeIDBKeyPath):
(WebCore::IDBLevelDBCoding::decodeIDBKeyPath):
(WebCore::IDBLevelDBCoding::compare):
(WebCore::IDBLevelDBCoding::KeyPrefix::KeyPrefix):
(WebCore::IDBLevelDBCoding::KeyPrefix::encode):
(WebCore::IDBLevelDBCoding::KeyPrefix::compare):
(WebCore::IDBLevelDBCoding::KeyPrefix::type):
(WebCore::IDBLevelDBCoding::SchemaVersionKey::encode):
(WebCore::IDBLevelDBCoding::MaxDatabaseIdKey::encode):
(WebCore::IDBLevelDBCoding::DatabaseFreeListKey::decode):
(WebCore::IDBLevelDBCoding::DatabaseFreeListKey::encode):
(WebCore::IDBLevelDBCoding::DatabaseNameKey::decode):
(WebCore::IDBLevelDBCoding::DatabaseNameKey::encode):
(WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::decode):
(WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::encode):
(WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::encodeMaxKey):
(WebCore::IDBLevelDBCoding::IndexMetaDataKey::decode):
(WebCore::IDBLevelDBCoding::IndexMetaDataKey::encode):
(WebCore::IDBLevelDBCoding::IndexMetaDataKey::encodeMaxKey):
(WebCore::IDBLevelDBCoding::ObjectStoreFreeListKey::decode):
(WebCore::IDBLevelDBCoding::ObjectStoreFreeListKey::encode):
(WebCore::IDBLevelDBCoding::IndexFreeListKey::decode):
(WebCore::IDBLevelDBCoding::IndexFreeListKey::encode):
(WebCore::IDBLevelDBCoding::ObjectStoreNamesKey::decode):
(WebCore::IDBLevelDBCoding::ObjectStoreNamesKey::encode):
(WebCore::IDBLevelDBCoding::IndexNamesKey::decode):
(WebCore::IDBLevelDBCoding::IndexNamesKey::encode):
(WebCore::IDBLevelDBCoding::ObjectStoreDataKey::decode):
(WebCore::IDBLevelDBCoding::ObjectStoreDataKey::encode):
(WebCore::IDBLevelDBCoding::ExistsEntryKey::decode):
(WebCore::IDBLevelDBCoding::ExistsEntryKey::encode):
(WebCore::IDBLevelDBCoding::IndexDataKey::decode):
* Modules/indexeddb/IDBLevelDBCoding.h:
(IDBLevelDBCoding):
(ObjectStoreDataKey):
(ExistsEntryKey):

Source/WebKit/chromium:

* tests/IDBLevelDBCodingTest.cpp:
(IDBLevelDBCoding::TEST):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123020 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Qt] feature detection in orwt/nrwt does not work with force_static_libs_as_shared
https://bugs.webkit.org/show_bug.cgi?id=91514

Reviewed by Dirk Pranke.

Analyzing libQtWebKit.so is not enough in the case of force_static_libs_as_shared.
We need to analyze all the shared library or at least the WebCore one.

* Scripts/webkitdirs.pm:
(builtDylibPathForName):
In orwt it is hard coded to search for symbols in the WebCore library.
While in theory it is possible that symbols for a given feature are not
located in that, it doesn't happen in practice, so returning the path of
the WebCore library for a force_static_libs_as_shared build is enough to
fix the bug and it doesn't require a bigger refactoring. For a default
build we still return the path of the QtWebKit lib.
* Scripts/webkitpy/layout_tests/port/qt.py:
(QtPort._modules_to_search_for_symbols):
Enumerate all dynamic libraries, not just the QtWebKit one.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123021 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed gardening.

svg/W3C-I18N/tspan-dirRTL-ubEmbed-in-default-context.svg flakily crashes on Chromium Win.

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123022 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Unreviewed, try to fix the chromium-win build after r123014.

* platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@123023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed test expectations update. Added bug ID for fast/filesystem/file-writer-truncate-extend.html flakiness.

* platform/chromium/TestExpectations:

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