IndexedDB: Closing connection in upgradeneeded should result in error event
https://bugs.webkit.org/show_bug.cgi?id=99486

Reviewed by Tony Chang.

Source/WebCore:

The IDB spec requires that "...if connection is closed, return a DOMError of type AbortError".
This was being handled during the "enqueue" phase, which was too early either for synchronously
executing scripts or asynchronous messaging in multiprocess ports (crbug.com/150691). Move the
logic to the "dispatch" phase.

Test: storage/indexeddb/intversion-close-in-oncomplete.html

* Modules/indexeddb/IDBOpenDBRequest.cpp:
(WebCore::IDBOpenDBRequest::onSuccess): Move success to error morphing from here...
(WebCore::IDBOpenDBRequest::dispatchEvent): To here.
* Modules/indexeddb/IDBOpenDBRequest.h:
(IDBOpenDBRequest):

LayoutTests:

Updated test expectation - error, not success.

* storage/indexeddb/intversion-close-in-oncomplete-expected.txt:
* storage/indexeddb/resources/intversion-close-in-oncomplete.js:
(deleteSuccess):
(upgradeNeeded.transaction.oncomplete):
(upgradeNeeded):
(openError):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131668 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Crash in ContainerNode::removeAllChildren()
https://bugs.webkit.org/show_bug.cgi?id=98443

Reviewed by Eric Carlson.

Source/WebCore:

This patch makes the errorEventSender added in WebKit Revision 112190 interact
with the updatedHasPendingLoadEvent() mechanism in the same manner as the other
existing event senders.

Test: http/tests/security/video-poster-cross-origin-crash2.html

* loader/ImageLoader.cpp:
(WebCore::ImageLoader::setImage):
(WebCore::ImageLoader::updateFromElement):
(WebCore::ImageLoader::notifyFinished):
(WebCore::ImageLoader::updatedHasPendingEvent):
(WebCore::ImageLoader::dispatchPendingBeforeLoadEvent):
(WebCore::ImageLoader::dispatchPendingLoadEvent):
* loader/ImageLoader.h:
(ImageLoader):

LayoutTests:

* http/tests/security/video-poster-cross-origin-crash2-expected.txt: Added.
* http/tests/security/video-poster-cross-origin-crash2.html: Added.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131670 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Incorrect rendering of borders on <col> with span > 1
https://bugs.webkit.org/show_bug.cgi?id=76246

Patch by Arpita Bahuguna <arpitabahuguna@gmail.com> on 2012-10-17
Reviewed by Julien Chaffraix.

Source/WebCore:

The HTML5 rendering specification [10.2.2 - Display Types] states that
"For the purposes of the CSS table model, the col element is expected to
be treated as if it was present as many times as its span attribute
specifies."
We should thus apply a col element's border as if the element is present
as many number of times as its span attribute.

Apart from this, we should also treat the col and its enclosing colgroup
separately while computing the collapsed borders.

Test: fast/table/border-collapsing/collapsed-border-with-col-colgroup-span.html

* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeCollapsedStartBorder):
(WebCore::RenderTableCell::computeCollapsedEndBorder):
Borders from col and its enclosing colgroup element should be handled
separately, while considering the preceeding col's end border (for start
border computation) and the next col's start border (for end border
computation).

Also, have made changes for handling of col elements with span attribute as
per the specification. We now apply the border (start or end) of the col
element irrespective of whether it has any span specified for it or not.

LayoutTests:

* fast/table/border-collapsing/cached-change-colgroup-border-color-expected.png:
* fast/table/border-collapsing/cached-change-colgroup-border-color-expected.txt:
* fast/table/border-collapsing/cached-change-colgroup-border-width-expected.png:
* fast/table/border-collapsing/cached-change-colgroup-border-width-expected.txt:
Existing tests modified. This is because previously, while computing collapsed
start border, we did not take the preceeding col's enclosing colgroup's end border
into consideration. While computing the collapsed start border, only the preceeding
col element's end border was considered.

With this fix, for the above two tests, the last col's width now changes due to
the border being applied to it (the preceeding col's enclosing colgroup's end border)
which causes the table's width to change. Also, we should note that the cell's grow
by half the border's width; which is expected (on account of their being collapsed
borders).

* fast/table/border-collapsing/collapsed-border-with-col-colgroup-span-expected.txt: Added.
* fast/table/border-collapsing/collapsed-border-with-col-colgroup-span.html: Added.
* platform/chromium-linux/fast/table/border-collapsing/collapsed-border-with-col-colgroup-span-expected.png: Added.
Image only test added for verifying the behavior of collapsed borders with
col and colgroup span.
New expected image file added for the chromium-linux port.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131671 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Destroy leveldb directory if unknown schema is detected
https://bugs.webkit.org/show_bug.cgi?id=99636

Reviewed by Tony Chang.

chromium browser test in progress at
https://codereview.chromium.org/11196029

* Modules/indexeddb/IDBLevelDBBackingStore.cpp:
(WebCore):
(WebCore::isSchemaKnown):
Return true when the schema key doesn't exist because new databases
won't have one.

(WebCore::setUpMetadata):
(WebCore::IDBLevelDBBackingStore::open):
Piggy-back on existing leveldb::destroy code.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131672 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[V8] Don't generate code that declares visitDOMWrapper if we're not going to generate the implementation
https://bugs.webkit.org/show_bug.cgi?id=99653

Reviewed by Eric Seidel.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateHeader):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131673 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[GTK] AccessibilityUIElement::role() should be consistent across platforms wherever possible
https://bugs.webkit.org/show_bug.cgi?id=99640

Patch by Joanmarie Diggs <jdiggs@igalia.com> on 2012-10-17
Reviewed by Chris Fleizach.

Tools:

Convert AtkRole instances to the Mac/Safari-style AXRole string.

* DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp:
(roleToString): New method to convert AtkRole instances to the Mac/Safari-style AXRole string
(AccessibilityUIElement::role): Output the Mac/Safair-style AXRole string rather than the AtkRole's name

LayoutTests:

Updated tests and expectations to use the Mac/Safari-style AXRole strings

* platform/gtk/accessibility/adjacent-continuations-cause-assertion-failure-expected.txt:
* platform/gtk/accessibility/aria-combobox-expected.txt:
* platform/gtk/accessibility/aria-fallback-roles-expected.txt:
* platform/gtk/accessibility/aria-menubar-menuitems-expected.txt:
* platform/gtk/accessibility/aria-roles-expected.txt:
* platform/gtk/accessibility/aria-roles-unignored-expected.txt:
* platform/gtk/accessibility/aria-roles-unignored.html:
* platform/gtk/accessibility/aria-slider-required-attributes-expected.txt:
* platform/gtk/accessibility/aria-slider-required-attributes.html:
* platform/gtk/accessibility/aria-table-hierarchy-expected.txt:
* platform/gtk/accessibility/aria-table-hierarchy.html:
* platform/gtk/accessibility/aria-tables-expected.txt:
* platform/gtk/accessibility/aria-toggle-button-role-expected.txt:
* platform/gtk/accessibility/aria-toggle-button-role.html:
* platform/gtk/accessibility/aria-toggle-button-with-title-expected.txt:
* platform/gtk/accessibility/button-accessible-name-expected.txt:
* platform/gtk/accessibility/button-accessible-name.html:
* platform/gtk/accessibility/canvas-description-and-role-expected.txt:
* platform/gtk/accessibility/caret-browsing-text-focus-expected.txt:
* platform/gtk/accessibility/caret-browsing-text-focus.html:
* platform/gtk/accessibility/deleting-iframe-destroys-axcache-expected.txt:
* platform/gtk/accessibility/div-within-anchors-causes-crash-expected.txt:
* platform/gtk/accessibility/entry-and-password-expected.txt:
* platform/gtk/accessibility/input-slider-expected.txt:
* platform/gtk/accessibility/input-slider.html:
* platform/gtk/accessibility/legend-expected.txt:
* platform/gtk/accessibility/list-items-always-exposed-expected.txt:
* platform/gtk/accessibility/list-items-always-exposed.html:
* platform/gtk/accessibility/media-controls-panel-title-expected.txt:
* platform/gtk/accessibility/media-controls-panel-title.html:
* platform/gtk/accessibility/name-from-label-expected.txt:
* platform/gtk/accessibility/name-from-label.html:
* platform/gtk/accessibility/object-with-title-expected.txt:
* platform/gtk/accessibility/object-with-title.html:
* platform/gtk/accessibility/replaced-objects-in-anonymous-blocks-expected.txt:
* platform/gtk/accessibility/spans-expected.txt:
* platform/gtk/accessibility/spans-paragraphs-and-divs-expected.txt:
* platform/gtk/accessibility/spans-paragraphs-and-divs.html:
* platform/gtk/accessibility/spans.html:
* platform/gtk/accessibility/svg-image-expected.txt:
* platform/gtk/accessibility/table-hierarchy-expected.txt:
* platform/gtk/accessibility/table-hierarchy.html:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131674 268f45cc-cd09-0410-ab3c-d52691b4dbfc
[WebKit2] Add removeChild: to WKDOMNode and make WKDOMText.data read/write
https://bugs.webkit.org/show_bug.cgi?id=99662

Reviewed by Sam Weinig.

Source/WebCore:

Export needed symbols.

* WebCore.exp.in:

Source/WebKit2:

* WebProcess/InjectedBundle/API/mac/WKDOMNode.h:
* WebProcess/InjectedBundle/API/mac/WKDOMNode.mm:
(-[WKDOMNode removeChild:]):
* WebProcess/InjectedBundle/API/mac/WKDOMText.h:
* WebProcess/InjectedBundle/API/mac/WKDOMText.mm:
(-[WKDOMText setData:]):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131675 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Roll out r131645 as it causes random site crashes.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131676 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Move handling of CSSPropertyWebkitLineClamp from StyleResolver into StyleBuilder.
https://bugs.webkit.org/show_bug.cgi?id=99534

Reviewed by Alexis Menard.

One small step towards removing the giant switch statement in StyleResolver, this patch moves line clamp handling into StyleBuilder.

Covered by fast/overflow/line-clamp.html

* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@131677 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Make dom-query.html slightly faster by removing unnecessary ref-churn in StringTraits
https://bugs.webkit.org/show_bug.cgi?id=99652

Reviewed by Adam Barth.

My testing showed this moved dom-query.html from  465560 runs/s to 479019
which is about 2% if I'm doing my math correctly.

I suspect that's due to avoiding the ref-churn we were incurring by using
return-by-value symantics here.

This is just the tip of the iceburg. :)

* bindings/v8/V8StringResource.cpp:
(StringTraits):
* bindings/v8/V8ValueCache.h:
(WebCore::WebCoreStringResource::webcoreString):
(WebCore::WebCoreStringResource::atomicString):


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