e9db4851b8a108b1585ccf2438addef3b0644edc
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-02-14  David Grogan  <dgrogan@chromium.org>
2
3         IndexedDB: Add a few more histogram calls
4         https://bugs.webkit.org/show_bug.cgi?id=109762
5
6         Reviewed by Tony Chang.
7
8         A few places where commits could fail weren't being logged.
9
10         * Modules/indexeddb/IDBBackingStore.cpp:
11         (WebCore::IDBBackingStore::deleteDatabase):
12         (WebCore::IDBBackingStore::Transaction::commit):
13
14 2013-02-14  Tony Chang  <tony@chromium.org>
15
16         Padding and border changes doesn't trigger relayout of children
17         https://bugs.webkit.org/show_bug.cgi?id=109639
18
19         Reviewed by Kent Tamura.
20
21         In RenderBlock::layoutBlock, we only relayout our children if our logical width
22         changes. This misses cases where our logical width doesn't change (i.e., padding
23         or border changes), but our content width does change.
24
25         This is a more general case of bug 104997.
26
27         Test: fast/block/dynamic-padding-border.html
28
29         * rendering/RenderBox.cpp:
30         (WebCore::borderOrPaddingLogicalWidthChanged): Only check if the logical width changed.
31         (WebCore::RenderBox::styleDidChange): Drop the border-box condition since this can happen
32         even without border-box box sizing.
33
34 2013-02-14  Peter Rybin  <prybin@chromium.org>
35
36         Web Inspector: fix closure compilation warnings caused by setVariableValue change
37         https://bugs.webkit.org/show_bug.cgi?id=109488
38
39         Reviewed by Pavel Feldman.
40
41         Annotations are fixed as required by closure compiler.
42         Parameters in Inspector.json are reordered as required.
43
44         * inspector/InjectedScriptExterns.js:
45         (InjectedScriptHost.prototype.setFunctionVariableValue):
46         (JavaScriptCallFrame.prototype.setVariableValue):
47         * inspector/InjectedScriptSource.js:
48         (.):
49         * inspector/Inspector.json:
50         * inspector/InspectorDebuggerAgent.cpp:
51         (WebCore::InspectorDebuggerAgent::setVariableValue):
52         * inspector/InspectorDebuggerAgent.h:
53         (InspectorDebuggerAgent):
54
55 2013-02-14  Tommy Widenflycht  <tommyw@google.com>
56
57         MediaStream API: RTCDataChannel triggers a use-after-free
58         https://bugs.webkit.org/show_bug.cgi?id=109806
59
60         Reviewed by Adam Barth.
61
62         Making sure RTCPeerConnection::stop() is always called at least once.
63         Also making sure that RTCDataChannels state gets set to Closed correctly.
64
65         Hard to test in WebKit but covered by Chromium tests.
66
67         * Modules/mediastream/RTCDataChannel.cpp:
68         (WebCore::RTCDataChannel::stop):
69         * Modules/mediastream/RTCPeerConnection.cpp:
70         (WebCore::RTCPeerConnection::~RTCPeerConnection):
71         (WebCore::RTCPeerConnection::stop):
72
73 2013-02-14  Vsevolod Vlasov  <vsevik@chromium.org>
74
75         Web Inspector: [Regression] When several consecutive characters are typed each of them is marked as undoable state.
76         https://bugs.webkit.org/show_bug.cgi?id=109823
77
78         Reviewed by Pavel Feldman.
79
80         * inspector/front-end/TextEditorModel.js:
81         (WebInspector.TextEditorModel.endsWithBracketRegex.):
82
83 2013-02-14  Sheriff Bot  <webkit.review.bot@gmail.com>
84
85         Unreviewed, rolling out r142820.
86         http://trac.webkit.org/changeset/142820
87         https://bugs.webkit.org/show_bug.cgi?id=109839
88
89         Causing crashes on chromium canaries (Requested by atwilson_
90         on #webkit).
91
92         * dom/Document.cpp:
93         (WebCore::Document::updateLayout):
94         (WebCore::Document::implicitClose):
95         * rendering/RenderQuote.h:
96         (RenderQuote):
97         * rendering/RenderView.cpp:
98         * rendering/RenderView.h:
99
100 2013-02-14  Mario Sanchez Prada  <mario.prada@samsung.com>
101
102         [GTK] Missing call to g_object_ref while retrieving accessible table cells
103         https://bugs.webkit.org/show_bug.cgi?id=106903
104
105         Reviewed by Martin Robinson.
106
107         Add missing extra ref to implementation of atk_table_ref_at().
108
109         Test: accessibility/table-cell-for-column-and-row-crash.html
110
111         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
112         (webkitAccessibleTableRefAt): This method transfers full ownership
113         over the returned AtkObject, so an extra reference is needed here.
114
115 2013-02-14  Mike Fenton  <mifenton@rim.com>
116
117         [BlackBerry] Update keyboard event details to match platform details.
118         https://bugs.webkit.org/show_bug.cgi?id=109693
119
120         Reviewed by Yong Li.
121
122         PR 220170.
123
124         Update the keyboard event details to match the
125         platform details available.
126
127         Rename helper function to better describe the conversion.
128
129         Reviewed Internally by Nima Ghanavatian and Gen Mak.
130
131         * platform/blackberry/PlatformKeyboardEventBlackBerry.cpp:
132         (WebCore::windowsKeyCodeForBlackBerryKeycode):
133         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
134
135 2013-02-08  Andrey Kosyakov  <caseq@chromium.org>
136
137         Web Inspector: expose did{Begin,Cancel}Frame() and {will,did}Composite() on WebDebToolsAgent
138         https://bugs.webkit.org/show_bug.cgi?id=109192
139
140         Reviewed by Pavel Feldman.
141
142         - remove frame and compositing instrumentation methods from InspectorInstrumentation;
143         - expose those methods on InspectorController instead.
144
145         * WebCore.exp.in:
146         * inspector/InspectorController.cpp:
147         (WebCore::InspectorController::didBeginFrame):
148         (WebCore):
149         (WebCore::InspectorController::didCancelFrame):
150         (WebCore::InspectorController::willComposite):
151         (WebCore::InspectorController::didComposite):
152         * inspector/InspectorController.h:
153         (InspectorController):
154         * inspector/InspectorInstrumentation.cpp:
155         (WebCore):
156         * inspector/InspectorInstrumentation.h:
157         (InspectorInstrumentation):
158         * testing/Internals.cpp:
159         (WebCore::Internals::emitInspectorDidBeginFrame):
160         (WebCore::Internals::emitInspectorDidCancelFrame):
161
162 2013-02-14  Vladislav Kaznacheev  <kaznacheev@chromium.org>
163
164         Web Inspector: Fixed a layout regression in CanvasProfileView.
165         https://bugs.webkit.org/show_bug.cgi?id=109835
166
167         Reviewed by Pavel Feldman.
168
169         Changed splitView.css to supported nested SplitView instances.
170
171         * inspector/front-end/splitView.css:
172         (.split-view-vertical > .split-view-contents):
173         (.split-view-vertical > .split-view-contents-first):
174         (.split-view-vertical > .split-view-contents-first.maximized):
175         (.split-view-vertical > .split-view-contents-second):
176         (.split-view-vertical > .split-view-contents-second.maximized):
177         (.split-view-horizontal > .split-view-contents):
178         (.split-view-horizontal > .split-view-contents-first):
179         (.split-view-horizontal > .split-view-contents-first.maximized):
180         (.split-view-horizontal > .split-view-contents-second):
181         (.split-view-horizontal > .split-view-contents-second.maximized):
182         (.split-view-vertical > .split-view-sidebar.split-view-contents-first:not(.maximized)):
183         (.split-view-vertical > .split-view-sidebar.split-view-contents-second:not(.maximized)):
184         (.split-view-horizontal > .split-view-sidebar.split-view-contents-first:not(.maximized)):
185         (.split-view-horizontal > .split-view-sidebar.split-view-contents-second:not(.maximized)):
186         (.split-view-vertical > .split-view-resizer):
187         (.split-view-horizontal > .split-view-resizer):
188
189 2013-02-14  Vladislav Kaznacheev  <kaznacheev@chromium.org>
190
191         Web Inspector: Color picker should not be available in Computed Styles pane.
192         https://bugs.webkit.org/show_bug.cgi?id=109697
193
194         Reviewed by Alexander Pavlov.
195
196         Changed the parentPane parameter of WebInspector.ComputedStylePropertiesSection to the correct value
197         (the ComputedStyleSidebarPane instance).
198
199         * inspector/front-end/StylesSidebarPane.js:
200         (WebInspector.StylesSidebarPane.prototype._rebuildSectionsForStyleRules):
201
202 2013-02-14  Yury Semikhatsky  <yurys@chromium.org>
203
204         Web Inspector: don't create static local string for program literal in InspectorTimelineAgent
205         https://bugs.webkit.org/show_bug.cgi?id=109811
206
207         Reviewed by Pavel Feldman.
208
209         Use const char* constant value instead of creating String from it in thread-unsafe
210         static local variable.
211
212         * inspector/InspectorTimelineAgent.cpp:
213         (WebCore::InspectorTimelineAgent::innerAddRecordToTimeline):
214
215 2013-02-14  Pan Deng  <pan.deng@intel.com>
216
217         [Web Inspector] Fix initiator name issue in reload scenario for Network Panel.
218         https://bugs.webkit.org/show_bug.cgi?id=108746.
219
220         Reviewed by Vsevolod Vlasov.
221
222         WebInspector.displayNameForURL() does not work as expected in the reload scenario,
223         for example, "http://www.yahoo.com/" was trimed to "/" at one time, but at another,
224         the full host name will be displayed.
225         This fix return host + "/" in the issue scenario, and keep with get displayName() in ParsedURL.
226
227         No new tests.
228
229         * inspector/front-end/ParsedURL.js:
230         (WebInspector.ParsedURL.prototype.get displayName): append "/" in the display host scenario.
231         * inspector/front-end/ResourceUtils.js:
232         (WebInspector.displayNameForURL): add host in the head if url trimed as a "/".
233
234 2013-02-14  Alexei Filippov  <alph@chromium.org>
235
236         Web Inspector: fix to record button remaining red after heap snapshot is taken
237         https://bugs.webkit.org/show_bug.cgi?id=109804
238
239         Reviewed by Yury Semikhatsky.
240
241         Revert part of r142243 fix. Namely heap snapshot taking button made
242         stateless as it was before.
243
244         * inspector/front-end/HeapSnapshotView.js:
245         (WebInspector.HeapSnapshotProfileType.prototype.buttonClicked):
246         * inspector/front-end/ProfilesPanel.js:
247         (WebInspector.ProfilesPanel.prototype.toggleRecordButton):
248
249 2013-02-14  Alexander Pavlov  <apavlov@chromium.org>
250
251         Web Inspector: Consistently use SecurityOrigin::toRawString() for serialization across the backend code
252         https://bugs.webkit.org/show_bug.cgi?id=109801
253
254         Reviewed by Yury Semikhatsky.
255
256         No new tests, as existing tests cover the change.
257
258         * inspector/InspectorAgent.cpp:
259         (WebCore::InspectorAgent::didClearWindowObjectInWorld):
260         * inspector/InspectorIndexedDBAgent.cpp:
261         (WebCore::InspectorIndexedDBAgent::requestDatabaseNamesForFrame):
262         * inspector/InspectorPageAgent.cpp:
263         (WebCore::InspectorPageAgent::buildObjectForFrame):
264         * inspector/PageRuntimeAgent.cpp:
265         (WebCore::PageRuntimeAgent::notifyContextCreated):
266
267 2013-02-14  Sergio Villar Senin  <svillar@igalia.com>
268
269         Add logging support to IndexedDB for non-Chromium platforms
270         https://bugs.webkit.org/show_bug.cgi?id=109809
271
272         Reviewed by Kentaro Hara.
273
274         Enable logging of IndexedDB through the StorageAPI log channel for
275         non-Chromium architectures.
276
277         No new tests required, we're just enabling logging for IndexedDB
278         using the currently available logging framework.
279
280         * Modules/indexeddb/IDBTracing.h:
281
282 2013-02-14  Vsevolod Vlasov  <vsevik@chromium.org>
283
284         Web Inspector: Remove uriForFile and fileForURI methods from FileSystemMapping.
285         https://bugs.webkit.org/show_bug.cgi?id=109704
286
287         Reviewed by Alexander Pavlov.
288
289         Replaced this methods with one line implementation on the only call site.
290
291         * inspector/front-end/FileSystemMapping.js:
292         * inspector/front-end/FileSystemProjectDelegate.js:
293         (WebInspector.FileSystemProjectDelegate.prototype._filePathForURI):
294         (WebInspector.FileSystemProjectDelegate.prototype.setFileContent):
295         (WebInspector.FileSystemProjectDelegate.prototype._populate.filesLoaded):
296         (WebInspector.FileSystemProjectDelegate.prototype._populate):
297
298 2013-02-14  Anton Vayvod  <avayvod@chromium.org>
299
300         [Text Autosizing] Process narrow descendants with the same multiplier for the font size.
301         https://bugs.webkit.org/show_bug.cgi?id=109573
302
303         Reviewed by Julien Chaffraix.
304
305         Combine narrow descendants of the same autosizing cluster into a group that is autosized
306         with the same multiplier.
307
308         For example, on sites with a sidebar, sometimes the paragraphs next to the sidebar will have
309         a large margin individually applied (via a CSS selector), causing them all to individually
310         appear narrower than their enclosing blockContainingAllText. Rather than making each of
311         these paragraphs into a separate cluster, we want them all to share the same multiplier, as
312         if they were a single cluster.
313
314         Test: fast/text-autosizing/narrow-descendants-combined.html
315
316         * rendering/TextAutosizer.cpp:
317         (WebCore::TextAutosizer::processClusterInternal):
318
319             Common implementation for processCluster() and processCompositeCluster that accepts the
320             text width and whether the cluster should be autosized as parameters instead of
321             calculating it inline.
322
323         (WebCore::TextAutosizer::processCluster):
324
325             Calculates the text width for a single cluster and whether it should be autosized, then
326             calls processClusterInternal() to apply the multiplier and process the cluster's
327             descendants.
328
329         (WebCore::TextAutosizer::processCompositeCluster):
330
331             Calculates the text width for a group of renderers and if the group should be autosized,
332             then calls processClusterInternal() repeatedly with the same multiplier to apply it and
333             process all the descendants of the group.
334
335         (WebCore::TextAutosizer::clusterShouldBeAutosized):
336
337             Calls the multiple renderers version to avoid code duplication.
338
339         (WebCore::TextAutosizer::compositeClusterShouldBeAutosized):
340
341             The multiple renderers version of clusterShouldBeAutosized.
342
343         * rendering/TextAutosizer.h:
344
345             Updated method declarations.
346
347 2013-02-14  Andrey Adaikin  <aandrey@chromium.org>
348
349         Look into possibilities of typedef in webkit idl files
350         https://bugs.webkit.org/show_bug.cgi?id=52340
351
352         Reviewed by Kentaro Hara.
353
354         Add typedef support for WebKit IDL parser.
355         Drive by: fixed a bug of generating "unrestrictedfloat" without a space.
356
357         Added a new IDL test TestTypedefs.idl. The results were generated without typedefs.
358
359         * bindings/scripts/IDLParser.pm:
360         (assertNoExtendedAttributesInTypedef):
361         (parseDefinitions):
362         (applyTypedefs):
363         (applyTypedefsForSignature):
364         (parseTypedef):
365         (parseUnrestrictedFloatType):
366         * bindings/scripts/test/CPP/WebDOMTestTypedefs.cpp: Added.
367         (WebDOMTestTypedefs::WebDOMTestTypedefsPrivate::WebDOMTestTypedefsPrivate):
368         (WebDOMTestTypedefs::WebDOMTestTypedefsPrivate):
369         (WebDOMTestTypedefs::WebDOMTestTypedefs):
370         (WebDOMTestTypedefs::operator=):
371         (WebDOMTestTypedefs::impl):
372         (WebDOMTestTypedefs::~WebDOMTestTypedefs):
373         (WebDOMTestTypedefs::unsignedLongLongAttr):
374         (WebDOMTestTypedefs::setUnsignedLongLongAttr):
375         (WebDOMTestTypedefs::immutableSerializedScriptValue):
376         (WebDOMTestTypedefs::setImmutableSerializedScriptValue):
377         (WebDOMTestTypedefs::func):
378         (WebDOMTestTypedefs::multiTransferList):
379         (WebDOMTestTypedefs::setShadow):
380         (WebDOMTestTypedefs::nullableArrayArg):
381         (WebDOMTestTypedefs::immutablePointFunction):
382         (toWebCore):
383         (toWebKit):
384         * bindings/scripts/test/CPP/WebDOMTestTypedefs.h: Added.
385         (WebCore):
386         (WebDOMTestTypedefs):
387         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.cpp: Added.
388         (_WebKitDOMTestTypedefsPrivate):
389         (WebKit):
390         (WebKit::kit):
391         (WebKit::core):
392         (WebKit::wrapTestTypedefs):
393         (webkit_dom_test_typedefs_finalize):
394         (webkit_dom_test_typedefs_set_property):
395         (webkit_dom_test_typedefs_get_property):
396         (webkit_dom_test_typedefs_constructor):
397         (webkit_dom_test_typedefs_class_init):
398         (webkit_dom_test_typedefs_init):
399         (webkit_dom_test_typedefs_func):
400         (webkit_dom_test_typedefs_multi_transfer_list):
401         (webkit_dom_test_typedefs_set_shadow):
402         (webkit_dom_test_typedefs_nullable_array_arg):
403         (webkit_dom_test_typedefs_immutable_point_function):
404         (webkit_dom_test_typedefs_string_array_function):
405         (webkit_dom_test_typedefs_get_unsigned_long_long_attr):
406         (webkit_dom_test_typedefs_set_unsigned_long_long_attr):
407         (webkit_dom_test_typedefs_get_immutable_serialized_script_value):
408         (webkit_dom_test_typedefs_set_immutable_serialized_script_value):
409         * bindings/scripts/test/GObject/WebKitDOMTestTypedefs.h: Added.
410         (_WebKitDOMTestTypedefs):
411         (_WebKitDOMTestTypedefsClass):
412         * bindings/scripts/test/GObject/WebKitDOMTestTypedefsPrivate.h: Added.
413         (WebKit):
414         * bindings/scripts/test/JS/JSTestTypedefs.cpp: Added.
415         (WebCore):
416         (WebCore::JSTestTypedefsConstructor::constructJSTestTypedefs):
417         (WebCore::JSTestTypedefsConstructor::JSTestTypedefsConstructor):
418         (WebCore::JSTestTypedefsConstructor::finishCreation):
419         (WebCore::JSTestTypedefsConstructor::getOwnPropertySlot):
420         (WebCore::JSTestTypedefsConstructor::getOwnPropertyDescriptor):
421         (WebCore::JSTestTypedefsConstructor::getConstructData):
422         (WebCore::JSTestTypedefsPrototype::self):
423         (WebCore::JSTestTypedefsPrototype::getOwnPropertySlot):
424         (WebCore::JSTestTypedefsPrototype::getOwnPropertyDescriptor):
425         (WebCore::JSTestTypedefs::JSTestTypedefs):
426         (WebCore::JSTestTypedefs::finishCreation):
427         (WebCore::JSTestTypedefs::createPrototype):
428         (WebCore::JSTestTypedefs::destroy):
429         (WebCore::JSTestTypedefs::~JSTestTypedefs):
430         (WebCore::JSTestTypedefs::getOwnPropertySlot):
431         (WebCore::JSTestTypedefs::getOwnPropertyDescriptor):
432         (WebCore::jsTestTypedefsUnsignedLongLongAttr):
433         (WebCore::jsTestTypedefsImmutableSerializedScriptValue):
434         (WebCore::jsTestTypedefsConstructorTestSubObj):
435         (WebCore::jsTestTypedefsConstructor):
436         (WebCore::JSTestTypedefs::put):
437         (WebCore::setJSTestTypedefsUnsignedLongLongAttr):
438         (WebCore::setJSTestTypedefsImmutableSerializedScriptValue):
439         (WebCore::JSTestTypedefs::getConstructor):
440         (WebCore::jsTestTypedefsPrototypeFunctionFunc):
441         (WebCore::jsTestTypedefsPrototypeFunctionMultiTransferList):
442         (WebCore::jsTestTypedefsPrototypeFunctionSetShadow):
443         (WebCore::jsTestTypedefsPrototypeFunctionMethodWithSequenceArg):
444         (WebCore::jsTestTypedefsPrototypeFunctionNullableArrayArg):
445         (WebCore::jsTestTypedefsPrototypeFunctionFuncWithClamp):
446         (WebCore::jsTestTypedefsPrototypeFunctionImmutablePointFunction):
447         (WebCore::jsTestTypedefsPrototypeFunctionStringArrayFunction):
448         (WebCore::isObservable):
449         (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
450         (WebCore::JSTestTypedefsOwner::finalize):
451         (WebCore::toJS):
452         (WebCore::toTestTypedefs):
453         * bindings/scripts/test/JS/JSTestTypedefs.h: Added.
454         (WebCore):
455         (JSTestTypedefs):
456         (WebCore::JSTestTypedefs::create):
457         (WebCore::JSTestTypedefs::createStructure):
458         (WebCore::JSTestTypedefs::impl):
459         (WebCore::JSTestTypedefs::releaseImpl):
460         (WebCore::JSTestTypedefs::releaseImplIfNotNull):
461         (JSTestTypedefsOwner):
462         (WebCore::wrapperOwner):
463         (WebCore::wrapperContext):
464         (JSTestTypedefsPrototype):
465         (WebCore::JSTestTypedefsPrototype::create):
466         (WebCore::JSTestTypedefsPrototype::createStructure):
467         (WebCore::JSTestTypedefsPrototype::JSTestTypedefsPrototype):
468         (JSTestTypedefsConstructor):
469         (WebCore::JSTestTypedefsConstructor::create):
470         (WebCore::JSTestTypedefsConstructor::createStructure):
471         * bindings/scripts/test/ObjC/DOMTestTypedefs.h: Added.
472         * bindings/scripts/test/ObjC/DOMTestTypedefs.mm: Added.
473         (-[DOMTestTypedefs dealloc]):
474         (-[DOMTestTypedefs finalize]):
475         (-[DOMTestTypedefs unsignedLongLongAttr]):
476         (-[DOMTestTypedefs setUnsignedLongLongAttr:]):
477         (-[DOMTestTypedefs immutableSerializedScriptValue]):
478         (-[DOMTestTypedefs setImmutableSerializedScriptValue:]):
479         (-[DOMTestTypedefs multiTransferList:tx:second:txx:]):
480         (-[DOMTestTypedefs setShadow:height:blur:color:alpha:]):
481         (-[DOMTestTypedefs immutablePointFunction]):
482         (core):
483         (kit):
484         * bindings/scripts/test/ObjC/DOMTestTypedefsInternal.h: Added.
485         (WebCore):
486         * bindings/scripts/test/TestTypedefs.idl: Added.
487         * bindings/scripts/test/V8/V8TestTypedefs.cpp: Added.
488         (WebCore):
489         (WebCore::checkTypeOrDieTrying):
490         (TestTypedefsV8Internal):
491         (WebCore::TestTypedefsV8Internal::V8_USE):
492         (WebCore::TestTypedefsV8Internal::unsignedLongLongAttrAttrGetter):
493         (WebCore::TestTypedefsV8Internal::unsignedLongLongAttrAttrSetter):
494         (WebCore::TestTypedefsV8Internal::immutableSerializedScriptValueAttrGetter):
495         (WebCore::TestTypedefsV8Internal::immutableSerializedScriptValueAttrSetter):
496         (WebCore::TestTypedefsV8Internal::TestTypedefsConstructorGetter):
497         (WebCore::TestTypedefsV8Internal::TestTypedefsReplaceableAttrSetter):
498         (WebCore::TestTypedefsV8Internal::funcCallback):
499         (WebCore::TestTypedefsV8Internal::multiTransferListCallback):
500         (WebCore::TestTypedefsV8Internal::setShadowCallback):
501         (WebCore::TestTypedefsV8Internal::methodWithSequenceArgCallback):
502         (WebCore::TestTypedefsV8Internal::nullableArrayArgCallback):
503         (WebCore::TestTypedefsV8Internal::funcWithClampCallback):
504         (WebCore::TestTypedefsV8Internal::immutablePointFunctionCallback):
505         (WebCore::TestTypedefsV8Internal::stringArrayFunctionCallback):
506         (WebCore::V8TestTypedefs::constructorCallback):
507         (WebCore::ConfigureV8TestTypedefsTemplate):
508         (WebCore::V8TestTypedefs::GetRawTemplate):
509         (WebCore::V8TestTypedefs::GetTemplate):
510         (WebCore::V8TestTypedefs::HasInstance):
511         (WebCore::V8TestTypedefs::createWrapper):
512         (WebCore::V8TestTypedefs::derefObject):
513         * bindings/scripts/test/V8/V8TestTypedefs.h: Added.
514         (WebCore):
515         (V8TestTypedefs):
516         (WebCore::V8TestTypedefs::toNative):
517         (WebCore::V8TestTypedefs::installPerContextProperties):
518         (WebCore::V8TestTypedefs::installPerContextPrototypeProperties):
519         (WebCore::wrap):
520         (WebCore::toV8):
521         (WebCore::toV8Fast):
522
523 2013-02-13  Kentaro Hara  <haraken@chromium.org>
524
525         [V8] Rename XXXAccessorGetter() to XXXAttrGetterCustom(),
526         and XXXAccessorSetter() to XXXAttrSetterCustom()
527         https://bugs.webkit.org/show_bug.cgi?id=109679
528
529         Reviewed by Adam Barth.
530
531         For naming consistency and clarification.
532
533         No tests. No change in behavior.
534
535         * bindings/scripts/CodeGeneratorV8.pm:
536         (GenerateHeader):
537         (GenerateHeaderCustomCall):
538         (GenerateNormalAttrGetter):
539         (GenerateNormalAttrSetter):
540         (GenerateImplementation):
541         * bindings/scripts/test/V8/V8TestInterface.cpp:
542         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrGetter):
543         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrSetter):
544         * bindings/scripts/test/V8/V8TestObj.cpp:
545         (WebCore::TestObjV8Internal::customAttrAttrGetter):
546         (WebCore::TestObjV8Internal::customAttrAttrSetter):
547         * bindings/scripts/test/V8/V8TestObj.h:
548         (V8TestObj):
549         * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:
550         (WebCore::V8AudioBufferSourceNode::bufferAttrSetterCustom):
551         * bindings/v8/custom/V8BiquadFilterNodeCustom.cpp:
552         (WebCore::V8BiquadFilterNode::typeAttrSetterCustom):
553         * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
554         (WebCore::V8CanvasRenderingContext2D::strokeStyleAttrGetterCustom):
555         (WebCore::V8CanvasRenderingContext2D::strokeStyleAttrSetterCustom):
556         (WebCore::V8CanvasRenderingContext2D::fillStyleAttrGetterCustom):
557         (WebCore::V8CanvasRenderingContext2D::fillStyleAttrSetterCustom):
558         * bindings/v8/custom/V8ClipboardCustom.cpp:
559         (WebCore::V8Clipboard::typesAttrGetterCustom):
560         * bindings/v8/custom/V8CoordinatesCustom.cpp:
561         (WebCore::V8Coordinates::altitudeAttrGetterCustom):
562         (WebCore::V8Coordinates::altitudeAccuracyAttrGetterCustom):
563         (WebCore::V8Coordinates::headingAttrGetterCustom):
564         (WebCore::V8Coordinates::speedAttrGetterCustom):
565         * bindings/v8/custom/V8CustomEventCustom.cpp:
566         (WebCore::V8CustomEvent::detailAttrGetterCustom):
567         * bindings/v8/custom/V8DOMWindowCustom.cpp:
568         (WebCore::V8DOMWindow::eventAttrGetterCustom):
569         (WebCore::V8DOMWindow::eventAttrSetterCustom):
570         (WebCore::V8DOMWindow::locationAttrSetterCustom):
571         (WebCore::V8DOMWindow::openerAttrSetterCustom):
572         * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
573         (WebCore::V8DeviceMotionEvent::accelerationAttrGetterCustom):
574         (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAttrGetterCustom):
575         (WebCore::V8DeviceMotionEvent::rotationRateAttrGetterCustom):
576         (WebCore::V8DeviceMotionEvent::intervalAttrGetterCustom):
577         * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp:
578         (WebCore::V8DeviceOrientationEvent::alphaAttrGetterCustom):
579         (WebCore::V8DeviceOrientationEvent::betaAttrGetterCustom):
580         (WebCore::V8DeviceOrientationEvent::gammaAttrGetterCustom):
581         (WebCore::V8DeviceOrientationEvent::absoluteAttrGetterCustom):
582         * bindings/v8/custom/V8DocumentLocationCustom.cpp:
583         (WebCore::V8Document::locationAttrGetterCustom):
584         (WebCore::V8Document::locationAttrSetterCustom):
585         * bindings/v8/custom/V8EventCustom.cpp:
586         (WebCore::V8Event::dataTransferAttrGetterCustom):
587         (WebCore::V8Event::clipboardDataAttrGetterCustom):
588         * bindings/v8/custom/V8FileReaderCustom.cpp:
589         (WebCore::V8FileReader::resultAttrGetterCustom):
590         * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
591         (WebCore::V8HTMLDocument::allAttrSetterCustom):
592         * bindings/v8/custom/V8HTMLElementCustom.cpp:
593         (WebCore::V8HTMLElement::itemValueAttrGetterCustom):
594         (WebCore::V8HTMLElement::itemValueAttrSetterCustom):
595         * bindings/v8/custom/V8HTMLFrameElementCustom.cpp:
596         (WebCore::V8HTMLFrameElement::locationAttrSetterCustom):
597         * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
598         (WebCore::V8HTMLInputElement::selectionStartAttrGetterCustom):
599         (WebCore::V8HTMLInputElement::selectionStartAttrSetterCustom):
600         (WebCore::V8HTMLInputElement::selectionEndAttrGetterCustom):
601         (WebCore::V8HTMLInputElement::selectionEndAttrSetterCustom):
602         (WebCore::V8HTMLInputElement::selectionDirectionAttrGetterCustom):
603         (WebCore::V8HTMLInputElement::selectionDirectionAttrSetterCustom):
604         * bindings/v8/custom/V8HTMLLinkElementCustom.cpp:
605         (WebCore::V8HTMLLinkElement::sizesAttrGetterCustom):
606         (WebCore::V8HTMLLinkElement::sizesAttrSetterCustom):
607         * bindings/v8/custom/V8HTMLMediaElementCustom.cpp:
608         (WebCore::V8HTMLMediaElement::controllerAttrSetterCustom):
609         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
610         (WebCore::V8HTMLOptionsCollection::lengthAttrSetterCustom):
611         * bindings/v8/custom/V8HistoryCustom.cpp:
612         (WebCore::V8History::stateAttrGetterCustom):
613         * bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp:
614         (WebCore::V8JavaScriptCallFrame::scopeChainAttrGetterCustom):
615         (WebCore::V8JavaScriptCallFrame::thisObjectAttrGetterCustom):
616         (WebCore::V8JavaScriptCallFrame::typeAttrGetterCustom):
617         * bindings/v8/custom/V8LocationCustom.cpp:
618         (WebCore::V8Location::hashAttrSetterCustom):
619         (WebCore::V8Location::hostAttrSetterCustom):
620         (WebCore::V8Location::hostnameAttrSetterCustom):
621         (WebCore::V8Location::hrefAttrSetterCustom):
622         (WebCore::V8Location::pathnameAttrSetterCustom):
623         (WebCore::V8Location::portAttrSetterCustom):
624         (WebCore::V8Location::protocolAttrSetterCustom):
625         (WebCore::V8Location::searchAttrSetterCustom):
626         (WebCore::V8Location::reloadAttrGetterCustom):
627         (WebCore::V8Location::replaceAttrGetterCustom):
628         (WebCore::V8Location::assignAttrGetterCustom):
629         * bindings/v8/custom/V8MessageEventCustom.cpp:
630         (WebCore::V8MessageEvent::dataAttrGetterCustom):
631         (WebCore::V8MessageEvent::portsAttrGetterCustom):
632         * bindings/v8/custom/V8OscillatorNodeCustom.cpp:
633         (WebCore::V8OscillatorNode::typeAttrSetterCustom):
634         * bindings/v8/custom/V8PannerNodeCustom.cpp:
635         (WebCore::V8PannerNode::panningModelAttrSetterCustom):
636         (WebCore::V8PannerNode::distanceModelAttrSetterCustom):
637         * bindings/v8/custom/V8PopStateEventCustom.cpp:
638         (WebCore::V8PopStateEvent::stateAttrGetterCustom):
639         * bindings/v8/custom/V8SVGLengthCustom.cpp:
640         (WebCore::V8SVGLength::valueAttrGetterCustom):
641         (WebCore::V8SVGLength::valueAttrSetterCustom):
642         * bindings/v8/custom/V8TrackEventCustom.cpp:
643         (WebCore::V8TrackEvent::trackAttrGetterCustom):
644         * bindings/v8/custom/V8WebKitAnimationCustom.cpp:
645         (WebCore::V8WebKitAnimation::iterationCountAttrGetterCustom):
646         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
647         (WebCore::V8XMLHttpRequest::responseTextAttrGetterCustom):
648         (WebCore::V8XMLHttpRequest::responseAttrGetterCustom):
649
650 2013-02-14  Yury Semikhatsky  <yurys@chromium.org>
651
652         Web Inspector: extract DOM counters graph implementation into its own class
653         https://bugs.webkit.org/show_bug.cgi?id=109796
654
655         Reviewed by Alexander Pavlov.
656
657         Extracted DOM counters graph implementation into DOMCountersGraph.js leaving
658         in MemoryStatistics.js only common parts shared with NativeMemoryGraph.js
659         Added some closure annotations and converted object literals into classes
660         with named constructors.
661
662         * WebCore.gypi:
663         * WebCore.vcproj/WebCore.vcproj:
664         * inspector/compile-front-end.py:
665         * inspector/front-end/DOMCountersGraph.js: Added.
666         (WebInspector.DOMCountersGraph):
667         (WebInspector.DOMCounterUI):
668         (WebInspector.DOMCountersGraph.Counter):
669         (WebInspector.DOMCounterUI.prototype.setRange):
670         (WebInspector.DOMCounterUI.prototype.updateCurrentValue):
671         (WebInspector.DOMCounterUI.prototype.clearCurrentValueAndMarker):
672         (WebInspector.DOMCounterUI.prototype.saveImageUnderMarker):
673         (WebInspector.DOMCounterUI.prototype.restoreImageUnderMarker):
674         (WebInspector.DOMCounterUI.prototype.discardImageUnderMarker):
675         (WebInspector.DOMCountersGraph.prototype._createCurrentValuesBar):
676         (WebInspector.DOMCountersGraph.prototype._createCounterUIList):
677         (WebInspector.DOMCountersGraph.prototype._createCounterUIList.getNodeCount):
678         (WebInspector.DOMCountersGraph.prototype._createCounterUIList.getListenerCount):
679         (WebInspector.DOMCountersGraph.prototype._canvasHeight):
680         (WebInspector.DOMCountersGraph.prototype._onRecordAdded):
681         (WebInspector.DOMCountersGraph.prototype._draw):
682         (WebInspector.DOMCountersGraph.prototype._restoreImageUnderMarker):
683         (WebInspector.DOMCountersGraph.prototype._saveImageUnderMarker):
684         (WebInspector.DOMCountersGraph.prototype._drawMarker):
685         (WebInspector.DOMCountersGraph.prototype._drawGraph):
686         (WebInspector.DOMCountersGraph.prototype._discardImageUnderMarker):
687         * inspector/front-end/MemoryStatistics.js:
688         (WebInspector.MemoryStatistics):
689         (WebInspector.MemoryStatistics.Counter):
690         (WebInspector.MemoryStatistics.prototype._createCurrentValuesBar):
691         (WebInspector.MemoryStatistics.prototype._createCounterUIList):
692         (WebInspector.MemoryStatistics.prototype.setTopPosition):
693         (WebInspector.MemoryStatistics.prototype._canvasHeight):
694         (WebInspector.MemoryStatistics.prototype._onRecordAdded):
695         (WebInspector.MemoryStatistics.prototype._draw):
696         (WebInspector.MemoryStatistics.prototype._onClick):
697         (WebInspector.MemoryStatistics.prototype._onMouseOut):
698         (WebInspector.MemoryStatistics.prototype._onMouseOver):
699         (WebInspector.MemoryStatistics.prototype._onMouseMove):
700         (WebInspector.MemoryStatistics.prototype._restoreImageUnderMarker):
701         (WebInspector.MemoryStatistics.prototype._drawMarker):
702         (WebInspector.MemoryStatistics.prototype._discardImageUnderMarker):
703         * inspector/front-end/NativeMemoryGraph.js:
704         (WebInspector.NativeMemoryGraph.Counter):
705         (WebInspector.NativeMemoryGraph.prototype._onRecordAdded.addStatistics):
706         (WebInspector.NativeMemoryGraph.prototype._onRecordAdded):
707         (WebInspector.NativeMemoryGraph.prototype._draw):
708         * inspector/front-end/TimelinePanel.js:
709         * inspector/front-end/WebKit.qrc:
710
711 2013-02-14  Aivo Paas  <aivopaas@gmail.com>
712
713         Updating mouse cursor on style changes without emitting fake mousemove event
714         https://bugs.webkit.org/show_bug.cgi?id=101857
715
716         Reviewed by Allan Sandfeld Jensen.
717
718         Mouse cursor changes in styles used to be reflected in UI through dispatching a fake
719         mousemove event. The old approach has some flaws: it emits a mousemove event in
720         javascript when there is no mouse movement involved (bug 85343); the fake mousemove
721         event is cancelled while there is a mouse button held down - cursor won't change
722         until mouse is moved or the button released (bug 53341); it has extra overhead of
723         using a timer which was introduced to make scrolling smoother.
724
725         The new approach does not use the fake mousemove event. Instead, it uses only the logic
726         needed for the actual cursor change to happen. This bypasses all the mousemove event related
727         overhead. The remaining code is a stripped version of what was run through the mousemove
728         event path. Everything that was not needed for changing a cursor is stripped off, everything
729         that is needed, remains the same.
730
731         The call to update cursor was moved up in the call tree from RenderObject::StyleDidChange
732         to RenderObject::SetStyle right after the StyleDidChange call. This allows to any updates
733         and style propagations in StyleDidChange to happen and makes sure that a cursor change is
734         not missed. Previous place was at the end of RenderObject::StyleDidChange, where it could
735         have been missed because of an early exit. For example, cursor change on mousedown/up on
736         a text node missed the correct cursor in the first pass.
737
738         Refactored EventHandler::selectCursor to not take a whole mouse event but instead work with
739         HitTestResult so that EventHandler::updateCursor must not create a useless PlatformEvent.
740
741         Fixes: https://bugs.webkit.org/show_bug.cgi?id=85343 (mousemove event on cursor change)
742                https://bugs.webkit.org/show_bug.cgi?id=53341 (no cursor change when mouse button down)
743
744         Tests: fast/events/mouse-cursor-change.html
745                fast/events/mouse-cursor-no-mousemove.html
746
747         * page/EventHandler.cpp:
748         (WebCore::EventHandler::updateCursor): Newly added method for updating mouse cursor
749         (WebCore):
750         (WebCore::EventHandler::selectCursor):
751         (WebCore::EventHandler::handleMouseMoveEvent):
752         * page/EventHandler.h:
753         (EventHandler):
754         * rendering/RenderObject.cpp:
755         (WebCore::areNonIdenticalCursorListsEqual):
756         (WebCore):
757         (WebCore::areCursorsEqual):
758         (WebCore::RenderObject::setStyle):
759         (WebCore::RenderObject::styleDidChange):
760
761 2013-02-13  Ilya Tikhonovsky  <loislo@chromium.org>
762
763         Web Inspector: Native Memory Instrumentation: Report child nodes as direct members of a container node to make them look like a tree in the snapshot.
764         https://bugs.webkit.org/show_bug.cgi?id=109703
765
766         Also we need to traverse the tree from the top root element down to the leaves.
767
768         Reviewed by Yury Semikhatsky.
769
770         * dom/ContainerNode.cpp:
771         (WebCore::ContainerNode::reportMemoryUsage):
772         * dom/Node.cpp:
773         (WebCore::Node::reportMemoryUsage):
774         * inspector/InspectorMemoryAgent.cpp:
775         (WebCore):
776
777 2013-02-13  Hayato Ito  <hayato@chromium.org>
778
779         [Shadow DOM] Implements a '::distributed()' pseudo element.
780         https://bugs.webkit.org/show_bug.cgi?id=82169
781
782         Reviewed by Dimitri Glazkov.
783
784         Implements a '::distributed()' pseudo element.
785         See the Shadow DOM specification and the filed bug for the detail.
786
787         - http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#selecting-nodes-distributed-to-insertion-points
788         - https://www.w3.org/Bugs/Public/show_bug.cgi?id=19684
789
790         For example, suppose we are given the following DOM tree and shadow tree:
791
792         - <A>
793           - <B>
794             - <C>
795
796         [A's ShadowRoot]
797           <D>
798           - <style>
799               E content::distributed(B C) { color: green; }
800           - <E>
801             - <content>  (Node B is distributed to this insertion point.)
802
803         In this case, the style rule defined in the shadow tree matches node 'C'.
804
805         A '::distributed()' pseudo element can not be a pseudo class since
806         an intersection between matched_elements(some_selector) and
807         matched_elements(some_selector::distributed(...)) is always an
808         empty set. A '::distributed()' pseudo element is the first-ever
809         *functional* pseudo element which takes a parameter, which can be
810         a selector.
811
812         This rule crosses the shadow boundary from a shadow tree to the
813         tree of its shadow host. That means a rule which includes
814         '::distributed()' pseudo element is defined in shadow tree, but
815         the node which is matched in the rule, the subject of the
816         selector, is outside of the shadow tree. Therefore, we cannot
817         predict where the subject of the selector will be beforehand.
818         Current CSS implementation assumes the subject of the selector
819         must exist in the current scope.
820
821         To overcome this issue, DocumentRuleSets now has a instance of
822         ShadowDistributedRules class.  A style rule will be stored in this
823         instance if the rule includes a '::distributed()' pseudo element.
824         This class also keeps track of each RuleSet by mapping it with a
825         scope where the rule was originally defined. In the example, the
826         scope is A's ShadowRoot.  The scope is used to check whether the
827         left-most matched element (in the example, it's a node 'E') exists
828         in the scope.
829
830         Internally, a '::distributed' pseudo element is represented by a
831         newly introduced 'ShadowDistributed' relation.  That makes an
832         implementation of SelectorChecker::checkSelector() much simpler.
833         A transformation from a distributed pseudo element to a
834         ShadowDistributed is done in parsing stage of CSS.
835
836         Since '::distributed()' is an experimental feature, it's actually
837         prefixed with '-webkit-' and guarded by SHADOW_DOM flag.
838
839         Tests: fast/dom/shadow/distributed-pseudo-element-for-shadow-element.html
840                fast/dom/shadow/distributed-pseudo-element-match-all.html
841                fast/dom/shadow/distributed-pseudo-element-match-descendant.html
842                fast/dom/shadow/distributed-pseudo-element-nested.html
843                fast/dom/shadow/distributed-pseudo-element-no-match.html
844                fast/dom/shadow/distributed-pseudo-element-reprojection.html
845                fast/dom/shadow/distributed-pseudo-element-scoped.html
846                fast/dom/shadow/distributed-pseudo-element-support-selector.html
847                fast/dom/shadow/distributed-pseudo-element-used-in-selector-list.html
848                fast/dom/shadow/distributed-pseudo-element-with-any.html
849                fast/dom/shadow/distributed-pseudo-element.html
850
851         * css/CSSGrammar.y.in:
852         CSS Grammar was updated to support '::distrbuted(selector)'.
853         This pseudo element is the first pseudo element which can take a selector as a parameter.
854         * css/CSSParser.cpp:
855         (WebCore::CSSParser::detectDashToken):
856         (WebCore::CSSParser::rewriteSpecifiersWithNamespaceIfNeeded):
857         (WebCore::CSSParser::rewriteSpecifiersWithElementName):
858         Here we are converting a '::distributed' pseudo element into a
859         ShadowDistributed relation internally.  To support the conversion,
860         these rewriteSpecifiersXXX functions (formally called
861         updateSpecifiersXXX) now return the specifiers which may be
862         converted.
863         (WebCore::CSSParser::rewriteSpecifiers):
864         * css/CSSParser.h:
865         * css/CSSParserValues.cpp:
866         (WebCore::CSSParserSelector::CSSParserSelector):
867         * css/CSSParserValues.h:
868         (CSSParserSelector):
869         (WebCore::CSSParserSelector::functionArgumentSelector):
870         To hold an intermediate selector which appears at the position of an argument in
871         functional pseudo element when parsing CSS.
872         (WebCore::CSSParserSelector::setFunctionArgumentSelector):
873         (WebCore::CSSParserSelector::isDistributedPseudoElement):
874         * css/CSSSelector.cpp:
875         Add new pseudo element, PseudoDistributed, and its internal representation, ShadowDistributed relation.
876         (WebCore::CSSSelector::pseudoId):
877         (WebCore::nameToPseudoTypeMap):
878         (WebCore::CSSSelector::extractPseudoType):
879         (WebCore::CSSSelector::selectorText):
880         * css/CSSSelector.h:
881         (CSSSelector):
882         (WebCore):
883         (WebCore::CSSSelector::isDistributedPseudoElement):
884         (WebCore::CSSSelector::isShadowDistributed):
885         * css/CSSSelectorList.cpp:
886         (WebCore):
887         (SelectorHasShadowDistributed):
888         (WebCore::SelectorHasShadowDistributed::operator()):
889         (WebCore::CSSSelectorList::hasShadowDistributedAt):
890         * css/CSSSelectorList.h:
891         (CSSSelectorList):
892         * css/DocumentRuleSets.cpp:
893         (WebCore):
894         (WebCore::ShadowDistributedRules::addRule):
895         Every CSS rule which includes '::distributed(...)' should be managed by calling this function.
896         (WebCore::ShadowDistributedRules::collectMatchRequests):
897         (WebCore::DocumentRuleSets::resetAuthorStyle):
898         * css/DocumentRuleSets.h:
899         (WebCore):
900         (ShadowDistributedRules):
901         (WebCore::ShadowDistributedRules::clear):
902         (DocumentRuleSets):
903         (WebCore::DocumentRuleSets::shadowDistributedRules)
904         DocumentRuleSets owns an instance of ShadowDistributedRules.
905         * css/RuleSet.cpp:
906         (WebCore::RuleSet::addChildRules):
907         Updated to check whether the rule contains '::distributed()' or not.
908         * css/SelectorChecker.cpp:
909         (WebCore::SelectorChecker::match):
910         Support ShadowDistributed relation. Check all possible insertion points where a node is distributed.
911         * css/SelectorChecker.h:
912         (WebCore::SelectorChecker::SelectorCheckingContext::SelectorCheckingContext):
913         Adds enum of BehaviorAtBoundary. '::distributed()' is the only
914         rule which uses 'CrossedBoundary' since it is the only rule which
915         crosses shadow boundaries.
916         (SelectorCheckingContext):
917         * css/SelectorFilter.cpp:
918         (WebCore::SelectorFilter::collectIdentifierHashes):
919         * css/StyleResolver.cpp:
920         (WebCore::StyleResolver::collectMatchingRules):
921         (WebCore::StyleResolver::matchAuthorRules):
922         (WebCore::StyleResolver::collectMatchingRulesForList):
923         (WebCore::StyleResolver::ruleMatches):
924         * css/StyleResolver.h:
925         (MatchRequest):
926         (WebCore::MatchRequest::MatchRequest): Add behaviorAtBoundary field.
927         (WebCore):
928         (StyleResolver):
929         * html/shadow/InsertionPoint.cpp:
930         (WebCore::collectInsertionPointsWhereNodeIsDistributed):
931         (WebCore):
932         * html/shadow/InsertionPoint.h:
933         (WebCore):
934
935 2013-02-13  Kentaro Hara  <haraken@chromium.org>
936
937         [V8] Generate wrapper methods for custom methods
938         https://bugs.webkit.org/show_bug.cgi?id=109678
939
940         Reviewed by Adam Barth.
941
942         Currently V8 directly calls back custom methods written
943         in custom binding files. This makes it impossible for code
944         generators to hook custom methods (e.g. Code generators cannot
945         insert a code for FeatureObservation into custom methods).
946         To solve the problem, we should generate wrapper methods for
947         custom methods.
948
949         No tests. No change in behavior.
950
951         * page/DOMWindow.idl: Removed overloaded methods. The fact that methods in an IDL
952         file are overloaded but they are not overloaded in custom bindings confuses code
953         generators. (For some reason, this problem hasn't appeared before this change.)
954         * xml/XMLHttpRequest.idl: Ditto.
955
956         * bindings/scripts/CodeGeneratorV8.pm:
957         (GenerateHeader):
958         (GenerateDomainSafeFunctionGetter):
959         (GenerateEventListenerCallback):
960         (GenerateFunctionCallback):
961         (GenerateNonStandardFunction):
962         (GenerateImplementation):
963         * bindings/scripts/test/V8/V8TestInterface.cpp:
964         (WebCore::TestInterfaceV8Internal::supplementalMethod3Callback):
965         (TestInterfaceV8Internal):
966         (WebCore):
967         * bindings/scripts/test/V8/V8TestObj.cpp:
968         (WebCore::TestObjV8Internal::customMethodCallback):
969         (TestObjV8Internal):
970         (WebCore::TestObjV8Internal::customMethodWithArgsCallback):
971         (WebCore::TestObjV8Internal::classMethod2Callback):
972         (WebCore):
973         (WebCore::ConfigureV8TestObjTemplate):
974         * bindings/scripts/test/V8/V8TestObj.h:
975         (V8TestObj):
976         * bindings/v8/custom/V8ClipboardCustom.cpp:
977         (WebCore::V8Clipboard::clearDataCallbackCustom):
978         (WebCore::V8Clipboard::setDragImageCallbackCustom):
979         * bindings/v8/custom/V8ConsoleCustom.cpp:
980         (WebCore::V8Console::traceCallbackCustom):
981         (WebCore::V8Console::assertCallbackCustom):
982         (WebCore::V8Console::profileCallbackCustom):
983         (WebCore::V8Console::profileEndCallbackCustom):
984         * bindings/v8/custom/V8CryptoCustom.cpp:
985         (WebCore::V8Crypto::getRandomValuesCallbackCustom):
986         * bindings/v8/custom/V8DOMFormDataCustom.cpp:
987         (WebCore::V8DOMFormData::appendCallbackCustom):
988         * bindings/v8/custom/V8DOMWindowCustom.cpp:
989         (WebCore::V8DOMWindow::addEventListenerCallbackCustom):
990         (WebCore::V8DOMWindow::removeEventListenerCallbackCustom):
991         (WebCore::V8DOMWindow::postMessageCallbackCustom):
992         (WebCore::V8DOMWindow::toStringCallbackCustom):
993         (WebCore::V8DOMWindow::releaseEventsCallbackCustom):
994         (WebCore::V8DOMWindow::captureEventsCallbackCustom):
995         (WebCore::V8DOMWindow::showModalDialogCallbackCustom):
996         (WebCore::V8DOMWindow::openCallbackCustom):
997         (WebCore::V8DOMWindow::setTimeoutCallbackCustom):
998         (WebCore::V8DOMWindow::setIntervalCallbackCustom):
999         * bindings/v8/custom/V8DataViewCustom.cpp:
1000         (WebCore::V8DataView::getInt8CallbackCustom):
1001         (WebCore::V8DataView::getUint8CallbackCustom):
1002         (WebCore::V8DataView::setInt8CallbackCustom):
1003         (WebCore::V8DataView::setUint8CallbackCustom):
1004         * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
1005         (WebCore::V8DedicatedWorkerContext::postMessageCallbackCustom):
1006         * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
1007         (WebCore::V8DeviceMotionEvent::initDeviceMotionEventCallbackCustom):
1008         * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp:
1009         (WebCore::V8DeviceOrientationEvent::initDeviceOrientationEventCallbackCustom):
1010         * bindings/v8/custom/V8DocumentCustom.cpp:
1011         (WebCore::V8Document::evaluateCallbackCustom):
1012         (WebCore::V8Document::createTouchListCallbackCustom):
1013         * bindings/v8/custom/V8GeolocationCustom.cpp:
1014         (WebCore::V8Geolocation::getCurrentPositionCallbackCustom):
1015         (WebCore::V8Geolocation::watchPositionCallbackCustom):
1016         * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp:
1017         (WebCore::V8HTMLAllCollection::itemCallbackCustom):
1018         (WebCore::V8HTMLAllCollection::namedItemCallbackCustom):
1019         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
1020         (WebCore::V8HTMLCanvasElement::getContextCallbackCustom):
1021         (WebCore::V8HTMLCanvasElement::toDataURLCallbackCustom):
1022         * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
1023         (WebCore::V8HTMLDocument::writeCallbackCustom):
1024         (WebCore::V8HTMLDocument::writelnCallbackCustom):
1025         (WebCore::V8HTMLDocument::openCallbackCustom):
1026         * bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp:
1027         (WebCore::V8HTMLFormControlsCollection::namedItemCallbackCustom):
1028         * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
1029         (WebCore::v8HTMLImageElementConstructorCallbackCustom):
1030         (WebCore::V8HTMLImageElementConstructor::GetTemplate):
1031         * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
1032         (WebCore::V8HTMLInputElement::setSelectionRangeCallbackCustom):
1033         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
1034         (WebCore::V8HTMLOptionsCollection::namedItemCallbackCustom):
1035         (WebCore::V8HTMLOptionsCollection::removeCallbackCustom):
1036         (WebCore::V8HTMLOptionsCollection::addCallbackCustom):
1037         * bindings/v8/custom/V8HTMLSelectElementCustom.cpp:
1038         (WebCore::V8HTMLSelectElement::removeCallbackCustom):
1039         * bindings/v8/custom/V8HistoryCustom.cpp:
1040         (WebCore::V8History::pushStateCallbackCustom):
1041         (WebCore::V8History::replaceStateCallbackCustom):
1042         * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
1043         (WebCore::V8InjectedScriptHost::inspectedObjectCallbackCustom):
1044         (WebCore::V8InjectedScriptHost::internalConstructorNameCallbackCustom):
1045         (WebCore::V8InjectedScriptHost::isHTMLAllCollectionCallbackCustom):
1046         (WebCore::V8InjectedScriptHost::typeCallbackCustom):
1047         (WebCore::V8InjectedScriptHost::functionDetailsCallbackCustom):
1048         (WebCore::V8InjectedScriptHost::getInternalPropertiesCallbackCustom):
1049         (WebCore::V8InjectedScriptHost::getEventListenersCallbackCustom):
1050         (WebCore::V8InjectedScriptHost::inspectCallbackCustom):
1051         (WebCore::V8InjectedScriptHost::databaseIdCallbackCustom):
1052         (WebCore::V8InjectedScriptHost::storageIdCallbackCustom):
1053         (WebCore::V8InjectedScriptHost::evaluateCallbackCustom):
1054         (WebCore::V8InjectedScriptHost::setFunctionVariableValueCallbackCustom):
1055         * bindings/v8/custom/V8InspectorFrontendHostCustom.cpp:
1056         (WebCore::V8InspectorFrontendHost::platformCallbackCustom):
1057         (WebCore::V8InspectorFrontendHost::portCallbackCustom):
1058         (WebCore::V8InspectorFrontendHost::showContextMenuCallbackCustom):
1059         (WebCore::V8InspectorFrontendHost::recordActionTakenCallbackCustom):
1060         (WebCore::V8InspectorFrontendHost::recordPanelShownCallbackCustom):
1061         (WebCore::V8InspectorFrontendHost::recordSettingChangedCallbackCustom):
1062         * bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp:
1063         (WebCore::V8JavaScriptCallFrame::evaluateCallbackCustom):
1064         (WebCore::V8JavaScriptCallFrame::restartCallbackCustom):
1065         (WebCore::V8JavaScriptCallFrame::setVariableValueCallbackCustom):
1066         (WebCore::V8JavaScriptCallFrame::scopeTypeCallbackCustom):
1067         * bindings/v8/custom/V8LocationCustom.cpp:
1068         (WebCore::V8Location::reloadAccessorGetter):
1069         (WebCore::V8Location::replaceAccessorGetter):
1070         (WebCore::V8Location::assignAccessorGetter):
1071         (WebCore::V8Location::reloadCallbackCustom):
1072         (WebCore::V8Location::replaceCallbackCustom):
1073         (WebCore::V8Location::assignCallbackCustom):
1074         (WebCore::V8Location::valueOfCallbackCustom):
1075         (WebCore::V8Location::toStringCallbackCustom):
1076         * bindings/v8/custom/V8MessageEventCustom.cpp:
1077         (WebCore::V8MessageEvent::initMessageEventCallbackCustom):
1078         (WebCore::V8MessageEvent::webkitInitMessageEventCallbackCustom):
1079         * bindings/v8/custom/V8MessagePortCustom.cpp:
1080         (WebCore::V8MessagePort::postMessageCallbackCustom):
1081         * bindings/v8/custom/V8NodeCustom.cpp:
1082         (WebCore::V8Node::insertBeforeCallbackCustom):
1083         (WebCore::V8Node::replaceChildCallbackCustom):
1084         (WebCore::V8Node::removeChildCallbackCustom):
1085         (WebCore::V8Node::appendChildCallbackCustom):
1086         * bindings/v8/custom/V8NotificationCenterCustom.cpp:
1087         (WebCore::V8NotificationCenter::requestPermissionCallbackCustom):
1088         * bindings/v8/custom/V8NotificationCustom.cpp:
1089         (WebCore::V8Notification::requestPermissionCallbackCustom):
1090         * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
1091         (WebCore::V8SQLResultSetRowList::itemCallbackCustom):
1092         * bindings/v8/custom/V8SQLTransactionCustom.cpp:
1093         (WebCore::V8SQLTransaction::executeSqlCallbackCustom):
1094         * bindings/v8/custom/V8SQLTransactionSyncCustom.cpp:
1095         (WebCore::V8SQLTransactionSync::executeSqlCallbackCustom):
1096         * bindings/v8/custom/V8SVGLengthCustom.cpp:
1097         (WebCore::V8SVGLength::convertToSpecifiedUnitsCallbackCustom):
1098         * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
1099         (WebCore::V8WebGLRenderingContext::getAttachedShadersCallbackCustom):
1100         (WebCore::V8WebGLRenderingContext::getBufferParameterCallbackCustom):
1101         (WebCore::V8WebGLRenderingContext::getExtensionCallbackCustom):
1102         (WebCore::V8WebGLRenderingContext::getFramebufferAttachmentParameterCallbackCustom):
1103         (WebCore::V8WebGLRenderingContext::getParameterCallbackCustom):
1104         (WebCore::V8WebGLRenderingContext::getProgramParameterCallbackCustom):
1105         (WebCore::V8WebGLRenderingContext::getRenderbufferParameterCallbackCustom):
1106         (WebCore::V8WebGLRenderingContext::getShaderParameterCallbackCustom):
1107         (WebCore::V8WebGLRenderingContext::getSupportedExtensionsCallbackCustom):
1108         (WebCore::V8WebGLRenderingContext::getTexParameterCallbackCustom):
1109         (WebCore::V8WebGLRenderingContext::getUniformCallbackCustom):
1110         (WebCore::V8WebGLRenderingContext::getVertexAttribCallbackCustom):
1111         (WebCore::V8WebGLRenderingContext::uniform1fvCallbackCustom):
1112         (WebCore::V8WebGLRenderingContext::uniform1ivCallbackCustom):
1113         (WebCore::V8WebGLRenderingContext::uniform2fvCallbackCustom):
1114         (WebCore::V8WebGLRenderingContext::uniform2ivCallbackCustom):
1115         (WebCore::V8WebGLRenderingContext::uniform3fvCallbackCustom):
1116         (WebCore::V8WebGLRenderingContext::uniform3ivCallbackCustom):
1117         (WebCore::V8WebGLRenderingContext::uniform4fvCallbackCustom):
1118         (WebCore::V8WebGLRenderingContext::uniform4ivCallbackCustom):
1119         (WebCore::V8WebGLRenderingContext::uniformMatrix2fvCallbackCustom):
1120         (WebCore::V8WebGLRenderingContext::uniformMatrix3fvCallbackCustom):
1121         (WebCore::V8WebGLRenderingContext::uniformMatrix4fvCallbackCustom):
1122         (WebCore::V8WebGLRenderingContext::vertexAttrib1fvCallbackCustom):
1123         (WebCore::V8WebGLRenderingContext::vertexAttrib2fvCallbackCustom):
1124         (WebCore::V8WebGLRenderingContext::vertexAttrib3fvCallbackCustom):
1125         (WebCore::V8WebGLRenderingContext::vertexAttrib4fvCallbackCustom):
1126         * bindings/v8/custom/V8WorkerContextCustom.cpp:
1127         (WebCore::V8WorkerContext::importScriptsCallbackCustom):
1128         (WebCore::V8WorkerContext::setTimeoutCallbackCustom):
1129         (WebCore::V8WorkerContext::setIntervalCallbackCustom):
1130         * bindings/v8/custom/V8WorkerCustom.cpp:
1131         (WebCore::V8Worker::postMessageCallbackCustom):
1132         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
1133         (WebCore::V8XMLHttpRequest::openCallbackCustom):
1134         (WebCore::V8XMLHttpRequest::sendCallbackCustom):
1135         * bindings/v8/custom/V8XSLTProcessorCustom.cpp:
1136         (WebCore::V8XSLTProcessor::setParameterCallbackCustom):
1137         (WebCore::V8XSLTProcessor::getParameterCallbackCustom):
1138         (WebCore::V8XSLTProcessor::removeParameterCallbackCustom):
1139
1140 2013-02-13  Praveen R Jadhav  <praveen.j@samsung.com>
1141
1142         JSObject for ChannelSplitterNode and ChannelMergerNode are not created.
1143         https://bugs.webkit.org/show_bug.cgi?id=109542
1144
1145         Reviewed by Kentaro Hara.
1146
1147         "JSGenerateToJSObject" should be included in IDL files
1148         of ChannelSplitterNode and ChannelMergerNode in WebAudio.
1149         This ensures html files to access corresponding objects.
1150
1151         * Modules/webaudio/ChannelMergerNode.idl:
1152         * Modules/webaudio/ChannelSplitterNode.idl:
1153
1154 2013-02-13   Vineet Chaudhary  <rgf748@motorola.com>
1155
1156         [Regression] After r142831  collection-null-like-arguments.html layout test failing
1157         https://bugs.webkit.org/show_bug.cgi?id=109780
1158
1159         Reviewed by Kentaro Hara.
1160
1161         No new tests. LayoutTests/fast/dom/collection-null-like-arguments.html
1162         Should pass now.
1163
1164         * bindings/js/JSHTMLAllCollectionCustom.cpp: Return null for namedItem() only.
1165         (WebCore::getNamedItems):
1166         (WebCore::JSHTMLAllCollection::namedItem):
1167         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Ditto.
1168         (WebCore::getNamedItems):
1169         (WebCore::JSHTMLFormControlsCollection::namedItem):
1170         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Ditto.
1171         (WebCore::getNamedItems):
1172         (WebCore::JSHTMLOptionsCollection::namedItem):
1173
1174 2013-02-13  Soo-Hyun Choi  <sh9.choi@samsung.com>
1175
1176         Fix indentation error in MediaPlayerPrivateGStreamer.h
1177         https://bugs.webkit.org/show_bug.cgi?id=109768
1178
1179         Reviewed by Kentaro Hara.
1180
1181         No new tests as this patch just changes indentation style.
1182
1183         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1184         (MediaPlayerPrivateGStreamer):
1185         (WebCore::MediaPlayerPrivateGStreamer::hasVideo):
1186         (WebCore::MediaPlayerPrivateGStreamer::hasAudio):
1187         (WebCore::MediaPlayerPrivateGStreamer::engineDescription):
1188         (WebCore::MediaPlayerPrivateGStreamer::isLiveStream):
1189
1190 2013-02-13  Adam Barth  <abarth@webkit.org>
1191
1192         TokenPreloadScanner should be (mostly!) thread-safe
1193         https://bugs.webkit.org/show_bug.cgi?id=109760
1194
1195         Reviewed by Eric Seidel.
1196
1197         This patch makes the bulk of TokenPreloadScanner thread-safe.  The one
1198         remaining wart is processPossibleBaseTag because it wants to grub
1199         around in the base tag's attributes. I have a plan for that, but it's
1200         going to need to wait for the next patch.
1201
1202         * html/parser/HTMLPreloadScanner.cpp:
1203         (WebCore::isStartTag):
1204         (WebCore::isStartOrEndTag):
1205         (WebCore::TokenPreloadScanner::identifierFor):
1206         (WebCore::TokenPreloadScanner::inititatorFor):
1207         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
1208         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
1209         (TokenPreloadScanner::StartTagScanner):
1210         (WebCore::TokenPreloadScanner::processPossibleTemplateTag):
1211         (WebCore::TokenPreloadScanner::processPossibleStyleTag):
1212         (WebCore::TokenPreloadScanner::processPossibleBaseTag):
1213         (WebCore::TokenPreloadScanner::scan):
1214         (WebCore::HTMLPreloadScanner::scan):
1215         * html/parser/HTMLPreloadScanner.h:
1216         (WebCore):
1217
1218 2013-02-13  Adam Barth  <abarth@webkit.org>
1219
1220         StartTagScanner should be thread-safe
1221         https://bugs.webkit.org/show_bug.cgi?id=109750
1222
1223         Reviewed by Eric Seidel.
1224
1225         This patch weens the StartTagScanner off AtomicString using two
1226         techniques:
1227
1228         1) This patch creates an enum to represent the four tag names that the
1229            StartTagScanner needs to understand. Using an enum is better than
1230            using an AtomicString because we can use the enum on both the main
1231            thread and on the background thread.
1232
1233         2) For attributes, this patch uses threadSafeMatch. We're not able to
1234            use threadSafeMatch everywhere due to performance, but using it for
1235            attributes appears to be ok becaues we only call threadSafeMatch on
1236            the attributes of "interesting" tags.
1237
1238         I tested the performance of this patch using
1239         PerformanceTests/Parser/html-parser.html and did not see any slowdown.
1240         (There actually appeared to be a <1% speedup, but I'm attributing that
1241         to noise.)
1242
1243         * html/parser/HTMLPreloadScanner.cpp:
1244         (WebCore::identifierFor):
1245         (WebCore):
1246         (WebCore::inititatorFor):
1247         (WebCore::StartTagScanner::StartTagScanner):
1248         (WebCore::StartTagScanner::processAttributes):
1249         (StartTagScanner):
1250         (WebCore::StartTagScanner::createPreloadRequest):
1251         (WebCore::StartTagScanner::processAttribute):
1252         (WebCore::StartTagScanner::charset):
1253         (WebCore::StartTagScanner::resourceType):
1254         (WebCore::StartTagScanner::shouldPreload):
1255         (WebCore::HTMLPreloadScanner::processToken):
1256
1257 2013-02-13  Huang Dongsung  <luxtella@company100.net>
1258
1259         Coordinated Graphics: a long page is scaled vertically while loading.
1260         https://bugs.webkit.org/show_bug.cgi?id=109645
1261
1262         Reviewed by Noam Rosenthal.
1263
1264         When loading http://www.w3.org/TR/xpath-datamodel/, Coordinated Graphics draws
1265         vertically scaled contents. It is because there is the difference between the
1266         size of a layer and the size of CoordinatedBackingStore.
1267
1268         Currently, CoordinatedGraphicsScene notifies the size to CoordinatedBackingStore
1269         at the moment of creating, updating and removing a tile. However, it is not
1270         necessary to send tile-related messages when the size of layer is changed.
1271         So this patch resets the size of CoordinatedBackingStore when receiving the
1272         message that is created when the size is changed: SyncLayerState.
1273
1274         There is no current way to reliably test flicker issues.
1275
1276         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp:
1277           Add m_pendingSize to set m_size at the moment of flushing.
1278           After http://webkit.org/b/108294, m_pendingSize will be removed
1279           because the bug makes CoordinatedGraphicsScene execute all messages at
1280           the moment of flushing.
1281         (WebCore::CoordinatedBackingStore::setSize):
1282         (WebCore::CoordinatedBackingStore::commitTileOperations):
1283         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h:
1284         (CoordinatedBackingStore):
1285         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
1286         (WebCore::CoordinatedGraphicsScene::prepareContentBackingStore):
1287         (WebCore::CoordinatedGraphicsScene::createBackingStoreIfNeeded):
1288         (WebCore::CoordinatedGraphicsScene::resetBackingStoreSizeToLayerSize):
1289         (WebCore::CoordinatedGraphicsScene::createTile):
1290         (WebCore::CoordinatedGraphicsScene::removeTile):
1291         (WebCore::CoordinatedGraphicsScene::updateTile):
1292
1293 2013-02-13  Kentaro Hara  <haraken@chromium.org>
1294
1295         [V8] Rename XXXAccessorGetter() to XXXAttrGetterCustom(),
1296         and XXXAccessorSetter() to XXXAttrSetterCustom()
1297         https://bugs.webkit.org/show_bug.cgi?id=109679
1298
1299         Reviewed by Adam Barth.
1300
1301         For naming consistency and clarification.
1302
1303         No tests. No change in behavior.
1304
1305         * bindings/scripts/CodeGeneratorV8.pm:
1306         (GenerateHeader):
1307         (GenerateHeaderCustomCall):
1308         (GenerateNormalAttrGetter):
1309         (GenerateNormalAttrSetter):
1310         (GenerateImplementation):
1311         * bindings/scripts/test/V8/V8TestInterface.cpp:
1312         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrGetter):
1313         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrSetter):
1314         * bindings/scripts/test/V8/V8TestObj.cpp:
1315         (WebCore::TestObjV8Internal::customAttrAttrGetter):
1316         (WebCore::TestObjV8Internal::customAttrAttrSetter):
1317         * bindings/scripts/test/V8/V8TestObj.h:
1318         (V8TestObj):
1319         * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:
1320         (WebCore::V8AudioBufferSourceNode::bufferAttrSetterCustom):
1321         * bindings/v8/custom/V8BiquadFilterNodeCustom.cpp:
1322         (WebCore::V8BiquadFilterNode::typeAttrSetterCustom):
1323         * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
1324         (WebCore::V8CanvasRenderingContext2D::strokeStyleAttrGetterCustom):
1325         (WebCore::V8CanvasRenderingContext2D::strokeStyleAttrSetterCustom):
1326         (WebCore::V8CanvasRenderingContext2D::fillStyleAttrGetterCustom):
1327         (WebCore::V8CanvasRenderingContext2D::fillStyleAttrSetterCustom):
1328         * bindings/v8/custom/V8ClipboardCustom.cpp:
1329         (WebCore::V8Clipboard::typesAttrGetterCustom):
1330         * bindings/v8/custom/V8CoordinatesCustom.cpp:
1331         (WebCore::V8Coordinates::altitudeAttrGetterCustom):
1332         (WebCore::V8Coordinates::altitudeAccuracyAttrGetterCustom):
1333         (WebCore::V8Coordinates::headingAttrGetterCustom):
1334         (WebCore::V8Coordinates::speedAttrGetterCustom):
1335         * bindings/v8/custom/V8CustomEventCustom.cpp:
1336         (WebCore::V8CustomEvent::detailAttrGetterCustom):
1337         * bindings/v8/custom/V8DOMWindowCustom.cpp:
1338         (WebCore::V8DOMWindow::eventAttrGetterCustom):
1339         (WebCore::V8DOMWindow::eventAttrSetterCustom):
1340         (WebCore::V8DOMWindow::locationAttrSetterCustom):
1341         (WebCore::V8DOMWindow::openerAttrSetterCustom):
1342         * bindings/v8/custom/V8DeviceMotionEventCustom.cpp:
1343         (WebCore::V8DeviceMotionEvent::accelerationAttrGetterCustom):
1344         (WebCore::V8DeviceMotionEvent::accelerationIncludingGravityAttrGetterCustom):
1345         (WebCore::V8DeviceMotionEvent::rotationRateAttrGetterCustom):
1346         (WebCore::V8DeviceMotionEvent::intervalAttrGetterCustom):
1347         * bindings/v8/custom/V8DeviceOrientationEventCustom.cpp:
1348         (WebCore::V8DeviceOrientationEvent::alphaAttrGetterCustom):
1349         (WebCore::V8DeviceOrientationEvent::betaAttrGetterCustom):
1350         (WebCore::V8DeviceOrientationEvent::gammaAttrGetterCustom):
1351         (WebCore::V8DeviceOrientationEvent::absoluteAttrGetterCustom):
1352         * bindings/v8/custom/V8DocumentLocationCustom.cpp:
1353         (WebCore::V8Document::locationAttrGetterCustom):
1354         (WebCore::V8Document::locationAttrSetterCustom):
1355         * bindings/v8/custom/V8EventCustom.cpp:
1356         (WebCore::V8Event::dataTransferAttrGetterCustom):
1357         (WebCore::V8Event::clipboardDataAttrGetterCustom):
1358         * bindings/v8/custom/V8FileReaderCustom.cpp:
1359         (WebCore::V8FileReader::resultAttrGetterCustom):
1360         * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
1361         (WebCore::V8HTMLDocument::allAttrSetterCustom):
1362         * bindings/v8/custom/V8HTMLElementCustom.cpp:
1363         (WebCore::V8HTMLElement::itemValueAttrGetterCustom):
1364         (WebCore::V8HTMLElement::itemValueAttrSetterCustom):
1365         * bindings/v8/custom/V8HTMLFrameElementCustom.cpp:
1366         (WebCore::V8HTMLFrameElement::locationAttrSetterCustom):
1367         * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
1368         (WebCore::V8HTMLInputElement::selectionStartAttrGetterCustom):
1369         (WebCore::V8HTMLInputElement::selectionStartAttrSetterCustom):
1370         (WebCore::V8HTMLInputElement::selectionEndAttrGetterCustom):
1371         (WebCore::V8HTMLInputElement::selectionEndAttrSetterCustom):
1372         (WebCore::V8HTMLInputElement::selectionDirectionAttrGetterCustom):
1373         (WebCore::V8HTMLInputElement::selectionDirectionAttrSetterCustom):
1374         * bindings/v8/custom/V8HTMLLinkElementCustom.cpp:
1375         (WebCore::V8HTMLLinkElement::sizesAttrGetterCustom):
1376         (WebCore::V8HTMLLinkElement::sizesAttrSetterCustom):
1377         * bindings/v8/custom/V8HTMLMediaElementCustom.cpp:
1378         (WebCore::V8HTMLMediaElement::controllerAttrSetterCustom):
1379         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
1380         (WebCore::V8HTMLOptionsCollection::lengthAttrSetterCustom):
1381         * bindings/v8/custom/V8HistoryCustom.cpp:
1382         (WebCore::V8History::stateAttrGetterCustom):
1383         * bindings/v8/custom/V8JavaScriptCallFrameCustom.cpp:
1384         (WebCore::V8JavaScriptCallFrame::scopeChainAttrGetterCustom):
1385         (WebCore::V8JavaScriptCallFrame::thisObjectAttrGetterCustom):
1386         (WebCore::V8JavaScriptCallFrame::typeAttrGetterCustom):
1387         * bindings/v8/custom/V8LocationCustom.cpp:
1388         (WebCore::V8Location::hashAttrSetterCustom):
1389         (WebCore::V8Location::hostAttrSetterCustom):
1390         (WebCore::V8Location::hostnameAttrSetterCustom):
1391         (WebCore::V8Location::hrefAttrSetterCustom):
1392         (WebCore::V8Location::pathnameAttrSetterCustom):
1393         (WebCore::V8Location::portAttrSetterCustom):
1394         (WebCore::V8Location::protocolAttrSetterCustom):
1395         (WebCore::V8Location::searchAttrSetterCustom):
1396         (WebCore::V8Location::reloadAttrGetterCustom):
1397         (WebCore::V8Location::replaceAttrGetterCustom):
1398         (WebCore::V8Location::assignAttrGetterCustom):
1399         * bindings/v8/custom/V8MessageEventCustom.cpp:
1400         (WebCore::V8MessageEvent::dataAttrGetterCustom):
1401         (WebCore::V8MessageEvent::portsAttrGetterCustom):
1402         * bindings/v8/custom/V8OscillatorNodeCustom.cpp:
1403         (WebCore::V8OscillatorNode::typeAttrSetterCustom):
1404         * bindings/v8/custom/V8PannerNodeCustom.cpp:
1405         (WebCore::V8PannerNode::panningModelAttrSetterCustom):
1406         (WebCore::V8PannerNode::distanceModelAttrSetterCustom):
1407         * bindings/v8/custom/V8PopStateEventCustom.cpp:
1408         (WebCore::V8PopStateEvent::stateAttrGetterCustom):
1409         * bindings/v8/custom/V8SVGLengthCustom.cpp:
1410         (WebCore::V8SVGLength::valueAttrGetterCustom):
1411         (WebCore::V8SVGLength::valueAttrSetterCustom):
1412         * bindings/v8/custom/V8TrackEventCustom.cpp:
1413         (WebCore::V8TrackEvent::trackAttrGetterCustom):
1414         * bindings/v8/custom/V8WebKitAnimationCustom.cpp:
1415         (WebCore::V8WebKitAnimation::iterationCountAttrGetterCustom):
1416         * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
1417         (WebCore::V8XMLHttpRequest::responseTextAttrGetterCustom):
1418         (WebCore::V8XMLHttpRequest::responseAttrGetterCustom):
1419
1420 2013-02-12  Kentaro Hara  <haraken@chromium.org>
1421
1422         [V8] Generate wrapper methods for custom getters/setters
1423         https://bugs.webkit.org/show_bug.cgi?id=109666
1424
1425         Reviewed by Adam Barth.
1426
1427         Currently V8 directly calls back custom getters/setters written
1428         in custom binding files. This makes it impossible for code generators
1429         to hook custom getters/setters (e.g. Code generators cannot insert a code
1430         for FeatureObservation into custom getters/setters). To solve the problem,
1431         we should generate wrapper methods for custom getters/setters.
1432
1433         No tests. No change in behavior.
1434
1435         * bindings/scripts/CodeGeneratorV8.pm:
1436         (GenerateNormalAttrGetter):
1437         (GenerateNormalAttrSetter):
1438         (GenerateSingleBatchedAttribute):
1439         (GenerateImplementation):
1440         * bindings/scripts/test/V8/V8TestInterface.cpp:
1441         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrGetter):
1442         (TestInterfaceV8Internal):
1443         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrSetter):
1444         (WebCore):
1445         * bindings/scripts/test/V8/V8TestObj.cpp:
1446         (WebCore::TestObjV8Internal::customAttrAttrGetter):
1447         (TestObjV8Internal):
1448         (WebCore::TestObjV8Internal::customAttrAttrSetter):
1449         (WebCore):
1450
1451 2013-02-13   Vineet Chaudhary  <rgf748@motorola.com>
1452
1453         HTMLCollections namedItem() methods should return null than undefined for empty collections.
1454         https://bugs.webkit.org/show_bug.cgi?id=104096
1455
1456         Reviewed by Kentaro Hara.
1457
1458         As per specification namedItem() should return null if collection is empty.
1459         Spec: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html#htmlallcollection
1460
1461         Test: fast/dom/htmlcollection-namedItem.html
1462
1463         * bindings/js/JSHTMLAllCollectionCustom.cpp: Returning null.
1464         (WebCore::getNamedItems):
1465         * bindings/js/JSHTMLFormControlsCollectionCustom.cpp: Ditto.
1466         (WebCore::getNamedItems):
1467         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Ditto.
1468         (WebCore::getNamedItems):
1469         * bindings/v8/custom/V8HTMLAllCollectionCustom.cpp: Ditto.
1470         (WebCore::V8HTMLAllCollection::namedItemCallback):
1471         * bindings/v8/custom/V8HTMLFormControlsCollectionCustom.cpp: Ditto.
1472         (WebCore::V8HTMLFormControlsCollection::namedItemCallback):
1473         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp: Ditto.
1474         (WebCore::V8HTMLOptionsCollection::namedItemCallback):
1475
1476 2013-02-13  Tony Gentilcore  <tonyg@chromium.org>
1477
1478         Fix svg/in-html/script-write.html with threaded HTML parser
1479         https://bugs.webkit.org/show_bug.cgi?id=109495
1480
1481         Reviewed by Eric Seidel.
1482
1483         This patch makes the background parser's simulateTreeBuilder() more realistic.
1484         1. The HTMLTreeBuilder does not call the updateStateFor() setState()s when in foreign content mode so we shouldn't do it when simulating the tree builder.
1485         2. HTMLTreeBuilder::processTokenInForeignContent has a list of tags which exit foreign content mode. We need to respect those.
1486         3. Support the <foreignObject> tag which enters and leaves foreign content mode.
1487         4. The tree builder sets state to DataState upon a </script> tag when not in foreign content mode. We need to do the same.
1488
1489         This involved creating a namespace stack where we push upon entering each namespace and pop upon leaving.
1490         We are in foreign content if the topmost namespace is SVG or MathML.
1491
1492         This fixes svg/in-html/script-write.html and likely others.
1493
1494         * html/parser/BackgroundHTMLParser.cpp:
1495         (WebCore::BackgroundHTMLParser::simulateTreeBuilder):
1496         * html/parser/BackgroundHTMLParser.h:
1497         (BackgroundHTMLParser):
1498         * html/parser/CompactHTMLToken.cpp:
1499         (WebCore::CompactHTMLToken::getAttributeItem): Returns the attribute of the given name. Necessary to test for <font> attributes in simulateTreeBuilder.
1500         (WebCore):
1501         * html/parser/CompactHTMLToken.h:
1502         (WebCore):
1503         (CompactHTMLToken):
1504
1505 2013-02-13  Andreas Kling  <akling@apple.com>
1506
1507         Remove Element::getAttributeItem() overload that returned a mutable Attribute*.
1508         <http://webkit.org/b/109756>
1509
1510         Reviewed by Antti Koivisto.
1511
1512         Remove this to prevent callers from accidentally causing elements to convert to UniqueElementData.
1513         There are two call sites (Attr and HTMLSelectElement) that legitimately need to mutate Attribute
1514         objects in-place, they now use Element::ensureUniqueElementData()->getAttributeItem() directly instead.
1515
1516         Small progression on Membuster3, mostly for peace of mind.
1517
1518         * dom/Attr.cpp:
1519         (WebCore::Attr::elementAttribute):
1520         * dom/Element.h:
1521         (Element):
1522         * html/HTMLInputElement.cpp:
1523         (WebCore::HTMLInputElement::updateType):
1524         * html/HTMLSelectElement.cpp:
1525         (WebCore::HTMLSelectElement::parseAttribute):
1526         * svg/SVGStyledElement.cpp:
1527         (WebCore::SVGStyledElement::getPresentationAttribute):
1528
1529 2013-02-13  Andreas Kling  <akling@apple.com>
1530
1531         Stronger ElementData pointer typing.
1532         <http://webkit.org/b/109752>
1533
1534         Reviewed by Antti Koivisto.
1535
1536         Use ShareableElementData/UniqueElementData pointers instead of generic ElementData pointers
1537         where possible. Moved some methods from base class into leaf classes that don't make sense
1538         for both classes.
1539
1540         * dom/DocumentSharedObjectPool.cpp:
1541         (WebCore::ShareableElementDataCacheEntry::ShareableElementDataCacheEntry):
1542         (ShareableElementDataCacheEntry):
1543         (WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
1544         * dom/DocumentSharedObjectPool.h:
1545         (DocumentSharedObjectPool):
1546         * dom/Element.cpp:
1547         (WebCore::Element::parserSetAttributes):
1548         (WebCore::Element::setAttributeNode):
1549         (WebCore::Element::removeAttributeInternal):
1550         (WebCore::Element::cloneAttributesFromElement):
1551         (WebCore::Element::createUniqueElementData):
1552         (WebCore::ShareableElementData::createWithAttributes):
1553         (WebCore::UniqueElementData::create):
1554         (WebCore::ElementData::makeUniqueCopy):
1555         (WebCore::UniqueElementData::makeShareableCopy):
1556         * dom/Element.h:
1557         (ElementData):
1558         (ShareableElementData):
1559         (UniqueElementData):
1560         (Element):
1561         (WebCore::Element::ensureUniqueElementData):
1562         * dom/StyledElement.cpp:
1563         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
1564
1565 2013-02-13  Antti Koivisto  <antti@apple.com>
1566
1567         Reschedule shared CFRunLoopTimer instead of reconstructing it
1568         https://bugs.webkit.org/show_bug.cgi?id=109765
1569
1570         Reviewed by Andreas Kling and Anders Carlsson.
1571
1572         Using CFRunLoopTimerSetNextFireDate is over 2x faster than deleting and reconstructing timers.
1573
1574         * platform/mac/SharedTimerMac.mm:
1575         (WebCore):
1576         (WebCore::PowerObserver::restartSharedTimer):
1577         (WebCore::sharedTimer):
1578         (WebCore::setSharedTimerFireInterval):
1579         (WebCore::stopSharedTimer):
1580
1581 2013-02-13  Emil A Eklund  <eae@chromium.org>
1582
1583         getComputedStyle returns truncated value for margin-right
1584         https://bugs.webkit.org/show_bug.cgi?id=109759
1585
1586         Reviewed by Tony Chang.
1587         
1588         Due to an unfortunate cast in CSSComputedStyleDeclaration::
1589         getPropertyCSSValue getComputedStyle returns truncated styles
1590         for margin-right in cases where it isn't set to a specific pixel
1591         value.
1592
1593         Test: fast/sub-pixel/computedstylemargin.html
1594
1595         * css/CSSComputedStyleDeclaration.cpp:
1596         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
1597         Change type of temporary value variable to float to prevent loss of precision.
1598
1599 2013-02-13  Max Vujovic  <mvujovic@adobe.com>
1600
1601         [CSS Filters] Refactor filter outsets into a class
1602         https://bugs.webkit.org/show_bug.cgi?id=109330
1603
1604         Reviewed by Dean Jackson.
1605
1606         In filters related code, we're often operating on 4 ints representing the top, right,
1607         bottom, and left filter outsets. These outsets come from a filter like blur or drop-shadow.
1608         This patch packages those ints and their related operations into a class called
1609         IntRectExtent.
1610
1611         Here are some signs that we should make a class to hold those 4 ints:
1612         1) In RenderLayer.cpp, we have a expandRectForFilterOutsets function, which looks like
1613            feature envy.
1614         2) RenderStyle and other classes have methods like getFilterOutsets which set the 4 ints by
1615            reference. The calling code has to define 4 ints, which looks bloated.
1616         3) To fix bug 109098, we will need to check if filter outsets changed, which sounds like a
1617            nice job for an inequality operator. (https://bugs.webkit.org/show_bug.cgi?id=109098)
1618
1619         No new tests. No change in behavior. Just refactoring.
1620
1621         * GNUmakefile.list.am:
1622         * Target.pri:
1623         * WebCore.gypi:
1624         * WebCore.xcodeproj/project.pbxproj:
1625         * platform/graphics/IntRectExtent.h: Added.
1626         (WebCore):
1627         (IntRectExtent):
1628         (WebCore::IntRectExtent::IntRectExtent):
1629         (WebCore::IntRectExtent::top):
1630         (WebCore::IntRectExtent::setTop):
1631         (WebCore::IntRectExtent::right):
1632         (WebCore::IntRectExtent::setRight):
1633         (WebCore::IntRectExtent::bottom):
1634         (WebCore::IntRectExtent::setBottom):
1635         (WebCore::IntRectExtent::left):
1636         (WebCore::IntRectExtent::setLeft):
1637         (WebCore::IntRectExtent::expandRect):
1638         (WebCore::IntRectExtent::isZero):
1639         (WebCore::operator==):
1640         (WebCore::operator!=):
1641         (WebCore::operator+=):
1642         * platform/graphics/filters/FilterOperations.cpp:
1643         (WebCore::FilterOperations::outsets):
1644         * platform/graphics/filters/FilterOperations.h:
1645         (FilterOperations):
1646         * platform/graphics/texmap/TextureMapperLayer.cpp:
1647         (WebCore::TextureMapperLayer::intermediateSurfaceRect):
1648         * rendering/FilterEffectRenderer.cpp:
1649         (WebCore::FilterEffectRenderer::FilterEffectRenderer):
1650         (WebCore::FilterEffectRenderer::build):
1651         (WebCore::FilterEffectRenderer::computeSourceImageRectForDirtyRect):
1652         * rendering/FilterEffectRenderer.h:
1653         (FilterEffectRenderer):
1654         * rendering/RenderLayer.cpp:
1655         (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
1656         (WebCore::transparencyClipBox):
1657         (WebCore::RenderLayer::calculateLayerBounds):
1658         * rendering/style/RenderStyle.h:
1659
1660 2013-02-13  Adam Barth  <abarth@webkit.org>
1661
1662         Factor HTMLTokenScanner out of HTMLPreloadScanner
1663         https://bugs.webkit.org/show_bug.cgi?id=109754
1664
1665         Reviewed by Eric Seidel.
1666
1667         This patch is just a mechanical separation of the per-token "scanning"
1668         logic from HTMLPreloadScanner into a separate class.
1669         HTMLPreloadScanner's job is now to keep track of the input stream and
1670         to pump the tokenizer.
1671
1672         This factorization class will let us use HTMLTokenScanner on the
1673         background thread (once we finish making it thread-safe). In a follow
1674         up patch, I'll move HTMLTokenScanner to its own file.
1675
1676         * html/parser/HTMLPreloadScanner.cpp:
1677         (WebCore::HTMLTokenScanner::HTMLTokenScanner):
1678         (WebCore::HTMLTokenScanner::~HTMLTokenScanner):
1679         (WebCore::HTMLTokenScanner::processPossibleTemplateTag):
1680         (WebCore::HTMLTokenScanner::processPossibleStyleTag):
1681         (WebCore::HTMLTokenScanner::processPossibleBaseTag):
1682         (WebCore::HTMLTokenScanner::scan):
1683         (WebCore::HTMLPreloadScanner::HTMLPreloadScanner):
1684         (WebCore):
1685         (WebCore::HTMLPreloadScanner::~HTMLPreloadScanner):
1686         (WebCore::HTMLPreloadScanner::appendToEnd):
1687         (WebCore::HTMLPreloadScanner::scan):
1688         * html/parser/HTMLPreloadScanner.h:
1689         (HTMLTokenScanner):
1690         (WebCore::HTMLTokenScanner::setPredictedBaseElementURL):
1691         (HTMLPreloadScanner):
1692         (WebCore):
1693
1694 2013-02-13  Elliott Sprehn  <esprehn@chromium.org>
1695
1696         ASSERT(!renderer()->needsLayout()) when calling Element::focus() with generated content
1697         https://bugs.webkit.org/show_bug.cgi?id=109616
1698
1699         Reviewed by Julien Chaffraix.
1700
1701         Test: fast/css-generated-content/quote-layout-focus-crash.html
1702
1703         In some cases RenderQuote may mark itself and containing blocks as needing layout
1704         during a layout, but then one of it's containing blocks will mark itself as having
1705         finished layout so the RenderQuote and potentially some of it's ancestor renderers
1706         needLayout(), but the ancestors above those do not.
1707
1708         Until we have proper pre-layout tasks we should just walk the list of quotes
1709         right before layout and mark all their ancestors as needing layout if the quote
1710         needs layout.
1711
1712         * dom/Document.cpp:
1713         (WebCore::Document::updateLayout): Call markQuoteContainingBlocksForLayoutIfNeeded.
1714         (WebCore::Document::implicitClose): Call markQuoteContainingBlocksForLayoutIfNeeded.
1715         * rendering/RenderQuote.h:
1716         (WebCore::RenderQuote::next): Added.
1717         * rendering/RenderView.cpp:
1718         (WebCore::RenderView::markQuoteContainingBlocksForLayoutIfNeeded): Added.
1719         * rendering/RenderView.h:
1720         (RenderView):
1721
1722 2013-02-13  Jer Noble  <jer.noble@apple.com>
1723
1724         EME: MediaPlayer::keyNeede() should return a bool indicating whether an event listener was triggered.
1725         https://bugs.webkit.org/show_bug.cgi?id=109701
1726
1727         Reviewed by Eric Carlson.
1728
1729         Clients of MediaPlayer may need to do cleanup if calling keyNeeded()
1730         results in no event listener being triggered. Return a bool (like the
1731         v1 equivalent keyNeeded method) to indicate this.
1732
1733         * html/HTMLMediaElement.cpp:
1734         (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded):
1735         * html/HTMLMediaElement.h:
1736         * platform/graphics/MediaPlayer.cpp:
1737         (WebCore::MediaPlayer::keyNeeded):
1738         * platform/graphics/MediaPlayer.h:
1739         (WebCore::MediaPlayerClient::mediaPlayerKeyNeeded):
1740
1741 2013-02-13  Abhishek Arya  <inferno@chromium.org>
1742
1743         ASSERTION FAILED: !object || object->isBox(), Bad cast in RenderBox::computeLogicalHeight
1744         https://bugs.webkit.org/show_bug.cgi?id=107748
1745
1746         Reviewed by Levi Weintraub.
1747
1748         Make sure that body renderer is not an inline-block display
1749         when determining that it stretches to viewport or when paginated
1750         content needs base height.
1751
1752         Test: fast/block/body-inline-block-crash.html
1753
1754         * rendering/RenderBox.cpp:
1755         (WebCore::RenderBox::computeLogicalHeight):
1756         * rendering/RenderBox.h:
1757         (WebCore::RenderBox::stretchesToViewport):
1758
1759 2013-02-13  Shawn Singh  <shawnsingh@chromium.org>
1760
1761         Fix debug assertion being triggered because we may access dirty normalFlowList.
1762         https://bugs.webkit.org/show_bug.cgi?id=109740
1763
1764         A debug assertion in RenderLayer.h is being hit when trying to
1765         access the normalFlowList when it is dirty.  This is caused by a
1766         new recursion that I added in RenderLayerBacking::hasVisibleNonCompositingDescendant(),
1767         but I overlooked the need to call updateLayerListsIfNeeded()
1768         recursively as well.
1769
1770         Reviewed by Simon Fraser.
1771
1772         No test, because there's no reliable way to test this (same as bug 85512).
1773
1774         * rendering/RenderLayerBacking.cpp:
1775         (WebCore::hasVisibleNonCompositingDescendant):
1776         (WebCore::RenderLayerBacking::hasVisibleNonCompositingDescendantLayers):
1777
1778 2013-02-13  Antti Koivisto  <antti@apple.com>
1779
1780         Don't restart shared timer if both the current and the new fire time are in the past
1781         https://bugs.webkit.org/show_bug.cgi?id=109731
1782
1783         Reviewed by Andreas Kling.
1784
1785         In 40-50% of cases we reschedule the shared timer both the old and the new fire time have already passed. This can happen at least when rescheduling 
1786         a zero duration timer and when stopping a timer that was ready to fire.
1787
1788         We can skip rescheduling in this case, the shared timer will fire immediately anyway.
1789         
1790         Scheduling timers calls into platform layer and can be slow. This about halves the time under setSharedTimerFireInterval in PLT3
1791         for ~0.1% total CPU time reduction.
1792
1793         * platform/ThreadTimers.cpp:
1794         (WebCore::ThreadTimers::ThreadTimers):
1795         (WebCore::ThreadTimers::setSharedTimer):
1796         (WebCore::ThreadTimers::updateSharedTimer):
1797         (WebCore::ThreadTimers::sharedTimerFiredInternal):
1798         * platform/ThreadTimers.h:
1799         (ThreadTimers):
1800
1801 2013-02-13  Zan Dobersek  <zdobersek@igalia.com>
1802
1803         The 'global isinf/isnan' compiler quirk required when using clang with libstdc++
1804         https://bugs.webkit.org/show_bug.cgi?id=109325
1805
1806         Reviewed by Anders Carlsson.
1807
1808         Prefix calls to the isinf and isnan methods with std::, declaring we want to use the
1809         two methods as they're provided by the C++ standard library being used.
1810
1811         No new tests as there's no change in functionality.
1812
1813         * Modules/mediasource/MediaSource.cpp:
1814         (WebCore::MediaSource::setDuration):
1815         * Modules/webaudio/AudioBufferSourceNode.cpp:
1816         (WebCore::AudioBufferSourceNode::totalPitchRate):
1817         * Modules/webaudio/AudioParam.cpp:
1818         (WebCore::AudioParam::setValue):
1819         * Modules/webaudio/AudioParamTimeline.cpp:
1820         (WebCore::isValidNumber):
1821         * Modules/webaudio/PannerNode.cpp:
1822         (WebCore::fixNANs):
1823         * bindings/js/IDBBindingUtilities.cpp:
1824         (WebCore::createIDBKeyFromValue):
1825         * bindings/js/JSDataViewCustom.cpp:
1826         (WebCore::getDataViewMember):
1827         * bindings/js/JSGeolocationCustom.cpp:
1828         (WebCore::setTimeout):
1829         (WebCore::setMaximumAge):
1830         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
1831         (WebCore::JSHTMLOptionsCollection::setLength):
1832         * bindings/js/JSWebKitPointCustom.cpp:
1833         (WebCore::JSWebKitPointConstructor::constructJSWebKitPoint):
1834         * bindings/scripts/CodeGeneratorJS.pm:
1835         (GenerateImplementation):
1836         (GenerateParametersCheck):
1837         * bindings/scripts/CodeGeneratorV8.pm:
1838         (GenerateParametersCheck):
1839         * bindings/scripts/test/JS/JSFloat64Array.cpp:
1840         (WebCore::JSFloat64Array::getByIndex):
1841         * bindings/scripts/test/JS/JSTestObj.cpp:
1842         (WebCore::jsTestObjPrototypeFunctionClassMethodWithClamp):
1843         * bindings/scripts/test/V8/V8TestObj.cpp:
1844         (WebCore::TestObjV8Internal::classMethodWithClampCallback):
1845         * bindings/v8/IDBBindingUtilities.cpp:
1846         (WebCore::createIDBKeyFromValue):
1847         * bindings/v8/V8Binding.cpp:
1848         (WebCore::toInt32):
1849         (WebCore::toUInt32):
1850         * bindings/v8/custom/V8GeolocationCustom.cpp:
1851         (WebCore::createPositionOptions):
1852         * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
1853         (WebCore::V8HTMLOptionsCollection::lengthAccessorSetter):
1854         * bindings/v8/custom/V8WebKitPointCustom.cpp:
1855         (WebCore::V8WebKitPoint::constructorCallbackCustom):
1856         * bridge/qt/qt_runtime.cpp:
1857         (JSC::Bindings::convertValueToQVariant):
1858         * css/WebKitCSSMatrix.cpp:
1859         (WebCore::WebKitCSSMatrix::translate):
1860         (WebCore::WebKitCSSMatrix::scale):
1861         (WebCore::WebKitCSSMatrix::rotate):
1862         (WebCore::WebKitCSSMatrix::rotateAxisAngle):
1863         (WebCore::WebKitCSSMatrix::skewX):
1864         (WebCore::WebKitCSSMatrix::skewY):
1865         * html/HTMLMediaElement.cpp:
1866         (WebCore::HTMLMediaElement::percentLoaded):
1867         (WebCore::HTMLMediaElement::mediaPlayerTimeChanged):
1868         (WebCore::HTMLMediaElement::endedPlayback):
1869         * html/MediaController.cpp:
1870         (MediaController::duration):
1871         * html/canvas/WebGLRenderingContext.cpp:
1872         (WebCore):
1873         (WebCore::WebGLRenderingContext::clearColor):
1874         * html/track/TextTrack.cpp:
1875         (WebCore::TextTrack::addCue):
1876         * html/track/TextTrackCue.cpp:
1877         (WebCore::TextTrackCue::setStartTime):
1878         (WebCore::TextTrackCue::setEndTime):
1879         * page/DOMWindow.cpp:
1880         (WebCore::DOMWindow::adjustWindowRect):
1881         * page/WindowFeatures.cpp:
1882         (WebCore::WindowFeatures::floatFeature): Also include an opportunistic style fix.
1883         * platform/CalculationValue.cpp:
1884         (WebCore::CalculationValue::evaluate):
1885         * platform/Decimal.cpp:
1886         (WebCore::Decimal::fromDouble):
1887         * platform/Length.cpp:
1888         (WebCore::Length::nonNanCalculatedValue):
1889         * platform/audio/AudioResampler.cpp:
1890         (WebCore::AudioResampler::setRate):
1891         * platform/audio/DynamicsCompressorKernel.cpp:
1892         (WebCore::DynamicsCompressorKernel::process):
1893         * platform/audio/Reverb.cpp:
1894         (WebCore::calculateNormalizationScale):
1895         * platform/graphics/Font.cpp:
1896         (WebCore::Font::width):
1897         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1898         (WebCore::MediaPlayerPrivateAVFoundation::isLiveStream):
1899         * platform/graphics/gpu/LoopBlinnMathUtils.cpp:
1900         (LoopBlinnMathUtils):
1901         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1902         (WebCore::MediaPlayerPrivateGStreamer::buffered):
1903         (WebCore::MediaPlayerPrivateGStreamer::maxTimeSeekable):
1904         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
1905         (WebCore::MediaPlayerPrivateQTKit::maxTimeSeekable):
1906         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
1907         (WebCore::OpenTypeVerticalData::getVerticalTranslationsForGlyphs):
1908         * platform/graphics/transforms/TransformationMatrix.cpp:
1909         (WebCore::clampEdgeValue):
1910         (WebCore::TransformationMatrix::clampedBoundsOfProjectedQuad):
1911         * platform/network/ResourceResponseBase.cpp:
1912         (WebCore::ResourceResponseBase::parseCacheControlDirectives):
1913         * rendering/RenderMediaControlsChromium.cpp:
1914         (WebCore::paintMediaSlider):
1915         (WebCore::paintMediaVolumeSlider):
1916         * rendering/RenderThemeMac.mm:
1917         (WebCore::RenderThemeMac::paintMediaSliderTrack):
1918         * svg/SVGAnimationElement.cpp:
1919         (WebCore::SVGAnimationElement::beginElementAt):
1920         (WebCore::SVGAnimationElement::endElementAt):
1921         * svg/SVGSVGElement.cpp:
1922         (WebCore::SVGSVGElement::setCurrentTime):
1923         * svg/animation/SMILTime.h:
1924         (WebCore::SMILTime::SMILTime):
1925         * svg/animation/SVGSMILElement.cpp:
1926         (WebCore::SVGSMILElement::addBeginTime):
1927         (WebCore::SVGSMILElement::addEndTime):
1928         * xml/XPathFunctions.cpp:
1929         (WebCore::XPath::FunSubstring::evaluate):
1930         (WebCore::XPath::FunRound::round):
1931         * xml/XPathValue.cpp:
1932         (WebCore::XPath::Value::toBoolean): Also include an opportunistic style fix.
1933         (WebCore::XPath::Value::toString):
1934
1935 2013-02-13  Eric Carlson  <eric.carlson@apple.com>
1936
1937         [Mac] Caption menu should have only one item selected
1938         https://bugs.webkit.org/show_bug.cgi?id=109730
1939
1940         Reviewed by Dean Jackson.
1941
1942         No new tests, media/track/track-user-preferences.html was modified to test the changes.
1943
1944         * CMakeLists.txt: Add CaptionUserPreferences.cpp.
1945         * GNUmakefile.list.am: Ditto.
1946         * Target.pri: Ditto.
1947         * WebCore.gypi: Ditto.
1948         * WebCore.vcproj/WebCore.vcproj: Ditto.
1949         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1950         * WebCore.xcodeproj/project.pbxproj: Ditto.
1951
1952         * html/HTMLMediaElement.cpp:
1953         (WebCore::HTMLMediaElement::HTMLMediaElement): Initialize m_processingPreferenceChange.
1954         (WebCore::HTMLMediaElement::configureTextTrackGroup): Only end up with one selected track when
1955             called because of a preferences change.
1956         (WebCore::HTMLMediaElement::captionPreferencesChanged): Call setClosedCaptionsVisible instead
1957             of calling markCaptionAndSubtitleTracksAsUnconfigured directly.
1958         (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): Process all tracks, 
1959             not just track elements.
1960         * html/HTMLMediaElement.h:
1961
1962         * page/CaptionUserPreferences.cpp: Added so the functionality can be tested in DRT.
1963         (WebCore::CaptionUserPreferences::registerForPreferencesChangedCallbacks):
1964         (WebCore::CaptionUserPreferences::unregisterForPreferencesChangedCallbacks):
1965         (WebCore::CaptionUserPreferences::setUserPrefersCaptions):
1966         (WebCore::CaptionUserPreferences::captionPreferencesChanged):
1967         (WebCore::CaptionUserPreferences::preferredLanguages):
1968         (WebCore::CaptionUserPreferences::setPreferredLanguage):
1969         (WebCore::CaptionUserPreferences::displayNameForTrack):
1970         * page/CaptionUserPreferences.h:
1971
1972         * page/CaptionUserPreferencesMac.h:
1973         * page/CaptionUserPreferencesMac.mm:
1974         (WebCore::CaptionUserPreferencesMac::registerForPreferencesChangedCallbacks): Moved some logic
1975             to base class.
1976         (WebCore::CaptionUserPreferencesMac::captionPreferencesChanged): Ditto.
1977
1978 2013-02-13  Hans Muller  <hmuller@adobe.com>
1979
1980         [CSS Exclusions] ExclusionPolygon reflex vertices should constrain the first fit location.
1981         https://bugs.webkit.org/show_bug.cgi?id=107568
1982
1983         Reviewed by Dirk Schulze.
1984
1985         The ExclusionPolygon::firstIncludedIntervalLogicalTop() method now includes offset edges
1986         for each of the polygon's reflex vertices. The motivation for this change is explained
1987         here: http://hansmuller-webkit.blogspot.com/2013/01/getting-to-point-reflex-vertices.html.
1988
1989         Test: fast/exclusions/shape-inside/shape-inside-first-fit-reflex.html
1990
1991         * rendering/ExclusionPolygon.cpp:
1992         (WebCore::isReflexVertex): Given three vertices that represent a pair of connected polygon edges, return true if the second vertex is a reflex vertex.
1993         (WebCore::ExclusionPolygon::firstIncludedIntervalLogicalTop): This method now includes offset edges for reflex vertices.
1994         * rendering/ExclusionPolygon.h:
1995         (WebCore::OffsetPolygonEdge::OffsetPolygonEdge): Added a constructor for creating an OffsetPolygonEdge given a reflex vertex.
1996         (WebCore::OffsetPolygonEdge::edgeIndex): Changed this property from unsigned to int. Now using -1 to indicate that the offset edge doesn't correspond to a single polygon edge.
1997
1998 2013-02-13  Adam Barth  <abarth@webkit.org>
1999
2000         CSSPreloadScanner should not depend on HTMLToken
2001         https://bugs.webkit.org/show_bug.cgi?id=109742
2002
2003         Reviewed by Eric Seidel.
2004
2005         There's no need for the CSSPreloadScanner to depend on HTMLToken. On
2006         the background thread, we'll likely want to use a CompactHTMLToken for
2007         preload scanning, so this dependency is problematic. This patch also
2008         teaches the CSSPreloadScanner how to scan LChars.
2009
2010         * html/parser/CSSPreloadScanner.cpp:
2011         (WebCore::CSSPreloadScanner::~CSSPreloadScanner):
2012         (WebCore):
2013         (WebCore::CSSPreloadScanner::scan):
2014         * html/parser/CSSPreloadScanner.h:
2015         (CSSPreloadScanner):
2016         * html/parser/HTMLPreloadScanner.cpp:
2017         (WebCore::HTMLPreloadScanner::processToken):
2018
2019 2013-02-13  Julien Chaffraix  <jchaffraix@webkit.org>
2020
2021         [CSS Grid Layout] Adding or removing grid items doesn't properly recompute the track sizes
2022         https://bugs.webkit.org/show_bug.cgi?id=109100
2023
2024         Reviewed by Ojan Vafai.
2025
2026         Test: fast/css-grid-layout/grid-item-removal-track-breadth-update.html
2027
2028         The test uncovered several bugs in our implementation that is fixed as part
2029         of this change. They will be detailed below.
2030
2031         * rendering/RenderGrid.cpp:
2032         (WebCore::RenderGrid::logicalContentHeightForChild):
2033         Added this function to share the code between minContentForChild and maxContentForChild.
2034         Also forced a relayout in this case to avoid getting a wrong answer (e.g. the logical height
2035         constrained by the previous layout's grid breadth).
2036
2037         (WebCore::RenderGrid::minContentForChild):
2038         (WebCore::RenderGrid::maxContentForChild):
2039         Updated to use logicalContentHeightForChild.
2040
2041         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
2042         Updated to match the specification and set max breadth to current breadth per the specification.
2043         This made us over-grow some cases in the test.
2044
2045         (WebCore::RenderGrid::distributeSpaceToTracks):
2046         Updated to match the specification and use an extra variable to do the intermediate spreading. Also removed
2047         a now unneeded max. This fixes the case of multiple grid items in the same grid area that was completely broken.
2048
2049         (WebCore::RenderGrid::layoutGridItems):
2050         Added a FIXME about always relaying out content sized tracks' children.
2051
2052         * rendering/RenderGrid.h:
2053         Added logicalContentHeightForChild.
2054
2055 2013-02-13  Adam Barth  <abarth@webkit.org>
2056
2057         Clean up some style nits in HTMLPreloadScanner
2058         https://bugs.webkit.org/show_bug.cgi?id=109738
2059
2060         Reviewed by Tony Gentilcore.
2061
2062         This patch just fixes a few style nits I noticed when reading through
2063         the code.
2064
2065         * html/parser/HTMLPreloadScanner.cpp:
2066         (WebCore::StartTagScanner::StartTagScanner):
2067         (WebCore::HTMLPreloadScanner::processPossibleStyleTag):
2068         (WebCore::HTMLPreloadScanner::processPossibleBaseTag):
2069         * html/parser/HTMLResourcePreloader.cpp:
2070         (WebCore::PreloadRequest::isSafeToSendToAnotherThread):
2071         * html/parser/HTMLResourcePreloader.h:
2072         (PreloadRequest):
2073         (WebCore::PreloadRequest::PreloadRequest):
2074         (WebCore::HTMLResourcePreloader::HTMLResourcePreloader):
2075
2076 2013-02-13  Sheriff Bot  <webkit.review.bot@gmail.com>
2077
2078         Unreviewed, rolling out r142747.
2079         http://trac.webkit.org/changeset/142747
2080         https://bugs.webkit.org/show_bug.cgi?id=109746
2081
2082         broke component build (Requested by alecf_gardening on
2083         #webkit).
2084
2085         * inspector/HeapGraphSerializer.cpp:
2086         (WebCore::HeapGraphSerializer::HeapGraphSerializer):
2087         (WebCore::HeapGraphSerializer::pushUpdate):
2088         (WebCore::HeapGraphSerializer::reportNode):
2089         (WebCore::HeapGraphSerializer::toNodeId):
2090         (WebCore::HeapGraphSerializer::addRootNode):
2091         * inspector/HeapGraphSerializer.h:
2092         (WebCore):
2093         (HeapGraphSerializer):
2094         * inspector/InspectorMemoryAgent.cpp:
2095         (WebCore::InspectorMemoryAgent::getProcessMemoryDistributionImpl):
2096
2097 2013-02-13  Levi Weintraub  <leviw@chromium.org>
2098
2099         Bidi-Isolated inlines can cause subsequent content to not be rendered
2100         https://bugs.webkit.org/show_bug.cgi?id=108137
2101
2102         Reviewed by Eric Seidel.
2103
2104         First step in fixing how inline isolates behave with collapsed spaces.
2105         webkit.org/b/109624 tracks the overarching issue.
2106
2107         Test: fast/text/content-following-inline-isolate-with-collapsed-whitespace.html
2108
2109         * rendering/InlineIterator.h:
2110         (WebCore::IsolateTracker::addFakeRunIfNecessary): If we enter an isolate while
2111         ignoring spaces, ensure we leave it considering them again. This can result in
2112         including spaces that should be ignored following the isolate on the line, but
2113         failing to do so results in those contents not being rendered at all.
2114
2115 2013-02-13  Andreas Kling  <akling@apple.com>
2116
2117         Better names for ElementAttributeData & subclasses.
2118         <http://webkit.org/b/109529>
2119
2120         Reviewed by Antti Koivisto.
2121
2122         - ElementAttributeData => ElementData
2123
2124             Because ElementAttributeData won't be a good name once we move some non-attribute related
2125             things to this structure.
2126
2127         - ImmutableElementAttributeData => ShareableElementData
2128
2129             These objects can be shared with other Elements that have the same attribute name/value pairs.
2130
2131         - MutableElementAttributeData => UniqueElementData
2132
2133             These objects contain data that is unique to a specific Element, and cannot be shared with
2134             other Elements. This is what's important about it, not that its underlying storage is mutable.
2135
2136         - attributeData() -> elementData()
2137         - updatedAttributeData() -> elementDataWithSynchronizedAttributes()
2138         - ensureUpdatedAttributeData() -> ensureElementDataWithSynchronizedAttributes()
2139         - mutableAttributeData() -> ensureUniqueElementData()
2140
2141             Ride-along renames. Much less vague than previous names IMO.
2142
2143         * css/StyleResolver.cpp:
2144         (WebCore::StyleResolver::canShareStyleWithControl):
2145         (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
2146         * dom/Attr.cpp:
2147         (WebCore::Attr::elementAttribute):
2148         * dom/DocumentSharedObjectPool.cpp:
2149         (WebCore::ShareableElementDataCacheKey::ShareableElementDataCacheKey):
2150         (WebCore::ShareableElementDataCacheKey::operator!=):
2151         (WebCore::ShareableElementDataCacheEntry::ShareableElementDataCacheEntry):
2152         (ShareableElementDataCacheEntry):
2153         (WebCore::DocumentSharedObjectPool::cachedShareableElementDataWithAttributes):
2154         * dom/DocumentSharedObjectPool.h:
2155         (DocumentSharedObjectPool):
2156         * dom/Element.cpp:
2157         (WebCore::Element::detachAttribute):
2158         (WebCore::Element::removeAttribute):
2159         (WebCore::Element::attributes):
2160         (WebCore::Element::getAttribute):
2161         (WebCore::Element::setAttribute):
2162         (WebCore::Element::setSynchronizedLazyAttribute):
2163         (WebCore::Element::setAttributeInternal):
2164         (WebCore::Element::attributeChanged):
2165         (WebCore::Element::classAttributeChanged):
2166         (WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged):
2167         (WebCore::Element::parserSetAttributes):
2168         (WebCore::Element::hasAttributes):
2169         (WebCore::Element::hasEquivalentAttributes):
2170         (WebCore::Element::setAttributeNode):
2171         (WebCore::Element::removeAttributeNode):
2172         (WebCore::Element::removeAttributeInternal):
2173         (WebCore::Element::addAttributeInternal):
2174         (WebCore::Element::getAttributeNode):
2175         (WebCore::Element::getAttributeNodeNS):
2176         (WebCore::Element::hasAttribute):
2177         (WebCore::Element::hasAttributeNS):
2178         (WebCore::Element::computeInheritedLanguage):
2179         (WebCore::Element::getURLAttribute):
2180         (WebCore::Element::getNonEmptyURLAttribute):
2181         (WebCore::Element::cloneAttributesFromElement):
2182         (WebCore::Element::createUniqueElementData):
2183         (WebCore::Element::reportMemoryUsage):
2184         (WebCore::ElementData::deref):
2185         (WebCore::ElementData::ElementData):
2186         (WebCore::sizeForShareableElementDataWithAttributeCount):
2187         (WebCore::ElementData::createShareableWithAttributes):
2188         (WebCore::ElementData::createUnique):
2189         (WebCore::ShareableElementData::ShareableElementData):
2190         (WebCore::ShareableElementData::~ShareableElementData):
2191         (WebCore::UniqueElementData::UniqueElementData):
2192         (WebCore::ElementData::makeMutableCopy):
2193         (WebCore::ElementData::makeImmutableCopy):
2194         (WebCore::ElementData::setPresentationAttributeStyle):
2195         (WebCore::ElementData::addAttribute):
2196         (WebCore::ElementData::removeAttribute):
2197         (WebCore::ElementData::isEquivalent):
2198         (WebCore::ElementData::reportMemoryUsage):
2199         (WebCore::ElementData::getAttributeItemIndexSlowCase):
2200         * dom/Element.h:
2201         (ElementData):
2202         (WebCore::ElementData::isUnique):
2203         (ShareableElementData):
2204         (UniqueElementData):
2205         (WebCore::Element::getAttributeItemIndex):
2206         (WebCore::Element::elementData):
2207         (Element):
2208         (WebCore::Element::elementDataWithSynchronizedAttributes):
2209         (WebCore::Element::ensureElementDataWithSynchronizedAttributes):
2210         (WebCore::Element::fastHasAttribute):
2211         (WebCore::Element::fastGetAttribute):
2212         (WebCore::Element::hasAttributesWithoutUpdate):
2213         (WebCore::Element::idForStyleResolution):
2214         (WebCore::Element::classNames):
2215         (WebCore::Element::attributeCount):
2216         (WebCore::Element::attributeItem):
2217         (WebCore::Element::getAttributeItem):
2218         (WebCore::Element::updateInvalidAttributes):
2219         (WebCore::Element::hasID):
2220         (WebCore::Element::hasClass):
2221         (WebCore::Element::ensureUniqueElementData):
2222         (WebCore::ElementData::mutableAttributeVector):
2223         (WebCore::ElementData::immutableAttributeArray):
2224         (WebCore::ElementData::length):
2225         (WebCore::ElementData::presentationAttributeStyle):
2226         (WebCore::ElementData::getAttributeItem):
2227         (WebCore::ElementData::getAttributeItemIndex):
2228         (WebCore::ElementData::attributeItem):
2229         * dom/Node.cpp:
2230         (WebCore::Node::dumpStatistics):
2231         (WebCore::Node::compareDocumentPosition):
2232         * dom/StyledElement.cpp:
2233         (WebCore::StyledElement::updateStyleAttribute):
2234         (WebCore::StyledElement::ensureMutableInlineStyle):
2235         (WebCore::StyledElement::attributeChanged):
2236         (WebCore::StyledElement::inlineStyleCSSOMWrapper):
2237         (WebCore::StyledElement::setInlineStyleFromString):
2238         (WebCore::StyledElement::styleAttributeChanged):
2239         (WebCore::StyledElement::inlineStyleChanged):
2240         (WebCore::StyledElement::addSubresourceAttributeURLs):
2241         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
2242         * dom/StyledElement.h:
2243         (WebCore::StyledElement::inlineStyle):
2244         (WebCore::StyledElement::invalidateStyleAttribute):
2245         (WebCore::StyledElement::presentationAttributeStyle):
2246         * html/ClassList.cpp:
2247         (WebCore::ClassList::classNames):
2248         * html/HTMLInputElement.cpp:
2249         (WebCore::HTMLInputElement::updateType):
2250         * html/parser/HTMLConstructionSite.cpp:
2251         (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
2252         * svg/SVGElement.cpp:
2253         (WebCore::SVGElement::updateAnimatedSVGAttribute):
2254         * svg/SVGElement.h:
2255         (WebCore::SVGElement::invalidateSVGAttributes):
2256         * xml/parser/XMLDocumentParserQt.cpp:
2257         (WebCore::XMLDocumentParser::XMLDocumentParser):
2258
2259 2013-02-13  Christian Biesinger  <cbiesinger@chromium.org>
2260
2261         Crash when encountering <object style="resize:both;">
2262         https://bugs.webkit.org/show_bug.cgi?id=109728
2263
2264         See also https://code.google.com/p/chromium/issues/detail?id=175535
2265         This bug can be reproduced on
2266         http://dramalink.net/tudou.y/?xink=162601060
2267
2268         Reviewed by Eric Seidel.
2269
2270         Test: fast/css/resize-object-crash.html
2271
2272         * rendering/RenderWidget.cpp:
2273         (WebCore::RenderWidget::paint):
2274         Only call paintResizer() if we have a layer and canResize() is true
2275
2276 2013-02-13  Arko Saha  <arko@motorola.com>
2277
2278         [Microdata] HTMLPropertiesCollection code cleanup
2279         https://bugs.webkit.org/show_bug.cgi?id=109721
2280
2281         Reviewed by Ryosuke Niwa.
2282
2283         Removed forward declaration of DOMStringList class.
2284         Removed unused findRefElements() method declaration.
2285         Also Removed unused parameter Element* from updatePropertyCache() method.
2286
2287         No new test since no change in behavior.
2288
2289         * html/HTMLPropertiesCollection.cpp:
2290         (WebCore::HTMLPropertiesCollection::updateNameCache):
2291         * html/HTMLPropertiesCollection.h:
2292         (WebCore):
2293         (HTMLPropertiesCollection):
2294         (WebCore::HTMLPropertiesCollection::updatePropertyCache):
2295
2296 2013-02-13  Kondapally Kalyan  <kalyan.kondapally@intel.com>
2297
2298         [WebGL][EFL][GTK][Qt]Add support for OES_vertex_array_object.
2299         https://bugs.webkit.org/show_bug.cgi?id=109382
2300
2301         Reviewed by Kenneth Russell.
2302
2303         Covered by fast/canvas/webgl/oes-vertex-array-object.html
2304
2305         This patch adds support for using Vertex Array Object with OpenGl.
2306         The patch adds support for loading necessary opengl functions
2307         and support for checking GL_ARB_vertex_array_object. The support
2308         for OES_vertex_array_object is advertised if GL_ARB_vertex_array_object is
2309         supported.
2310
2311         * platform/graphics/OpenGLShims.cpp:
2312         (WebCore::initializeOpenGLShims):
2313         * platform/graphics/OpenGLShims.h:
2314         (_OpenGLFunctionTable):
2315         Added support for loading the necessary functions.
2316
2317         * platform/graphics/opengl/Extensions3DOpenGL.cpp:
2318         (WebCore::Extensions3DOpenGL::createVertexArrayOES):
2319         (WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
2320         (WebCore::Extensions3DOpenGL::isVertexArrayOES):
2321         (WebCore::Extensions3DOpenGL::bindVertexArrayOES):
2322         (WebCore::Extensions3DOpenGL::supportsExtension):
2323
2324         (WebCore):
2325         (WebCore::Extensions3DOpenGL::isVertexArrayObjectSupported):
2326         * platform/graphics/opengl/Extensions3DOpenGL.h:
2327         (Extensions3DOpenGL):
2328
2329 2013-02-13  Eberhard Graether  <egraether@google.com>
2330
2331         chromium: remove CompositorHUDFontAtlas
2332         https://bugs.webkit.org/show_bug.cgi?id=109328
2333
2334         Reviewed by James Robinson.
2335
2336         After switching the HudLayer to use skia's font rendering the
2337         CompositorHUDFontAtlas has become obsolete. This change removes
2338         this class and the related WebLayerTreeView API.
2339
2340         No new tests.
2341
2342         * WebCore.gypi:
2343         * platform/graphics/chromium/CompositorHUDFontAtlas.cpp: Removed.
2344         * platform/graphics/chromium/CompositorHUDFontAtlas.h: Removed.
2345
2346 2013-02-13  Dean Jackson  <dino@apple.com>
2347
2348         Small update to speech bubble for captions menu [Mac]
2349         https://bugs.webkit.org/show_bug.cgi?id=109641
2350
2351         Reviewed by Eric Carlson
2352
2353         Small adjustment to the embedded SVG that draws a speech bubble
2354         for the captions button. Remove a polygon that was so small
2355         it looked like a rendering error.
2356
2357         * css/mediaControlsQuickTime.css:
2358         (video::-webkit-media-controls-toggle-closed-captions-button):
2359
2360 2013-02-13  Dean Jackson  <dino@apple.com>
2361
2362         Clicking outside captions menu should dismiss it
2363         https://bugs.webkit.org/show_bug.cgi?id=109648
2364
2365         Reviewed by Eric Carlson.
2366
2367         Add a virtual override to the platform-specific
2368         defaultEventHandler to intercept any click in the controls,
2369         and hide the captions menu if it is showing.
2370
2371         Test: media/video-controls-captions-trackmenu-hide-on-click.html
2372
2373         * html/shadow/MediaControlsApple.cpp:
2374         (WebCore::MediaControlsApple::defaultEventHandler): Override from MediaControls. Hide
2375             captions menu if a click event comes in.
2376         * html/shadow/MediaControlsApple.h:
2377
2378 2013-02-13  Tommy Widenflycht  <tommyw@google.com>
2379
2380         MediaStream API: Use the source id when creating new tracks
2381         https://bugs.webkit.org/show_bug.cgi?id=109688
2382
2383         Reviewed by Adam Barth.
2384
2385         This patch reuses the ids from the source when creating tracks instead of creating a new one.
2386         This was requested by the chromium port to greatly simplify their implementation.
2387         In the longer run the API should be rewritten to only use tracks instead of sources.
2388
2389         Covered by existing tests.
2390
2391         * platform/chromium/support/WebMediaStream.cpp:
2392         (WebKit::WebMediaStream::audioTracks):
2393         (WebKit::WebMediaStream::videoTracks):
2394         (WebKit::WebMediaStream::initialize):
2395         (WebKit):
2396         * platform/chromium/support/WebMediaStreamTrack.cpp:
2397         (WebKit::WebMediaStreamTrack::initialize):
2398         (WebKit):
2399         * platform/mediastream/MediaStreamComponent.h:
2400         (WebCore::MediaStreamComponent::create):
2401         (MediaStreamComponent):
2402         (WebCore::MediaStreamComponent::MediaStreamComponent):
2403         (WebCore):
2404         * platform/mediastream/MediaStreamDescriptor.h:
2405         (WebCore::MediaStreamDescriptor::create):
2406         (MediaStreamDescriptor):
2407         (WebCore::MediaStreamDescriptor::MediaStreamDescriptor):
2408
2409 2013-02-13  Eric Seidel  <eric@webkit.org>
2410
2411         Use fancy new Vector-based String constructors in the WebVTT parser
2412         https://bugs.webkit.org/show_bug.cgi?id=109619
2413
2414         Reviewed by Benjamin Poulain.
2415
2416         No change in behavior. Added some FIXMEs for future perf optimization.
2417
2418         * html/track/WebVTTParser.cpp:
2419         (WebCore::WebVTTParser::constructTreeFromToken):
2420
2421 2013-02-13  Morten Stenshorne  <mstensho@opera.com>
2422
2423         WebKit ignores column-rules wider than column-gap
2424         https://bugs.webkit.org/show_bug.cgi?id=15553
2425
2426         Paint column rules even if they are wider than the gap.
2427         Rules wider than the gap should just overlap with column contents.
2428
2429         Reviewed by Eric Seidel.
2430
2431         Test: fast/multicol/rule-thicker-than-gap.html
2432
2433         * rendering/RenderBlock.cpp:
2434         (WebCore::RenderBlock::paintColumnRules):
2435
2436 2013-02-13  Philip Rogers  <pdr@google.com>
2437
2438         Replace SVG bitmap cache with directly-rendered SVG
2439         https://bugs.webkit.org/show_bug.cgi?id=106159
2440
2441         Reviewed by Tim Horton.
2442
2443         This patch removes the caching of SVG bitmaps so SVG images are rendered directly. This
2444         enables WebKit to pass the IE Chalkboard demo in 10s on a Z620:
2445         http://ie.microsoft.com/testdrive/Performance/Chalkboard/
2446
2447         On a simple scaled SVG benchmark similar to the IE10 Chalkboard demo
2448         (http://philbit.com/SvgImagePerformance/viewport.html):
2449             without patch: ~20FPS
2450             with patch: ~55FPS
2451
2452         The bitmap SVG image cache had several shortcomings:
2453             - The bitmap cache prevented viewport rendering. (WK104693)
2454             - Bitmap memory usage was high. (WK106484)
2455             - Caching animating images was expensive.
2456
2457         This change removes almost all of the SVGImageCache implementation, replacing it with
2458         directly-rendered SVG. Instead of caching bitmaps, an SVGImageForContainer is cached which
2459         is a thin wrapper around an SVG image with the associated container size and scale.
2460         When rendering patterns (e.g., tiled backgrounds), a temporary bitmap is used for
2461         performance. This change also removes the redraw timer of the old cache, instead relying
2462         on the SVG image to notify clients if the image changes (e.g., during animations).
2463
2464         This patch fixes two existing bugs (WK99481 and WK104189) that were due to caching bitmaps
2465         at a fixed size. A test has been added for each of these bugs.
2466
2467         Tests: svg/as-image/svg-image-scaled.html
2468                svg/as-image/svg-image-viewbox.html
2469
2470         * CMakeLists.txt:
2471         * GNUmakefile.list.am:
2472         * Target.pri:
2473         * WebCore.gypi:
2474         * WebCore.vcproj/WebCore.vcproj:
2475         * WebCore.xcodeproj/project.pbxproj:
2476         * loader/cache/CachedImage.cpp:
2477         (WebCore::CachedImage::lookupOrCreateImageForRenderer):
2478         (WebCore::CachedImage::setContainerSizeForRenderer):
2479         (WebCore::CachedImage::clear):
2480         (WebCore::CachedImage::changedInRect):
2481
2482             SVG images are no longer special-cased here. When the SVG image changes, users are
2483             notified through this function, and users can then request their content to be redrawn.
2484
2485         * svg/graphics/SVGImage.cpp:
2486         (WebCore::SVGImage::setContainerSize):
2487         (WebCore::SVGImage::drawForContainer):
2488
2489             drawForContainer lays out the SVG content for a specific container size and renders it.
2490             The logic is fairly straightforward but a note about the scales and zooms here:
2491                 the destination rect parameter is zoomed but not scaled
2492                 the source rect parameter is zoomed but not scaled
2493                 the context is scaled but not zoomed
2494             SVGImage::draw(...) only accepts a source and destination rect but does not consider
2495             scale or zoom. Therefore, drawForContainer removes the zoom component from the source
2496             so SVGImage::draw(...) will draw from the pre-zoom source to the post-zoom destination.
2497
2498         (WebCore::SVGImage::drawPatternForContainer):
2499
2500             For performance, drawPatternForContainer renders the SVG content onto a bitmap, then
2501             has the bitmap image draw the pattern. This is necessary because drawPattern is used
2502             for tiling.
2503
2504         (WebCore):
2505         (WebCore::SVGImage::startAnimation):
2506         (WebCore::SVGImage::stopAnimation):
2507         (WebCore::SVGImage::resetAnimation):
2508         (WebCore::SVGImage::reportMemoryUsage):
2509         * svg/graphics/SVGImage.h:
2510         (WebCore):
2511         (SVGImage):
2512         * svg/graphics/SVGImageCache.cpp:
2513
2514             Instead of storing a SizeAndScales values for each renderer, a SVGImageForContainer
2515             is stored which is just a thin wrapper around an SVG image that contains container
2516             sizing information. By combining the image and size information, the two maps of
2517             SVGImageCache have been merged into one.
2518
2519             To make this patch easier to review, SVGImageCache still exists and works similar to
2520             how it did before the patch. Now, SVGImageCache simply stores the SVGImageForContainers.
2521             In a followup patch it will be removed.
2522
2523             Note: the redraw timer of SVGImageCache has been removed because animation
2524             invalidation is now properly propagated back to the image clients.
2525
2526         (WebCore):
2527         (WebCore::SVGImageCache::SVGImageCache):
2528         (WebCore::SVGImageCache::~SVGImageCache):
2529         (WebCore::SVGImageCache::removeClientFromCache):
2530         (WebCore::SVGImageCache::setContainerSizeForRenderer):
2531         (WebCore::SVGImageCache::imageSizeForRenderer):
2532
2533             Previously, this function returned the scaled image size which was incorrect. The image
2534             size is used by clients such as GraphicsContext2D to determine the source size
2535             for drawing the image. draw() accepts zoomed but not scaled values, so this has been
2536             changed.
2537
2538         (WebCore::SVGImageCache::imageForRenderer):
2539
2540             A FIXME has been added here to not set the scale on every lookup. This can be improved
2541             by setting the page scale factor in setContainerSizeForRenderer() in a future patch.
2542
2543         * svg/graphics/SVGImageCache.h:
2544         (WebCore):
2545         (SVGImageCache):
2546         * svg/graphics/SVGImageForContainer.cpp: Added.
2547         (WebCore):
2548
2549             SVGImageForContainer is a thin wrapper around an SVG image. The lifetime of the
2550             SVGImage will be longer than the image cache.
2551
2552         (WebCore::SVGImageForContainer::size):
2553
2554             This is the only logic in SVGImageForContainer. The size returned needs to be zoomed
2555             but not scaled because it is used (e.g., by RenderImage) to pass back into draw() which
2556             takes zoomed but not scaled values.
2557
2558         (WebCore::SVGImageForContainer::draw):
2559         (WebCore::SVGImageForContainer::drawPattern):
2560         * svg/graphics/SVGImageForContainer.h: Added.
2561         (WebCore):
2562         (SVGImageForContainer):
2563
2564             In a future patch SVGImageForContainer can be made immutable but without a refactoring
2565             for not setting the page scale factor in SVGImageCache::lookupOrCreateImageForRenderer,
2566             setters are needed.
2567
2568         (WebCore::SVGImageForContainer::create):
2569         (WebCore::SVGImageForContainer::containerSize):
2570         (WebCore::SVGImageForContainer::pageScale):
2571         (WebCore::SVGImageForContainer::zoom):
2572         (WebCore::SVGImageForContainer::setSize):
2573         (WebCore::SVGImageForContainer::setZoom):
2574         (WebCore::SVGImageForContainer::setPageScale):
2575         (WebCore::SVGImageForContainer::SVGImageForContainer):
2576         (WebCore::SVGImageForContainer::destroyDecodedData):
2577         (WebCore::SVGImageForContainer::decodedSize):
2578
2579 2013-02-12  Antti Koivisto  <antti@apple.com>
2580
2581         Avoid updating timer heap when nothing changes
2582         https://bugs.webkit.org/show_bug.cgi?id=109630
2583
2584         Reviewed by Andreas Kling.
2585
2586         When the fire time of a Timer is changed we remove it from the timer heap and reinsert it. This is pretty slow. 
2587         Turns out that in ~80% of cases we are already in the heap and the insertion position is the same as the 
2588         original position. We can check if anything is actually going to change before doing this work.
2589         
2590         This makes starting a timer ~30% faster in average, ~0.1% progression in PLT3.
2591         
2592         * platform/Timer.cpp:
2593         (TimerHeapLessThanFunction):
2594         (WebCore::TimerHeapLessThanFunction::operator()):
2595         (WebCore::parentHeapPropertyHolds):
2596         (WebCore):
2597         (WebCore::childHeapPropertyHolds):
2598         (WebCore::TimerBase::hasValidHeapPosition):
2599         
2600             The code here assumes that STL heap is a normal binary heap. If there is a different implementation
2601             somewhere the assertions will catch it.
2602
2603         (WebCore::TimerBase::updateHeapIfNeeded):
2604         
2605             Skip updating the heap if it is already valid.
2606
2607         (WebCore::TimerBase::setNextFireTime):
2608         * platform/Timer.h:
2609         (TimerBase):
2610
2611 2013-02-13  Martin Robinson  <mrobinson@igalia.com>
2612
2613         [GTK] Remove remaining dead code from the GLib unicode backend
2614         https://bugs.webkit.org/show_bug.cgi?id=109707
2615
2616         Reviewed by Philippe Normand.
2617
2618         * platform/KURL.cpp:
2619         (WebCore::appendEncodedHostname):
2620         * platform/text/TextEncoding.cpp:
2621         (WebCore::TextEncoding::encode):
2622         * platform/text/TextEncodingRegistry.cpp:
2623         (WebCore::buildBaseTextCodecMaps):
2624         (WebCore::extendTextCodecMaps):
2625
2626 2013-02-13  Xianzhu Wang  <wangxianzhu@chromium.org>
2627
2628         Heap-use-after-free in WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects
2629         https://bugs.webkit.org/show_bug.cgi?id=108695
2630
2631         See comments of RenderLayerModelObject::willBeDestroyed() below for details.
2632
2633         Reviewed by Abhishek Arya.
2634
2635         Test: ManulTests/scrolling-coordinator-viewport-constrained-crash.html
2636         Unable to write a normal layout test because
2637         1) must waitUntilDone() to reproduce the crash but the redirected URL can't notifyDone();
2638         2) Can't use a frame to contain the test because ScrollingCoordinator handles only the main frame.
2639
2640         * rendering/RenderBoxModelObject.cpp:
2641         (WebCore::RenderBoxModelObject::willBeDestroyed): Moved removeViewportConstrainedObject() call into RenderLayerModelObject::willBeDestroyed() because only RenderLayerModelObjects can be added as viewportConstrainedObjects.
2642         * rendering/RenderLayerModelObject.cpp:
2643         (WebCore::RenderLayerModelObject::willBeDestroyed): Changed this->view() (then view->frameView()) to this->frame() (then frame->view()) because when willBeDestroyed() is called, the document has set its renderView to 0 thus this->view() will return 0, causing removeViewportConstrainedObject() not called and a deleted RenderLayerModelObject in FrameView's viewportConstrainedObjects.
2644
2645 2013-02-13  Florin Malita  <fmalita@chromium.org>
2646
2647         [SVG] OOB access in SVGListProperty::replaceItemValues()
2648         https://bugs.webkit.org/show_bug.cgi?id=109293
2649
2650         Replacing a list property item with itself should be a no-op. This patch updates the related
2651         APIs and logic to detect the self-replace case and prevent removal of the item from the list.
2652
2653         To avoid scanning the list multiple times, removeItemFromList() is updated to operate on
2654         indices and a findItem() method is added to resolve an item to an index.
2655
2656         Reviewed by Dirk Schulze.
2657
2658         No new tests: updated existing tests cover the change.
2659
2660         * svg/properties/SVGAnimatedListPropertyTearOff.h:
2661         (WebCore::SVGAnimatedListPropertyTearOff::findItem):
2662         (SVGAnimatedListPropertyTearOff):
2663         (WebCore::SVGAnimatedListPropertyTearOff::removeItemFromList):
2664         * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
2665         (WebCore::SVGAnimatedPathSegListPropertyTearOff::findItem):
2666         (SVGAnimatedPathSegListPropertyTearOff):
2667         (WebCore::SVGAnimatedPathSegListPropertyTearOff::removeItemFromList):
2668         Add a findItem() delegating method, and update removeItemFromList() to use the new
2669         index-based API.
2670
2671         * svg/properties/SVGListProperty.h:
2672         (WebCore::SVGListProperty::insertItemBeforeValues):
2673         (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
2674         (WebCore::SVGListProperty::replaceItemValues):
2675         (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
2676         (SVGListProperty):
2677         Updated to handle the no-op case for insertItemBefore() & replaceItem().
2678
2679         * svg/properties/SVGListPropertyTearOff.h:
2680         (WebCore::SVGListPropertyTearOff::findItem):
2681         (WebCore::SVGListPropertyTearOff::removeItemFromList):
2682         Index-based API updates.
2683
2684         (WebCore::SVGListPropertyTearOff::processIncomingListItemValue):
2685         (WebCore::SVGListPropertyTearOff::processIncomingListItemWrapper):
2686         * svg/properties/SVGPathSegListPropertyTearOff.cpp:
2687         (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemValue):
2688         Detect the self-replace case and return without removing the item from the list.
2689
2690         * svg/properties/SVGPathSegListPropertyTearOff.h:
2691         (WebCore::SVGPathSegListPropertyTearOff::findItem):
2692         (WebCore::SVGPathSegListPropertyTearOff::removeItemFromList):
2693         (SVGPathSegListPropertyTearOff):
2694         (WebCore::SVGPathSegListPropertyTearOff::processIncomingListItemWrapper):
2695         * svg/properties/SVGStaticListPropertyTearOff.h:
2696         (WebCore::SVGStaticListPropertyTearOff::processIncomingListItemValue):
2697         (WebCore::SVGStaticListPropertyTearOff::processIncomingListItemWrapper):
2698         Index-based API updates.
2699
2700 2013-02-13  Takashi Sakamoto  <tasak@google.com>
2701
2702         [Refactoring] StyleResolver::State should have methods to access its member variables.
2703         https://bugs.webkit.org/show_bug.cgi?id=108563
2704
2705         Reviewed by Antti Koivisto.
2706
2707         Made all member variables private and added methods to access the
2708         variables, because most of the member variables are read-only.
2709         We don't need to update those read-only variables while resolving
2710         styles.
2711
2712         No new tests, because just refactoring.
2713
2714         * css/SVGCSSStyleSelector.cpp:
2715         (WebCore::StyleResolver::applySVGProperty):
2716         * css/StyleResolver.cpp:
2717         (WebCore):
2718         (WebCore::StyleResolver::collectMatchingRules):
2719         (WebCore::StyleResolver::collectMatchingRulesForRegion):
2720         (WebCore::StyleResolver::sortAndTransferMatchedRules):
2721         (WebCore::StyleResolver::matchScopedAuthorRules):
2722         (WebCore::StyleResolver::styleSharingCandidateMatchesHostRules):
2723         (WebCore::StyleResolver::matchHostRules):
2724         (WebCore::StyleResolver::matchAuthorRules):
2725         (WebCore::StyleResolver::matchUserRules):
2726         (WebCore::StyleResolver::matchUARules):
2727         (WebCore::StyleResolver::collectMatchingRulesForList):
2728         (WebCore::StyleResolver::sortMatchedRules):
2729         (WebCore::StyleResolver::matchAllRules):
2730         (WebCore::StyleResolver::State::initElement):
2731         (WebCore::StyleResolver::initElement):
2732         Modified to invoke m_state.initElement if a given element is
2733         different from current m_state's element.
2734         (WebCore::StyleResolver::State::initForStyleResolve):
2735         Moved from StyleResolver.
2736         (WebCore::StyleResolver::styleSharingCandidateMatchesRuleSet):
2737         (WebCore::StyleResolver::canShareStyleWithControl):
2738         (WebCore::StyleResolver::sharingCandidateHasIdenticalStyleAffectingAttributes):
2739         (WebCore::StyleResolver::canShareStyleWithElement):
2740         (WebCore::StyleResolver::locateSharedStyle):
2741         (WebCore::StyleResolver::styleForElement):
2742         (WebCore::StyleResolver::styleForKeyframe):
2743         (WebCore::StyleResolver::keyframeStylesForAnimation):
2744         (WebCore::StyleResolver::pseudoStyleForElement):
2745         Changed ASSERT in the first line. ASSERT(m_state.parentStyle) would be
2746         wrong, because it depends on previous resolving. However,
2747         initForStyleResolve will also update m_state.parentStyle. No code in
2748         pseudoStyleForElement depends on previous resolving state.
2749         (WebCore::StyleResolver::styleForPage):
2750         (WebCore::StyleResolver::defaultStyleForElement):
2751         (WebCore::StyleResolver::adjustRenderStyle):
2752         (WebCore::StyleResolver::updateFont):
2753         (WebCore::StyleResolver::pseudoStyleRulesForElement):
2754         (WebCore::StyleResolver::ruleMatches):
2755         Added one more parameter, dynamicPseudo, because dynamicPseudo in
2756         State class is just used for returning matched pseudo style from
2757         this ruleMatches to collectMatchingRulesForList. No need to keep
2758         dynamicPseudo while resolving styles.
2759         (WebCore::StyleResolver::checkRegionSelector):
2760         Removed m_pseudoStyle = NOPSEUDO, because this method uses just
2761         SelectorChecker::matched. SelectorChecker doesn't see StyleResolver's
2762         m_pseudoStyle directly. Need to use SelectorCheckerContext. So no
2763         need to set m_pseudoStyle to be NOPSEUDO.
2764         (WebCore::StyleResolver::applyProperties):
2765         (WebCore::StyleResolver::applyMatchedProperties):
2766         (WebCore::StyleResolver::isLeftPage):
2767         (WebCore::StyleResolver::applyPropertyToStyle):
2768         (WebCore::StyleResolver::useSVGZoomRules):
2769         (WebCore::createGridTrackBreadth):
2770         (WebCore::StyleResolver::resolveVariables):
2771         (WebCore::StyleResolver::applyProperty):
2772         (WebCore::StyleResolver::cachedOrPendingFromValue):
2773         (WebCore::StyleResolver::generatedOrPendingFromValue):
2774         (WebCore::StyleResolver::setOrPendingFromValue):
2775         (WebCore::StyleResolver::cursorOrPendingFromValue):
2776         (WebCore::StyleResolver::checkForTextSizeAdjust):
2777         (WebCore::StyleResolver::initializeFontStyle):
2778         (WebCore::StyleResolver::setFontSize):
2779         (WebCore::StyleResolver::colorFromPrimitiveValue):
2780         (WebCore::StyleResolver::loadPendingSVGDocuments):
2781         (WebCore::StyleResolver::cachedOrPendingStyleShaderFromValue):
2782         (WebCore::StyleResolver::loadPendingShaders):
2783         (WebCore::StyleResolver::parseCustomFilterTransformParameter):
2784         (WebCore::StyleResolver::createFilterOperations):
2785         (WebCore::StyleResolver::loadPendingImage):
2786         (WebCore::StyleResolver::loadPendingImages):
2787         * css/StyleResolver.h:
2788         (WebCore::StyleResolver::style):
2789         (WebCore::StyleResolver::parentStyle):
2790         (WebCore::StyleResolver::rootElementStyle):
2791         (WebCore::StyleResolver::element):
2792         (WebCore::StyleResolver::hasParentNode):
2793         (StyleResolver):
2794         (WebCore::StyleResolver::State::State):
2795         (State):
2796         (WebCore::StyleResolver::State::clear):
2797         Modified to use clear at the end of styleForElement.
2798         (WebCore::StyleResolver::State::document):
2799         (WebCore::StyleResolver::State::element):
2800         (WebCore::StyleResolver::State::styledElement):
2801         (WebCore::StyleResolver::State::setStyle):
2802         (WebCore::StyleResolver::State::style):
2803         (WebCore::StyleResolver::State::takeStyle):
2804         (WebCore::StyleResolver::State::ensureRuleList):
2805         (WebCore::StyleResolver::State::takeRuleList):
2806         (WebCore::StyleResolver::State::parentNode):
2807         (WebCore::StyleResolver::State::setParentStyle):
2808         (WebCore::StyleResolver::State::parentStyle):
2809         (WebCore::StyleResolver::State::rootElementStyle):
2810         (WebCore::StyleResolver::State::regionForStyling):
2811         (WebCore::StyleResolver::State::setSameOriginOnly):
2812         (WebCore::StyleResolver::State::isSameOriginOnly):
2813         (WebCore::StyleResolver::State::pseudoStyle):
2814         (WebCore::StyleResolver::State::elementLinkState):
2815         (WebCore::StyleResolver::State::distributedToInsertionPoint):
2816         (WebCore::StyleResolver::State::setElementAffectedByClassRules):
2817         (WebCore::StyleResolver::State::elementAffectedByClassRules):
2818         (WebCore::StyleResolver::State::setApplyPropertyToRegularStyle):
2819         (WebCore::StyleResolver::State::setApplyPropertyToVisitedLinkStyle):
2820         (WebCore::StyleResolver::State::applyPropertyToRegularStyle):
2821         (WebCore::StyleResolver::State::applyPropertyToVisitedLinkStyle):
2822         (WebCore::StyleResolver::State::pendingImageProperties):
2823         (WebCore::StyleResolver::State::pendingSVGDocuments):
2824         (WebCore::StyleResolver::State::setHasPendingShaders):
2825         (WebCore::StyleResolver::State::hasPendingShaders):
2826         (WebCore::StyleResolver::State::setLineHeightValue):
2827         (WebCore::StyleResolver::State::lineHeightValue):
2828         (WebCore::StyleResolver::State::setFontDirty):
2829         (WebCore::StyleResolver::State::fontDirty):
2830         (WebCore::StyleResolver::State::cacheBorderAndBackground):
2831         (WebCore::StyleResolver::State::hasUAAppearance):
2832         (WebCore::StyleResolver::State::borderData):
2833         (WebCore::StyleResolver::State::backgroundData):
2834         (WebCore::StyleResolver::State::backgroundColor):
2835         (WebCore::StyleResolver::State::fontDescription):
2836         (WebCore::StyleResolver::State::parentFontDescription):
2837         (WebCore::StyleResolver::State::setFontDescription):
2838         (WebCore::StyleResolver::State::setZoom):
2839         (WebCore::StyleResolver::State::setEffectiveZoom):
2840         (WebCore::StyleResolver::State::setTextSizeAdjust):
2841         (WebCore::StyleResolver::State::setWritingMode):
2842         (WebCore::StyleResolver::State::setTextOrientation):
2843         fontDescription, ... and setTextOrientation were moved from
2844         StyleResolver.
2845         (WebCore::StyleResolver::State::matchedRules):
2846         (WebCore::StyleResolver::State::addMatchedRule):
2847         Moved from StyleResolver.
2848         (WebCore::StyleResolver::applyPropertyToRegularStyle):
2849         (WebCore::StyleResolver::applyPropertyToVisitedLinkStyle):
2850         (WebCore::StyleResolver::fontDescription):
2851         (WebCore::StyleResolver::parentFontDescription):
2852         (WebCore::StyleResolver::setFontDescription):
2853         (WebCore::StyleResolver::setZoom):
2854         (WebCore::StyleResolver::setEffectiveZoom):
2855         (WebCore::StyleResolver::setTextSizeAdjust):
2856         (WebCore::StyleResolver::setWritingMode):
2857         (WebCore::StyleResolver::setTextOrientation):
2858         These fontDescription, ..., setTextOrientation are wrappers to
2859         invoke State's methods. StyleBuilder still depends on StyleResolver
2860         and invokes these methods. So we need these wrappers.
2861
2862 2013-02-13  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2863
2864         [Qt] window.open passes height and width parameters even if not defined in a page
2865         https://bugs.webkit.org/show_bug.cgi?id=107705
2866
2867         Reviewed by Kenneth Rohde Christiansen.
2868
2869         Do not override width or height of 0, as that indicates default size, and not minimum size.
2870
2871         Tested by tst_qwebpage.
2872
2873         * page/DOMWindow.cpp:
2874         (WebCore::DOMWindow::adjustWindowRect):
2875
2876 2013-02-13  Rashmi Shyamasundar  <rashmi.s2@samsung.com>
2877
2878         The 2D Canvas functions fillText()/strokeText() should display nothing when maxWidth is less then or equal to zero
2879         https://bugs.webkit.org/show_bug.cgi?id=102656
2880
2881         Reviewed by Dirk Schulze.
2882
2883         The functions fillText()/strokeText() should not display anything when 
2884         maxWidth is less than or equal to zero, according to spec :
2885         http://www.w3.org/TR/2dcontext/#text-preparation-algorithm
2886
2887         Test: fast/canvas/canvas-fillText-maxWidth-zero.html
2888
2889         * html/canvas/CanvasRenderingContext2D.cpp:
2890         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2891
2892 2013-02-13  ChangSeok Oh  <shivamidow@gmail.com>
2893
2894         [GTK][AC] Implement basic transform animations with clutter ac backend
2895         https://bugs.webkit.org/show_bug.cgi?id=109363
2896
2897         Reviewed by Gustavo Noronha Silva.
2898
2899         Implement basic transform animation with clutter ac backend.
2900         GraphicsLayerClutter is almost same with GraphicsLayerCA. And PlatformClutterAnimation
2901         interfaces are also similar with PlatformCAAnimation, but they are implemented
2902         with native clutter APIs. Clutter backend AC supports a basic single transform animation
2903         with this patch now, but additive animation combination and keyframe animation
2904         are not supported yet.
2905
2906         Covered by existing animation tests.
2907
2908         * platform/graphics/clutter/GraphicsLayerActor.cpp:
2909         (graphicsLayerActorSetTransform):
2910         * platform/graphics/clutter/GraphicsLayerClutter.cpp:
2911         (WebCore::isTransformTypeTransformationMatrix):
2912         (WebCore):
2913         (WebCore::isTransformTypeFloatPoint3D):
2914         (WebCore::isTransformTypeNumber):
2915         (WebCore::getTransformFunctionValue):
2916         (WebCore::getValueFunctionNameForTransformOperation):
2917         (WebCore::GraphicsLayerClutter::setTransformAnimationEndpoints):
2918         (WebCore::GraphicsLayerClutter::appendToUncommittedAnimations):
2919         (WebCore::GraphicsLayerClutter::createTransformAnimationsFromKeyframes):
2920         * platform/graphics/clutter/GraphicsLayerClutter.h:
2921         (GraphicsLayerClutter):
2922         * platform/graphics/clutter/PlatformClutterAnimation.cpp:
2923         (WebCore::toClutterActorPropertyString):
2924         (WebCore):
2925         (WebCore::PlatformClutterAnimation::supportsValueFunction):
2926         (WebCore::PlatformClutterAnimation::duration):
2927         (WebCore::PlatformClutterAnimation::setDuration):
2928         (WebCore::PlatformClutterAnimation::setAdditive):
2929         (WebCore::PlatformClutterAnimation::valueFunction):
2930         (WebCore::PlatformClutterAnimation::setValueFunction):
2931         (WebCore::PlatformClutterAnimation::setFromValue):
2932         (WebCore::PlatformClutterAnimation::setToValue):
2933         (WebCore::PlatformClutterAnimation::timeline):
2934         (WebCore::PlatformClutterAnimation::addClutterTransitionForProperty):
2935         (WebCore::PlatformClutterAnimation::addOpacityTransition):
2936         (WebCore::PlatformClutterAnimation::addTransformTransition):
2937         (WebCore::PlatformClutterAnimation::addAnimationForKey):
2938         * platform/graphics/clutter/PlatformClutterAnimation.h:
2939         (PlatformClutterAnimation):
2940
2941 2013-02-13  Ilya Tikhonovsky  <loislo@chromium.org>
2942
2943         Web Inspector: Native Memory Instrumentation: reportLeaf method doesn't report the leaf node properly.
2944         https://bugs.webkit.org/show_bug.cgi?id=109554
2945
2946         In some cases leaves have no pointer so with the old schema we can't generate nodeId for them because we
2947         can't insert 0 into hashmap. It happens when we call addPrivateBuffer method.
2948
2949         Drive by fix: I introduced a client interface for the HeapGraphSerializer.
2950         It helps me to do the tests for the serializer.
2951
2952         Reviewed by Yury Semikhatsky.
2953
2954         It is covered by newly added tests in TestWebKitAPI.
2955
2956         * inspector/HeapGraphSerializer.cpp:
2957         (WebCore::HeapGraphSerializer::HeapGraphSerializer):
2958         (WebCore::HeapGraphSerializer::pushUpdate):
2959         (WebCore::HeapGraphSerializer::reportNode):
2960         (WebCore::HeapGraphSerializer::toNodeId):
2961         (WebCore::HeapGraphSerializer::addRootNode):
2962         * inspector/HeapGraphSerializer.h:
2963         (HeapGraphSerializer):
2964         (Client):
2965         (WebCore::HeapGraphSerializer::Client::~Client):
2966         * inspector/InspectorMemoryAgent.cpp:
2967         (WebCore):
2968         (WebCore::InspectorMemoryAgent::getProcessMemoryDistributionImpl):
2969
2970 2013-02-13  Yury Semikhatsky  <yurys@chromium.org>
2971
2972         Web Inspector: add experimental native heap graph to Timeline panel
2973         https://bugs.webkit.org/show_bug.cgi?id=109687
2974
2975         Reviewed by Alexander Pavlov.
2976
2977         Added experimentatl support for native heap graph on the Timeline panel.
2978         Native memory usage data is collected after each top level task and can
2979         be displayed instead of DOM counters graph on the Timeline panel if
2980         corresponding experiment is enabled in the inspector settings.
2981
2982         * inspector/Inspector.json:
2983         * inspector/InspectorController.cpp:
2984         (WebCore::InspectorController::InspectorController):
2985         * inspector/InspectorTimelineAgent.cpp:
2986         (TimelineAgentState):
2987         (WebCore::InspectorTimelineAgent::setIncludeDomCounters):
2988         (WebCore):
2989         (WebCore::InspectorTimelineAgent::setIncludeNativeMemoryStatistics):
2990         (WebCore::InspectorTimelineAgent::innerAddRecordToTimeline):
2991         (WebCore::InspectorTimelineAgent::setDOMCounters):
2992         (WebCore::InspectorTimelineAgent::setNativeHeapStatistics):
2993         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
2994         * inspector/InspectorTimelineAgent.h:
2995         (WebCore):
2996         (WebCore::InspectorTimelineAgent::create):
2997         (InspectorTimelineAgent):
2998         * inspector/WorkerInspectorController.cpp:
2999         (WebCore::WorkerInspectorController::WorkerInspectorController):
3000         * inspector/front-end/MemoryStatistics.js:
3001         (WebInspector.MemoryStatistics):
3002         * inspector/front-end/NativeMemoryGraph.js:
3003         (WebInspector.NativeMemoryGraph):
3004         (WebInspector.NativeMemoryGraph.prototype._onRecordAdded.addStatistics):
3005         (WebInspector.NativeMemoryGraph.prototype._onRecordAdded):
3006         * inspector/front-end/Settings.js:
3007         (WebInspector.ExperimentsSettings):
3008         * inspector/front-end/TimelinePanel.js:
3009
3010 2013-02-13  Vladislav Kaznacheev  <kaznacheev@chromium.org>
3011
3012         Web Inspector: Fixed colorpicker editing and scrolling.
3013         https://bugs.webkit.org/show_bug.cgi?id=109434.
3014
3015         Reviewed by Alexander Pavlov.
3016
3017         The color picker scrolling logic relied on the fixed DOM structure which changed with the introduction of
3018         SidebarPaneStack (https://bugs.webkit.org/show_bug.cgi?id=108183).
3019         Added a special CSS class to mark the scroll target.
3020
3021         No new tests.
3022
3023         * inspector/front-end/SplitView.js:
3024         (WebInspector.SplitView):
3025         * inspector/front-end/StylesSidebarPane.js:
3026         (WebInspector.StylePropertyTreeElement.prototype.updateTitle.):
3027         * inspector/front-end/TabbedPane.js:
3028         (WebInspector.TabbedPane):
3029  
3030 2013-02-13  Andrey Lushnikov  <lushnikov@chromium.org>
3031
3032         Web Inspector: fix js compilation warnings in TextPrompt
3033         https://bugs.webkit.org/show_bug.cgi?id=109685
3034
3035         Reviewed by Alexander Pavlov.
3036
3037         Mark last argument of _applySuggestion function as optional.
3038
3039         No new tests: no change in behaviour.
3040
3041         * inspector/front-end/TextPrompt.js:
3042
3043 2013-02-13  Pablo Flouret  <pablof@motorola.com>
3044
3045         Implement css-conditional's CSS.supports()
3046         https://bugs.webkit.org/show_bug.cgi?id=100324
3047
3048         Reviewed by Antti Koivisto.
3049
3050         http://dev.w3.org/csswg/css3-conditional/#the-css-interface
3051
3052         The supports() method provides the css @supports rule's corresponding
3053         dom api.
3054         The patch also adds the CSS interface on DOMWindow, which holds "useful
3055         CSS-related functions that do not belong elsewhere". This is where
3056         supports() lives.
3057
3058         Test: css3/supports-dom-api.html
3059
3060         * CMakeLists.txt:
3061         * DerivedSources.cpp:
3062         * DerivedSources.make:
3063         * DerivedSources.pri:
3064         * GNUmakefile.list.am:
3065         * Target.pri:
3066         * WebCore.exp.in:
3067         * WebCore.gypi:
3068         * WebCore.vcproj/WebCore.vcproj:
3069         * WebCore.xcodeproj/project.pbxproj:
3070         * bindings/gobject/GNUmakefile.am:
3071         * bindings/scripts/CodeGeneratorGObject.pm:
3072         (SkipFunction):
3073             Add DOMWindowCSS.* to the build systems.
3074
3075         * bindings/scripts/CodeGenerator.pm:
3076         (WK_lcfirst):
3077             Handle CSS prefixes correctly (s/cSS/css/).
3078
3079         * css/CSSGrammar.y.in:
3080         * css/CSSParser.cpp:
3081         (WebCore::CSSParser::CSSParser):
3082         (WebCore::CSSParser::parseSupportsCondition):
3083         (WebCore::CSSParser::detectAtToken):
3084         * css/CSSParser.h:
3085             webkit_supports_condition parses just the condition part of an
3086             @supports rule and evaluates it, outputting whether the condition
3087             is supported or not.
3088
3089         * css/CSSAllInOne.cpp:
3090         * css/DOMWindowCSS.cpp: Added.
3091         * css/DOMWindowCSS.h: Added.
3092         * css/DOMWindowCSS.idl: Added.
3093             The CSS interface object.
3094
3095         * page/DOMWindow.cpp:
3096         (WebCore::DOMWindow::css):
3097         * page/DOMWindow.h:
3098         * page/DOMWindow.idl:
3099             window.CSS
3100
3101 2013-02-13  Vladislav Kaznacheev  <kaznacheev@chromium.org>
3102
3103         Web Inspector: Simplify SplitView to rely more on CSS
3104         https://bugs.webkit.org/show_bug.cgi?id=109426
3105
3106         Reviewed by Vsevolod Vlasov.
3107
3108         Simplified Javascript code by moving large part of the layout logic into CSS rules. The patch is larger than it
3109         should be because one of the clients (TimelinePanel) is breaking SplitView incapsulation by reparenting its
3110         resizer.
3111
3112         No new tests.
3113
3114         * inspector/front-end/SidebarView.js:
3115         (WebInspector.SidebarView):
3116         * inspector/front-end/SplitView.js:
3117         (WebInspector.SplitView):
3118         (WebInspector.SplitView.prototype._innerSetVertical):
3119         (WebInspector.SplitView.prototype.setSecondIsSidebar):
3120         (WebInspector.SplitView.prototype._showOnly):
3121         (WebInspector.SplitView.prototype._removeAllLayoutProperties):
3122         * inspector/front-end/TimelinePanel.js:
3123         * inspector/front-end/cssNamedFlows.css:
3124         (.css-named-flow-collections-view .split-view-sidebar):
3125         (.css-named-flow-collections-view .split-view-sidebar .sidebar-content):
3126         (.css-named-flow-collections-view .split-view-sidebar .selection):
3127         (.css-named-flow-collections-view .split-view-sidebar .named-flow-overflow::before, .css-named-flow-collections-view .region-empty:before, .css-named-flow-collections-view .region-fit::before, .css-named-flow-collections-view .region-overset::before):
3128         (.css-named-flow-collections-view .split-view-sidebar .named-flow-overflow::before):
3129         * inspector/front-end/splitView.css:
3130         (.split-view-contents.maximized):
3131         (.split-view-vertical .split-view-contents):
3132         (.split-view-vertical .split-view-contents-first):
3133         (.split-view-vertical .split-view-contents-first.maximized):
3134         (.split-view-vertical .split-view-contents-second):
3135         (.split-view-vertical .split-view-contents-second.maximized):
3136         (.split-view-horizontal .split-view-contents):
3137         (.split-view-horizontal .split-view-contents-first):
3138         (.split-view-horizontal .split-view-contents-first.maximized):
3139         (.split-view-horizontal .split-view-contents-second):
3140         (.split-view-horizontal .split-view-contents-second.maximized):
3141         (.split-view-vertical .split-view-sidebar.split-view-contents-first:not(.maximized)):
3142         (.split-view-vertical .split-view-sidebar.split-view-contents-second:not(.maximized)):
3143         (.split-view-horizontal .split-view-sidebar.split-view-contents-first:not(.maximized)):
3144         (.split-view-horizontal .split-view-sidebar.split-view-contents-second:not(.maximized)):
3145         (.split-view-vertical .split-view-resizer):
3146         (.split-view-horizontal .split-view-resizer):
3147         * inspector/front-end/timelinePanel.css:
3148         (.timeline.split-view-vertical .split-view-resizer):
3149         (#timeline-container .split-view-sidebar):
3150
3151 2013-02-13  Kentaro Hara  <haraken@chromium.org>
3152
3153         Unreviewed, rolling out r142730.
3154         http://trac.webkit.org/changeset/142730
3155         https://bugs.webkit.org/show_bug.cgi?id=109666
3156
3157         chromium browser tests are failing
3158
3159         * bindings/scripts/CodeGeneratorV8.pm:
3160         (GenerateNormalAttrGetter):
3161         (GenerateNormalAttrSetter):
3162         (GenerateSingleBatchedAttribute):
3163         (GenerateImplementation):
3164         * bindings/scripts/test/V8/V8TestInterface.cpp:
3165         (TestInterfaceV8Internal):
3166         (WebCore):
3167         * bindings/scripts/test/V8/V8TestObj.cpp:
3168         (WebCore):
3169
3170 2013-02-13  Tamas Czene  <tczene@inf.u-szeged.hu>
3171
3172         OpenCL implementation of Flood SVG filters.
3173         https://bugs.webkit.org/show_bug.cgi?id=109580
3174
3175         Reviewed by Zoltan Herczeg.
3176
3177         * Target.pri:
3178         * platform/graphics/filters/FEFlood.h:
3179         (FEFlood):
3180         * platform/graphics/gpu/opencl/FilterContextOpenCL.cpp:
3181         (WebCore):
3182         (WebCore::PROGRAM_STR):
3183         (WebCore::FilterContextOpenCL::compileFill):
3184         (WebCore::FilterContextOpenCL::fill):
3185         * platform/graphics/gpu/opencl/FilterContextOpenCL.h:
3186         (WebCore::FilterContextOpenCL::FilterContextOpenCL):
3187         (FilterContextOpenCL):
3188         * platform/graphics/gpu/opencl/OpenCLFEFlood.cpp: Added.
3189         (WebCore):
3190         (WebCore::FEFlood::platformApplyOpenCL):
3191
3192 2013-02-13  Mike West  <mkwst@chromium.org>
3193
3194         location.href does not throw SECURITY_ERR when accessed across origins with JSC bindings
3195         https://bugs.webkit.org/show_bug.cgi?id=43891
3196
3197         Reviewed by Adam Barth.
3198
3199         Other browsers (IE, Firefox, and Opera) throw an exception when accessing
3200         properties of a Location object across origins, as the spec suggests[1].
3201         WebKit is currently the outlier.
3202
3203         This has a few negative effects: developers are forced to hack around
3204         access violations in two ways rather than having a single code path, and
3205         (more annoyingly) developers are unable to avoid generating the error
3206         message. See every ad on the internet for the effect on the console. :)
3207
3208         This patch adds a SECURITY_ERR exception to these access violations,
3209         which is the first step towards getting rid of the console spam. Getting
3210         rid of the message entirely will require a solution to
3211         http://wkbug.com/98050.
3212
3213         A fairly inconclusive thread[2] on webkit-dev popped up in 2010 and
3214         trailed off without reaching conclusion. A more recent thread reached
3215         agreement that this patch seems like a reasonable thing to do[3].
3216
3217         This is the JSC half of the patch. V8 is coming in http://wkbug.com/43892
3218
3219         [1]: http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#security-location
3220         [2]: https://lists.webkit.org/pipermail/webkit-dev/2010-August/013880.html
3221         [2]: https://lists.webkit.org/pipermail/webkit-dev/2012-February/023636.html
3222
3223         * bindings/js/JSLocationCustom.cpp:
3224         (WebCore::JSLocation::getOwnPropertySlotDelegate):
3225
3226 2013-02-13  Andrew Wilson  <atwilson@chromium.org>
3227
3228         Unreviewed Chromium gyp-file cleanup after glib backend removal.
3229         https://bugs.webkit.org/show_bug.cgi?id=109672
3230
3231         Removed references to GLib unicode backend:
3232
3233         * WebCore.gypi:
3234
3235 2013-02-12  Kentaro Hara  <haraken@chromium.org>
3236
3237         [V8] Generate wrapper methods for custom getters/setters
3238         https://bugs.webkit.org/show_bug.cgi?id=109666
3239
3240         Reviewed by Adam Barth.
3241
3242         Currently V8 directly calls back custom getters/setters written
3243         in custom binding files. This makes it impossible for code generators
3244         to hook custom getters/setters (e.g. Code generators cannot insert a code
3245         for FeatureObservation into custom getters/setters). We should generate
3246         wrapper methods for custom getters/setters.
3247
3248         In the future, I will insert TRACE_EVENT() macros into these wrapper methods
3249         to profile DOM getters/setters/methods.
3250
3251         * bindings/scripts/CodeGeneratorV8.pm:
3252         (GenerateNormalAttrGetter):
3253         (GenerateNormalAttrSetter):
3254         (GenerateSingleBatchedAttribute):
3255         (GenerateImplementation):
3256         * bindings/scripts/test/V8/V8TestInterface.cpp:
3257         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrGetter):
3258         (TestInterfaceV8Internal):
3259         (WebCore::TestInterfaceV8Internal::supplementalStr3AttrSetter):
3260         (WebCore):
3261         * bindings/scripts/test/V8/V8TestObj.cpp:
3262         (WebCore::TestObjV8Internal::customAttrAttrGetter):
3263         (TestObjV8Internal):
3264         (WebCore::TestObjV8Internal::customAttrAttrSetter):
3265         (WebCore):
3266
3267 2013-02-13  Sheriff Bot  <webkit.review.bot@gmail.com>
3268
3269         Unreviewed, rolling out r142611.
3270         http://trac.webkit.org/changeset/142611
3271         https://bugs.webkit.org/show_bug.cgi?id=109668
3272
3273         Suggest box is not shown anymore when user types "window." in
3274         inspector console. (Requested by vsevik on #webkit).
3275
3276         * inspector/front-end/TextPrompt.js:
3277         (WebInspector.TextPrompt.prototype.complete):
3278
3279 2013-02-13  Kentaro Hara  <haraken@chromium.org>
3280
3281         [V8] There is no XXXConstructor that requires a custom getter
3282         https://bugs.webkit.org/show_bug.cgi?id=109667
3283
3284         Reviewed by Adam Barth.
3285
3286         Currently '[Custom] attribute XXXConstructor xxx' generates
3287         XXXAttrGetter(). However, there is no XXXConstructor with [Custom].
3288         In addition, it does make no sense to generate XXXAttrGetter() for such cases.
3289         We can remove the logic from CodeGeneratorV8.pm.
3290
3291         * bindings/scripts/CodeGeneratorV8.pm:
3292         (GenerateSingleBatchedAttribute):
3293
3294 2013-02-12  Hajime Morrita  <morrita@google.com>
3295
3296         [Internals] setShadowDOMEnabled() shouldn't be used except a few tests.
3297         https://bugs.webkit.org/show_bug.cgi?id=109642
3298
3299         Reviewed by Kent Tamura.
3300
3301         InternalSettings.setShadowDOMEnabled() shouldn't be called after
3302         any relevant DOM bindings are touched. However for fuzzers, it
3303         isn't trivial to regulate its behavior.
3304
3305         This change whitelists the URL of running test for prevent
3306         unintended API calls. This doesn't hurt the Internals usability
3307         since the API is called from just a couple of tests and the number
3308         isn't expected to grow.
3309
3310         Test: fast/dom/shadow/shadow-dom-enabled-flag-whitelist.html
3311
3312         * testing/InternalSettings.cpp:
3313         (WebCore::urlIsWhitelisted):
3314         (WebCore):
3315         (WebCore::InternalSettings::setShadowDOMEnabled):
3316
3317 2013-02-12  Vsevolod Vlasov  <vsevik@chromium.org>
3318
3319         Web Inspector: Introduce version controller to migrate settings versions.
3320         https://bugs.webkit.org/show_bug.cgi?id=109553
3321
3322         Reviewed by Yury Semikhatsky.
3323
3324         This patch introduces version controller that could be used to migrate inspector settings.
3325
3326         Test: inspector/version-controller.html
3327
3328         * inspector/front-end/Settings.js:
3329         (WebInspector.Settings):
3330         (WebInspector.VersionController):
3331         (WebInspector.VersionController.prototype.set _methodsToRunToUpdateVersion):
3332         (WebInspector.VersionController.prototype._updateVersionFrom0To1):
3333         * inspector/front-end/inspector.js:
3334
3335 2013-02-12  Martin Robinson  <mrobinson@igalia.com>
3336
3337         [GTK] Remove the GLib unicode backend
3338         https://bugs.webkit.org/show_bug.cgi?id=109627
3339
3340         Reviewed by Benjamin Poulain.
3341
3342         Remove references to the GLib unicode backend from WebCore.
3343
3344         * GNUmakefile.list.am: Update the source list.
3345         * platform/text/gtk/TextBreakIteratorGtk.cpp: Removed.
3346         * platform/text/gtk/TextCodecGtk.cpp: Removed.
3347         * platform/text/gtk/TextCodecGtk.h: Removed.
3348
3349 2013-02-12  Chris Fleizach  <cfleizach@apple.com>
3350
3351          AX: crash when accessing AccessibilityScrollbar after page has been unloaded
3352          https://bugs.webkit.org/show_bug.cgi?id=109524
3353
3354          Reviewed by Ryosuke Niwa.
3355
3356          AX clients can hold onto AccesibilityScrollbar references that reference parent
3357          AccessibilityScrollViews that have already gone away.
3358
3359          AccessibilityScrollView is not calling detachFromParent after it is removed, which
3360          leads to a crash. The fix is to clearChildren() when an object is deallocated.
3361
3362          I could not create a test because the crash only manifests over multiple page loads.
3363
3364          * accessibility/AccessibilityObject.cpp:
3365          (WebCore::AccessibilityObject::detach):
3366
3367 2013-02-12  Hayato Ito  <hayato@chromium.org>
3368
3369         Use FocusEvent.relatedTarget in {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator.
3370         https://bugs.webkit.org/show_bug.cgi?id=109650
3371
3372         Reviewed by Dimitri Glazkov.
3373
3374         Set FocusEvent.relatedTarget in its constructor so that each
3375         EventDispatchMediator can use FocusEvent.relatedTarget rather than
3376         its redundant m_{old,new}FocusedNode member variable.
3377
3378         I've also removed FIXME comments, mentioning bug 109261, since I
3379         can not reproduce the issue.
3380
3381         No new tests. No change in functionality.
3382
3383         * dom/FocusEvent.cpp:
3384         (WebCore::FocusEventDispatchMediator::create):
3385         (WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator):
3386         (WebCore::FocusEventDispatchMediator::dispatchEvent):
3387         (WebCore::BlurEventDispatchMediator::create):
3388         (WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator):
3389         (WebCore::BlurEventDispatchMediator::dispatchEvent):
3390         (WebCore::FocusInEventDispatchMediator::create):
3391         (WebCore::FocusInEventDispatchMediator::FocusInEventDispatchMediator):
3392         (WebCore::FocusInEventDispatchMediator::dispatchEvent):
3393         (WebCore::FocusOutEventDispatchMediator::create):
3394         (WebCore::FocusOutEventDispatchMediator::FocusOutEventDispatchMediator):
3395         (WebCore::FocusOutEventDispatchMediator::dispatchEvent):
3396         * dom/FocusEvent.h:
3397         (FocusEventDispatchMediator):
3398         (BlurEventDispatchMediator):
3399         (FocusInEventDispatchMediator):
3400         (FocusOutEventDispatchMediator):
3401         * dom/Node.cpp:
3402         (WebCore::Node::dispatchFocusInEvent):
3403         (WebCore::Node::dispatchFocusOutEvent):
3404         (WebCore::Node::dispatchFocusEvent):
3405         (WebCore::Node::dispatchBlurEvent):
3406
3407 2013-02-12  Takashi Sakamoto  <tasak@google.com>
3408
3409         [Refactoring] Make SelectorChecker::mode a constructor parameter.
3410         https://bugs.webkit.org/show_bug.cgi?id=109653
3411
3412         Reviewed by Dimitri Glazkov.
3413
3414         No new tests, because just refactoring.
3415
3416         * css/SelectorChecker.cpp:
3417         (WebCore::SelectorChecker::SelectorChecker):
3418         Made mode a constructor parameter.
3419         * css/SelectorChecker.h:
3420         Removed setMode.
3421         (SelectorChecker):
3422         * css/StyleResolver.cpp:
3423         (WebCore::StyleResolver::ruleMatches):
3424         (WebCore::StyleResolver::checkRegionSelector):
3425         * dom/SelectorQuery.cpp:
3426         (WebCore::SelectorQuery::matches):
3427         (WebCore::SelectorQuery::queryAll):
3428         (WebCore::SelectorQuery::queryFirst):
3429         * html/shadow/ContentSelectorQuery.cpp:
3430         (WebCore::ContentSelectorChecker::ContentSelectorChecker):
3431
3432 2013-02-12  Andreas Kling  <akling@apple.com>
3433
3434         Remove Element::ensureAttributeData().
3435         <http://webkit.org/b/109643>
3436
3437         Reviewed by Anders Carlsson.
3438
3439         * dom/Element.h:
3440         * dom/Element.cpp:
3441         (WebCore::Element::classAttributeChanged):
3442         (WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged):
3443
3444             Use attributeData() instead of ensureAttributeData(), it's already guaranteed to exist in
3445             both these functions as they are called in response to attribute changes.
3446
3447         * svg/SVGElement.h:
3448         (WebCore::SVGElement::invalidateSVGAttributes):
3449
3450             Use mutableAttributeData() instead of ensureAttributeData() when invalidating animated
3451             SVG attributes. While I can't find any bugs caused by this, an element with property animations
3452             shouldn't share attribute data with other elements.
3453
3454 2013-02-12  Hayato Ito  <hayato@chromium.org>
3455
3456         Make {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator type safe.
3457         https://bugs.webkit.org/show_bug.cgi?id=109561
3458
3459         Reviewed by Dimitri Glazkov.
3460
3461         Use FocusEvent rather than Event in {FocusIn,FocusOut,Focus,Blur}EventDispatchMediator.
3462
3463         No new tests. No change in functionality.
3464
3465         * dom/FocusEvent.cpp:
3466         (WebCore::FocusEventDispatchMediator::create):
3467         (WebCore::FocusEventDispatchMediator::FocusEventDispatchMediator):
3468         (WebCore::BlurEventDispatchMediator::create):
3469         (WebCore::BlurEventDispatchMediator::BlurEventDispatchMediator):
3470         (WebCore::FocusInEventDispatchMediator::create):
3471         (WebCore::FocusInEventDispatchMediator::FocusInEventDispatchMediator):
3472         (WebCore::FocusOutEventDispatchMediator::create):
3473         (WebCore::FocusOutEventDispatchMediator::FocusOutEventDispatchMediator):
3474         * dom/FocusEvent.h:
3475         (FocusEventDispatchMediator):
3476         (WebCore::FocusEventDispatchMediator::event):
3477         (BlurEventDispatchMediator):
3478         (WebCore::BlurEventDispatchMediator::event):
3479         (FocusInEventDispatchMediator):
3480         (WebCore::FocusInEventDispatchMediator::event):
3481         (FocusOutEventDispatchMediator):
3482         (WebCore::FocusOutEventDispatchMediator::event):
3483
3484 2013-02-12  Eric Seidel  <eric@webkit.org>
3485
3486         Fix HTMLToken::Attribute member naming and update callsites to use Vector-based String functions
3487         https://bugs.webkit.org/show_bug.cgi?id=109638
3488
3489         Reviewed by Adam Barth.
3490
3491         Darin Adler noted in:
3492         https://bugs.webkit.org/show_bug.cgi?id=109408#c4
3493         that HTMLToken::Attribute (then MarkupTokenBase::Attribute)
3494         was a struct, yet incorrectly used m_ for its public members.
3495
3496         This patch fixes the members to not have the m_, and since I was
3497         touching all callers, I also updated all callers to use modern
3498         Vector-based String creation/append functions instead of manually
3499         calling UChar*, size_t versions.
3500
3501         There should be no behavior change to this patch.  Where I saw
3502         performance/memory bugs, I noted them with FIXMEs to keep
3503         this change simple.
3504
3505         * html/HTMLViewSourceDocument.cpp:
3506         (WebCore::HTMLViewSourceDocument::processTagToken):
3507         * html/parser/AtomicHTMLToken.h:
3508         (WebCore::AtomicHTMLToken::publicIdentifier):
3509         (WebCore::AtomicHTMLToken::systemIdentifier):
3510         (WebCore::AtomicHTMLToken::AtomicHTMLToken):
3511         (WebCore::AtomicHTMLToken::initializeAttributes):
3512         * html/parser/CompactHTMLToken.cpp:
3513         (WebCore::CompactHTMLToken::CompactHTMLToken):
3514         * html/parser/HTMLMetaCharsetParser.cpp:
3515         (WebCore::HTMLMetaCharsetParser::processMeta):
3516         (WebCore::HTMLMetaCharsetParser::checkForMetaCharset):
3517         * html/parser/HTMLPreloadScanner.cpp:
3518         (WebCore::StartTagScanner::processAttributes):
3519         (WebCore::HTMLPreloadScanner::scan):
3520         (WebCore::HTMLPreloadScanner::processPossibleBaseTag):
3521         (WebCore::HTMLPreloadScanner::processToken):
3522         * html/parser/HTMLToken.h:
3523         (Range):
3524         (Attribute):
3525         (WebCore::HTMLToken::clear):
3526         (WebCore::HTMLToken::startIndex):
3527         (WebCore::HTMLToken::endIndex):
3528         (WebCore::HTMLToken::end):
3529         (WebCore::HTMLToken::nameString):
3530         (WebCore::HTMLToken::addNewAttribute):
3531         (WebCore::HTMLToken::beginAttributeName):
3532         (WebCore::HTMLToken::endAttributeName):
3533         (WebCore::HTMLToken::beginAttributeValue):
3534         (WebCore::HTMLToken::endAttributeValue):
3535         (WebCore::HTMLToken::appendToAttributeName):
3536         (WebCore::HTMLToken::appendToAttributeValue):
3537         (WebCore::HTMLToken::eraseValueOfAttribute):
3538         * html/parser/HTMLTokenizer.cpp:
3539         (WebCore::AtomicHTMLToken::nameForAttribute):
3540         * html/parser/HTMLViewSourceParser.cpp:
3541         (WebCore::HTMLViewSourceParser::updateTokenizerState):
3542         * html/parser/XSSAuditor.cpp:
3543         (WebCore::findAttributeWithName):
3544         (WebCore::XSSAuditor::filterParamToken):
3545         (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected):
3546         (WebCore::XSSAuditor::eraseAttributeIfInjected):
3547         (WebCore::XSSAuditor::decodedSnippetForAttribute):
3548
3549 2013-02-12  Ryosuke Niwa  <rniwa@webkit.org>
3550
3551         Build fix.
3552
3553         * editing/Editor.h:
3554         (WebCore::Editor::avoidIntersectionWithDeleteButtonController):
3555
3556 2013-02-12  Nate Chapin  <japhet@chromium.org>
3557
3558         REGRESSION: Reloading a local file doesn't pick up changes
3559         https://bugs.webkit.org/show_bug.cgi?id=109344
3560
3561         Reviewed by Alexey Proskuryakov.
3562
3563         Test: http/tests/cache/reload-main-resource.php
3564
3565         * loader/cache/CachedResource.cpp:
3566         (WebCore::CachedResource::load):
3567         * loader/cache/CachedResourceLoader.cpp:
3568         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
3569         (WebCore::CachedResourceLoader::cachePolicy): Don't use subresourceCachePolicy()
3570             for main resources.
3571         * loader/cache/CachedResourceLoader.h:
3572         (CachedResourceLoader):
3573
3574 2013-02-12  Ryosuke Niwa  <rniwa@webkit.org>
3575
3576         Turn avoidIntersectionWithNode into Editor member functions to encapsulate delete button controller
3577         https://bugs.webkit.org/show_bug.cgi?id=109549
3578
3579         Reviewed by Tony Chang.
3580
3581         Renamed avoidIntersectionWithNode to Editor::avoidIntersectionWithDeleteButtonController and added trivial
3582         implementations when delete button controllers are disabled (ENABLE_DELETION_UI is 0).
3583
3584         * editing/DeleteButtonController.cpp:
3585         * editing/EditCommand.cpp:
3586         (WebCore::EditCommand::EditCommand):
3587         * editing/Editor.cpp:
3588         (WebCore::Editor::avoidIntersectionWithDeleteButtonController): Moved from htmlediting.cpp and renamed.
3589         The version that takes VisibleSelection has been updated to use updatePositionForNodeRemoval to share
3590         mode code with that function.
3591         (WebCore::Editor::rangeForPoint):
3592         * editing/Editor.h:
3593         (WebCore::Editor::avoidIntersectionWithDeleteButtonController): Added; trivial implementations.
3594         * editing/htmlediting.cpp:
3595         * editing/htmlediting.h:
3596         * editing/markup.cpp:
3597         (WebCore::createMarkupInternal): Extracted from createMarkup.
3598         (WebCore::createMarkup):
3599
3600 2013-02-12  Joseph Pecoraro  <pecoraro@apple.com>
3601
3602         [iOS] Enable PAGE_VISIBILITY_API
3603         https://bugs.webkit.org/show_bug.cgi?id=109399
3604
3605         Reviewed by David Kilzer.
3606
3607         * Configurations/FeatureDefines.xcconfig:
3608
3609 2013-02-12  Andreas Kling  <akling@apple.com>
3610
3611         Move ElementAttributeData into Element.cpp/h
3612         <http://webkit.org/b/109610>
3613
3614         Reviewed by Anders Carlsson.
3615
3616         Removed ElementAttributeData.cpp/h and moved the class itself into Element headquarters.
3617         In the near future, Element should be the only client of this class, and thus it won't
3618         be necessary for other classes to know anything about it.
3619
3620         * dom/ElementAttributeData.cpp: Removed.
3621         * dom/ElementAttributeData.h: Removed.
3622         * CMakeLists.txt:
3623         * GNUmakefile.list.am:
3624         * Target.pri:
3625         * WebCore.gypi:
3626         * WebCore.xcodeproj/project.pbxproj:
3627         * dom/DOMAllInOne.cpp:
3628         * dom/DocumentSharedObjectPool.cpp:
3629         * dom/Element.cpp:
3630         * dom/Element.h:
3631         * workers/SharedWorker.cpp:
3632         * Modules/webdatabase/DatabaseManager.cpp: Add ExceptionCode.h since Element.h doesn't pull it in anymore.
3633
3634 2013-02-12  Simon Fraser  <simon.fraser@apple.com>
3635
3636         Crash when scrolling soon after page starts loading
3637         https://bugs.webkit.org/show_bug.cgi?id=109631
3638         <rdar://problem/13157533&13159627&13196727>
3639         
3640         Reviewed by Anders Carlsson.
3641         
3642         Make the scrolling tree more robust when the root state node,
3643         and/or scrolling node are null. This can happen if we try to
3644         handle a wheel event before we've done the first scrolling
3645         tree commit.
3646
3647         * page/scrolling/ScrollingStateTree.cpp:
3648         (WebCore::ScrollingStateTree::commit): Handle the case where
3649         m_rootStateNode is null. We'll still commit, but the state tree
3650         will have no state nodes.
3651         * page/scrolling/ScrollingTree.cpp:
3652         (WebCore::ScrollingTree::handleWheelEvent): Null-check m_rootNode.
3653         (WebCore::ScrollingTree::commitNewTreeState): Handle a null root node.
3654         (WebCore::ScrollingTree::updateTreeFromStateNode): If the rood state node
3655         is null, just clear the map and null out the root scrolling node.
3656         * page/scrolling/ScrollingTree.h: m_debugInfoLayer was unused.
3657         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
3658         (WebCore::ScrollingCoordinatorMac::ensureRootStateNodeForFrameView): It may be possible
3659         to get here before we've registered the root scroll layer, in which case scrollLayerID()
3660         will be 0. Assert to see if this can ever happen.
3661         (WebCore::ScrollingCoordinatorMac::scrollingStateTreeAsText): Handle case of rootStateNode()
3662         being null.
3663
3664 2013-02-12  Raymond Toy  <rtoy@google.com>
3665
3666         Synchronize setting of panner node model and processing
3667         https://bugs.webkit.org/show_bug.cgi?id=109599
3668
3669         Reviewed by Chris Rogers.
3670
3671         No new tests.
3672
3673         * Modules/webaudio/PannerNode.cpp:
3674         (WebCore::PannerNode::process):
3675         (WebCore::PannerNode::setPanningModel):
3676         * Modules/webaudio/PannerNode.h:
3677
3678 2013-02-12  Dean Jackson  <dino@apple.com>
3679
3680         Add class name for snapshotted plugin based on dimensions
3681         https://bugs.webkit.org/show_bug.cgi?id=108369
3682
3683         Reviewed by Simon Fraser.
3684
3685         As the size of the plugin changes, the Shadow Root for the snapshot
3686         might want to toggle different interfaces. Expose "tiny", "small",
3687         "medium" and "large" classes on the Shadow. (The dimensions are
3688         currently chosen fairly arbitrarily).
3689
3690         Because we only know the dimensions after layout, we set up
3691         a post layout task to add the class. Luckily there already was
3692         a post layout task for plugins - I just updated it to handle
3693         both real and snapshotted plugins. This involved modifying
3694         the list of RenderEmbeddedObjects in FrameView to take generic
3695         RenderObjects, and decide which type they are when calling
3696         the update method.
3697
3698         * html/HTMLPlugInImageElement.cpp: Some new dimensions for the various size thresholds.
3699         (WebCore::classNameForShadowRootSize): New static function that returns a class name
3700             after examining the size of the object.
3701         (WebCore::HTMLPlugInImageElement::updateSnapshotInfo): Sets the class name for
3702             the shadow root. This is called in the post layout task.
3703         (WebCore::shouldPlugInShowLabelAutomatically): Use new size names.
3704         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Ditto.
3705         * html/HTMLPlugInImageElement.h:
3706         (HTMLPlugInImageElement): New method updateSnapshotInfo.
3707
3708         * page/FrameView.cpp:
3709         (WebCore::FrameView::addWidgetToUpdate): Change RenderEmbeddedObject* to RenderObject*.
3710         (WebCore::FrameView::removeWidgetToUpdate): Ditto
3711         (WebCore::FrameView::updateWidget): Branch based on EmbeddedObject vs SnapshottedPlugIn. Call
3712             plugin snapshot update if necessary.
3713         (WebCore::FrameView::updateWidgets): Handle both EmbeddedObject and SnapshottedPlugIn cases.
3714         * page/FrameView.h: Change RenderEmbeddedObject* to RenderObject* for post layout widget updates.
3715
3716         * rendering/RenderSnapshottedPlugIn.cpp:
3717         (WebCore::RenderSnapshottedPlugIn::layout): New virtual override. If size has changed, ask the
3718             FrameView to recalculate size after layout.
3719         * rendering/RenderSnapshottedPlugIn.h: New layout() method.
3720
3721 2013-02-12  Mike West  <mkwst@chromium.org>
3722
3723         Implement script MIME restrictions for X-Content-Type-Options: nosniff
3724         https://bugs.webkit.org/show_bug.cgi?id=71851
3725
3726         Reviewed by Adam Barth.
3727
3728         This patch adds support for 'X-Content-Type-Options: nosniff' when
3729         deciding whether or not to execute a given chunk of JavaScript. If the
3730         header is present, script will only execute if it matches a predefined
3731         set of MIME types[1] that are deemed "executable". Scripts served with
3732         types that don't match the list will not execute.
3733
3734         IE introduced this feature, and Gecko is working on an implementation[2]
3735         now. There's been some discussion on the WHATWG list about formalizing
3736         the specification for this feature[3], but nothing significant has been
3737         decided.
3738
3739         This implementation's list of acceptible MIME types differs from IE's:
3740         it matches the list of supported JavaScript MIME types defined in
3741         MIMETypeRegistry::initializeSupportedJavaScriptMIMETypes()[4]. In
3742         particular, the VBScript types are not accepted, and
3743         'text/javascript1.{1,2,3}' are accepted, along with 'text/livescript'.
3744
3745         This feature is locked tightly behind the ENABLE_NOSNIFF flag, which is
3746         currently only enabled on the Chromium port.
3747
3748         [1]: http://msdn.microsoft.com/en-us/library/gg622941(v=vs.85).aspx
3749         [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=471020
3750         [3]: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2012-November/037974.html
3751         [4]: http://trac.webkit.org/browser/trunk/Source/WebCore/platform/MIMETypeRegistry.cpp?rev=142086#L307
3752
3753         Tests: http/tests/security/contentTypeOptions/invalid-content-type-options-allowed.html
3754                http/tests/security/contentTypeOptions/nosniff-script-allowed.html
3755                http/tests/security/contentTypeOptions/nosniff-script-blocked.html
3756                http/tests/security/contentTypeOptions/nosniff-script-without-content-type-allowed.html
3757
3758         * dom/ScriptElement.cpp:
3759         (WebCore::ScriptElement::executeScript):
3760             Before executing script, ensure that it shouldn't be blocked due to
3761             its MIME type. If it is blocked, write an error message to the
3762             console.
3763         * loader/cache/CachedScript.cpp:
3764         (WebCore::CachedScript::mimeType):
3765             Make scripts' MIME type available outside the context of
3766             CachedScript in order to correctly populate error messages we write
3767             to the console in ScriptElement::executeScript
3768         (WebCore):
3769         (WebCore::CachedScript::mimeTypeAllowedByNosniff):
3770         * loader/cache/CachedScript.h:
3771         (CachedScript):
3772             A new method which checks the resource's HTTP headers to set the
3773             'nosniff' disposition, and compares the resource's MIME type against
3774             the list of allowed executable types. Returns true iff the script
3775             is allowed.
3776         * platform/network/HTTPParsers.cpp:
3777         (WebCore):
3778         (WebCore::parseContentTypeOptionsHeader):
3779         * platform/network/HTTPParsers.h:
3780             Adds a new enum which relates the sniffable status of the resource,
3781             and a method to parse the HTTP header.
3782
3783 2013-02-12  Adam Barth  <abarth@webkit.org>
3784
3785         Threaded HTML parser should pass the remaining fast/tokenizer tests
3786         https://bugs.webkit.org/show_bug.cgi?id=109607
3787
3788         Reviewed by Eric Seidel.
3789
3790         This patch fixes some edge cases involving document.write. Previously,
3791         we would drop input characters on the floor if the tokenizer wasn't
3792         able to consume them synchronously. In this patch, we send the unparsed
3793         characters to the background thread for consumption after rewinding the
3794         input stream.
3795
3796         * html/parser/BackgroundHTMLInputStream.cpp:
3797         (WebCore::BackgroundHTMLInputStream::rewindTo):
3798         * html/parser/BackgroundHTMLInputStream.h:
3799         (BackgroundHTMLInputStream):
3800         * html/parser/BackgroundHTMLParser.cpp:
3801         (WebCore::BackgroundHTMLParser::resumeFrom):
3802         * html/parser/BackgroundHTMLParser.h:
3803         (Checkpoint):
3804         * html/parser/HTMLDocumentParser.cpp:
3805         (WebCore::HTMLDocumentParser::canTakeNextToken):
3806         (WebCore::HTMLDocumentParser::didFailSpeculation):
3807         (WebCore::HTMLDocumentParser::pumpTokenizer):
3808         (WebCore::HTMLDocumentParser::finish):
3809         * html/parser/HTMLInputStream.h:
3810         (WebCore::HTMLInputStream::closeWithoutMarkingEndOfFile):
3811         (HTMLInputStream):
3812
3813 2013-02-12  Csaba Osztrogon√°c  <ossy@webkit.org>
3814
3815         Unreviewed buildfix for !ENABLE(INSPECTOR) platforms after r142654.
3816
3817         * inspector/InspectorInstrumentation.h:
3818         (WebCore::InspectorInstrumentation::scriptsEnabled):
3819
3820 2013-02-12  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3821
3822         Remove remaining traces of Web Intents
3823         https://bugs.webkit.org/show_bug.cgi?id=109586
3824
3825         Reviewed by Eric Seidel.
3826
3827         Remove remaining traces of Web Intents as the functionality was
3828         removed in r142549.
3829
3830         No new tests, no behavior change for layout tests.
3831
3832         * GNUmakefile.features.am.in:
3833         * html/HTMLTagNames.in:
3834
3835 2013-02-12  Robert Hogan  <robert@webkit.org>
3836
3837         REGRESSION(r136967): Combination of float and clear yields to bad layout
3838         https://bugs.webkit.org/show_bug.cgi?id=109476
3839
3840         Reviewed by Levi Weintraub.
3841
3842         Test: fast/block/margin-collapse/self-collapsing-block-with-float-children.html
3843
3844         The change made at http://trac.webkit.org/changeset/136967 only needs to worry about the first floated
3845         child of a self-collapsing block. The ones that follow are not affected by its margins.
3846
3847         * rendering/RenderBlockLineLayout.cpp:
3848         (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
3849
3850 2013-02-12  Levi Weintraub  <leviw@chromium.org>
3851
3852         ASSERTION FAILED: !object || object->isBox(), UNKNOWN in WebCore::RenderListItem::positionListMarker
3853         https://bugs.webkit.org/show_bug.cgi?id=108699
3854
3855         Reviewed by Abhishek Arya.
3856
3857         RenderListItems performs special management of its children to maintain list markers. Splitting a flow
3858         through a list item results in assumptions made inside RenderListItem failing, so for now, avoid splitting
3859         flows when inside one.
3860
3861         Test: fast/multicol/span/list-multi-column-crash.html
3862
3863         * rendering/RenderBlock.cpp:
3864         (WebCore::RenderBlock::containingColumnsBlock):
3865
3866 2013-02-12  Roger Fong  <roger_fong@apple.com>
3867
3868         Unreviewed Windows build fix.
3869
3870         * testing/Internals.cpp:
3871         (WebCore::Internals::resetToConsistentState):
3872         (WebCore::Internals::Internals):
3873
3874 2013-02-12  Vivek Galatage  <vivek.vg@samsung.com>
3875
3876         Web Inspector: JavaScript execution disabled by browser/UA should be notified to the front-end
3877         https://bugs.webkit.org/show_bug.cgi?id=109402
3878
3879         Reviewed by Yury Semikhatsky.
3880
3881         Whenever the UA/Browser changes the Script Execution state of a page, it should notify the
3882         inspector front-end. Added the InspectorInstrumentation method didScriptExecutionStateChange
3883         to achieve this. Also the state change triggered by the inspector should be ignored to avoid
3884         infinite loop.
3885
3886         Test: inspector/script-execution-state-change-notification.html
3887
3888         * inspector/Inspector.json:
3889         * inspector/InspectorInstrumentation.cpp:
3890         (WebCore):
3891         (WebCore::InspectorInstrumentation::scriptsEnabledImpl):
3892         * inspector/InspectorInstrumentation.h:
3893         (InspectorInstrumentation):
3894         (WebCore::InspectorInstrumentation::scriptsEnabled):
3895         (WebCore):
3896         * inspector/InspectorPageAgent.cpp:
3897         (WebCore::InspectorPageAgent::InspectorPageAgent):
3898         (WebCore::InspectorPageAgent::setScriptExecutionDisabled):
3899         (WebCore::InspectorPageAgent::scriptsEnabled):
3900         (WebCore):
3901         * inspector/InspectorPageAgent.h:
3902         (InspectorPageAgent):
3903         * inspector/front-end/ResourceTreeModel.js:
3904         (WebInspector.PageDispatcher.prototype.javascriptDialogClosed):
3905         (WebInspector.PageDispatcher.prototype.scriptsEnabled):
3906         * page/Settings.cpp:
3907         (WebCore::Settings::setScriptEnabled):
3908
3909 2013-02-12  Antti Koivisto  <antti@apple.com>
3910
3911         Cache timer heap pointer to timers
3912         https://bugs.webkit.org/show_bug.cgi?id=109597
3913
3914         Reviewed by Andreas Kling.
3915
3916         Accessing timer heap through thread global storage is slow (~0.1% in PLT3). We can cache the heap pointer to
3917         each TimerBase. There are not huge numbers of timers around so memory is not an issue and many timers are heavily reused.
3918
3919         * platform/Timer.cpp:
3920         (WebCore::threadGlobalTimerHeap):
3921         (WebCore::TimerHeapReference::operator=):
3922         (WebCore::TimerHeapIterator::checkConsistency):
3923         (WebCore::TimerBase::TimerBase):
3924         (WebCore::TimerBase::checkHeapIndex):
3925         (WebCore::TimerBase::setNextFireTime):
3926         * platform/Timer.h:
3927         (WebCore::TimerBase::timerHeap):
3928         (TimerBase):
3929
3930 2013-02-12  Adam Barth  <abarth@webkit.org>
3931
3932         BackgroundHTMLParser::resumeFrom should take a struct
3933         https://bugs.webkit.org/show_bug.cgi?id=109598
3934
3935         Reviewed by Eric Seidel.
3936
3937         This patch is purely a syntatic change that paves the way for fixing
3938         the partial-entity document.write tests. To fix those tests, we'll need
3939         to pass more information to resumeFrom, but we're hitting the argument
3940         limits in Functional.h. Rather than adding yet more arguments, this
3941         patch moves to a single argument that's a struct.
3942
3943         * html/parser/BackgroundHTMLParser.cpp:
3944         (WebCore::BackgroundHTMLParser::resumeFrom):
3945         * html/parser/BackgroundHTMLParser.h:
3946         (Checkpoint):
3947         (BackgroundHTMLParser):
3948         * html/parser/HTMLDocumentParser.cpp:
3949         (WebCore::HTMLDocumentParser::didFailSpeculation):
3950
3951 2013-02-12  Elliott Sprehn  <esprehn@chromium.org>
3952
3953         rootRenderer in FrameView is really RenderView
3954         https://bugs.webkit.org/show_bug.cgi?id=109510
3955
3956         Reviewed by Eric Seidel.
3957
3958         The global function rootRenderer(FrameView*) is really just a way
3959         to get the RenderView from the Frame so replace it with a renderView()
3960         method and replace usage of the word "root" with renderView so it's
3961         obvious the root we're talking about is the renderView. This is an
3962         important distinction to make since we also have rootRenderer in the code
3963         for the documentElement()'s renderer and we also have a "layout root" which
3964         is entirely different.
3965
3966         No new tests, just refactoring.
3967
3968         * page/FrameView.cpp:
3969         (WebCore::FrameView::rootRenderer): Removed.
3970         (WebCore::FrameView::setFrameRect):
3971         (WebCore::FrameView::adjustViewSize):
3972         (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
3973         (WebCore::FrameView::updateCompositingLayersAfterLayout):
3974         (WebCore::FrameView::clearBackingStores):
3975         (WebCore::FrameView::restoreBackingStores):
3976         (WebCore::FrameView::usesCompositedScrolling):
3977         (WebCore::FrameView::layerForHorizontalScrollbar):
3978         (WebCore::FrameView::layerForVerticalScrollbar):
3979         (WebCore::FrameView::layerForScrollCorner):
3980         (WebCore::FrameView::tiledBacking):
3981         (WebCore::FrameView::scrollLayerID):
3982         (WebCore::FrameView::layerForOverhangAreas):
3983         (WebCore::FrameView::flushCompositingStateForThisFrame):
3984         (WebCore::FrameView::hasCompositedContent):
3985         (WebCore::FrameView::enterCompositingMode):
3986         (WebCore::FrameView::isSoftwareRenderable):
3987         (WebCore::FrameView::didMoveOnscreen):
3988         (WebCore::FrameView::willMoveOffscreen):
3989         (WebCore::FrameView::layout):
3990         (WebCore::FrameView::embeddedContentBox):
3991         (WebCore::FrameView::contentsInCompositedLayer):
3992         (WebCore::FrameView::scrollContentsFastPath):
3993         (WebCore::FrameView::scrollContentsSlowPath):
3994         (WebCore::FrameView::maintainScrollPositionAtAnchor):
3995         (WebCore::FrameView::scrollPositionChanged):
3996         (WebCore::FrameView::repaintFixedElementsAfterScrolling):
3997         (WebCore::FrameView::updateFixedElementsAfterScrolling):
3998         (WebCore::FrameView::visibleContentsResized):
3999         (WebCore::FrameView::scheduleRelayoutOfSubtree):
4000         (WebCore::FrameView::needsLayout):
4001         (WebCore::FrameView::setNeedsLayout):
4002         (WebCore::FrameView::performPostLayoutTasks):