Layout Test editing/selection/move-by-character-crash-test-textarea.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=104951

Reviewed by Eric Seidel.

The problem was that editing/selection/move-by-character-6.html was running editing commands
in a timer without making the test runner wait. Fixed the bug by calling waitUntilDone and
notifyDone at appropriate places in editing.js.

We don't need to rebaseline other tests since this is the only test that uses commandDelay.

* editing/editing.js:
(setSelectionCommand):
(transposeCharactersCommand):
(moveSelectionLeftByCharacterCommand):
(moveSelectionRightByCharacterCommand):
(extendSelectionLeftByCharacterCommand):
(extendSelectionRightByCharacterCommand):
(moveSelectionForwardByCharacterCommand):
(extendSelectionForwardByCharacterCommand):
(moveSelectionForwardByWordCommand):
(extendSelectionForwardByWordCommand):
(moveSelectionForwardBySentenceCommand):
(extendSelectionForwardBySentenceCommand):
(moveSelectionForwardByLineCommand):
(extendSelectionForwardByLineCommand):
(moveSelectionForwardByLineBoundaryCommand):
(extendSelectionForwardByLineBoundaryCommand):
(moveSelectionBackwardByCharacterCommand):
(extendSelectionBackwardByCharacterCommand):
(moveSelectionBackwardByWordCommand):
(extendSelectionBackwardByWordCommand):
(moveSelectionBackwardBySentenceCommand):
(extendSelectionBackwardBySentenceCommand):
(moveSelectionBackwardByLineCommand):
(extendSelectionBackwardByLineCommand):
(extendSelectionBackwardByLineBoundaryCommand):
(moveSelectionBackwardByLineBoundaryCommand):
(boldCommand):
(underlineCommand):
(fontNameCommand):
(fontSizeCommand):
(fontSizeDeltaCommand):
(italicCommand):
(justifyCenterCommand):
(justifyLeftCommand):
(justifyRightCommand):
(insertHTMLCommand):
(insertImageCommand):
(insertLineBreakCommand):
(insertParagraphCommand):
(insertNewlineInQuotedContentCommand):
(typeCharacterCommand):
(selectAllCommand):
(strikethroughCommand):
(undoCommand):
(redoCommand):
(changeRootSize):
(cutCommand):
(copyCommand):
(pasteCommand):
(createLinkCommand):
(unlinkCommand):
(pasteAndMatchStyleCommand):
(deleteCommand):
(forwardDeleteCommand):
(backColorCommand):
(foreColorCommand):
(executeCommand):
* platform/mac/editing/selection/move-by-character-6-expected.txt: Rebaselined.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
IndexedDB: Don't use strings to represent serialized values
https://bugs.webkit.org/show_bug.cgi?id=104354

Patch by Michael Pruett <michael@68k.org> on 2012-12-17
Reviewed by Kentaro Hara.

Use Vector<uint8_t> rather than String to represent serialized values
in IndexedDB. This change is necessary to implement IndexedDB for JSC.

Tests: storage/indexeddb/*

* Modules/indexeddb/IDBBackingStore.cpp:
(WebCore::IDBBackingStore::getRecord):
(WebCore::IDBBackingStore::putRecord):
(WebCore::ObjectStoreKeyCursorImpl::value):
(WebCore::ObjectStoreKeyCursorImpl::ObjectStoreKeyCursorImpl):
(WebCore::ObjectStoreCursorImpl::value):
(ObjectStoreCursorImpl):
(WebCore::ObjectStoreCursorImpl::loadCurrentRow):
(WebCore::IndexKeyCursorImpl::value):
(WebCore::IndexCursorImpl::value):
(WebCore::IndexCursorImpl::IndexCursorImpl):
(IndexCursorImpl):
(WebCore::IndexCursorImpl::loadCurrentRow):
* Modules/indexeddb/IDBBackingStore.h:
(IDBBackingStore):
(Cursor):
* Modules/indexeddb/IDBCursorBackendImpl.cpp:
(WebCore::IDBCursorBackendImpl::CursorPrefetchIterationOperation::perform):
* Modules/indexeddb/IDBCursorBackendImpl.h:
(WebCore::IDBCursorBackendImpl::value):
* Modules/indexeddb/IDBIndexBackendImpl.cpp:
(WebCore::IDBIndexBackendImpl::IndexReferencedValueRetrievalOperation::perform):
* Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
(WebCore::IDBObjectStoreBackendImpl::ObjectStoreRetrievalOperation::perform):
(WebCore::IDBObjectStoreBackendImpl::ObjectStoreStorageOperation::perform):
* bindings/js/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::SerializedScriptValue):
(WebCore):
* bindings/js/SerializedScriptValue.h:
* bindings/v8/SerializedScriptValue.cpp:
(WebCore::SerializedScriptValue::createFromWireBytes):
(WebCore):
(WebCore::SerializedScriptValue::toWireBytes):
* bindings/v8/SerializedScriptValue.h:
(SerializedScriptValue):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@137954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Implement matching cue by the class name with ::cue pseudo element
https://bugs.webkit.org/show_bug.cgi?id=104191

Patch by Dima Gorbik <dgorbik@apple.com> on 2012-12-17
Reviewed by Antti Koivisto.

Source/WebCore:

Implemented the ::cue() pseudo-element with an argument that may hold a simple selector list.
This enables matching cue objects by the class name.

Test: media/track/track-css-matching.html

* css/CSSGrammar.y.in: support parsing the ::cue() with an argument.
* css/CSSParser.cpp:
(WebCore::CSSParser::detectFunctionTypeToken): tokenize the 'cue'.
(WebCore::CSSParser::updateSpecifiersWithElementName): do not set the tag for the cue pseudo-element because
the ::cue may match elements with different tags.
(WebCore::CSSParser::updateSpecifiers): the behavior for the PseudoCue selector should be same as for
unknown pseudo elements - the pseudo-element should stay on top of the selector chain.
* css/CSSSelector.cpp: added the type detection for the new selector.
(WebCore::CSSSelector::pseudoId):
(WebCore::nameToPseudoTypeMap):
(WebCore::CSSSelector::extractPseudoType):
* css/CSSSelector.h:
* css/RuleSet.cpp: add a new list to hold all the rulesets for the new pseudo element.
(WebCore::RuleSet::reportMemoryUsage):
(WebCore::RuleSet::addRule):
(WebCore::RuleSet::shrinkToFit):
* css/RuleSet.h:
(RuleSet):
(WebCore::RuleSet::cuePseudoRules):
* css/SelectorChecker.cpp:
(WebCore::SelectorChecker::checkOneSelector):
* css/SelectorChecker.h:
(WebCore::SelectorChecker::SelectorCheckingContext::SelectorCheckingContext):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::collectMatchingRules):
* dom/Element.cpp: an addition to the rare data to be able to find out if the node is a webvtt node.
(WebCore):
(WebCore::Element::isWebVTTNode):
(WebCore::Element::setIsWebVTTNode):
(WebCore::Element::cloneDataFromElement):
* dom/Element.h:
(Element):
* dom/ElementRareData.h:
(ElementRareData):
* dom/NodeRareData.h:
(WebCore::NodeRareData::NodeRareData):
(NodeRareData):
(WebCore::NodeRareData::isWebVTTNode):
(WebCore::NodeRareData::setIsWebVTTNode):
* html/track/TextTrackCue.cpp:
(WebCore::TextTrackCue::markNodesAsWebVTTNodes): mark the cloned nodes as WebVTT nodes.
(WebCore):
(WebCore::TextTrackCue::getCueAsHTML):
* html/track/TextTrackCue.h:
(TextTrackCue):
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTParser::constructTreeFromToken):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

Verify that ::cue pseudo-element accepts a simple-selector list that matches cue objects by the a class.

* media/track/captions-webvtt/styling.vtt:
* media/track/track-css-matching-expected.txt: Added.
* media/track/track-css-matching.html: Added.

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