[mathml] Improve performance of nested sup or sub elements
https://bugs.webkit.org/show_bug.cgi?id=103665

Reviewed by Darin Adler.

Source/WebCore:

Reduce the number of extra layouts. Since RenderMathMLSubSup calls
layout twice, this can lead to an exponential number of layouts. Avoid
extra layouts.

Test: mathml/presentation/sup-nested.html - Should not time out.

* css/mathml.css:
(msup): Stretching children also causes extra layouts. Avoid this by aligning to the top.
(msub): Same as msup, but align to the bottom.
* rendering/mathml/RenderMathMLSubSup.cpp:
(WebCore::RenderMathMLSubSup::layout): Only do the second layout if the padding changed.
Also fix up the calls to setNeedsLayout (since we're calling it on this) and
setChildNeedsLayout (since we're calling it on a child).

LayoutTests:

Update Chromium Linux baselines and mark tests as failing on other platforms.
The mathml.css change causes these pixel results changes. This doesn't change
the pixel results, it is only a change to the render tree. The render boxes
should more tightly wrap the superscripts and subscripts but be positioned
in the same place.

* mathml/presentation/sup-nested-expected.txt: Added.
* mathml/presentation/sup-nested.html: Added.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/chromium-linux/mathml/presentation/roots-expected.txt:
* platform/chromium-linux/mathml/presentation/row-alignment-expected.txt:
* platform/chromium-linux/mathml/presentation/sub-expected.txt:
* platform/chromium-linux/mathml/presentation/subsup-expected.txt:
* platform/chromium-linux/mathml/presentation/sup-expected.txt:
* platform/chromium-linux/mathml/presentation/tables-expected.txt:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136409 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Optimization in image decoding
https://bugs.webkit.org/show_bug.cgi?id=88424

Patch by Viatcheslav Ostapenko <v.ostapenko@samsung.com> on 2012-12-03
Reviewed by Brent Fulgham.

Replace int with J_COLOR_SPACE in parameters of templates setPixel and
outputScanlines to avoid casting from int to enum. It required move
inclusion of jpeglib.h and related #if to JPEGImageDecoder.h .

* platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
(WebCore):
(WebCore::setPixel):
(WebCore::JPEGImageDecoder::outputScanlines):
* platform/image-decoders/jpeg/JPEGImageDecoder.h:
(JPEGImageDecoder):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136410 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Text Autosizing: don't autosize horizontal menu items implemented via floating list items
https://bugs.webkit.org/show_bug.cgi?id=103840

Patch by Anton Vayvod <avayvod@chromium.org> on 2012-12-03
Reviewed by Kenneth Rohde Christiansen.

Floating list items are often used to implement horizontal menus. Currently, text autosizing
disregards such elements as autosizing containers. List items are often then autosized as part
of a bigger cluster (usually the whole page) and look too big.
This change turns floating list items into autosizing clusters so they are autosized separately
resulting in no font size multiplication for menu items implemented in this manner.

Source/WebCore:

Test: fast/text-autosizing/cluster-list-item.html

* rendering/TextAutosizer.cpp:
(WebCore::TextAutosizer::isAutosizingContainer): Returns true for floating list items; split the
condition logically.

LayoutTests:

* fast/text-autosizing/cluster-list-item-expected.html: Renamed from LayoutTests/fast/text-autosizing/list-item-out-of-flow-expected.html.
* fast/text-autosizing/cluster-list-item.html: Renamed from LayoutTests/fast/text-autosizing/list-item-out-of-flow.html; added case for a floating list item.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136411 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make MainResourceLoader not use m_frame directly.
https://bugs.webkit.org/show_bug.cgi?id=103907

Reviewed by Darin Adler.

MainResourceLoader will soon cease to be a ResourceLoader subclass.  It currently
makes extensively use of both m_documentLoader and m_frame from ResourceLoader.
By moving everything over to going through m_documentLoader, we reduce the number
of members we have to add to MainResourceLoader in https://bugs.webkit.org/show_bug.cgi?id=49246.

No new tests, refactor only.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/MainResourceLoader.cpp:
(WebCore::MainResourceLoader::MainResourceLoader):
(WebCore::MainResourceLoader::create):
(WebCore::MainResourceLoader::receivedError):
(WebCore::MainResourceLoader::willSendRequest):
(WebCore::MainResourceLoader::continueAfterContentPolicy):
(WebCore::MainResourceLoader::didReceiveResponse):
(WebCore::MainResourceLoader::didReceiveData):
(WebCore::MainResourceLoader::startDataLoadTimer):
* loader/MainResourceLoader.h:
(MainResourceLoader):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136412 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[style scoped]: style scoped needs more tests.
https://bugs.webkit.org/show_bug.cgi?id=99821

Reviewed by Dimitri Glazkov.

Test cases in this patch validate dynamically creating, moving and
removing a scoped style works well.

* fast/css/style-scoped/style-scoped-with-dom-operation-expected.txt: Added.
* fast/css/style-scoped/style-scoped-with-dom-operation.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136413 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Implement context menus in CodeMirrorTextEditor
https://bugs.webkit.org/show_bug.cgi?id=94062

Patch by Jan Keromnes <janx@linux.com> on 2012-12-03
Reviewed by Pavel Feldman.

Listen for contextmenu events in the editor and handle them differently
if triggered on gutter line number or in text body. This adds controls
for breakpoints (including disabled / conditional), debugger navigation
and text input methods.

* inspector/front-end/CodeMirrorTextEditor.js:
(WebInspector.CodeMirrorTextEditor):
(WebInspector.CodeMirrorTextEditor.prototype._contextMenu):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Mac] Enable CSS3 background-position offset by default.
https://bugs.webkit.org/show_bug.cgi?id=103905

Reviewed by Simon Fraser.

Source/JavaScriptCore:

Turn the flag on by default.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Turn the flag on by default.

No new tests : covered by tests landed previously.

* Configurations/FeatureDefines.xcconfig:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapFillXPosition): Build fix in release on Mac with unused variable.
(WebCore::CSSToStyleMap::mapFillYPosition): Ditto.

Source/WebKit/mac:

Turn the flag on by default.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Turn the flag on by default.

* Configurations/FeatureDefines.xcconfig:

LayoutTests:

Enable by default the new CSS3 background position offsets therefore we
can unskip the tests.

* platform/mac/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136415 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Rename exception enum members from UGLY_ERR to PrettyError
https://bugs.webkit.org/show_bug.cgi?id=103759

Reviewed by Darin Fisher.

Source/WebCore:

Now that IDBDatabaseException isn't exposed to script with constants, the exception types
can be renamed to match the much friendlier names used in newer iterations of the spec. Also
remove the legacy/unused types.

No new tests, just constant renames.

* Modules/indexeddb/IDBCursor.cpp:
(WebCore::IDBCursor::update):
(WebCore::IDBCursor::advance):
(WebCore::IDBCursor::continueFunction):
(WebCore::IDBCursor::deleteFunction):
* Modules/indexeddb/IDBCursorBackendImpl.cpp:
(WebCore::IDBCursorBackendImpl::continueFunction):
(WebCore::IDBCursorBackendImpl::advance):
(WebCore::IDBCursorBackendImpl::prefetchContinue):
* Modules/indexeddb/IDBDatabase.cpp:
(WebCore::IDBDatabase::createObjectStore):
(WebCore::IDBDatabase::deleteObjectStore):
(WebCore::IDBDatabase::transaction):
* Modules/indexeddb/IDBDatabaseBackendImpl.cpp:
(WebCore::IDBDatabaseBackendImpl::createObjectStore):
(WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
(WebCore::IDBDatabaseBackendImpl::VersionChangeOperation::perform):
(WebCore::IDBDatabaseBackendImpl::transactionFinishedAndAbortFired):
(WebCore::IDBDatabaseBackendImpl::openConnection):
(WebCore::IDBDatabaseBackendImpl::openConnectionWithVersion):
(WebCore::IDBDatabaseBackendImpl::deleteDatabase):
(WebCore::IDBDatabaseBackendImpl::close):
* Modules/indexeddb/IDBDatabaseException.cpp: Tidying and renaming.
(WebCore):
(WebCore::getErrorEntry):
* Modules/indexeddb/IDBDatabaseException.h:
* Modules/indexeddb/IDBFactory.cpp:
(WebCore::IDBFactory::cmp):
* Modules/indexeddb/IDBFactoryBackendImpl.cpp:
(WebCore::IDBFactoryBackendImpl::getDatabaseNames):
(WebCore::IDBFactoryBackendImpl::deleteDatabase):
(WebCore::IDBFactoryBackendImpl::open):
* Modules/indexeddb/IDBIndex.cpp:
(WebCore::IDBIndex::openCursor):
(WebCore::IDBIndex::count):
(WebCore::IDBIndex::openKeyCursor):
(WebCore::IDBIndex::get):
(WebCore::IDBIndex::getKey):
* Modules/indexeddb/IDBIndexBackendImpl.cpp:
(WebCore::IDBIndexBackendImpl::openCursor):
(WebCore::IDBIndexBackendImpl::openKeyCursor):
(WebCore::IDBIndexBackendImpl::count):
(WebCore::IDBIndexBackendImpl::get):
(WebCore::IDBIndexBackendImpl::getKey):
* Modules/indexeddb/IDBKeyRange.cpp:
(WebCore::IDBKeyRange::only):
(WebCore::IDBKeyRange::lowerBound):
(WebCore::IDBKeyRange::upperBound):
(WebCore::IDBKeyRange::bound):
* Modules/indexeddb/IDBObjectStore.cpp:
(WebCore::IDBObjectStore::get):
(WebCore::IDBObjectStore::put):
(WebCore::IDBObjectStore::deleteFunction):
(WebCore::IDBObjectStore::clear):
(WebCore):
(WebCore::IDBObjectStore::createIndex):
(WebCore::IDBObjectStore::index):
(WebCore::IDBObjectStore::deleteIndex):
(WebCore::IDBObjectStore::openCursor):
(WebCore::IDBObjectStore::count):
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::get):
(WebCore::IDBObjectStoreBackendImpl::put):
(WebCore):
(WebCore::IDBObjectStoreBackendImpl::setIndexKeys):
(WebCore::IDBObjectStoreBackendImpl::ObjectStoreStorageOperation::perform):
(WebCore::IDBObjectStoreBackendImpl::deleteFunction):
(WebCore::IDBObjectStoreBackendImpl::clear):
(WebCore::IDBObjectStoreBackendImpl::createIndex):
(WebCore::IDBObjectStoreBackendImpl::deleteIndex):
(WebCore::IDBObjectStoreBackendImpl::openCursor):
(WebCore::IDBObjectStoreBackendImpl::count):
* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::dispatchEvent):
* Modules/indexeddb/IDBRequest.cpp:
(WebCore::IDBRequest::result):
(WebCore::IDBRequest::error):
(WebCore::IDBRequest::errorCode):
(WebCore::IDBRequest::webkitErrorMessage):
(WebCore::IDBRequest::abort):
(WebCore::IDBRequest::dispatchEvent):
(WebCore::IDBRequest::uncaughtExceptionInEventHandler):
* Modules/indexeddb/IDBTransaction.cpp:
(WebCore::IDBTransaction::objectStore):
(WebCore::IDBTransaction::abort):
* Modules/indexeddb/IDBTransactionBackendImpl.cpp:
(WebCore::IDBTransactionBackendImpl::objectStore):
(WebCore::IDBTransactionBackendImpl::abort):
(WebCore::IDBTransactionBackendImpl::commit):

Source/WebKit/chromium:

Update IDBDatabaseException enum names/values to match WebCore.

* public/WebIDBDatabaseException.h:
* src/AssertMatchingEnums.cpp:
* src/IDBFactoryBackendProxy.cpp:
(WebKit::IDBFactoryBackendProxy::allowIndexedDB):
* tests/IDBRequestTest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136417 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: [Canvas] show replay screenshot of the last call's canvas
https://bugs.webkit.org/show_bug.cgi?id=103739

Reviewed by Pavel Feldman.

When many canvases are being instrumented we'll want to show replay screenshots for each canvas.
Meanwhile, show the screenshot of the last-touched canvas during the current replay.

* inspector/InjectedScriptCanvasModuleSource.js:
(.):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[Chromium] Fix issue with hard coded error codes in quota error
https://bugs.webkit.org/show_bug.cgi?id=103892

Reviewed by Darin Fisher.

Chromium currently hard codes the enum values for QuotaStatusCode. To fix
this we need to do a few iteration of changes. This is the first step and
it exposes the enums that Chromium depends on.

* public/WebStorageQuotaError.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136419 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Turn on the new Skia mask blur algorithm.
https://bugs.webkit.org/show_bug.cgi?id=103906

Reviewed by Adrienne Walker.

Source/WebKit/chromium:

* skia_webkit.gyp:

LayoutTests:

* platform/chromium/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136420 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[chromium] Tell WebInputHandlerClient when end of input is reached for current vsync period
https://bugs.webkit.org/show_bug.cgi?id=103648

Patch by Sami Kyostila <skyostil@chromium.org> on 2012-12-03
Reviewed by James Robinson.

Let the WebInputHandlerClient know when we've received the final input event
for the current vsync period.

Test: WebCompositorInputHandlerImplTest.lastInputEventForVSync

Source/Platform:

* chromium/public/WebInputHandlerClient.h:
(WebKit::WebInputHandlerClient::didReceiveLastInputEventForVSync):
(WebInputHandlerClient):

Source/WebKit/chromium:

* src/WebCompositorInputHandlerImpl.cpp:
(WebKit::WebCompositorInputHandlerImpl::handleInputEvent):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
PDFPlugin: <embed> and <object> PDFs affect their parent frame's page scale
https://bugs.webkit.org/show_bug.cgi?id=103286
<rdar://problem/12752315>

Reviewed by Dan Bernstein. 

Style fixes after http://trac.webkit.org/changeset/136316.

* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::isFullFramePlugin):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136422 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: remove IDBDatabaseBackendInterface::transaction()
https://bugs.webkit.org/show_bug.cgi?id=102733

Reviewed by Darin Fisher.

Source/WebCore:

Part 3 of a refactor, remove the old transaction() method.

No new tests as this is just post-refactor cleanup.

* Modules/indexeddb/IDBDatabaseBackendInterface.h:
(IDBDatabaseBackendInterface):

Source/WebKit/chromium:

Part 3 of a refactor - just remove the proxy code for the now
defunct transaction method.

* public/WebIDBDatabase.h:
* src/IDBDatabaseBackendProxy.cpp:
* src/IDBDatabaseBackendProxy.h:
(IDBDatabaseBackendProxy):
* src/WebIDBDatabaseImpl.cpp:
* src/WebIDBDatabaseImpl.h:
(WebIDBDatabaseImpl):
* tests/IDBDatabaseBackendTest.cpp:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136423 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore: Invalidate SVG width on width attribute changes.
https://bugs.webkit.org/show_bug.cgi?id=103304

Reviewed by Dirk Schulze.

An inline SVG element's replaced width can depend on both attributes and style properties.
After r105513, we invalidated this width on style changes but not attribute changes. With
this patch we invalidate the replaced width on width attribute changes too. Note that height
is handled differently for replaced elements so only the width attribute needs this handling
(the added test covers this too).

Test: svg/custom/root-size-attribute-changes.html

* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::svgAttributeChanged):

LayoutTests: Invalidate SVG width on width attribute change.
https://bugs.webkit.org/show_bug.cgi?id=103304

Reviewed by Dirk Schulze.

* svg/custom/root-size-attribute-changes-expected.html: Added.
* svg/custom/root-size-attribute-changes.html: Added.


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

* platform/chromium/TestExpectations:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Web Inspector: Make main-thread monitoring go through InspectorController
https://bugs.webkit.org/show_bug.cgi?id=103550

Patch by Eugene Klyuchnikov <eustas@chromium.org> on 2012-12-03
Reviewed by Pavel Feldman.

InspectorInstrumentation was a wrong path.

Source/WebCore:

* inspector/InspectorClient.h: Remove start/stop methods.
* inspector/InspectorController.cpp:
Dispatch main thread activity notifications.
* inspector/InspectorController.h: Ditto.
* inspector/InspectorInstrumentation.cpp: Remove dispatchng.
* inspector/InspectorInstrumentation.h: Ditto.
* inspector/InspectorTimelineAgent.cpp:
Do not subscribe for notifications explicitly.

Source/WebKit/chromium:

* src/InspectorClientImpl.cpp: Remove TaskObserver implementation, and
listen/unlisten methods.
* src/InspectorClientImpl.h: Ditto.
* src/WebDevToolsAgentImpl.cpp:
(WebKit::WebDevToolsAgentImpl::~WebDevToolsAgentImpl):
Unsubscribe for main thread activity events.
(WebKit::WebDevToolsAgentImpl::detach): Ditto.
(WebKit::WebDevToolsAgentImpl::attach):
Subscribe for main thread activity events.
(WebKit::WebDevToolsAgentImpl::willProcessTask): Implement TasObserver
interface. Froward to InspectorController.
(WebKit::WebDevToolsAgentImpl::didProcessTask): Ditto.
* src/WebDevToolsAgentImpl.h: Implement TasObserver interface.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136426 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[EFL] Enable CSS3 background-position offsets by default.
https://bugs.webkit.org/show_bug.cgi?id=103879

Reviewed by Laszlo Gombos.

.:

Enable the feature for EFL only.

* Source/cmake/OptionsEfl.cmake:

LayoutTests:

Enable by default the new CSS3 background position offsets therefore we
can unskip the tests.

* platform/efl/TestExpectations:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Performance degradation while rendering MathML content, freezes the tab.
https://bugs.webkit.org/show_bug.cgi?id=102585

Reviewed by Eric Seidel.

Add a regression test for nested fractions. The O(2^n) layout time should
be fixed by r136324.

* mathml/presentation/mfrac-nested-expected.txt: Added.
* mathml/presentation/mfrac-nested.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136428 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Enable CSS3 background-position offset by default
https://bugs.webkit.org/show_bug.cgi?id=103917

Reviewed by Benjamin Poulain.

Even though each port may enable or not the feature we still need
to pass it at configure time otherwise it will be disabled.

* Scripts/webkitperl/FeatureList.pm:

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