[webkit-changes] [105389] trunk/Source/WebCore

2012-01-18 Thread commit-queue
Title: [105389] trunk/Source/WebCore








Revision 105389
Author commit-qu...@webkit.org
Date 2012-01-18 23:52:31 -0800 (Wed, 18 Jan 2012)


Log Message
[v8] Low efficiency of writing long string from web application to plugin.
https://bugs.webkit.org/show_bug.cgi?id=76592

The efficiency will be improved by 300 times in the best case, when the
size of string reaches 1MB.

Patch by Li Yin  on 2012-01-18
Reviewed by Adam Barth.

* bindings/v8/V8NPUtils.cpp:
(WebCore::convertV8ObjectToNPVariant):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/bindings/v8/V8NPUtils.cpp




Diff

Modified: trunk/Source/WebCore/ChangeLog (105388 => 105389)

--- trunk/Source/WebCore/ChangeLog	2012-01-19 07:39:41 UTC (rev 105388)
+++ trunk/Source/WebCore/ChangeLog	2012-01-19 07:52:31 UTC (rev 105389)
@@ -1,3 +1,16 @@
+2012-01-18  Li Yin  
+
+[v8] Low efficiency of writing long string from web application to plugin.
+https://bugs.webkit.org/show_bug.cgi?id=76592
+
+The efficiency will be improved by 300 times in the best case, when the
+size of string reaches 1MB.
+
+Reviewed by Adam Barth.
+
+* bindings/v8/V8NPUtils.cpp:
+(WebCore::convertV8ObjectToNPVariant):
+
 2012-01-18  Adam Barth  
 
 Assigning to Element.prefix should throw exception when using illegal characters


Modified: trunk/Source/WebCore/bindings/v8/V8NPUtils.cpp (105388 => 105389)

--- trunk/Source/WebCore/bindings/v8/V8NPUtils.cpp	2012-01-19 07:39:41 UTC (rev 105388)
+++ trunk/Source/WebCore/bindings/v8/V8NPUtils.cpp	2012-01-19 07:52:31 UTC (rev 105389)
@@ -62,11 +62,11 @@
 else if (object->IsUndefined())
 VOID_TO_NPVARIANT(*result);
 else if (object->IsString()) {
-v8::String::Utf8Value utf8(object);
-int length = utf8.length() + 1;
+v8::Handle str = object->ToString();
+int length = str->Utf8Length() + 1;
 char* utf8Chars = reinterpret_cast(malloc(length));
-memcpy(utf8Chars, *utf8, length);
-STRINGN_TO_NPVARIANT(utf8Chars, utf8.length(), *result);
+str->WriteUtf8(utf8Chars, length, 0, v8::String::HINT_MANY_WRITES_EXPECTED);
+STRINGN_TO_NPVARIANT(utf8Chars, length-1, *result);
 } else if (object->IsObject()) {
 DOMWindow* window = V8Proxy::retrieveWindow(V8Proxy::currentContext());
 NPObject* npobject = npCreateV8ScriptObject(0, v8::Handle::Cast(object), window);






___
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes


[webkit-changes] [105388] trunk

2012-01-18 Thread abarth
Title: [105388] trunk








Revision 105388
Author aba...@webkit.org
Date 2012-01-18 23:39:41 -0800 (Wed, 18 Jan 2012)


Log Message
Assigning to Element.prefix should throw exception when using illegal characters
https://bugs.webkit.org/show_bug.cgi?id=76589

Reviewed by Eric Seidel.

This patch fixes a FIXME and implements the INVALID_CHARACTER_ERR
exception described in
http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSPrefix

Tests: fast/dom/Element/prefix-setter-exception.html

* dom/Node.cpp:
(WebCore::isValidNameStartCharacter):
(WebCore::isValidNameCharacter):
(WebCore::hasInvalidValidNameCharacters):
(WebCore::Node::checkSetPrefix):

Modified Paths

trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/Node.cpp


Added Paths

trunk/LayoutTests/fast/dom/Element/prefix-setter-exception-expected.txt
trunk/LayoutTests/fast/dom/Element/prefix-setter-exception.html




Diff

Added: trunk/LayoutTests/fast/dom/Element/prefix-setter-exception-expected.txt (0 => 105388)

--- trunk/LayoutTests/fast/dom/Element/prefix-setter-exception-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/dom/Element/prefix-setter-exception-expected.txt	2012-01-19 07:39:41 UTC (rev 105388)
@@ -0,0 +1,27 @@
+Test for the implementation of DOM Level 3 Core API on Node Interface: prefix setter. INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character according to the XML version in use specified in the Document.xmlVersion attribute. http://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-NodeNSPrefix
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS prefixedElem.prefix = "." threw exception Error: INVALID_CHARACTER_ERR: DOM Exception 5.
+PASS prefixedElem.prefix is "before"
+PASS prefixedElem.prefix = "x." is "x."
+PASS prefixedElem.prefix is "x."
+PASS prefixedElem.prefix = "0a" threw exception Error: INVALID_CHARACTER_ERR: DOM Exception 5.
+PASS prefixedElem.prefix is "before"
+PASS prefixedElem.prefix = "a0" is "a0"
+PASS prefixedElem.prefix is "a0"
+PASS prefixedElem.prefix = "_0" is "_0"
+PASS prefixedElem.prefix is "_0"
+PASS prefixedElem.prefix = "×" threw exception Error: INVALID_CHARACTER_ERR: DOM Exception 5.
+PASS prefixedElem.prefix is "before"
+PASS prefixedElem.prefix = "·" threw exception Error: INVALID_CHARACTER_ERR: DOM Exception 5.
+PASS prefixedElem.prefix is "before"
+PASS prefixedElem.prefix = "aa" is "aa"
+PASS prefixedElem.prefix is "aa"
+PASS prefixedElem.prefix = "\n" threw exception Error: INVALID_CHARACTER_ERR: DOM Exception 5.
+PASS prefixedElem.prefix is "before"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+


Added: trunk/LayoutTests/fast/dom/Element/prefix-setter-exception.html (0 => 105388)

--- trunk/LayoutTests/fast/dom/Element/prefix-setter-exception.html	(rev 0)
+++ trunk/LayoutTests/fast/dom/Element/prefix-setter-exception.html	2012-01-19 07:39:41 UTC (rev 105388)
@@ -0,0 +1,38 @@
+
+
+
+DOM L3 Core: Node Interface prefix property setter
+
+
+
+description('Test for the implementation of DOM Level 3 Core API on Node Interface: prefix setter. INVALID_CHARACTER_ERR: Raised if the specified prefix contains an illegal character according to the XML version in use specified in the Document.xmlVersion attribute.  

[webkit-changes] [105387] trunk

2012-01-18 Thread commit-queue
Title: [105387] trunk








Revision 105387
Author commit-qu...@webkit.org
Date 2012-01-18 23:05:58 -0800 (Wed, 18 Jan 2012)


Log Message
ShadowContent query should be able to have fallback elements.
https://bugs.webkit.org/show_bug.cgi?id=75306

Patch by Shinya Kawanaka  on 2012-01-18
Reviewed by Hajime Morita.

Source/WebCore:

When no elements are selected by a shadow content element selector query,
light children are selected as a fallback elements.

Test: fast/dom/shadow/shadow-contents-fallback.html

* dom/NodeRenderingContext.cpp:
(WebCore::NodeRenderingContext::NodeRenderingContext):
  Considers fallback phase. When no elements are chosen, the phase is set to 'fallback'.
(WebCore::NodeRenderingContext::nextRenderer):
  Takes fallback phase into account.
(WebCore::NodeRenderingContext::previousRenderer): ditto.
* dom/NodeRenderingContext.h:
* html/shadow/HTMLContentElement.cpp:
(WebCore::HTMLContentElement::attach):
  Calculates inclusions before attaching light children.
* html/shadow/HTMLContentElement.h:
(WebCore::HTMLContentElement::hasInclusion):

LayoutTests:

* fast/dom/shadow/shadow-contents-fallback-expected.txt: Added.
* fast/dom/shadow/shadow-contents-fallback.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/dom/NodeRenderingContext.cpp
trunk/Source/WebCore/dom/NodeRenderingContext.h
trunk/Source/WebCore/html/shadow/HTMLContentElement.cpp
trunk/Source/WebCore/html/shadow/HTMLContentElement.h


Added Paths

trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback-expected.txt
trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback.html




Diff

Modified: trunk/LayoutTests/ChangeLog (105386 => 105387)

--- trunk/LayoutTests/ChangeLog	2012-01-19 06:51:57 UTC (rev 105386)
+++ trunk/LayoutTests/ChangeLog	2012-01-19 07:05:58 UTC (rev 105387)
@@ -1,3 +1,13 @@
+2012-01-18  Shinya Kawanaka  
+
+ShadowContent query should be able to have fallback elements.
+https://bugs.webkit.org/show_bug.cgi?id=75306
+
+Reviewed by Hajime Morita.
+
+* fast/dom/shadow/shadow-contents-fallback-expected.txt: Added.
+* fast/dom/shadow/shadow-contents-fallback.html: Added.
+
 2012-01-18  Kent Tamura  
 
 REGRESSION(r100111): A 'change' event does not fire when a mouse drag


Added: trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback-expected.txt (0 => 105387)

--- trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback-expected.txt	2012-01-19 07:05:58 UTC (rev 105387)
@@ -0,0 +1,9 @@
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+


Added: trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback.html (0 => 105387)

--- trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback.html	(rev 0)
+++ trunk/LayoutTests/fast/dom/shadow/shadow-contents-fallback.html	2012-01-19 07:05:58 UTC (rev 105387)
@@ -0,0 +1,247 @@
+ 
+
+
+
+/* relative positioning ensures underlying RenderLayer */
+.container {
+position: relative;
+}
+
+.span {
+display: boxed-inline;
+margin: 2px;
+border: solid;
+}
+
+
+function log(message) {
+document.getElementById('console').innerHTML += (message + "\n");
+}
+
+function removeAllChildren(elem) {
+while (elem.firstChild)
+elem.removeChild(elem.firstChild);
+}
+
+function cleanUp() {
+removeAllChildren(document.getElementById('actual-container'));
+removeAllChildren(document.getElementById('expect-container'));
+}
+
+function removeContainerLines(text) {
+var lines = text.split('\n');
+lines.splice(0, 2);
+return lines.join('\n');
+}
+
+function check() {
+var refContainerRenderTree = internals.elementRenderTreeAsText(document.getElementById('expect-container'));
+var refRenderTree = removeContainerLines(refContainerRenderTree);
+
+var targetContainerRenderTree = internals.elementRenderTreeAsText(document.getElementById('actual-container'));
+var targetRenderTree = removeContainerLines(targetContainerRenderTree);
+
+if (targetRenderTree == refRenderTree)
+log("PASS");
+else {
+log("FAIL");
+log("Expected: ");
+log(refRenderTree);
+log("Actual: ");
+log(targetRenderTree);
+}
+
+}
+
+function createSpanWithText(text) {
+var span = document.createElement('span');
+span.appendChild(document.createTextNode(text));
+return span;
+}
+
+function appendShadow(target, select) {
+var root = internals.ensureShadowRoot(target);
+
+var content = internals.createContentElement(document);
+content.setAttribute('select', select);
+content.appendChild(createSpanWithText("FALLBACK"));
+
+root.appendChild(document.createTextNode("{SHADOW: "));
+root.appendChild(content);
+root.appendChild(document.createTextNode("}"));
+}
+
+function appendShadowDeep(target, select) {
+var root = internals.en

[webkit-changes] [105386] trunk

2012-01-18 Thread tkent
Title: [105386] trunk








Revision 105386
Author tk...@chromium.org
Date 2012-01-18 22:51:57 -0800 (Wed, 18 Jan 2012)


Log Message
REGRESSION(r100111): A 'change' event does not fire when a mouse drag
occurs to switch elements in a listbox 
https://bugs.webkit.org/show_bug.cgi?id=76244

Reviewed by Hajime Morita.

Source/WebCore:

Test: fast/forms/select/listbox-drag-in-non-multiple.html

* html/HTMLSelectElement.cpp:
(WebCore::HTMLSelectElement::updateSelectedState):
Do not update m_activeSelectionState for non-multiple .
(WebCore::HTMLSelectElement::listBoxDefaultEventHandler):
Use setActiveSelection*Index() and updateListBoxSelection(true) instead
of updateSelectedState() because updateSelectedState() updates
m_lastOnChangeSelection and will prevent the mouseup handler from
dispatching 'change' event.
We should not call listBoxOnChange() in the mousemove handler in order
to align the behavior of IE and Firefox.

LayoutTests:

* fast/forms/resources/common.js:
(mouseMoveToIndexInListbox): Added.
* fast/forms/select/listbox-drag-in-non-multiple-expected.txt: Added.
* fast/forms/select/listbox-drag-in-non-multiple.html: Added.

Modified Paths

trunk/LayoutTests/ChangeLog
trunk/LayoutTests/fast/forms/resources/common.js
trunk/Source/WebCore/ChangeLog
trunk/Source/WebCore/html/HTMLSelectElement.cpp


Added Paths

trunk/LayoutTests/fast/forms/select/listbox-drag-in-non-multiple-expected.txt
trunk/LayoutTests/fast/forms/select/listbox-drag-in-non-multiple.html




Diff

Modified: trunk/LayoutTests/ChangeLog (105385 => 105386)

--- trunk/LayoutTests/ChangeLog	2012-01-19 06:30:48 UTC (rev 105385)
+++ trunk/LayoutTests/ChangeLog	2012-01-19 06:51:57 UTC (rev 105386)
@@ -1,3 +1,16 @@
+2012-01-18  Kent Tamura  
+
+REGRESSION(r100111): A 'change' event does not fire when a mouse drag
+occurs to switch elements in a listbox 
+https://bugs.webkit.org/show_bug.cgi?id=76244
+
+Reviewed by Hajime Morita.
+
+* fast/forms/resources/common.js:
+(mouseMoveToIndexInListbox): Added.
+* fast/forms/select/listbox-drag-in-non-multiple-expected.txt: Added.
+* fast/forms/select/listbox-drag-in-non-multiple.html: Added.
+
 2012-01-18  David Grogan  
 
 update resolve-url-sync-expected.txt


Modified: trunk/LayoutTests/fast/forms/resources/common.js (105385 => 105386)

--- trunk/LayoutTests/fast/forms/resources/common.js	2012-01-19 06:30:48 UTC (rev 105385)
+++ trunk/LayoutTests/fast/forms/resources/common.js	2012-01-19 06:51:57 UTC (rev 105386)
@@ -22,3 +22,12 @@
 pos.y = element.offsetTop + element.offsetHeight / 2;
 return pos;
 }
+
+function mouseMoveToIndexInListbox(index, listboxId) {
+var listbox = document.getElementById(listboxId);
+var itemHeight = Math.floor(listbox.offsetHeight / listbox.size);
+var border = 1;
+var y = border + index * itemHeight;
+if (window.eventSender)
+eventSender.mouseMoveTo(listbox.offsetLeft + border, listbox.offsetTop + y - window.pageYOffset);
+}


Added: trunk/LayoutTests/fast/forms/select/listbox-drag-in-non-multiple-expected.txt (0 => 105386)

--- trunk/LayoutTests/fast/forms/select/listbox-drag-in-non-multiple-expected.txt	(rev 0)
+++ trunk/LayoutTests/fast/forms/select/listbox-drag-in-non-multiple-expected.txt	2012-01-19 06:51:57 UTC (rev 105386)
@@ -0,0 +1,11 @@
+Test if 'change' event is dispatched when selecting an item by mouse dragging in a non-multiple listbox.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+PASS: A click event was dispatched.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+


Added: trunk/LayoutTests/fast/forms/select/listbox-drag-in-non-multiple.html (0 => 105386)

--- trunk/LayoutTests/fast/forms/select/listbox-drag-in-non-multiple.html	(rev 0)
+++ trunk/LayoutTests/fast/forms/select/listbox-drag-in-non-multiple.html	2012-01-19 06:51:57 UTC (rev 105386)
@@ -0,0 +1,36 @@
+
+
+
+

+ +
FAIL
+
+ +