Source/WebCore: Reset the canvas backing store pixel ratio when the buffer resizes.

The backing store was not being recreated using the current page pixel ratio
when a resize occurred.

https://bugs.webkit.org/show_bug.cgi?id=100608

Reviewed by Darin Adler.

Test: fast/canvas/canvas-resize-reset-pixelRatio.html

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::HTMLCanvasElement): Use targetDeviceScaleFactor.
(WebCore::HTMLCanvasElement::reset): Do a clear only if the pixel ratios also
match. Store the new pixel ratio in m_deviceScaleFactor.
(WebCore::HTMLCanvasElement::targetDeviceScaleFactor): Added.
* html/HTMLCanvasElement.h:
(WebCore::HTMLCanvasElement::setSize): Return early only if the sizes and
pixel ratios match.

LayoutTests: Test the canvas backing store pixel ratio when the buffer resizes.

https://bugs.webkit.org/show_bug.cgi?id=100608

Reviewed by Darin Adler.

* fast/canvas/canvas-resize-reset-pixelRatio-expected.txt: Added.
* fast/canvas/canvas-resize-reset-pixelRatio.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134099 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Make -webkit-canvas in CSS use the full backing store instead
of always 1x when rendering.

https://bugs.webkit.org/show_bug.cgi?id=100611

Reviewed by Dean Jackson.

Test: fast/canvas/canvas-as-image-hidpi.html

* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::makePresentationCopy): Pass Unscaled to copyImage.
(WebCore::HTMLCanvasElement::copiedImage): Ditto.
* platform/graphics/ImageBuffer.h:
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::copyImage): Added Scale parameter and use copyNativeImage for Unscaled.
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::copyImage): Added unnamed ScaleBehavior parameter.
* platform/graphics/qt/ImageBufferQt.cpp:
(WebCore::ImageBuffer::copyImage): Ditto.
* platform/graphics/skia/ImageBufferSkia.cpp:
(WebCore::ImageBuffer::copyImage): Ditto.
* platform/graphics/wince/ImageBufferWinCE.cpp:
(WebCore::ImageBuffer::copyImage): Ditto.
* platform/graphics/wx/ImageBufferWx.cpp:
(WebCore::ImageBuffer::copyImage): Ditto.

LayoutTests: Test if -webkit-canvas in CSS uses the full backing store instead
of always 1x when rendering.

https://bugs.webkit.org/show_bug.cgi?id=100611

Reviewed by Dean Jackson.

* fast/canvas/canvas-as-image-hidpi-expected.png: Added.
* fast/canvas/canvas-as-image-hidpi-expected.txt: Added.
* fast/canvas/canvas-as-image-hidpi.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134100 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Combine IDBBackingStore and IDBLevelDBBackingStore
https://bugs.webkit.org/show_bug.cgi?id=101415

Reviewed by Tony Chang.

Source/WebCore:

Combine abstract interface IDBBackingStore with its only
implementation, IDBLevelDBBackingStore, to reduce code
complexity. The legacy structure existed to support a SQLLite
IDBBackingStore, but it is no longer worth the complexity to
support this abstraction.

Changes include:
1) Merging IDBLevelDBBackingStore into IDBBackingStore.

2) Merge together IDBBackingStore's inner classes: Cursor,
Transaction, and ObjectStoreRecordIdentfier with their respective
subclasses in IDBLevelDBBackingStore.

3) Simplifying the inner Transaction class to not be refcounted or
virtualized, to allow it to be a simple concrete member of its
owner, IDBTransactionBackendImpl.

No new tests as this is purely a refactor.

* Modules/indexeddb/IDBBackingStore.cpp:
(WebCore::recordInternalError):
(WebCore::setUpMetadata):
(WebCore::IDBBackingStore::IDBBackingStore):
(WebCore):
(WebCore::IDBBackingStore::~IDBBackingStore):
(WebCore::IDBBackingStore::open):
(WebCore::IDBBackingStore::getDatabaseNames):
(WebCore::IDBBackingStore::getIDBDatabaseMetaData):
(WebCore::IDBBackingStore::createIDBDatabaseMetaData):
(WebCore::IDBBackingStore::updateIDBDatabaseIntVersion):
(WebCore::IDBBackingStore::updateIDBDatabaseMetaData):
(WebCore::deleteRange):
(WebCore::IDBBackingStore::deleteDatabase):
(WebCore::IDBBackingStore::getObjectStores):
(WebCore::setMaxObjectStoreId):
(WebCore::IDBBackingStore::createObjectStore):
(WebCore::IDBBackingStore::deleteObjectStore):
(WebCore::IDBBackingStore::getRecord):
(WebCore::IDBBackingStore::putRecord):
(WebCore::IDBBackingStore::clearObjectStore):
(WebCore::IDBBackingStore::deleteRecord):
(WebCore::IDBBackingStore::getKeyGeneratorCurrentNumber):
(WebCore::IDBBackingStore::maybeUpdateKeyGeneratorCurrentNumber):
(WebCore::IDBBackingStore::keyExistsInObjectStore):
(WebCore::IDBBackingStore::getIndexes):
(WebCore::setMaxIndexId):
(WebCore::IDBBackingStore::createIndex):
(WebCore::IDBBackingStore::deleteIndex):
(WebCore::IDBBackingStore::putIndexDataForRecord):
(WebCore::IDBBackingStore::deleteIndexDataForRecord):
(WebCore::IDBBackingStore::findKeyInIndex):
(WebCore::IDBBackingStore::getPrimaryKeyViaIndex):
(WebCore::IDBBackingStore::keyExistsInIndex):
(WebCore::IDBBackingStore::Cursor::Cursor):
(WebCore::IDBBackingStore::Cursor::firstSeek):
(WebCore::IDBBackingStore::Cursor::advance):
(WebCore::IDBBackingStore::Cursor::continueFunction):
(WebCore::IDBBackingStore::Cursor::haveEnteredRange):
(WebCore::IDBBackingStore::Cursor::isPastBounds):
(WebCore::ObjectStoreKeyCursorImpl::create):
(ObjectStoreKeyCursorImpl):
(WebCore::ObjectStoreKeyCursorImpl::value):
(WebCore::ObjectStoreKeyCursorImpl::ObjectStoreKeyCursorImpl):
(WebCore::ObjectStoreKeyCursorImpl::loadCurrentRow):
(WebCore::ObjectStoreCursorImpl::create):
(ObjectStoreCursorImpl):
(WebCore::ObjectStoreCursorImpl::value):
(WebCore::ObjectStoreCursorImpl::ObjectStoreCursorImpl):
(WebCore::ObjectStoreCursorImpl::loadCurrentRow):
(WebCore::IndexKeyCursorImpl::create):
(IndexKeyCursorImpl):
(WebCore::IndexKeyCursorImpl::value):
(WebCore::IndexKeyCursorImpl::primaryKey):
(WebCore::IndexKeyCursorImpl::recordIdentifier):
(WebCore::IndexKeyCursorImpl::IndexKeyCursorImpl):
(WebCore::IndexKeyCursorImpl::loadCurrentRow):
(WebCore::IndexCursorImpl::create):
(IndexCursorImpl):
(WebCore::IndexCursorImpl::value):
(WebCore::IndexCursorImpl::primaryKey):
(WebCore::IndexCursorImpl::recordIdentifier):
(WebCore::IndexCursorImpl::IndexCursorImpl):
(WebCore::IndexCursorImpl::loadCurrentRow):
(WebCore::objectStoreCursorOptions):
(WebCore::indexCursorOptions):
(WebCore::IDBBackingStore::openObjectStoreCursor):
(WebCore::IDBBackingStore::openObjectStoreKeyCursor):
(WebCore::IDBBackingStore::openIndexKeyCursor):
(WebCore::IDBBackingStore::openIndexCursor):
(WebCore::IDBBackingStore::Transaction::Transaction):
(WebCore::IDBBackingStore::Transaction::begin):
(WebCore::IDBBackingStore::Transaction::commit):
(WebCore::IDBBackingStore::Transaction::rollback):
* Modules/indexeddb/IDBBackingStore.h:
(WebCore):
(IDBBackingStore):
(RecordIdentifier):
(WebCore::IDBBackingStore::RecordIdentifier::create):
(WebCore::IDBBackingStore::RecordIdentifier::~RecordIdentifier):
(WebCore::IDBBackingStore::RecordIdentifier::isValid):
(WebCore::IDBBackingStore::RecordIdentifier::primaryKey):
(WebCore::IDBBackingStore::RecordIdentifier::setPrimaryKey):
(WebCore::IDBBackingStore::RecordIdentifier::version):
(WebCore::IDBBackingStore::RecordIdentifier::setVersion):
(WebCore::IDBBackingStore::RecordIdentifier::RecordIdentifier):
(Transaction):
(WebCore::IDBBackingStore::Transaction::levelDBTransactionFrom):
(CursorOptions):
(Cursor):
(WebCore::IDBBackingStore::Cursor::Cursor):
(WebCore::IDBBackingStore::Cursor::key):
(WebCore::IDBBackingStore::Cursor::primaryKey):
(WebCore::IDBBackingStore::Cursor::~Cursor):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::openBackingStore):
* Modules/indexeddb/IDBIndexBackendImpl.cpp:
(WebCore::IDBIndexBackendImpl::countInternal):
* Modules/indexeddb/IDBLevelDBBackingStore.h: Removed.
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
(WebCore::IDBObjectStoreBackendImpl::putInternal):
(WebCore::IDBObjectStoreBackendImpl::deleteInternal):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::IDBTransactionBackendImpl):
(WebCore::IDBTransactionBackendImpl::abort):
(WebCore::IDBTransactionBackendImpl::commit):
(WebCore::IDBTransactionBackendImpl::taskTimerFired):
* Modules/indexeddb/IDBTransactionBackendImpl.h:
(WebCore::IDBTransactionBackendImpl::backingStoreTransaction):
* WebCore.xcodeproj/project.pbxproj:

Source/WebKit/chromium:

Remove method that is no longer in the base class.

* tests/IDBFakeBackingStore.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134101 268f45cc-cd09-0410-ab3c-d52691b4dbfc
REGRESSION (r125239): classList contains() doesn't work after element was moved from strict mode document to quirks mode document
https://bugs.webkit.org/show_bug.cgi?id=101627

Reviewed by Alexey Proskuryakov.

We used to only create m_classNamesForQuirksMode in the constructor or when the class attribute
was changed. If an element is moved from a standards document to a quirks mode document the
m_classNamesForQuirksMode would not be up to date which lead to wrong results.

Now we alway check if m_classNamesForQuirksMode is up to date (in quirks mode only).

Source/WebCore:

Test: fast/dom/Element/class-list-move-between-document-with-different-quirks-mode.html

* html/ClassList.cpp:
(WebCore::ClassList::classNames): Create the m_classNamesForQuirksMode lazily as needed so that
                                  it is up to date.
* html/ClassList.h:

LayoutTests:

* fast/dom/Element/class-list-move-between-document-with-different-quirks-mode-expected.txt: Added.
* fast/dom/Element/class-list-move-between-document-with-different-quirks-mode.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@134102 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Unreviewed, baselines change - remove stray baselines for reftests.

* platform/chromium-mac/platform/chromium/virtual/softwarecompositing/text-on-scaled-layer-expected.png: Removed.
* platform/chromium-mac/platform/chromium/virtual/softwarecompositing/text-on-scaled-surface-expected.png: Removed.

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