REGRESSION(r146380): media/track/track-user-preferences.html
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-03-25  Eric Carlson  <eric.carlson@apple.com>
2
3         REGRESSION(r146380): media/track/track-user-preferences.html
4         https://bugs.webkit.org/show_bug.cgi?id=113083
5
6         Reviewed by Jer Noble.
7
8         Ignore track change notifications triggered by automatic track selection so the 
9         configuration is not changed.
10
11         No new tests, this fixes an existing test.
12
13         * html/HTMLMediaElement.cpp:
14         (WebCore::HTMLMediaElement::configureTextTrackGroup): Clear m_processingPreferenceChange after all
15             track configuration is finished.
16         (WebCore::HTMLMediaElement::configureTextTrackDisplay): Do nothing if m_processingPreferenceChange
17             is true.
18
19 2013-03-25  Martin Robinson  <mrobinson@igalia.com>
20
21         [GTK] [gyp] Build the final piece of WebCore
22         https://bugs.webkit.org/show_bug.cgi?id=113216
23
24         Reviewed by Nico Weber.
25
26         * WebCore.gyp/WebCoreGTK.gyp: Add the rest of the WebCore source files to the WebCore build target.
27
28 2013-03-25  Martin Robinson  <mrobinson@igalia.com>
29
30         [GTK] [gyp] Adding support for building WebCore rendering
31         https://bugs.webkit.org/show_bug.cgi?id=113213
32
33         Reviewed by Gustavo Noronha Silva.
34
35         * WebCore.gyp/WebCoreGTK.gyp: Build the rendering directory into a shared library.
36
37 2013-03-25  Tony Chang  <tony@chromium.org>
38
39         Remove TextIterator argumentless constructor
40         https://bugs.webkit.org/show_bug.cgi?id=113226
41
42         Reviewed by Ryosuke Niwa.
43
44         The TextIterator argumentless constructors are never used and wouldn't be useful
45         since you can't specify a range.
46
47         No new tests, removing dead code. There should be no behavior change.
48
49         * editing/TextIterator.cpp: Remove constructors.
50         * editing/TextIterator.h:
51         (TextIterator):
52         (SimplifiedBackwardsTextIterator):
53         (CharacterIterator):
54         (BackwardsCharacterIterator):
55         (WordAwareIterator):
56
57 2013-03-25  Brandon Jones  <bajones@chromium.org>
58
59         Enabled canvas.getContext("webgl") on Desktop Chrome
60         https://bugs.webkit.org/show_bug.cgi?id=113079
61
62         Reviewed by Dean Jackson.
63
64         Test: fast/canvas/webgl/webgl-unprefixed-context-id.html
65
66         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
67         (WebCore::V8HTMLCanvasElement::getContextMethodCustom):
68         * html/HTMLCanvasElement.cpp:
69         (WebCore::HTMLCanvasElement::getContext):
70
71 2013-03-25  Roger Fong  <roger_fong@apple.com>
72
73         Unreviewed. Remove some suspicious looking code in an attempt to fix EWS bots.
74
75         * bindings/scripts/preprocessor.pm:
76         (applyPreprocessor):
77
78 2013-03-25  Martin Robinson  <mrobinson@igalia.com>
79
80         [GTK] [gyp] Add support for building the platform directory
81         https://bugs.webkit.org/show_bug.cgi?id=113212
82
83         Reviewed by Nico Weber.
84
85         * WebCore.gyp/WebCoreGTK.gyp: Add support for building the platform directory including
86         two libraries, one for platform and one for geometry files. This follows the approach
87         of Chromium.
88
89 2013-03-25  Jochen Eisinger  <jochen@chromium.org>
90
91         Swap both the error and change event queue before processing fullscreen events
92         https://bugs.webkit.org/show_bug.cgi?id=113194
93
94         Reviewed by Jer Noble.
95
96         While processing the change events, not only new change events but
97         also new error events might get generated. However, for the timer, we
98         should only process preexisting events.
99
100         This is covered by fullscreen/full-screen-restrictions.html which times
101         out depending on the delay between requesting fullscreen and granting
102         fullscreen.
103
104         * dom/Document.cpp:
105         (WebCore::Document::fullScreenChangeDelayTimerFired):
106
107 2013-03-25  Marja Hölttä  <marja@chromium.org>
108
109         [V8] Generate specialized callbacks for the main world
110         https://bugs.webkit.org/show_bug.cgi?id=112430
111
112         Reviewed by Kentaro Hara.
113
114         The new specialized bindings will be faster, because they don't need to
115         do the "main world, isolated world or a worker" check, but can right
116         away assume that we're in the main world.
117
118         This patch generates main world bindings for getters and setters for a
119         small amount of frequently used functions / functions used by Dromaeo.
120
121         Added tests to TestObj.idl and updated bindings tests.
122
123         * bindings/scripts/CodeGeneratorV8.pm:
124         (GenerateOverloadedFunction):
125         (GenerateFunctionCallback):
126         (GenerateFunction):
127         (GenerateParametersCheck):
128         (GenerateSingleConstructorCallback):
129         (GenerateNonStandardFunction):
130         (GenerateImplementation):
131         (GenerateFunctionCallString):
132         * bindings/scripts/test/TestObj.idl:
133         * bindings/scripts/test/V8/V8Float64Array.cpp:
134         (WebCore):
135         * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
136         (WebCore):
137         * bindings/scripts/test/V8/V8TestEventTarget.cpp:
138         (WebCore):
139         * bindings/scripts/test/V8/V8TestInterface.cpp:
140         (WebCore):
141         * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
142         (WebCore):
143         * bindings/scripts/test/V8/V8TestObj.cpp:
144         (WebCore::TestObjV8Internal::perWorldReadOnlyAttributeAttrGetter):
145         (TestObjV8Internal):
146         (WebCore::TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterCallback):
147         (WebCore::TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterForMainWorld):
148         (WebCore::TestObjV8Internal::perWorldReadOnlyAttributeAttrGetterCallbackForMainWorld):
149         (WebCore::TestObjV8Internal::perWorldAttributeAttrGetter):
150         (WebCore::TestObjV8Internal::perWorldAttributeAttrGetterCallback):
151         (WebCore::TestObjV8Internal::perWorldAttributeAttrGetterForMainWorld):
152         (WebCore::TestObjV8Internal::perWorldAttributeAttrGetterCallbackForMainWorld):
153         (WebCore::TestObjV8Internal::perWorldAttributeAttrSetter):
154         (WebCore::TestObjV8Internal::perWorldAttributeAttrSetterCallback):
155         (WebCore::TestObjV8Internal::perWorldAttributeAttrSetterForMainWorld):
156         (WebCore::TestObjV8Internal::perWorldAttributeAttrSetterCallbackForMainWorld):
157         (WebCore::TestObjV8Internal::perWorldMethodMethod):
158         (WebCore::TestObjV8Internal::perWorldMethodMethodForMainWorld):
159         (WebCore::TestObjV8Internal::perWorldMethodMethodCallback):
160         (WebCore::TestObjV8Internal::perWorldMethodMethodCallbackForMainWorld):
161         (WebCore::TestObjV8Internal::overloadedPerWorldMethod1Method):
162         (WebCore::TestObjV8Internal::overloadedPerWorldMethod1MethodForMainWorld):
163         (WebCore::TestObjV8Internal::overloadedPerWorldMethod2Method):
164         (WebCore::TestObjV8Internal::overloadedPerWorldMethod2MethodForMainWorld):
165         (WebCore::TestObjV8Internal::overloadedPerWorldMethodMethod):
166         (WebCore::TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld):
167         (WebCore::TestObjV8Internal::overloadedPerWorldMethodMethodCallback):
168         (WebCore::TestObjV8Internal::overloadedPerWorldMethodMethodCallbackForMainWorld):
169         (WebCore):
170         * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
171         (WebCore):
172         * bindings/scripts/test/V8/V8TestTypedefs.cpp:
173         (WebCore):
174         * bindings/v8/V8DOMConfiguration.cpp:
175         (WebCore::V8DOMConfiguration::batchConfigureCallbacks):
176         (WebCore::V8DOMConfiguration::configureTemplate):
177         * bindings/v8/V8DOMConfiguration.h:
178         (BatchedMethod):
179         (V8DOMConfiguration):
180         * dom/Document.idl:
181         * dom/Element.idl:
182         * dom/Node.idl:
183         * page/DOMWindow.idl:
184
185 2013-03-25  Daniel Cheng  <dcheng@chromium.org>
186
187         Don't allow drags to start after a mouse press that creates a context menu
188         https://bugs.webkit.org/show_bug.cgi?id=112079
189
190         Reviewed by Tony Chang.
191
192         This appears to be the intent of the original code anyway (the comments in the corresponding
193         context menu handlers indicate that they set m_mousePressed to false in order to suppress
194         drags from starting). Since exact platform behavior differs quite a bit in this area, this
195         will also make the behavior more consistent across different WebKit implementations.
196
197         Manually testable using context-menu-during-drag-selection.html.
198
199         * page/EventHandler.cpp:
200         (WebCore::EventHandler::handleMouseDraggedEvent):
201
202 2013-03-25  Vsevolod Vlasov  <vsevik@chromium.org>
203
204         Web Inspector: [Regression] Provisional breakpoints are not shown on reload.
205         https://bugs.webkit.org/show_bug.cgi?id=113210
206
207         Reviewed by Pavel Feldman.
208
209         * inspector/front-end/BreakpointManager.js:
210         (WebInspector.BreakpointManager.prototype._restoreBreakpoints):
211         (WebInspector.BreakpointManager.prototype._projectWillReset.get for):
212         (WebInspector.BreakpointManager.prototype._projectWillReset):
213         (WebInspector.BreakpointManager.prototype._breakpointResolved):
214         * inspector/front-end/utilities.js:
215
216 2013-03-25  Sergey Ryazanov  <serya@chromium.org>
217
218         Web Inspector: Remove console warnings for *_ prefixed CSS styles
219         https://bugs.webkit.org/show_bug.cgi?id=113175
220
221         Reviewed by Pavel Feldman.
222
223         Added separate error message for syntax CSS error in declaration list when no property detected.
224         Added filter for messages starting with '*'.
225
226         * css/CSSGrammar.y.in:
227
228 2013-03-25  Alexis Hetu  <sugoi@chromium.org>
229
230         Integration of the Skia displacement mapping into WebKit
231         https://bugs.webkit.org/show_bug.cgi?id=112927
232
233         Reviewed by Stephen White.
234
235         Added displacement mapping to effect-reference.html and
236         effect-reference-hw.html
237
238         * WebCore.gypi:
239         * platform/graphics/filters/FEDisplacementMap.h:
240         (FEDisplacementMap):
241         Adding Skia specific declarations
242         * platform/graphics/filters/skia/FEDisplacementMapSkia.cpp: Added.
243         (WebCore):
244         (WebCore::toSkiaMode):
245         Provides conversion between the WebKit displacement mapping mode and
246         the Skia displacement mapping mode
247         (WebCore::FEDisplacementMap::platformApplySkia):
248         Displacement through the Skia API. (Accelerated only for now)
249         (WebCore::FEDisplacementMap::createImageFilter):
250         Displacement image filter creation through the Skia API.
251
252 2013-03-25  Vladislav Kaznacheev  <kaznacheev@chromium.org>
253
254         Web Inspector: Graduate some new Inspector APIs to public
255         https://bugs.webkit.org/show_bug.cgi?id=113176
256
257         Reviewed by Pavel Feldman.
258
259         Summary of changes:
260             DOM.highlightNode.nodeId: required parameter is now optional
261             Input: domain has been added
262             Runtime.enable: command has been added
263             Runtime.executionContextCreated: event has been added
264             Page.clearGeolocationOverride: command has been added
265             Page.setGeolocationOverride: command has been added
266             Page.captureScreenshot: command has been added
267             Debugger.setBreakpointByUrl.locations: optional response parameter is now required
268
269
270         * inspector/Inspector.json:
271
272 2013-03-25  Andrey Kosyakov  <caseq@chromium.org>
273
274         Web Inspector: [Timeline] set glue records mode off by default
275         https://bugs.webkit.org/show_bug.cgi?id=113189
276
277         Reviewed by Pavel Feldman.
278
279         * inspector/front-end/TimelinePanel.js: /glueRecordsSetting/s/true/false/
280
281 2013-03-25  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
282
283         [EFL] Fix build break when media source is enabled
284         https://bugs.webkit.org/show_bug.cgi?id=113143
285
286         Unreviewed. Build error needs to be fixed in order to start to implement
287         media source functionality.
288
289         * CMakeLists.txt:
290         * platform/efl/MIMETypeRegistryEfl.cpp:
291         (WebCore):
292         (WebCore::MIMETypeRegistry::isSupportedMediaSourceMIMEType):
293         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
294         (WebCore):
295         (WebCore::MediaPlayerPrivateGStreamer::load):
296         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
297         (MediaPlayerPrivateGStreamer):
298
299 2013-03-25  Vsevolod Vlasov  <vsevik@chromium.org>
300
301         Web Inspector: Toggling breakpoint with shortcut should be freezed as well while editing.
302         https://bugs.webkit.org/show_bug.cgi?id=113188
303
304         Reviewed by Pavel Feldman.
305
306         * inspector/front-end/JavaScriptSourceFrame.js:
307         (WebInspector.JavaScriptSourceFrame.prototype.toggleBreakpointOnCurrentLine):
308
309 2013-03-25  Vsevolod Vlasov  <vsevik@chromium.org>
310
311         Web Inspector: Remove unneeded code from JavaScriptSourceFrame.
312         https://bugs.webkit.org/show_bug.cgi?id=113182
313
314         Reviewed by Pavel Feldman.
315
316         * inspector/front-end/JavaScriptSourceFrame.js:
317         (WebInspector.JavaScriptSourceFrame):
318
319 2013-03-25  Alexei Filippov  <alph@chromium.org>
320
321         Web Inspector: Fonts refactoring
322         https://bugs.webkit.org/show_bug.cgi?id=113047
323
324         Reviewed by Pavel Feldman.
325
326         Unify fonts usage across inspector.
327         Make inspector default font depend on platform.
328
329         * inspector/front-end/dataGrid.css:
330         (.data-grid table):
331         (.data-grid td):
332         * inspector/front-end/inspector.css:
333         (.toolbar-label):
334         (body.show-toolbar-icons .toolbar-label):
335         (.console-message .bubble):
336         (li .status .bubble):
337         (.source-frame-breakpoint-message):
338         (.soft-context-menu):
339         * inspector/front-end/inspectorCommon.css:
340         (body):
341         * inspector/front-end/networkLogView.css:
342         (.network-log-grid.data-grid td):
343         (.network-log-grid.data-grid.small td):
344         * inspector/front-end/tabbedPane.css:
345         (.tabbed-pane-header-tab):
346         (select.tabbed-pane-header-tabs-drop-down-select):
347         * inspector/front-end/timelinePanel.css:
348         (.memory-counter-value):
349
350 2013-03-25  Vladislav Kaznacheev  <kaznacheev@chromium.org>
351
352         Web Inspector: Use generate-inspector-protocol-version to list valid public API changes
353         https://bugs.webkit.org/show_bug.cgi?id=113148
354
355         Added --show-changes command line option.
356         Used existing compare_schemas method to do a reverse compare.
357         Fixed a number of small problems (missing domain name in the message,
358         incorrect error messages for command parameters).
359
360         Reviewed by Pavel Feldman.
361
362         * inspector/generate-inspector-protocol-version:
363         (named_list_to_map):
364         (removed):
365         (required):
366         (compare_schemas):
367         (compare_domains):
368         (compare_commands):
369         (compare_events):
370         (compare_params_list):
371         (compare_types):
372         (self_test):
373         (self_test.create_test_schema_1):
374         (self_test.create_test_schema_2):
375         (self_test.is_subset):
376         (self_test.errors_match):
377         (main):
378
379 2013-03-25  Alec Flett  <alecflett@chromium.org>
380
381         Support Quota API in Workers
382         https://bugs.webkit.org/show_bug.cgi?id=112972
383
384         Reviewed by Adam Barth.
385
386         Tests: fast/workers/shared-worker-storagequota-query-usage.html
387                fast/workers/worker-storagequota-query-usage.html
388
389         * Modules/quota/WorkerNavigatorStorageQuota.cpp: Added.
390         * Modules/quota/WorkerNavigatorStorageQuota.h: Added.
391         * Modules/quota/WorkerNavigatorStorageQuota.idl: Added.
392         * WebCore.gypi: Add entries for WorkerNavigatorStorageQuota.
393         * page/WorkerNavigator.h: Add a Navigator supplement that extends the worker navigator.
394
395 2013-03-25  Mike West  <mkwst@chromium.org>
396
397         CSP 1.1: Rename SecurityPolicyViolationEvent::sourceURL to ::sourceFile.
398         https://bugs.webkit.org/show_bug.cgi?id=113033
399
400         Reviewed by Jochen Eisinger.
401
402         Bringing our experimental implementation into line with the spec, which
403         has landed on the de facto standard name Gecko has been sending out for
404         years and years.
405
406         Spec: https://dvcs.w3.org/hg/content-security-policy/rev/e44f4003e158
407         Thread: http://lists.w3.org/Archives/Public/public-webappsec/2013Mar/0087.html
408
409         * dom/SecurityPolicyViolationEvent.h:
410         (SecurityPolicyViolationEventInit):
411         (WebCore::SecurityPolicyViolationEvent::sourceFile):
412         (WebCore::SecurityPolicyViolationEvent::SecurityPolicyViolationEvent):
413         (SecurityPolicyViolationEvent):
414         * dom/SecurityPolicyViolationEvent.idl:
415         * page/ContentSecurityPolicy.cpp:
416         (WebCore::gatherSecurityPolicyViolationEventData):
417             s/sourceURL/sourceFile/
418
419 2013-03-25  Michelangelo De Simone  <michelangelo@webkit.org>
420
421         [CSS Filters] Using negative drop-shadow radius values has slow performance
422         https://bugs.webkit.org/show_bug.cgi?id=107848
423
424         Setting negative blur radius values in drop-shadow() and box-shadow() led to
425         significant rendering performance loss. The invalid value overflowed and the
426         embedder became unresponsive for few seconds.
427         This impacted SVG too (SVGFEDropShadow and SVGFEGaussianBlur).
428
429         Reviewed by Dirk Schulze.
430
431         Tests: css3/filters/effect-drop-shadow-negative-radius.html
432                fast/box-shadow/box-shadow-parsing-invalid.html
433                svg/filters/feDropShadow-negative-deviation-expected.svg
434                svg/filters/feDropShadow-negative-deviation.svg
435                svg/filters/feDropShadow-zero-deviation.svg
436                svg/filters/feGaussianBlur-negative-deviation-expected.svg
437                svg/filters/feGaussianBlur-negative-deviation.svg
438                svg/filters/feGaussianBlur-zero-deviation.svg
439
440         * css/CSSParser.cpp:
441         (WebCore::CSSParser::parseShadow): Negative values are skipped during parsing: as per
442         CSS Background and Borders specs, negative values shall not be allowed.
443         * platform/graphics/filters/FEGaussianBlur.cpp:
444         (WebCore::FEGaussianBlur::calculateUnscaledKernelSize): Added "non-negative" assertion for
445         negative deviations.
446         * svg/SVGFEDropShadowElement.cpp:
447         (WebCore::SVGFEDropShadowElement::build): If a negative standard deviation is encountered, don't
448         build the filter and returns earlier, this avoids unnecessary calls: FEGaussianBlur is not being
449         created with wrong and potentially overflowing values.
450         * svg/SVGFEGaussianBlurElement.cpp:
451         (WebCore::SVGFEGaussianBlurElement::build): Ditto.
452
453 2013-03-25  Allan Sandfeld Jensen  <allan.jensen@digia.com>
454
455         [Qt] REGRESSION(r146630): 8 text related test asserts on debug builds
456         https://bugs.webkit.org/show_bug.cgi?id=113179
457
458         Reviewed by Jocelyn Turcotte.
459
460         Test if range.start is within the valid range before testing the value at that point.
461
462         * platform/graphics/qt/FontQt.cpp:
463         (WebCore::Font::initFormatForTextLayout):
464
465 2013-03-25  Alexander Pavlov  <apavlov@chromium.org>
466
467         Web Inspector: Properly handle the rule addition to an XML or SVG document.
468         https://bugs.webkit.org/show_bug.cgi?id=113185
469
470         Reviewed by Pavel Feldman.
471
472         * inspector/InspectorCSSAgent.cpp:
473         (WebCore::InspectorCSSAgent::viaInspectorStyleSheet):
474
475 2013-03-25  Peter Rybin  <prybin@chromium.org>
476
477         Web Inspector: support changing local variables in frontend
478         https://bugs.webkit.org/show_bug.cgi?id=112470
479
480         Reviewed by Yury Semikhatsky.
481
482         ScopeRef type is added to RemoteObject and setPropertyValue is patched accordingly.
483
484         Test: inspector/debugger/debugger-change-variable.html
485
486         * inspector/front-end/DebuggerModel.js:
487         (WebInspector.DebuggerModel.CallFrame.prototype.get id):
488         * inspector/front-end/ObjectPropertiesSection.js:
489         (WebInspector.FunctionScopeMainTreeElement.prototype.onpopulate.didGetDetails):
490         (WebInspector.FunctionScopeMainTreeElement.prototype.onpopulate):
491         * inspector/front-end/RemoteObject.js:
492         (WebInspector.RemoteObject):
493         (WebInspector.RemoteObject.fromScopePayload):
494         (WebInspector.RemoteObject.prototype.):
495         (WebInspector.RemoteObject.prototype.setPropertyValue):
496         (WebInspector.RemoteObject.prototype.setVariableValueCallback):
497         (WebInspector.RemoteObject.prototype._setDeclarativeVariableValue):
498         (WebInspector.ScopeRef):
499         * inspector/front-end/ScopeChainSidebarPane.js:
500         (WebInspector.ScopeChainSidebarPane.prototype.update):
501
502 2013-03-25  Mike West  <mkwst@chromium.org>
503
504         CSP 1.1: Strip URLs in SecurityPolicyViolationEvents, just as we do for POSTed violation reports.
505         https://bugs.webkit.org/show_bug.cgi?id=113039
506
507         Reviewed by Jochen Eisinger.
508
509         I'd originally assumed that we didn't need to be quite so careful when
510         handing URLs to JavaScript via SecurityPolicyViolationEvents. This was
511         a mistake. Cross-origin URLs aren't accessible to JavaScript currently
512         and there's no reason that we should begin exposing them via an event.
513
514         This patch extracts the stripping logic from the existing reports into
515         stripURLForUseInReport(), and uses that new method when populating the
516         event and report objects.
517
518         Relatedly, we were doing the wrong thing with 'file:' URLs, which this
519         patch made clear. Now they're treated the same as 'data:' et al.
520
521         Spec: https://dvcs.w3.org/hg/content-security-policy/rev/45f6ccaba0ef
522
523         Tests: http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-block-cross-origin-image-from-script.html
524                http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-block-cross-origin-image.html
525                http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-block-image-from-script.html
526                http/tests/security/contentSecurityPolicy/report-blocked-file-uri.html
527
528         * page/ContentSecurityPolicy.cpp:
529         (WebCore::stripURLForUseInReport):
530             Extract the logic from blockedURI out into a reusable method:
531             cross-origin URLs are stripped down to the ASCII serialization of
532             their origin, and non-heirarchical (and 'file:') URLs are stripped
533             down to the ASCII serialization of their protocol.
534         (WebCore::gatherSecurityPolicyViolationEventData):
535         (WebCore::ContentSecurityPolicy::reportViolation):
536             Use ::stripURLForUseInReport for blockedURL and sourceFile
537             attributes in these two methods.
538
539 2013-03-25  Eugene Klyuchnikov  <eustas@chromium.org>
540
541         Web Inspector: Fix JSDocs.
542         https://bugs.webkit.org/show_bug.cgi?id=113025
543
544         Reviewed by Pavel Feldman.
545
546         Next version of JS compiler finds more inconsistencies
547         and ambiguous declarations.
548         Some of them are resolved in this patch.
549
550         * inspector/InjectedScriptSource.js: Fix JSDocs.
551         * inspector/front-end/ConsoleModel.js: Ditto.
552         * inspector/front-end/CookieParser.js: Ditto.
553         * inspector/front-end/FileContentView.js: Ditto.
554         * inspector/front-end/HeapSnapshotView.js: Ditto.
555         * inspector/front-end/IndexedDBModel.js: Ditto.
556         * inspector/front-end/ProfilesPanelDescriptor.js: Ditto.
557         * inspector/front-end/utilities.js: Ditto.
558
559 2013-03-25  Mike West  <mkwst@chromium.org>
560
561         Cleanup: Tiny nits in ContentSecurityPolicy::reportViolation.
562         https://bugs.webkit.org/show_bug.cgi?id=112784
563
564         Reviewed by Jochen Eisinger.
565
566         Just cleanup of three tiny nits I ran across in
567         ContentSecurityPolicy::reportViolation while doing other work.
568
569         - 'directiveText' and 'effectiveDirective' can't be empty; we pass in
570           values at every callsite. We can safely remove the 'isEmpty()' checks.
571           Moreover, even if they could possibly somehow be empty, we should
572           still include those empty strings in the report, rather than
573           dropping the values entirely.
574
575         - We don't need to hold 'document->referrer()' in a temp variable.
576
577         * page/ContentSecurityPolicy.cpp:
578         (WebCore::ContentSecurityPolicy::reportViolation):
579
580 2013-03-25  Eugene Klyuchnikov  <eustas@chromium.org>
581
582         Web Inspector: [Overview] Make "drag-to-move" feature more discoverable.
583         https://bugs.webkit.org/show_bug.cgi?id=113032
584
585         Reviewed by Pavel Feldman.
586
587         To move overview window user could drag-n-drop over
588         time "ribbon" on OverviewGrid.
589
590         This feature is hard to discover.
591
592         Setting "move" cursor will make this feature more discoverable.
593
594         * inspector/front-end/inspectorCommon.css:
595         Set "move" cursor to draggable area.
596         * inspector/front-end/OverviewGrid.js: Ditto.
597
598 2013-03-25  Eugene Klyuchnikov  <eustas@chromium.org>
599
600         Web Inspector: [Profiles] Remove unused private member.
601         https://bugs.webkit.org/show_bug.cgi?id=113015
602
603         Reviewed by Pavel Feldman.
604
605         _profileGroupsForLinks is not used anymore.
606
607         * inspector/front-end/ProfilesPanel.js:
608         (WebInspector.ProfilesPanel.prototype._reset): Removed unused member.
609
610 2013-03-25  PhistucK  <phistuck@chromium.org>
611
612         Web Inspector: Exception when turning on pretty print without any displayed source in the editor
613         https://bugs.webkit.org/show_bug.cgi?id=113136
614
615         Reviewed by Vsevolod Vlasov.
616
617         No new tests.
618         Added a check for the existence of currently edited document.
619
620         * inspector/ScriptsPanel.js:
621         (WebInspector.ScriptsPanel.prototype._toggleFormatSource):
622
623 2013-03-25  Mihnea Ovidenie  <mihnea@adobe.com>
624
625         [CSSRegions] Remove RenderRegion::printRegionObjectsStyles
626         https://bugs.webkit.org/show_bug.cgi?id=113081
627
628         Reviewed by Tony Chang.
629
630         No change in functionality, remove unused function..
631
632         * rendering/RenderRegion.h:
633
634 2013-03-25  Hurnjoo Lee  <hurnjoo.lee@samsung.com>
635
636         [Texmap] Memory leak when closing a tab
637         https://bugs.webkit.org/show_bug.cgi?id=112127
638
639         Reviewed by Noam Rosenthal.
640
641         When closing a tab, if there are any updates pending in CoordinatedGraphicsScene's
642         render queue, the scene is not freed because reference count of m_scene is not zero.
643
644         No new tests.
645
646         * platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.cpp:
647         (WebCore::CoordinatedGraphicsScene::detach): When bind updates in CoordinatedGraphicsScene,
648         the reference count of m_scene is increasing, if m_renderQueue is not empty
649         before closing tab, then m_scene is never freed.
650         Hence, when closing tab, need to clear m_renderQueue explicitly in order to
651         destroy m_scene.
652
653 2013-03-25  Keishi Hattori  <keishi@webkit.org>
654
655         Clear button visibility is not updated when restoring form state
656         https://bugs.webkit.org/show_bug.cgi?id=113172
657
658         Clear button wasn't showing up when restoring form state.
659
660         Reviewed by Kent Tamura.
661
662         Tests: fast/forms/date-multiple-fields/date-multiple-fields-clearbutton-visibility-after-restore.html
663                fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-clearbutton-visibility-after-restore.html
664                fast/forms/month-multiple-fields/month-multiple-fields-clearbutton-visibility-after-restore.html
665                fast/forms/time-multiple-fields/time-multiple-fields-clearbutton-visibility-after-restore.html
666                fast/forms/week-multiple-fields/week-multiple-fields-clearbutton-visibility-after-restore.html
667
668         * html/BaseMultipleFieldsDateAndTimeInputType.cpp:
669         (WebCore::BaseMultipleFieldsDateAndTimeInputType::restoreFormControlState):
670
671 2013-03-25  Eugene Klyuchnikov  <eustas@chromium.org>
672
673         Web Inspector: [Settings] Use registry to track settings objects.
674         https://bugs.webkit.org/show_bug.cgi?id=113008
675
676         Reviewed by Pavel Feldman.
677
678         Currently .createSetting creates new instance any time it is invoked.
679         When one instance saves value, the other instance do not know about it.
680
681         To resolve this issue we can use registry to make .createSetting return
682         same object for specific key.
683
684         * inspector/front-end/Settings.js:
685         (WebInspector.Settings.prototype.createSetting): Use registry.
686
687 2013-03-24  Matt Falkenhagen  <falken@chromium.org>
688
689         Refactoring: Pull Node::disabled() and Node::isInert() down to Element.
690         https://bugs.webkit.org/show_bug.cgi?id=112085
691
692         Reviewed by Hajime Morrita.
693
694         Node is too low a level for these methods. The plan is to rename
695         Element::disabled to isDisabledFormControl and to remove
696         Element::isEnabledFormControl.
697
698         No new tests, just refactoring.
699
700         * dom/Element.cpp:
701         (WebCore::Element::disabled):
702         (WebCore):
703         (WebCore::Element::isInert):
704         * dom/Element.h:
705         (Element):
706         * dom/EventDispatcher.cpp:
707         (WebCore::EventDispatcher::dispatchSimulatedClick):
708         * dom/GestureEvent.cpp:
709         (WebCore::GestureEventDispatchMediator::dispatchEvent):
710         * dom/MouseEvent.cpp:
711         (WebCore::MouseEventDispatchMediator::dispatchEvent):
712         * dom/Node.cpp:
713         (WebCore::Node::handleLocalEvents):
714         (WebCore::Node::willRespondToMouseMoveEvents):
715         (WebCore::Node::willRespondToMouseClickEvents):
716         (WebCore::Node::willRespondToTouchEvents):
717         * dom/Node.h:
718         (Node):
719
720 2013-03-24  Alpha Lam  <hclam@chromium.org>
721
722         GIFImageReader should reports parsing error to client
723         https://bugs.webkit.org/show_bug.cgi?id=113141
724
725         Reviewed by Stephen White.
726
727         GIFImageReader nows reports parsing error to client (GIFImageDecoder) such that errors can be handled.
728         In the case of corrupted GIF images GIFImageReader will be deleted and decoding will fail.
729
730         Unit test is updated to reflect change in behavior.
731         Tested with a local corpus which showed better handling of corrupted GIF images.
732
733         * platform/image-decoders/gif/GIFImageReader.cpp:
734         (GIFImageReader::decode):
735
736 2013-03-24  KondapallyKalyan  <kalyan.kondapally@intel.com>
737
738         [EFL] Add support to check for current Drawable.
739         https://bugs.webkit.org/show_bug.cgi?id=113103
740
741         Reviewed by Kenneth Rohde Christiansen.
742
743         Covered by existing WebGL tests.
744
745         In MakeCurrent we do an early return if it is
746         the current GL context but ignore Surface. This
747         patch fixes the issue, we now check for both
748         context and surface before doing an early return
749         in MakeCurrent.
750
751         * platform/graphics/opengl/GLPlatformContext.cpp:
752         (WebCore::GLPlatformContext::makeCurrent):
753         (WebCore::GLPlatformContext::releaseCurrent):
754         (WebCore::GLPlatformContext::destroy):
755         * platform/graphics/opengl/GLPlatformSurface.cpp:
756         (WebCore):
757         (WebCore::GLPlatformSurface::isCurrentDrawable):
758         (WebCore::GLPlatformSurface::onMakeCurrent):
759         * platform/graphics/opengl/GLPlatformSurface.h:
760
761 2013-03-24  David Kilzer  <ddkilzer@apple.com>
762
763         BUILD FIX (r146704): Settings::setHiddenPageDOMTimerThrottlingEnabled() isn't always built
764         <http://webkit.org/b/112308>
765
766         * WebCore.exp.in: Export
767         Settings::setHiddenPageDOMTimerThrottlingEnabled()
768         conditionally based on ENABLE(HIDDEN_PAGE_DOM_TIMER_THROTTLING).
769
770 2013-03-24  Christophe Dumez  <ch.dumez@sisa.samsung.com>
771
772         [EFL] NetworkStateNotifier::updateState() is called too often
773         https://bugs.webkit.org/show_bug.cgi?id=113152
774
775         Reviewed by Kenneth Rohde Christiansen.
776
777         Wait until we have read all the data on the Netlink socket before
778         reporting a possible network interface change. This way, we make
779         sure we don't call NetworkStateNotifier::updateState() several
780         times in a row for no reason.
781
782         We also call NetworkStateNotifier::updateState() only if we get a
783         RTM_NEWADDR event and we are currently offline, or if we get a
784         RTM_DELADDR and we are currently online. This avoids calling
785         NetworkStateNotifier::updateState() uselessly as there is no way
786         the online state can change otherwise.
787
788         No new tests, no behavior change for layout tests.
789
790         * platform/network/efl/NetworkStateNotifierEfl.cpp:
791         (WebCore::NetworkStateNotifier::readSocketCallback):
792
793 2013-03-24  Chris Fleizach  <cfleizach@apple.com>
794
795         AX: Crash in WebCore::AccessibilitySpinButton::incrementButton()
796         https://bugs.webkit.org/show_bug.cgi?id=111582
797
798         Reviewed by Tim Horton.
799
800         There are two ways to create a spin button: from a textfield counter or from ARIA.
801         If an ARIA spin button is created, it was returning true for isSpinButton, so we were 
802         casting to the other kind of spin button, leading to a crash.
803
804         We need to be more specific about our class types.
805
806         Test: platform/mac/accessibility/aria-spinbutton-crash.html
807
808         * accessibility/AccessibilityObject.h:
809         (WebCore::AccessibilityObject::isNativeSpinButton):
810         * accessibility/AccessibilitySpinButton.h:
811         (WebCore::AccessibilitySpinButton::isNativeSpinButton):
812         (WebCore::toAccessibilitySpinButton):
813         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
814         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
815
816 2013-03-24  Chris Fleizach  <cfleizach@apple.com>
817
818         AXObjectCache gets recreated during document tear-down.
819         https://bugs.webkit.org/show_bug.cgi?id=112525
820
821         Reviewed by Simon Fraser.
822
823         In many cases, a document's AXObjectCache was being created after the
824         document had detached, which is wasteful and could potentially lead to
825         crashes because the AXObjectCache has a timer and relies on its document
826         to exist.
827
828         This patch provides a way to get the existing AX object cache, instead of
829         always creating a new one.
830         It moves the accessibilityEnabled() checks into the axObjectCache retrieval
831         for easier readability.
832         It adds a number of ASSERTs to vieryf that only the correct (top) document is used
833         for cache manipulation.
834
835         * accessibility/AXObjectCache.cpp:
836         (WebCore::AXObjectCache::stopCachingComputedObjectAttributes):
837         * dom/ContainerNode.cpp:
838         (WebCore::ContainerNode::~ContainerNode):
839         * dom/Document.cpp:
840         (WebCore::Document::~Document):
841         (WebCore::Document::clearAXObjectCache):
842         (WebCore::Document::existingAXObjectCache):
843         (WebCore::Document::axObjectCache):
844         (WebCore::Document::setFocusedNode):
845         * dom/Document.h:
846         (Document):
847         * dom/Element.cpp:
848         (WebCore::Element::attributeChanged):
849         * dom/Node.cpp:
850         (WebCore::Node::~Node):
851         (WebCore::Node::isEditableToAccessibility):
852         (WebCore::Node::attach):
853         (WebCore::Node::rootEditableElement):
854         (WebCore::Node::didMoveToNewDocument):
855         * editing/AppendNodeCommand.cpp:
856         (WebCore::sendAXTextChangedIgnoringLineBreaks):
857         * editing/DeleteFromTextNodeCommand.cpp:
858         (WebCore::DeleteFromTextNodeCommand::doApply):
859         (WebCore::DeleteFromTextNodeCommand::doUnapply):
860         * editing/Editor.cpp:
861         (WebCore::Editor::respondToChangedContents):
862         (WebCore::Editor::markAndReplaceFor):
863         * editing/InsertIntoTextNodeCommand.cpp:
864         (WebCore::InsertIntoTextNodeCommand::doApply):
865         (WebCore::InsertIntoTextNodeCommand::doUnapply):
866         * editing/InsertNodeBeforeCommand.cpp:
867         (WebCore::InsertNodeBeforeCommand::doApply):
868         (WebCore::InsertNodeBeforeCommand::doUnapply):
869         * editing/atk/FrameSelectionAtk.cpp:
870         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
871         * editing/chromium/FrameSelectionChromium.cpp:
872         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
873         * editing/mac/FrameSelectionMac.mm:
874         (WebCore::FrameSelection::notifyAccessibilityForSelectionChange):
875         * html/HTMLInputElement.cpp:
876         (WebCore::HTMLInputElement::setChecked):
877         * html/HTMLSelectElement.cpp:
878         (WebCore::HTMLSelectElement::optionElementChildrenChanged):
879         (WebCore::HTMLSelectElement::setRecalcListItems):
880         * html/HTMLTextFormControlElement.cpp:
881         (WebCore::HTMLTextFormControlElement::setInnerTextValue):
882         * html/InputType.cpp:
883         (WebCore::InputType::applyStep):
884         * html/RangeInputType.cpp:
885         (WebCore::RangeInputType::handleKeydownEvent):
886         * loader/FrameLoader.cpp:
887         (WebCore::FrameLoader::prepareForLoadStart):
888         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
889         * page/FocusController.cpp:
890         (WebCore::FocusController::setInitialFocus):
891         * page/Frame.cpp:
892         (WebCore::Frame::disconnectOwnerElement):
893         * page/FrameView.cpp:
894         (WebCore::FrameView::removeFromAXObjectCache):
895         (WebCore::FrameView::layout):
896         (WebCore::FrameView::scrollToAnchor):
897         (WebCore::FrameView::axObjectCache):
898         * platform/ScrollView.cpp:
899         (WebCore::ScrollView::setHasHorizontalScrollbar):
900         (WebCore::ScrollView::setHasVerticalScrollbar):
901         * platform/Scrollbar.cpp:
902         (WebCore::Scrollbar::~Scrollbar):
903         (WebCore):
904         (WebCore::Scrollbar::existingAXObjectCache):
905         * platform/Scrollbar.h:
906         (Scrollbar):
907         * rendering/RenderBlock.cpp:
908         (WebCore::RenderBlock::deleteLineBoxTree):
909         (WebCore::RenderBlock::createRootInlineBox):
910         (WebCore::RenderBlock::createAndAppendRootInlineBox):
911         * rendering/RenderListBox.cpp:
912         (WebCore::RenderListBox::selectionChanged):
913         * rendering/RenderMenuList.cpp:
914         (WebCore::RenderMenuList::addChild):
915         (WebCore::RenderMenuList::didUpdateActiveOption):
916         * rendering/RenderObject.cpp:
917         (WebCore::RenderObject::styleWillChange):
918         (WebCore::RenderObject::willBeDestroyed):
919         * rendering/RenderObjectChildList.cpp:
920         (WebCore::RenderObjectChildList::removeChildNode):
921         (WebCore::RenderObjectChildList::insertChildNode):
922         * rendering/RenderText.cpp:
923         (WebCore::RenderText::setText):
924         * rendering/RenderWidget.cpp:
925         (WebCore::RenderWidget::willBeDestroyed):
926
927 2013-03-23  Mike West  <mkwst@chromium.org>
928
929         Drop full URLs from cross-origin access errors caused by sandboxing.
930         https://bugs.webkit.org/show_bug.cgi?id=113029
931
932         Reviewed by Timothy Hatcher.
933
934         Following up on http://wkbug.com/112042, this patch brings cross-origin
935         access error messages into line with the newly origin-only default
936         message, and changes the error message text to explicitly refer to the
937         missing 'allow-same-origin' sandbox flag that's the root cause of the
938         error.
939
940         * page/DOMWindow.cpp:
941         (WebCore::DOMWindow::crossDomainAccessErrorMessage):
942             Note that we're using the origin of the frames' URLs rather than
943             their actual origin in these messages. This seems like a reasonable
944             thing to do, since we know that at least one of the two origins will
945             be "null" in this scenario.
946
947 2013-03-23  Dominic Mazzoni  <dmazzoni@google.com>
948
949         Implement Web Speech Synthesis for Chromium
950         https://bugs.webkit.org/show_bug.cgi?id=111695
951
952         Reviewed by Adam Barth.
953
954         Straightforward implementation of speech synthesis
955         for Chromium by exposing interfaces for the platform
956         to implement.
957
958         * Modules/speech/SpeechSynthesis.cpp:
959         (WebCore::SpeechSynthesis::boundaryEventOccurred):
960         (WebCore::SpeechSynthesis::didStartSpeaking):
961         (WebCore::SpeechSynthesis::didPauseSpeaking):
962         (WebCore::SpeechSynthesis::didResumeSpeaking):
963         (WebCore::SpeechSynthesis::didFinishSpeaking):
964         (WebCore::SpeechSynthesis::speakingErrorOccurred):
965         (WebCore):
966         * Modules/speech/SpeechSynthesis.h:
967         (SpeechSynthesis):
968         * Modules/speech/SpeechSynthesisUtterance.cpp:
969         (WebCore::SpeechSynthesisUtterance::SpeechSynthesisUtterance):
970         (WebCore):
971         (WebCore::SpeechSynthesisUtterance::~SpeechSynthesisUtterance):
972         (WebCore::SpeechSynthesisUtterance::setVoice):
973         * Modules/speech/SpeechSynthesisUtterance.h:
974         (SpeechSynthesisUtterance):
975         (WebCore::SpeechSynthesisUtterance::text):
976         (WebCore::SpeechSynthesisUtterance::setText):
977         (WebCore::SpeechSynthesisUtterance::lang):
978         (WebCore::SpeechSynthesisUtterance::setLang):
979         (WebCore::SpeechSynthesisUtterance::volume):
980         (WebCore::SpeechSynthesisUtterance::setVolume):
981         (WebCore::SpeechSynthesisUtterance::rate):
982         (WebCore::SpeechSynthesisUtterance::setRate):
983         (WebCore::SpeechSynthesisUtterance::pitch):
984         (WebCore::SpeechSynthesisUtterance::setPitch):
985         (WebCore::SpeechSynthesisUtterance::startTime):
986         (WebCore::SpeechSynthesisUtterance::setStartTime):
987         (WebCore::SpeechSynthesisUtterance::platformUtterance):
988         * Modules/speech/SpeechSynthesisVoice.h:
989         (WebCore::SpeechSynthesisVoice::~SpeechSynthesisVoice):
990         * WebCore.exp.in:
991         * WebCore.gypi:
992         * platform/PlatformSpeechSynthesis.h:
993         (PlatformSpeechSynthesis):
994         * platform/PlatformSpeechSynthesisUtterance.cpp:
995         (WebCore):
996         (WebCore::PlatformSpeechSynthesisUtterance::create):
997         * platform/PlatformSpeechSynthesisUtterance.h:
998         (PlatformSpeechSynthesisUtterance):
999         (WebCore::PlatformSpeechSynthesisUtterance::setClient):
1000         * platform/PlatformSpeechSynthesisVoice.cpp:
1001         (WebCore):
1002         (WebCore::PlatformSpeechSynthesisVoice::create):
1003         (WebCore::PlatformSpeechSynthesisVoice::PlatformSpeechSynthesisVoice):
1004         * platform/PlatformSpeechSynthesisVoice.h:
1005         (PlatformSpeechSynthesisVoice):
1006         (WebCore::PlatformSpeechSynthesisVoice::setVoiceURI):
1007         (WebCore::PlatformSpeechSynthesisVoice::setName):
1008         (WebCore::PlatformSpeechSynthesisVoice::setLang):
1009         (WebCore::PlatformSpeechSynthesisVoice::setLocalService):
1010         (WebCore::PlatformSpeechSynthesisVoice::setIsDefault):
1011         * platform/PlatformSpeechSynthesizer.cpp:
1012         (WebCore::PlatformSpeechSynthesizer::create):
1013         (WebCore::PlatformSpeechSynthesizer::setVoiceList):
1014         (WebCore):
1015         * platform/PlatformSpeechSynthesizer.h:
1016         (WebKit):
1017         (PlatformSpeechSynthesizerClient):
1018         (PlatformSpeechSynthesizer):
1019         * platform/chromium/PlatformSpeechSynthesizerChromium.cpp: Added.
1020         (WebCore):
1021         (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
1022         (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):
1023         (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
1024         (WebCore::PlatformSpeechSynthesizer::speak):
1025         (WebCore::PlatformSpeechSynthesizer::pause):
1026         (WebCore::PlatformSpeechSynthesizer::resume):
1027         (WebCore::PlatformSpeechSynthesizer::cancel):
1028         * platform/chromium/support/WebSpeechSynthesisUtterance.cpp: Added.
1029         (WebKit):
1030         (WebKit::WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance):
1031         (WebKit::WebSpeechSynthesisUtterance::operator=):
1032         (WebKit::WebSpeechSynthesisUtterance::assign):
1033         (WebKit::WebSpeechSynthesisUtterance::reset):
1034         (WebKit::WebSpeechSynthesisUtterance::operator PassRefPtr<PlatformSpeechSynthesisUtterance>):
1035         (WebKit::WebSpeechSynthesisUtterance::operator PlatformSpeechSynthesisUtterance*):
1036         (WebKit::WebSpeechSynthesisUtterance::text):
1037         (WebKit::WebSpeechSynthesisUtterance::lang):
1038         (WebKit::WebSpeechSynthesisUtterance::voice):
1039         (WebKit::WebSpeechSynthesisUtterance::volume):
1040         (WebKit::WebSpeechSynthesisUtterance::rate):
1041         (WebKit::WebSpeechSynthesisUtterance::pitch):
1042         (WebKit::WebSpeechSynthesisUtterance::startTime):
1043         * platform/chromium/support/WebSpeechSynthesisVoice.cpp: Added.
1044         (WebKit):
1045         (WebKit::WebSpeechSynthesisVoice::assign):
1046         (WebKit::WebSpeechSynthesisVoice::reset):
1047         (WebKit::WebSpeechSynthesisVoice::setVoiceURI):
1048         (WebKit::WebSpeechSynthesisVoice::setName):
1049         (WebKit::WebSpeechSynthesisVoice::setLanguage):
1050         (WebKit::WebSpeechSynthesisVoice::setIsLocalService):
1051         (WebKit::WebSpeechSynthesisVoice::setIsDefault):
1052         (WebKit::WebSpeechSynthesisVoice::operator PassRefPtr<WebCore::PlatformSpeechSynthesisVoice>):
1053         * platform/chromium/support/WebSpeechSynthesizerClientImpl.cpp: Added.
1054         (WebCore):
1055         (WebCore::WebSpeechSynthesizerClientImpl::WebSpeechSynthesizerClientImpl):
1056         (WebCore::WebSpeechSynthesizerClientImpl::~WebSpeechSynthesizerClientImpl):
1057         (WebCore::WebSpeechSynthesizerClientImpl::setVoiceList):
1058         (WebCore::WebSpeechSynthesizerClientImpl::didStartSpeaking):
1059         (WebCore::WebSpeechSynthesizerClientImpl::didFinishSpeaking):
1060         (WebCore::WebSpeechSynthesizerClientImpl::didPauseSpeaking):
1061         (WebCore::WebSpeechSynthesizerClientImpl::didResumeSpeaking):
1062         (WebCore::WebSpeechSynthesizerClientImpl::speakingErrorOccurred):
1063         (WebCore::WebSpeechSynthesizerClientImpl::wordBoundaryEventOccurred):
1064         (WebCore::WebSpeechSynthesizerClientImpl::sentenceBoundaryEventOccurred):
1065         * platform/chromium/support/WebSpeechSynthesizerClientImpl.h: Added.
1066         (WebCore):
1067         (WebSpeechSynthesizerClientImpl):
1068         * platform/mac/PlatformSpeechSynthesizerMac.mm:
1069         (-[WebSpeechSynthesisWrapper speakUtterance:WebCore::]):
1070         (-[WebSpeechSynthesisWrapper speechSynthesizer:didFinishSpeaking:]):
1071         (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
1072         (WebCore):
1073         (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):
1074         (WebCore::PlatformSpeechSynthesizer::speak):
1075         * platform/mock/PlatformSpeechSynthesizerMock.cpp:
1076         (WebCore::PlatformSpeechSynthesizerMock::PlatformSpeechSynthesizerMock):
1077         (WebCore::PlatformSpeechSynthesizerMock::speakingFinished):
1078         (WebCore::PlatformSpeechSynthesizerMock::speak):
1079         * platform/mock/PlatformSpeechSynthesizerMock.h:
1080         (PlatformSpeechSynthesizerMock):
1081
1082 2013-03-23  Daniel Cheng  <dcheng@chromium.org>
1083
1084         [Qt] editing/pasteboard/can-read-in-dragstart-event.html and /can-read-in-copy-and-cut-events.html are crashing
1085         https://bugs.webkit.org/show_bug.cgi?id=113126
1086
1087         Reviewed by Ryosuke Niwa.
1088
1089         The ClipboardQt implementation only allows reading or writing, not both. Attempting to read
1090         when the clipboard is only writable will lead to a crash since the corresponding member will
1091         be null. To prevent crashes, change the asserts to early returns. In the long term, the
1092         correct fix is to unify the m_readableData and m_writableData members.
1093
1094         No new tests since no functionality in Qt port should change.
1095
1096         * platform/qt/ClipboardQt.cpp:
1097         (WebCore::ClipboardQt::getData):
1098         (WebCore::ClipboardQt::types):
1099         (WebCore::ClipboardQt::files):
1100
1101 2013-03-23  Carlos Garcia Campos  <cgarcia@igalia.com>
1102
1103         [GTK][Regression] webkit_dom_html_table_element_insert_row returns value that doesn't pass WEBKIT_DOM_IS_HTML_TABLE_ROW_ELEMENT macro
1104         https://bugs.webkit.org/show_bug.cgi?id=111714
1105
1106         Reviewed by Martin Robinson.
1107
1108         Add custom kit implementation for HTMLElements so that the HTML
1109         wrappers are used in that case instead of wrapHTMLElement.
1110
1111         * bindings/gobject/WebKitDOMBinding.cpp:
1112         (WebKit::kit):
1113         (WebKit):
1114         * bindings/gobject/WebKitDOMBinding.h:
1115         (WebCore):
1116         (WebKit):
1117         * bindings/scripts/CodeGeneratorGObject.pm:
1118         (UsesManualKitImplementation):
1119
1120 2013-03-23  David Kilzer  <ddkilzer@apple.com>
1121
1122         Revert "BUILD FIX (r146667): ResourceRequest constructor in SynchronousLoaderClient.cpp is ambiguous on iOS"
1123
1124         This is platform-agnositic code, so the previous solution won't work.
1125
1126         * platform/network/SynchronousLoaderClient.cpp:
1127         (WebCore::SynchronousLoaderClient::willSendRequest):
1128
1129 2013-03-23  David Kilzer  <ddkilzer@apple.com>
1130
1131         BUILD FIX (r146667): ResourceRequest constructor in SynchronousLoaderClient.cpp is ambiguous on iOS
1132
1133         Fixes the following build failure:
1134
1135             Source/WebCore/platform/network/SynchronousLoaderClient.cpp:52:15: error: conversion from 'int' to 'const WebCore::ResourceRequest' is ambiguous
1136                 request = 0;
1137                           ^
1138             In file included from Source/WebCore/platform/network/SynchronousLoaderClient.cpp:30:
1139             In file included from Source/WebCore/platform/network/ResourceHandle.h:37:
1140             In file included from Source/WebCore/platform/network/ios/QuickLook.h:13:
1141             Source/WebCore/platform/network/cf/ResourceRequest.h:79:9: note: candidate constructor
1142                     ResourceRequest(NSURLRequest *);
1143                     ^
1144             Source/WebCore/platform/network/cf/ResourceRequest.h:83:9: note: candidate constructor
1145                     ResourceRequest(CFURLRequestRef cfRequest)
1146                     ^
1147             1 error generated.
1148
1149         * platform/network/SynchronousLoaderClient.cpp:
1150         (WebCore::SynchronousLoaderClient::willSendRequest): If
1151         USE(CFNETWORK) is defined, use static_cast<CFURLRequestRef>(0),
1152         otherwise use static_cast<NSURLRequest *>(0).
1153
1154 2013-03-23  David Kilzer  <ddkilzer@apple.com>
1155
1156         BUILD FIX (r146687): setDefaultMIMEType() is unused in ResourceHandleCFNet.cpp on iOS
1157
1158         Fixes the following build failure:
1159
1160             Source/WebCore/platform/network/cf/ResourceHandleCFNet.cpp:98:13: error: unused function 'setDefaultMIMEType' [-Werror,-Wunused-function]
1161             static void setDefaultMIMEType(CFURLResponseRef response)
1162                         ^
1163             1 error generated.
1164
1165         * platform/network/cf/ResourceHandleCFNet.cpp:
1166         (WebCore::setDefaultMIMEType): Add #if !PLATFORM(MAC)/#endif
1167         guard.
1168
1169 2013-03-21  Kiran Muppala  <cmuppala@apple.com>
1170
1171         Add runtime setting for hidden page DOM timer throttling and CSS animation suspension
1172         https://bugs.webkit.org/show_bug.cgi?id=112308
1173
1174         Reviewed by Gavin Barraclough.
1175
1176         No new tests.  Only adding settings to enable/disable existing features
1177         and hence existing tests suffice.
1178
1179         * WebCore.exp.in:
1180         * page/Page.cpp:
1181         (WebCore::Page::setVisibilityState): Check if DOM timer throttling
1182         and CSS animation suspension are enabled before turning them on.
1183         (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged): Start or stop
1184         DOM timer throttling based on page visibility and the new setting state.
1185         (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged): Ditto
1186         for CSS animation suspension.
1187         * page/Page.h:
1188         * page/Settings.cpp:
1189         (WebCore::Settings::Settings): Initialize the flags for enabling hidden
1190         page DOM timer throttling and CSS animation suspension to false.
1191         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled): Update flag
1192         and notify page that the state of the setting has changed.
1193         (WebCore::Settings::setHiddenPageCSSAnimationSuspensionEnabled): Ditto.
1194         * page/Settings.h:
1195         (WebCore::Settings::hiddenPageDOMTimerThrottlingEnabled):
1196         (WebCore::Settings::hiddenPageCSSAnimationSuspensionEnabled):
1197
1198 2013-03-22  Benjamin Poulain  <bpoulain@apple.com>
1199
1200         Remove 2 bad branches from StringHash::equal() and CaseFoldingHash::equal()
1201         https://bugs.webkit.org/show_bug.cgi?id=113003
1202
1203         Reviewed by Eric Seidel.
1204
1205         Fix two unfortunate use of StringHash and use the correct StringImpl function.
1206
1207         * html/parser/HTMLParserIdioms.cpp:
1208         (WebCore::threadSafeEqual):
1209         * html/parser/HTMLTreeBuilderSimulator.cpp:
1210         (WebCore::tokenExitsSVG):
1211
1212 2013-03-22  Andy Estes  <aestes@apple.com>
1213
1214         Set the cache partition property on CFURLRequests
1215         https://bugs.webkit.org/show_bug.cgi?id=113116
1216
1217         Patch by Jeffrey Pfau
1218         Reviewed by David Kilzer.
1219
1220         * platform/network/cf/ResourceRequestCFNet.cpp:
1221         (WebCore::ResourceRequest::doUpdatePlatformRequest):
1222         (WebCore::ResourceRequest::doUpdateResourceRequest):
1223
1224 2013-03-22  Julien Chaffraix  <jchaffraix@webkit.org>
1225
1226         [CSS Grid Layout] content-sized row tracks with percentage logical height grid items don't resolve properly
1227         https://bugs.webkit.org/show_bug.cgi?id=113085
1228
1229         Reviewed by Tony Chang.
1230
1231         The core issue is that because overrideContainingBlockLogicalHeight() is unset in
1232         logicalContentHeightForChild, RenderBox::computePercentageLogicalHeight would try to
1233         resolve percentage logical height against the grid element (wrong containing block
1234         as a grid item's containing block is the grid area).
1235
1236         Tests: fast/css-grid-layout/grid-item-multiple-minmax-content-resolution.html
1237                fast/css-grid-layout/grid-item-with-percent-height-in-auto-height-grid-resolution.html
1238
1239         * rendering/RenderGrid.cpp:
1240         (WebCore::RenderGrid::logicalContentHeightForChild):
1241         Set our override logical height to -1, so that we don't try to constrain a grid item's logical height
1242         based on resolving (badly) its percentage.
1243
1244 2013-03-19  Zhenyao Mo  <zmo@google.com>
1245
1246         Check WEBGL_draw_buffers requirements before exposing the extension
1247         https://bugs.webkit.org/show_bug.cgi?id=112359
1248
1249         Reviewed by Kenneth Russell.
1250
1251         * html/canvas/EXTDrawBuffers.cpp:
1252         (WebCore::EXTDrawBuffers::supported): call satisfies*().
1253         (WebCore::EXTDrawBuffers::drawBuffersEXT):
1254         (WebCore):
1255         (WebCore::EXTDrawBuffers::satisfiesWebGLRequirements): check WebGL requirements.
1256         * html/canvas/EXTDrawBuffers.h:
1257         (EXTDrawBuffers):
1258         * html/canvas/WebGLFramebuffer.cpp:
1259         (WebCore::WebGLFramebuffer::getDrawBuffer):
1260         (WebCore):
1261         * html/canvas/WebGLFramebuffer.h:
1262         (WebGLFramebuffer):
1263         * html/canvas/WebGLRenderingContext.cpp:
1264         (WebCore):
1265         (WebCore::WebGLRenderingContext::initializeNewContext):
1266         (WebCore::WebGLRenderingContext::getExtension):
1267         (WebCore::WebGLRenderingContext::getParameter):
1268         (WebCore::WebGLRenderingContext::getSupportedExtensions):
1269         (WebCore::WebGLRenderingContext::validateFramebufferFuncParameters):
1270         (WebCore::WebGLRenderingContext::getMaxDrawBuffers):
1271         (WebCore::WebGLRenderingContext::getMaxColorAttachments):
1272         (WebCore::WebGLRenderingContext::setBackDrawBuffer):
1273         (WebCore::WebGLRenderingContext::restoreCurrentFramebuffer):
1274         (WebCore::WebGLRenderingContext::restoreCurrentTexture2D):
1275         (WebCore::WebGLRenderingContext::supportsDrawBuffers): a cached version of EXTDrawBuffers::supports()
1276         * html/canvas/WebGLRenderingContext.h:
1277         (WebGLRenderingContext):
1278
1279 2013-03-22  Roger Fong  <roger_fong@apple.com>
1280
1281         Unreviewed. Fix AppleWin port following https://bugs.webkit.org/show_bug.cgi?id=113100.
1282         Patch by Alexey Proskuryakov.
1283
1284         * platform/network/cf/ResourceHandleCFNet.cpp:
1285         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
1286
1287 2013-03-22  Tony Chang  <tony@chromium.org>
1288
1289         REGRESSION (r146272): layout issues for flex boxes that have -webkit-flex-wrap: wrap
1290         https://bugs.webkit.org/show_bug.cgi?id=113071
1291
1292         Reviewed by Ojan Vafai.
1293
1294         The refactor in r139535 introduced this bug, where a variable name wasn't updated properly.
1295         In combination with r146272, this bug became more visible when nesting multiline flexboxen.
1296
1297         Test: css3/flexbox/multiline-min-preferred-width.html
1298
1299         * rendering/RenderFlexibleBox.cpp:
1300         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths): We want the width of the widest
1301         flexitem, the value in m_minPreferredWidth isn't relevant. Also update the comment for max
1302         preferred width.
1303
1304 2013-03-22  Max Vujovic  <mvujovic@adobe.com>
1305
1306         [CSS Shaders] Clamp css_MixColor before the blending and compositing steps
1307         https://bugs.webkit.org/show_bug.cgi?id=113088
1308
1309         Reviewed by Dean Jackson.
1310
1311         The blending and compositing operations from the spec [1] expect that they are operating on
1312         valid color inputs, in the range [0.0, 1.0]. Thus, we should clamp the css_MixColor input to
1313         this range to avoid implementation-dependent behavior for invalid color inputs.
1314
1315         [1]: https://dvcs.w3.org/hg/FXTF/rawfile/tip/compositing/index.html#blending
1316
1317         Tests: css3/filters/custom/custom-filter-clamp-css-mix-color-negative.html
1318                css3/filters/custom/custom-filter-clamp-css-mix-color.html
1319
1320         * platform/graphics/filters/CustomFilterValidatedProgram.cpp:
1321         (WebCore::CustomFilterValidatedProgram::rewriteMixFragmentShader):
1322             Clamp css_MixColor as clampedMixColor before using it in the blending and compositing
1323             steps.
1324
1325 2013-03-19  Martin Robinson  <mrobinson@igalia.com>
1326
1327         [GTK] Add WebCoreDOM to the gyp build
1328         https://bugs.webkit.org/show_bug.cgi?id=112737
1329
1330         Reviewed by Nico Weber.
1331
1332         * WebCore.gyp/WebCoreGTK.gyp: Add WebCoreDOM to the gyp build.
1333
1334 2013-03-19  Martin Robinson  <mrobinson@igalia.com>
1335
1336         [GTK] Add WebCoreHTML to the gyp build
1337         https://bugs.webkit.org/show_bug.cgi?id=112727
1338
1339         Reviewed by Nico Weber.
1340
1341         * WebCore.gyp/WebCoreGTK.gyp: Add support for building all files under
1342         the HTML directory. This includes splitting off common WebCore dependencies
1343         into an aggregate target and adding a top-level WebCore target.
1344
1345 2013-03-22  Tim Horton  <timothy_horton@apple.com>
1346
1347         Plugin Snapshotting: Auto-start dominant plugins
1348         https://bugs.webkit.org/show_bug.cgi?id=113111
1349         <rdar://problem/13475726>
1350
1351         Reviewed by Dean Jackson.
1352
1353         * html/HTMLPlugInElement.cpp:
1354         (WebCore::HTMLPlugInElement::defaultEventHandler):
1355         Acknowledge the new "Restarting" DisplayState.
1356         * html/HTMLPlugInElement.h:
1357         Rename PlayingWithPendingMouseClick to RestartingWithPendingMouseClick for accuracy.
1358         Add "Restarting" DisplayState, so we can be aware that the plugin is intentionally restarting and not re-snapshot it.
1359         * html/HTMLPlugInImageElement.cpp:
1360         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Remove m_isPrimarySnapshottedPlugIn.
1361         (WebCore::classNameForShadowRoot): Remove m_isPrimarySnapshottedPlugIn.
1362         (WebCore::HTMLPlugInImageElement::setIsPrimarySnapshottedPlugIn): Restart the plugin when it becomes primary.
1363         (WebCore::HTMLPlugInImageElement::updateSnapshotInfo): Remove m_isPrimarySnapshottedPlugIn.
1364         (WebCore::HTMLPlugInImageElement::restartSnapshottedPlugIn):
1365         Move the plugin to Restarting unless it's already marked as PendingMouseClick.
1366         (WebCore::HTMLPlugInImageElement::simulatedMouseClickTimerFired): Match the PlayingWithPendingMouseClick rename.
1367         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Don't snapshot if we're restarting.
1368         * html/HTMLPlugInImageElement.h: Remove m_isPrimarySnapshottedPlugIn.
1369         * rendering/RenderSnapshottedPlugIn.cpp:
1370         (WebCore::RenderSnapshottedPlugIn::paint): Acknowledge the new "Restarting" DisplayState.
1371         (WebCore::RenderSnapshottedPlugIn::getCursor): Acknowledge the new "Restarting" DisplayState.
1372         (WebCore::RenderSnapshottedPlugIn::handleEvent): Match the PlayingWithPendingMouseClick rename.
1373
1374 2013-03-19  Martin Robinson  <mrobinson@igalia.com>
1375
1376         [GTK] Add support for building the WebCore bindings to the gyp build
1377         https://bugs.webkit.org/show_bug.cgi?id=112638
1378
1379         Reviewed by Nico Weber.
1380
1381         Add targets, actions, and rules for building the WebCore bindings. This is
1382         the first part of the WebCoreGTK build.
1383
1384         * WebCore.gyp/ConvertFileToHeaderWithCharacterArray.gypi: Added.
1385         * WebCore.gyp/MakeNames.gypi: Added.
1386         * WebCore.gyp/WebCoreGTK.gyp: Added WebCore bindings build. This has been adapted
1387         from the Chromium build.
1388         * WebCore.gypi: Updated list of derived sources files and added a parameter
1389         for adjusting the location of the built files. We don't want to force the
1390         Mac build to change, but we'd still like to reuse the scripts that the
1391         Chromium build uses.
1392
1393 2013-03-22  Dane Wallinga  <dgwallinga@chromium.org>
1394
1395         Add client callbacks to notify of changes of associated from controls
1396         https://bugs.webkit.org/show_bug.cgi?id=110375
1397
1398         Reviewed by Ryosuke Niwa.
1399
1400         Hook FormAssociatedElement, HTMLFormElement to notify EditorClient of form changes after a page has loaded.
1401         Will be used to add autofill support for ajax-y webpages. e.g if while filling out a form, new fields
1402         are dynamically created, autofill can know to re-query the autofill server and keep going.
1403         https://bugs.webkit.org/show_bug.cgi?id=110375
1404
1405         * dom/Document.cpp:
1406         (WebCore::Document::Document):
1407         (WebCore::Document::didAssociateFormControl):
1408         (WebCore):
1409         (WebCore::Document::didAssociateFormControlsTimerFired):
1410         * dom/Document.h:
1411         (Document):
1412         added method didAssociateFormControl, which batches form changes
1413         and calls out to ChromeClient on a timer.
1414         * html/FormAssociatedElement.cpp:
1415         (WebCore::FormAssociatedElement::resetFormOwner):
1416         (WebCore::FormAssociatedElement::formAttributeChanged):
1417         (WebCore):
1418         * html/FormAssociatedElement.h:
1419         (FormAssociatedElement):
1420         add calls to Document::didAssociateFormControl when form changes
1421         * html/HTMLFormElement.cpp:
1422         (WebCore::HTMLFormElement::insertedInto):
1423         (WebCore):
1424         * html/HTMLFormElement.h:
1425         add call to Document::didAssociateFormControl
1426         * loader/EmptyClients.h:
1427         (EmptyChromeClient):
1428         (WebCore::EmptyChromeClient::didAssociateFormControls):
1429         (WebCore::EmptyChromeClient::shouldNotifyOnFormChanges):
1430         * page/ChromeClient.h:
1431         (ChromeClient):
1432         add new method didAssociateFormControls
1433
1434 2013-03-22  Alexey Proskuryakov  <ap@apple.com>
1435
1436         Split ResourceHandleMac into multiple files
1437         https://bugs.webkit.org/show_bug.cgi?id=113100
1438
1439         Reviewed by Geoff Garen.
1440
1441         It's grown too big to navigate, and I'm going to make WebCoreResourceHandleAsDelegate
1442         substantially more complicated yet.
1443
1444         1. Mechanically moved WebCoreResourceHandleAsDelegate into separate files.
1445         2. Refactored WebCoreSynchronousLoaderClient to be cross-platform, and moved it into
1446         separate files.
1447
1448         * WebCore.vcproj/WebCore.vcproj:
1449         * WebCore.vcxproj/WebCore.vcxproj:
1450         * WebCore.vcxproj/WebCore.vcxproj.filters:
1451         * WebCore.xcodeproj/project.pbxproj:
1452         * platform/network/SynchronousLoaderClient.cpp: Added.
1453         * platform/network/SynchronousLoaderClient.h: Added.
1454         * platform/network/cf/ResourceHandleCFNet.cpp:
1455         * platform/network/mac/SynchronousLoaderClient.mm: Added.
1456         * platform/network/mac/WebCoreResourceHandleAsDelegate.h: Added.
1457         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm: Added.
1458
1459 2013-03-21  Geoffrey Garen  <ggaren@apple.com>
1460
1461         Added a setting for whether JavaScript markup is enabled
1462         https://bugs.webkit.org/show_bug.cgi?id=112999
1463
1464         Reviewed by Maciej Stachowiak.
1465
1466         This setting is useful for clients that want protection from script
1467         injection attacks.
1468
1469         * page/Settings.h:
1470         (Settings): Clarified which clients should call canExecuteScripts().
1471
1472         * page/Settings.in: Added the new setting.
1473
1474 2013-03-22  Roger Fong  <roger_fong@apple.com>
1475
1476         Unreviewed build fix.
1477
1478         * bindings/scripts/preprocessor.pm:
1479         (applyPreprocessor):
1480
1481 2013-03-22  Roger Fong  <roger_fong@apple.com>
1482
1483         Unreviewed. Force kill gcc-3.exe during bindings generation tests to avoid process hangs.
1484
1485         This problem is occuring on the WinEWS bots where there are somehow multiple gcc-3 processes existing at the same time.
1486         This is a speculative fix. There should only be 1 gcc-3.exe process running at a time ever.
1487
1488         * bindings/scripts/preprocessor.pm:
1489         (applyPreprocessor):
1490
1491 2013-03-22  Eric Carlson  <eric.carlson@apple.com>
1492
1493         Cleanup text track selection logic
1494         https://bugs.webkit.org/show_bug.cgi?id=113062
1495
1496         Reviewed by Jer Noble.
1497
1498         No new tests, covered by existing tests.
1499
1500         * html/HTMLMediaElement.cpp:
1501         (WebCore::HTMLMediaElement::userIsInterestedInThisTrackKind): Remove.
1502         (WebCore::HTMLMediaElement::configureTextTrackGroup): Don't look at track attributes directly,
1503             use captionPreferences->textTrackSelectionScore to calculate track rank.
1504         (WebCore::HTMLMediaElement::setClosedCaptionsVisible): Set m_processingPreferenceChange here
1505             instead of in captionPreferencesChanged.
1506         (WebCore::HTMLMediaElement::captionPreferencesChanged): Don't suppress calls to setClosedCaptionsVisible,
1507             existing code already makes sure we don't do unnecessary work.
1508         * html/HTMLMediaElement.h:
1509
1510         * html/shadow/MediaControlElements.cpp:
1511         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Drive by cleanup, don't
1512             process inactive cues.
1513
1514         * html/shadow/MediaControlsApple.cpp:
1515         (WebCore::MediaControlsApple::changedClosedCaptionsVisibility): Call resetTrackListMenu instead
1516             of updateDisplay so we only mark the menu as needing a recalculation and do the work when
1517             it is displayed.
1518
1519         * page/CaptionUserPreferences.cpp:
1520         (WebCore::CaptionUserPreferences::shouldShowCaptions): When in testing mode, return true if
1521             the caption or subtitle preference has been set.
1522         (WebCore::CaptionUserPreferences::setShouldShowCaptions): In testing mode, clear the caption
1523             and subtitle preference when passed false.
1524         (WebCore::CaptionUserPreferences::textTrackSelectionScore): Calculate the track score based on
1525             track type preference and preferred language.
1526         (WebCore::CaptionUserPreferences::textTrackLanguageSelectionScore): Score a track according to
1527             the language presence and position in the preferred languages list.
1528         * page/CaptionUserPreferences.h:
1529
1530         * page/CaptionUserPreferencesMac.h:
1531         * page/CaptionUserPreferencesMac.mm:
1532         (WebCore::CaptionUserPreferencesMac::textTrackSelectionScore): Calculate track language score 
1533             according to user preferences.
1534
1535         * platform/Language.cpp:
1536         (WebCore::indexOfBestMatchingLanguageInList): Repurposed the static bestMatchingLanguage
1537             function to return the location of a language in a Vector.
1538         (WebCore::preferredLanguageFromList): Removed.
1539         * platform/Language.h:
1540
1541 2013-03-22  ChangSeok Oh  <changseok.oh@collabora.com>
1542
1543         Build fix for TransformationMatrix
1544         https://bugs.webkit.org/show_bug.cgi?id=113087
1545
1546         Reviewed by Martin Robinson.
1547
1548         This is a trivial build fix for clutter ac backend. Clutter AC backend doesn't use
1549         TextureMapper so there is nowhere including TransformationMatrix.h.
1550         For the reason, we include it explicitly.
1551
1552         No new tests because of no functionality change.
1553
1554         * platform/graphics/clutter/GraphicsContext3DPrivate.cpp:
1555         * platform/graphics/clutter/GraphicsContext3DPrivate.h:
1556         (WebCore):
1557
1558 2013-03-22  Steve Block  <steveblock@chromium.org>
1559
1560         Coordinates.idl lacks Conditional=GEOLOCATION
1561         https://bugs.webkit.org/show_bug.cgi?id=112949
1562
1563         Reviewed by Steve Block.
1564
1565         No new tests, build optimization only.
1566
1567         * page/Coordinates.idl: Added GEOLOCATION conditional guard.
1568
1569 2013-03-22  Daniel Cheng  <dcheng@chromium.org>
1570
1571         Data store should be readable in dragstart/copy/cut events
1572         https://bugs.webkit.org/show_bug.cgi?id=23695
1573
1574         Reviewed by Tony Chang.
1575
1576         There were several events where data could be written but not read back due to the fact that
1577         different Clipboard method implementations checked permissions inconsistently. This patch
1578         adds helper methods to check if an operation is permitted on a Clipboard and refactors all
1579         direct comparisons against Clipboard::m_policy to use the new helpers instead. This fixes
1580         several bugs where Clipboard::types and Clipboard::getData are not usable inside the
1581         aforementioned events.
1582
1583         Tests: editing/pasteboard/can-read-in-copy-and-cut-events.html
1584                editing/pasteboard/can-read-in-dragstart-event.html
1585
1586         * dom/Clipboard.cpp:
1587         (WebCore::Clipboard::canReadTypes): Formerly restricted to ClipboardReadable and
1588                                             ClipboardTypesReadable; now allows ClipboardWritable as
1589                                             well.
1590         (WebCore::Clipboard::canReadData): Formerly restricted to ClipboardReadable; now allows
1591                                            ClipboardWritable as well.
1592         (WebCore::Clipboard::canWriteData):
1593         (WebCore::Clipboard::canSetDragImage):
1594         (WebCore::Clipboard::hasFileOfType):
1595         (WebCore::Clipboard::hasStringOfType):
1596         (WebCore::Clipboard::setDropEffect):
1597         (WebCore::Clipboard::setEffectAllowed):
1598         * dom/Clipboard.h:
1599         (Clipboard):
1600         * platform/blackberry/ClipboardBlackBerry.cpp:
1601         (WebCore::ClipboardBlackBerry::clearData):
1602         (WebCore::ClipboardBlackBerry::clearAllData):
1603         (WebCore::ClipboardBlackBerry::getData):
1604         (WebCore::ClipboardBlackBerry::setData):
1605         (WebCore::ClipboardBlackBerry::types):
1606         * platform/chromium/ClipboardChromium.cpp:
1607         (WebCore::DataTransferItemPolicyWrapper::kind):
1608         (WebCore::DataTransferItemPolicyWrapper::type):
1609         (WebCore::DataTransferItemPolicyWrapper::getAsString):
1610         (WebCore::DataTransferItemPolicyWrapper::getAsFile):
1611         (WebCore::ClipboardChromium::clearData):
1612         (WebCore::ClipboardChromium::clearAllData):
1613         (WebCore::ClipboardChromium::getData):
1614         (WebCore::ClipboardChromium::setData):
1615         (WebCore::ClipboardChromium::types):
1616         (WebCore::ClipboardChromium::files):
1617         (WebCore::ClipboardChromium::setDragImage):
1618         * platform/gtk/ClipboardGtk.cpp:
1619         (WebCore::ClipboardGtk::clearData):
1620         (WebCore::ClipboardGtk::clearAllData):
1621         (WebCore::ClipboardGtk::getData):
1622         (WebCore::ClipboardGtk::setData):
1623         (WebCore::ClipboardGtk::types):
1624         (WebCore::ClipboardGtk::files):
1625         (WebCore::ClipboardGtk::setDragImage):
1626         * platform/mac/ClipboardMac.mm:
1627         (WebCore::ClipboardMac::clearData):
1628         (WebCore::ClipboardMac::clearAllData):
1629         (WebCore::ClipboardMac::getData):
1630         (WebCore::ClipboardMac::setData):
1631         (WebCore::ClipboardMac::types):
1632         (WebCore::ClipboardMac::files):
1633         (WebCore::ClipboardMac::setDragImage):
1634         * platform/qt/ClipboardQt.cpp:
1635         (WebCore::ClipboardQt::clearData):
1636         (WebCore::ClipboardQt::clearAllData):
1637         (WebCore::ClipboardQt::getData):
1638         (WebCore::ClipboardQt::setData):
1639         (WebCore::ClipboardQt::types):
1640         (WebCore::ClipboardQt::files):
1641         (WebCore::ClipboardQt::setDragImage):
1642         (WebCore::ClipboardQt::items):
1643         * platform/qt/DataTransferItemListQt.cpp:
1644         (WebCore::DataTransferItemListQt::length):
1645         (WebCore::DataTransferItemListQt::item):
1646         (WebCore::DataTransferItemListQt::deleteItem):
1647         (WebCore::DataTransferItemListQt::clear):
1648         (WebCore::DataTransferItemListQt::add):
1649         * platform/qt/DataTransferItemQt.cpp:
1650         (WebCore::DataTransferItemQt::getAsString):
1651         * platform/win/ClipboardWin.cpp:
1652         (WebCore::ClipboardWin::clearData):
1653         (WebCore::ClipboardWin::clearAllData):
1654         (WebCore::ClipboardWin::getData):
1655         (WebCore::ClipboardWin::setData):
1656         (WebCore::ClipboardWin::types):
1657         (WebCore::ClipboardWin::files):
1658         (WebCore::ClipboardWin::setDragImage):
1659
1660 2013-03-22  Andrei Bucur  <abucur@adobe.com>
1661
1662         [CSS Regions] Remove pushLayoutState(RenderFlowThread*) from RenderView
1663         https://bugs.webkit.org/show_bug.cgi?id=113084
1664
1665         Reviewed by Dirk Schulze.
1666
1667         Remove void pushLayoutState(RenderFlowThread*, bool regionsChanged) from RenderView.h because it's not used.
1668
1669         Tests: Code cleanup. No tests needed.
1670
1671         * rendering/RenderView.h:
1672         (RenderView):
1673
1674 2013-03-22  Kondapally Kalyan  <kalyan.kondapally@intel.com>
1675
1676         [EFL] Fix build issues to enable CSS Filter and Shaders support.
1677         https://bugs.webkit.org/show_bug.cgi?id=111274
1678
1679         Reviewed by Noam Rosenthal.
1680
1681         This is in preperation to enable CSS Filter and Shaders support.
1682         This patch fixes related build issues to enable the support.
1683
1684         * platform/graphics/surfaces/efl/GLTransportSurface.cpp:
1685         * platform/graphics/texmap/TextureMapper.cpp:
1686         * platform/graphics/texmap/TextureMapper.h:
1687         (WebCore):
1688         * platform/graphics/texmap/TextureMapperGL.cpp:
1689         * platform/graphics/texmap/TextureMapperGL.h:
1690         (WebCore):
1691         * platform/graphics/texmap/TextureMapperShaderProgram.h:
1692
1693 2013-03-22  Matt Falkenhagen  <falken@chromium.org>
1694
1695         Implement isEnabledFormControl() for SliderThumbElement and SpinButtonElement in terms of disabled()
1696         https://bugs.webkit.org/show_bug.cgi?id=112993
1697
1698         Reviewed by Kent Tamura.
1699
1700         This is an intermediate step for refactoring Node::disabled and
1701         Element::isEnabledFormControl. All classes that override
1702         isEnabledFormControl just return !disabled(), except for
1703         SliderThumbElement and SpinButtonElement. This patch changes those two
1704         classes to do so, which shows that the two functions are redundant and
1705         easy to refactor into a single function in a subsequent patch.
1706
1707         No new tests, there should be no behavior change.
1708
1709         * html/shadow/SliderThumbElement.cpp:
1710         (WebCore::SliderThumbElement::disabled):
1711         (WebCore):
1712         (WebCore::SliderThumbElement::isEnabledFormControl):
1713         * html/shadow/SliderThumbElement.h:
1714         (SliderThumbElement):
1715         * html/shadow/SpinButtonElement.h: The check of shadowHost() is
1716         necessary because it can be detached by JavaScript that runs during
1717         event handling (see r76566)
1718
1719 2013-03-22  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1720
1721         [Qt] New fast/text/word-space-with-kerning-3.html fails on Qt.
1722         https://bugs.webkit.org/show_bug.cgi?id=112668
1723
1724         Reviewed by Jocelyn Turcotte.
1725
1726         Qt adds word-spacing to leading spaces, but WebCore only expects
1727         us to add for trailing spaces. We only corrected for this in width
1728         calculation but do need to also do it for drawing.
1729
1730         Instead of subtracting the extra word-spacing we now configure the
1731         FormatRange not to apply to leading spaces. This means this behavior
1732         will be applied everywhere reliably.
1733
1734         * platform/graphics/Font.h:
1735         (Font):
1736         * platform/graphics/qt/FontQt.cpp:
1737         (WebCore::Font::drawComplexText):
1738         (WebCore::Font::floatWidthForComplexText):
1739         (WebCore::Font::offsetForPositionForComplexText):
1740         (WebCore::Font::selectionRectForComplexText):
1741         (WebCore::Font::initFormatForTextLayout):
1742
1743 2013-03-22  Joshua Bell  <jsbell@chromium.org>
1744
1745         REGRESSION (r146540?): Crashes in storage/indexeddb/factory-basics-workers.html, storage/indexeddb/transaction-error.html
1746         https://bugs.webkit.org/show_bug.cgi?id=113019
1747
1748         Reviewed by Tony Chang.
1749
1750         Also manifesting flakily under Chromium's content_shell. It's an ASSERT being hit in
1751         the IDBTransaction destructor. The cause was r146540 which allows a stopped context
1752         to reclaim script wrappers. This allows the IDBTransaction to be deref'd at times where
1753         it previously would have just leaked. Modulate the destructor assertions to account
1754         for this case.
1755
1756         No new tests; failures already manifest as flaky crashes in some ports.
1757
1758         * Modules/indexeddb/IDBTransaction.cpp:
1759         (WebCore::IDBTransaction::~IDBTransaction): If context is stopped, expected state
1760         transitions/cleanup may not have occurred before destructor runs.
1761
1762 2013-03-22  David Grogan  <dgrogan@chromium.org>
1763
1764         IndexedDB: Histogram available disk space on attempt to open database
1765         https://bugs.webkit.org/show_bug.cgi?id=112862
1766
1767         Reviewed by Tony Chang.
1768
1769         ChromeOS suspects they might be hitting disk corruption when the disks
1770         are nearly full. This patch logs the available space to either the
1771         "success" or the "fail" histogram as appropriate so that the
1772         distributions can be compared.
1773
1774         No new tests - I don't know of a good way to test histograms. Local
1775         printf testing didn't turn up any bugs.
1776
1777         * platform/leveldb/LevelDBDatabase.cpp:
1778         (WebCore::HistogramFreeSpace):
1779         (WebCore):
1780         (WebCore::LevelDBDatabase::open):
1781
1782 2013-03-22  Nate Chapin  <japhet@chromium.org>
1783
1784         REGRESSION (r146239): Reproducible crash in WebCore::DocumentLoader::responseReceived.
1785         https://bugs.webkit.org/show_bug.cgi?id=112811
1786
1787         Reviewed by Brady Eidson.
1788
1789         Test: http/tests/cache/x-frame-options-304.html
1790
1791         * loader/DocumentLoader.cpp:
1792         (WebCore::DocumentLoader::responseReceived):
1793         * loader/cache/CachedRawResource.cpp:
1794         (WebCore::CachedRawResource::switchClientsToRevalidatedResource):
1795         * loader/cache/CachedRawResource.h:
1796
1797 2013-03-22  Jer Noble  <jer.noble@apple.com>
1798
1799         REGRESSION: -webkit-box-reflect does not show on video elements
1800         https://bugs.webkit.org/show_bug.cgi?id=112397
1801
1802         Reviewed by Eric Carlson.
1803
1804         Work around the ASSERTs generated when setting an AVPlayerLayer's player property
1805         during a CA flush by setting the player property during the next runloop, outside
1806         of a CA flush.
1807
1808         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1809         (PlatformCALayer::clone):
1810
1811 2013-03-22  peavo@outlook.com  <peavo@outlook.com>
1812
1813         [Curl] Performance fix, avoid loading cookie file on every request.
1814         https://bugs.webkit.org/show_bug.cgi?id=113023
1815
1816         Reviewed by Brent Fulgham.
1817
1818         We currently load the cookie file on every request, and when setting cookies from JavaScript, by using the option CURLOPT_COOKIEFILE.
1819         This is very inefficient as the cookie file can get quite large, and file I/O is slow.
1820         It is sufficient to load the cookie file on startup, as we use a shared cookie database between the requests.
1821
1822         * platform/network/curl/CookieJarCurl.cpp:
1823         (WebCore::setCookiesFromDOM): Avoid loading cookie file when setting cookies from JavaScript.
1824         * platform/network/curl/ResourceHandleManager.cpp:
1825         (WebCore::ResourceHandleManager::initializeHandle): Avoid loading cookie file on every request.
1826         (WebCore::ResourceHandleManager::initCookieSession): Load the cookie file to shared database on startup.
1827
1828 2013-03-22  Tiancheng Jiang  <tijiang@rim.com>
1829
1830         [BlackBerry] Update Input field Background Color
1831         https://bugs.webkit.org/show_bug.cgi?id=113063
1832
1833         Reviewed by George Staikos.
1834
1835         RIM PR 307463.
1836         Internally reviewed by Ed Baker.
1837
1838         * platform/blackberry/RenderThemeBlackBerry.cpp:
1839         (WebCore::RenderThemeBlackBerry::paintTextFieldOrTextAreaOrSearchField):
1840
1841 2013-03-22  Ilya Tikhonovsky  <loislo@chromium.org>
1842
1843         Web Inspector: FlameChart. Draw function names over flame chart bar if they fit into the bar.
1844         https://bugs.webkit.org/show_bug.cgi?id=113052
1845
1846         Reviewed by Vsevolod Vlasov.
1847
1848         The draw function will draw the bar title if the text is less than bar width.
1849         Unfortunately almost all the projects which need to be profiled
1850         use long function names with dots. So if the function name has dots and
1851         doesn't fit into the space then prepareTitle will try to drop the prefix before dot.
1852         If the title has no dots then the function will strip the tail of the title.
1853
1854         * inspector/front-end/FlameChart.js:
1855         (WebInspector.FlameChart):
1856         (WebInspector.FlameChart.prototype.draw):
1857         (WebInspector.FlameChart.prototype._prepareTitle):
1858
1859 2013-03-22  Vladislav Kaznacheev  <kaznacheev@chromium.org>
1860
1861         Web Inspector: Add "hidden" attribute to the recently added APIs in Inspector.json
1862         https://bugs.webkit.org/show_bug.cgi?id=113061
1863
1864         Added "hidden": true to the APIs introduced since version 1.0.
1865
1866         Reviewed by Pavel Feldman.
1867
1868         * inspector/Inspector.json:
1869
1870 2013-03-22  Vsevolod Vlasov  <vsevik@chromium.org>
1871
1872         Web Inspector: Correctly implement scrollToLine, revealLine and setSelection on CodeMirror  editor.
1873         https://bugs.webkit.org/show_bug.cgi?id=113028
1874
1875         Reviewed by Pavel Feldman.
1876
1877         Added focus event handler to CodeMirror editor view elememnt to support inspector's focus model.
1878         Added selection and scroll listeners to correctly save editor scroll and selection in history.
1879         Implemented revealLine, scrollToLine and setSelection.
1880         Note: CodeMirror's coordsChar method does not work correctly in "local" mode, implemented as binary search
1881         as a temporary workaround.
1882
1883         * inspector/front-end/CodeMirrorTextEditor.js:
1884         (WebInspector.CodeMirrorTextEditor):
1885         (WebInspector.CodeMirrorTextEditor.prototype.defaultFocusedElement):
1886         (WebInspector.CodeMirrorTextEditor.prototype._handleElementFocus):
1887         (WebInspector.CodeMirrorTextEditor.prototype.revealLine):
1888         (WebInspector.CodeMirrorTextEditor.prototype._coordsChar):
1889         (WebInspector.CodeMirrorTextEditor.prototype._topScrolledLine):
1890         (WebInspector.CodeMirrorTextEditor.prototype._bottomScrolledLine):
1891         (WebInspector.CodeMirrorTextEditor.prototype._scroll):
1892         (WebInspector.CodeMirrorTextEditor.prototype._selectionChange):
1893         (WebInspector.CodeMirrorTextEditor.prototype.scrollToLine):
1894         (WebInspector.CodeMirrorTextEditor.prototype.setSelection):
1895         (WebInspector.CodeMirrorTextEditor.prototype.copyRange):
1896         * inspector/front-end/TextEditor.js:
1897         (WebInspector.TextEditor.prototype.copyRange):
1898
1899 2013-03-22  Vsevolod Vlasov  <vsevik@chromium.org>
1900
1901         Web Inspector: [Regression] Editor scroll is not restored after inspector reload.
1902         https://bugs.webkit.org/show_bug.cgi?id=113027
1903
1904         Reviewed by Pavel Feldman.
1905
1906         * inspector/front-end/SourceFrame.js:
1907         (WebInspector.SourceFrame.prototype.wasShown):
1908         (WebInspector.SourceFrame.prototype._isEditorShowing):
1909         (WebInspector.SourceFrame.prototype._innerHighlightLineIfNeeded):
1910         (WebInspector.SourceFrame.prototype._innerRevealLineIfNeeded):
1911         (WebInspector.SourceFrame.prototype._innerScrollToLineIfNeeded):
1912         (WebInspector.SourceFrame.prototype._innerSetSelectionIfNeeded):
1913
1914 2013-03-22  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1915
1916         [Qt] Fix build with OPENCL 1.2
1917         https://bugs.webkit.org/show_bug.cgi?id=113056
1918
1919         Reviewed by Kenneth Rohde Christiansen.
1920
1921         Switch qmake checks to the modern style which means we can enable OpenCL with
1922         WEBKIT_CONFIG+=opencl. 
1923
1924         Upgrade OpenCL 1.1 clCreateImage2D to OpenCL 1.2 clCreateImage calls.
1925
1926         * Target.pri:
1927         * WebCore.pri:
1928         * platform/graphics/filters/FilterEffect.cpp:
1929         (WebCore::FilterEffect::createOpenCLImageResult):
1930         * platform/graphics/gpu/opencl/FilterContextOpenCL.cpp:
1931         (WebCore::FilterContextOpenCL::createOpenCLImage):
1932
1933 2013-03-22  ChangSeok Oh  <changseok.oh@collabora.com>
1934
1935         [GTK][AC] Opacity animation doesn't work with clutter backend
1936         https://bugs.webkit.org/show_bug.cgi?id=110347
1937
1938         Reviewed by Gustavo Noronha Silva.
1939
1940         The static casting in ternary operator doesn't change actual inputted argument type.
1941         So I replaced it with if-else statement.
1942
1943         Covered by existing animation tests.
1944
1945         * platform/graphics/clutter/PlatformClutterAnimation.cpp:
1946         (WebCore::PlatformClutterAnimation::addClutterTransitionForProperty):
1947         (WebCore::PlatformClutterAnimation::addClutterKeyframeTransitionForProperty):
1948
1949 2013-03-22  ChangSeok Oh  <changseok.oh@collabora.com>
1950
1951         [GTK][AC] Add removing animations procedure with clutter ac backend
1952         https://bugs.webkit.org/show_bug.cgi?id=110607
1953
1954         Reviewed by Gustavo Noronha Silva.
1955
1956         This changes is based on mac port implementation. The only different thing is
1957         that updateAnimations is called explicitly in destructor of GraphicsLayerClutter
1958         to remove uncommitted animations. Because even though we call notifyFlushRequired
1959         to remove existing animations in removeAnimation(), removeClutterAnimationFromLayer
1960         has been never reached since the root layer is destroyed before. It means
1961         that we haven't lost a change to remove actual animations from clutterActor.
1962
1963         Covered by existing animation tests.
1964
1965         * platform/graphics/clutter/GraphicsLayerClutter.cpp:
1966         (WebCore::GraphicsLayerClutter::~GraphicsLayerClutter):
1967         (WebCore::GraphicsLayerClutter::removeAnimation):
1968         (WebCore):
1969         (WebCore::GraphicsLayerClutter::removeClutterAnimationFromLayer):
1970         * platform/graphics/clutter/GraphicsLayerClutter.h:
1971         (WebCore::GraphicsLayerClutter::animationIsRunning):
1972         (GraphicsLayerClutter):
1973
1974 2013-03-22  Kondapally Kalyan  <kalyan.kondapally@intel.com>
1975
1976         [EFL][WebGL] Optimize AlphaOp for HTMLVideoElement input.
1977         https://bugs.webkit.org/show_bug.cgi?id=113049
1978
1979         Reviewed by Kenneth Rohde Christiansen.
1980
1981         Covered by existing tests.
1982
1983         Changeset 137397 implemented optimisation to avoid any
1984         unnecessary Unmultiply or Premultiply operation in unpack/pack
1985         provided the Image source is from HTMLVideoElement. This patch
1986         enables the same for EFL port.
1987
1988         * platform/graphics/efl/GraphicsContext3DEfl.cpp:
1989         (WebCore::GraphicsContext3D::ImageExtractor::extractImage):
1990
1991 2013-03-22  Tommy Widenflycht  <tommyw@google.com>
1992
1993         Clean up the speech recognintion API
1994         https://bugs.webkit.org/show_bug.cgi?id=112916
1995
1996         Reviewed by Adam Barth.
1997
1998         This patch cleans away deprecated parts, fixes so that stop() can be called more than once and adds
1999         the missing emma attribute on SpeechRecognitionEvent (which is always null).
2000
2001         Patch covered by existing tests.
2002
2003         * Modules/speech/SpeechRecognition.cpp:
2004         (WebCore::SpeechRecognition::stopFunction):
2005         (WebCore::SpeechRecognition::abort):
2006         (WebCore::SpeechRecognition::didEnd):
2007         (WebCore::SpeechRecognition::SpeechRecognition):
2008         * Modules/speech/SpeechRecognition.h:
2009         (SpeechRecognition):
2010         * Modules/speech/SpeechRecognitionEvent.cpp:
2011         (WebCore::SpeechRecognitionEvent::createResult):
2012         (WebCore::SpeechRecognitionEvent::createNoMatch):
2013         (WebCore::SpeechRecognitionEvent::SpeechRecognitionEvent):
2014         * Modules/speech/SpeechRecognitionEvent.h:
2015         (WebCore):
2016         (SpeechRecognitionEventInit):
2017         (SpeechRecognitionEvent):
2018         (WebCore::SpeechRecognitionEvent::emma):
2019         * Modules/speech/SpeechRecognitionEvent.idl:
2020
2021 2013-03-22  Emil A Eklund  <eae@chromium.org>
2022
2023         Floor cell widths in AutoTableLayout::recalcColumn
2024         https://bugs.webkit.org/show_bug.cgi?id=112922
2025
2026         Reviewed by Levi Weintraub.
2027
2028         Table cells widths are floored to ensure even distribution of available
2029         space across columns. The code path that computes the width of the
2030         _table_ failed to take this into account and thus can over report the
2031         total width of the table.
2032
2033         Test: fast/sub-pixel/table-with-subpixel-cell-size.html
2034
2035         * rendering/AutoTableLayout.cpp:
2036         (WebCore::AutoTableLayout::recalcColumn): Floor width to match column sizing logic.
2037
2038 2013-03-22  David Kilzer  <ddkilzer@apple.com>
2039
2040         BUILD FIX (r146208): Export shouldPrintExceptions methods for iOS
2041
2042         Fixes the following build failure:
2043
2044             Undefined symbols for architecture i386:
2045               "__ZN7WebCore11PageConsole24setShouldPrintExceptionsEb", referenced from:
2046                     +[WebCoreStatistics setShouldPrintExceptions:] in WebCoreStatistics.o
2047               "__ZN7WebCore11PageConsole21shouldPrintExceptionsEv", referenced from:
2048                     +[WebCoreStatistics shouldPrintExceptions] in WebCoreStatistics.o
2049             ld: symbol(s) not found for architecture i386
2050             clang: error: linker command failed with exit code 1 (use -v to see invocation)
2051
2052         * WebCore.exp.in: Move symbols so they're exported for iOS as
2053         well.
2054
2055 2013-03-22  Yury Semikhatsky  <yurys@chromium.org>
2056
2057         Unreviewed. Fix Chromium Win compilation after r146583.
2058
2059         * bindings/v8/CustomElementHelpers.cpp:
2060         (WebCore::CustomElementHelpers::invokeReadyCallbackIfNeeded):
2061
2062 2013-03-22  Ilya Tikhonovsky  <loislo@chromium.org>
2063
2064         Web Inspector: Flame Chart. Chart has to be zoomed around the mouse pointer.
2065         https://bugs.webkit.org/show_bug.cgi?id=113031
2066
2067         Reviewed by Yury Semikhatsky.
2068
2069         Overview grid is able to zoom around the mouse pointer.
2070         So the simplest way is to translate x coordinate of the mouse pointer hovered over the chart
2071         to x coordinate in term of overview window and pass it to the zoom function.
2072
2073         Minor unrelated fix: draw small border at bottom of the overview grid.
2074
2075         * inspector/front-end/FlameChart.js:
2076         (WebInspector.FlameChart.prototype._onMouseWheel):
2077         * inspector/front-end/OverviewGrid.js:
2078         (WebInspector.OverviewGrid.prototype.zoom):
2079         * inspector/front-end/flameChart.css:
2080         (#flame-chart-overview-container):
2081
2082 2013-03-22  No'am Rosenthal  <noam@webkit.org>
2083
2084         [Texmap] TextureMapperImageBuffer should not use rendering code for filters.
2085         https://bugs.webkit.org/show_bug.cgi?id=113040
2086
2087         Reviewed by Kenneth Rohde Christiansen.
2088
2089         Disable TextureMapperImageBuffer filters, until they can be done the right way.
2090         This should only disrupt accelerated filters in fallback mode, which is a very rare
2091         use case.
2092
2093         No new testable functionality.
2094
2095         * platform/graphics/texmap/TextureMapperImageBuffer.cpp:
2096         (WebCore::BitmapTextureImageBuffer::applyFilters):
2097
2098 2013-03-22  Sergey Ryazanov  <serya@chromium.org>
2099
2100         Web Inspector: Report more CSS errors
2101         https://bugs.webkit.org/show_bug.cgi?id=113022
2102
2103         Reviewed by Pavel Feldman.
2104
2105         Reporting next few CSS syntax errors in declaration_list.
2106
2107         * css/CSSGrammar.y.in:
2108
2109 2013-03-18  Yury Semikhatsky  <yurys@chromium.org>
2110
2111         Web Inspector: use individual samples to construct CPU profile flame chart
2112         https://bugs.webkit.org/show_bug.cgi?id=112569
2113
2114         Reviewed by Pavel Feldman.
2115
2116         Added an optional array of samples to the CPU profile returned over the
2117         protocol. Each sample is id of the profile node corresponding to the top frame
2118         of the sample's stack trace. The array of samples if present is used to draw
2119         the flame chart on the CPU profile panel, otherwise flame chart is drawn based
2120         on the aggregated profile data.
2121
2122         * bindings/js/ScriptProfile.cpp:
2123         (WebCore::ScriptProfile::buildInspectorObjectForSamples):
2124         * bindings/js/ScriptProfile.h:
2125         (ScriptProfile):
2126         * bindings/v8/ScriptProfile.cpp:
2127         (WebCore::buildInspectorObjectFor):
2128         (WebCore):
2129         (WebCore::ScriptProfile::buildInspectorObjectForSamples):
2130         * bindings/v8/ScriptProfile.h:
2131         (ScriptProfile):
2132         * bindings/v8/ScriptProfiler.cpp:
2133         (WebCore::ScriptProfiler::start):
2134         * inspector/Inspector.json:
2135         * inspector/InspectorProfilerAgent.cpp:
2136         (WebCore::InspectorProfilerAgent::getCPUProfile):
2137         * inspector/front-end/CPUProfileView.js:
2138         (WebInspector.CPUProfileView.prototype._getCPUProfileCallback):
2139         (WebInspector.CPUProfileView.prototype._buildIdToNodeMap):
2140         * inspector/front-end/FlameChart.js:
2141         (WebInspector.FlameChart.prototype._calculateTimelineData):
2142
2143 2013-03-22  Steve Block  <steveblock@chromium.org>
2144
2145         Use generated bindings for the Coordinates type used by Geolocation
2146         https://bugs.webkit.org/show_bug.cgi?id=112975
2147
2148         Reviewed by Kentaro Hara.
2149
2150         No new tests, refactoring only.
2151
2152         * CMakeLists.txt:
2153         * GNUmakefile.list.am:
2154         * Modules/geolocation/Coordinates.cpp: Renamed from Source/WebCore/bindings/js/JSCoordinatesCustom.cpp.
2155         (WebCore):
2156         (WebCore::Coordinates::altitude):
2157         (WebCore::Coordinates::altitudeAccuracy):
2158         (WebCore::Coordinates::heading):
2159         (WebCore::Coordinates::speed):
2160         * Modules/geolocation/Coordinates.h:
2161         (Coordinates):
2162         * Modules/geolocation/Coordinates.idl:
2163         * Target.pri:
2164         * UseJSC.cmake:
2165         * UseV8.cmake:
2166         * WebCore.gypi:
2167         * WebCore.vcproj/WebCore.vcproj:
2168         * WebCore.vcxproj/WebCore.vcxproj:
2169         * WebCore.vcxproj/WebCore.vcxproj.filters:
2170         * WebCore.xcodeproj/project.pbxproj:
2171         * bindings/js/JSBindingsAllInOne.cpp:
2172         * bindings/v8/custom/V8CoordinatesCustom.cpp: Removed.
2173
2174 2013-03-22  Kunihiko Sakamoto  <ksakamoto@chromium.org>
2175
2176         INPUT_MULTIPLE_FIELDS_UI: Incomplete datetime format should fallback to default
2177         https://bugs.webkit.org/show_bug.cgi?id=113005
2178
2179         Reviewed by Kent Tamura.
2180
2181         Use fallback format when datetime format from locale is not complete.
2182
2183         Tests: fast/forms/date-multiple-fields/date-multiple-fields-fallback-format.html
2184                fast/forms/datetime-multiple-fields/datetime-multiple-fields-fallback-format.html
2185                fast/forms/datetimelocal-multiple-fields/datetimelocal-multiple-fields-fallback-format.html
2186                fast/forms/month-multiple-fields/month-multiple-fields-fallback-format.html
2187                fast/forms/time-multiple-fields/time-multiple-fields-fallback-format.html
2188                fast/forms/week-multiple-fields/week-multiple-fields-fallback-format.html
2189
2190         * html/BaseMultipleFieldsDateAndTimeInputType.cpp:
2191         (DateTimeFormatValidator): A helper class that parses datetime format and tests existence of fields.
2192         (WebCore::DateTimeFormatValidator::DateTimeFormatValidator):
2193         (WebCore::DateTimeFormatValidator::visitField):
2194         (WebCore::DateTimeFormatValidator::validateFormat): Parses datetime format and validates by calling BaseMultipleFieldsDateAndTimeInputType::isValidFormat.
2195         (WebCore::BaseMultipleFieldsDateAndTimeInputType::updateInnerTextValue): Checks if dateTimeFormat is valid, and uses fallback format if not.
2196         * html/BaseMultipleFieldsDateAndTimeInputType.h:
2197         (BaseMultipleFieldsDateAndTimeInputType): Declare isValidFormat.
2198         * html/DateInputType.cpp:
2199         (WebCore::DateInputType::isValidFormat): Added.
2200         * html/DateInputType.h:
2201         (DateInputType):
2202         * html/DateTimeInputType.cpp:
2203         (WebCore::DateTimeInputType::isValidFormat): Added.
2204         * html/DateTimeInputType.h:
2205         (DateTimeInputType):
2206         * html/DateTimeLocalInputType.cpp:
2207         (WebCore::DateTimeLocalInputType::isValidFormat): Added.
2208         * html/DateTimeLocalInputType.h:
2209         (DateTimeLocalInputType):
2210         * html/MonthInputType.cpp:
2211         (WebCore::MonthInputType::isValidFormat): Added.
2212         * html/MonthInputType.h:
2213         (MonthInputType):
2214         * html/TimeInputType.cpp:
2215         (WebCore::TimeInputType::isValidFormat): Added.
2216         * html/TimeInputType.h:
2217         (TimeInputType):
2218         * html/WeekInputType.cpp:
2219         (WebCore::WeekInputType::isValidFormat): Added.
2220         * html/WeekInputType.h:
2221         (WeekInputType):
2222
2223 2013-03-22  Hajime Morrita  <morrita@google.com>
2224
2225         Custom Elements: "readyCallback" lifecycle callback should be called.
2226         https://bugs.webkit.org/show_bug.cgi?id=112538
2227
2228         Reviewed by Elliott Sprehn.
2229
2230         This change allows each custom element definition to hook up its instantiation,
2231         namely "readyCallback" lifecycle callback.
2232
2233         The change has two parts:
2234         - 1. Tracking which Element objects to be created.
2235         - 2. Invoking appropriate JavaScript functions, which are readyCallback(),
2236           before the Element object is visible from page script.
2237
2238         For 1, CustomElementRegistry maintains list of "callback
2239         invocaions".  Each list item ("invocation") tracks the element
2240         which has a lifecycle callback to be invoked. Each invocation is
2241         registered when - Any custom element C++ object is instantiated.
2242         See changes on CustomElementConstructor.cpp.
2243
2244         This also happens when @is attribute is set by the parser or node
2245         cloning routine, which can turn a non-custom element into a
2246         type-extended custom element. See changes on Element.cpp.
2247
2248         For 2, CustomElementRegistry basically follows what
2249         MutationObserver is doing, and introduces a method called
2250         deliverLifecycleCallbacks(). This function flushes all pending
2251         callback invocations. You can think it as a dual of
2252         MutationObserver::deliverAllMutations().
2253
2254         The delivery function is called places where MutationObserver's
2255         deliverAllMutations() is called. In addition, it is also called
2256         just before returning from a set of DOM APIs. For example, it is
2257         called just before createElement() returns, so that possibly
2258         created custom element becomes ready through its readyCallback().
2259         Such APIs get "V8DeliverCustomElementCallbacks" IDL attribute. In
2260         principle, APIs which can create new custom element instnaces are
2261         marked. See CustomElementRegistry::CallbackDeliveryScope and
2262         changes on CodeGeneratorV8.pm.
2263
2264         We need this extra work because the readyCallback() needs to give
2265         an illusion so that JavaScript programmers feel like the
2266         readyCallback() callback being called just after it is created,
2267         instead of called on arbitrary late timing like MutationObserver
2268         notifications.
2269
2270         Tests: fast/dom/custom/lifecycle-ready-createElement-recursion.html
2271                fast/dom/custom/lifecycle-ready-createElement-reentrancy.html
2272                fast/dom/custom/lifecycle-ready-creation-api.html
2273                fast/dom/custom/lifecycle-ready-innerHTML.html
2274                fast/dom/custom/lifecycle-ready-parser-only.html
2275                fast/dom/custom/lifecycle-ready-parser-script.html
2276                fast/dom/custom/lifecycle-ready-paste.html
2277
2278         * bindings/scripts/CodeGeneratorV8.pm:
2279         - Hooked up CallbackDeliveryScope through V8DeliverCustomElementCallbacks attriute.
2280         (GenerateCustomElementInvocationScopeIfNeeded):
2281         (GenerateNormalAttrSetter):
2282         (GenerateFunction):
2283         * bindings/scripts/IDLAttributes.txt:
2284         * bindings/v8/CustomElementHelpers.cpp:
2285         (WebCore::CustomElementHelpers::invokeReadyCallbackIfNeeded):
2286         (WebCore::CustomElementHelpers::invokeReadyCallbacksIfNeeded):
2287         * bindings/v8/CustomElementHelpers.h:
2288         (CustomElementHelpers):
2289         * bindings/v8/V8RecursionScope.cpp: Added deliverAllLifecycleCallbacks()
2290         (WebCore::V8RecursionScope::didLeaveScriptContext):
2291         * dom/CustomElementConstructor.cpp:
2292         (WebCore::CustomElementConstructor::createElement):
2293         (WebCore::CustomElementConstructor::createElementInternal):
2294         * dom/CustomElementConstructor.h:
2295         (WebCore::CustomElementConstructor::isExtended):
2296         (CustomElementConstructor):
2297         * dom/CustomElementRegistry.cpp: Adding element tracking and invocation execution.
2298         (WebCore::CustomElementInvocation::CustomElementInvocation):
2299         (WebCore::CustomElementInvocation::~CustomElementInvocation):
2300         (WebCore::activeCustomElementRegistries):
2301         (WebCore::CustomElementRegistry::~CustomElementRegistry):
2302         (WebCore::CustomElementRegistry::didGiveTypeExtension):
2303         (WebCore::CustomElementRegistry::didCreateElement):
2304         (WebCore::CustomElementRegistry::activate):
2305         (WebCore::CustomElementRegistry::deactivate):
2306         (WebCore::CustomElementRegistry::deliverLifecycleCallbacks):
2307         (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacks):
2308         * dom/CustomElementRegistry.h:
2309         (CustomElementInvocation):
2310         (WebCore::CustomElementInvocation::element):
2311         (CallbackDeliveryScope):
2312         (WebCore::CustomElementRegistry::CallbackDeliveryScope::CallbackDeliveryScope):
2313         (WebCore::CustomElementRegistry::CallbackDeliveryScope::~CallbackDeliveryScope):
2314         (CustomElementRegistry):
2315         (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacksIfNeeded):
2316         * dom/Document.cpp:
2317         (WebCore::Document::createElement):
2318         (WebCore::Document::didCreateCustomElement):
2319         * dom/Document.h:
2320         (Document):
2321         * dom/Document.idl:
2322         * dom/Element.cpp:
2323         (WebCore::Element::attributeChangedFromParserOrByCloning): Added to catch @is attribute
2324         (WebCore::Element::parserSetAttributes):
2325         (WebCore::Element::cloneAttributesFromElement):
2326         * dom/Element.h:
2327         * dom/Node.idl:
2328         * dom/ShadowRoot.idl:
2329         * html/HTMLElement.idl:
2330         * html/parser/HTMLScriptRunner.cpp: Added deliverAllLifecycleCallbacks()
2331         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
2332         (WebCore::HTMLScriptRunner::runScript):
2333
2334 2013-03-22  Tommy Widenflycht  <tommyw@google.com>
2335
2336         MediaStream API: Finalize the RTCPeerConnection states
2337         https://bugs.webkit.org/show_bug.cgi?id=112792
2338
2339         Reviewed by Adam Barth.
2340
2341         This patch finalized the RTCPeerConnection state and events. These changes
2342         have not yet pushed out to the editors draft; but they are uncontroversial
2343         and agreed upon.
2344
2345         readyState will be deleted; please use the replacement signalingState which is already available.
2346         onstatechange -> onsignalingstatechange
2347         onicechange -> oniceconnectionstatechange
2348         ongatheringchange will be deleted since oniceconnectionstatechange can be used for the same purpose.
2349         RTCIceConnectionState::"starting" -> RTCIceConnectionState::"new"
2350
2351         Patch covered by modified tests.
2352
2353         * Modules/mediastream/RTCPeerConnection.cpp:
2354         (WebCore::RTCPeerConnection::RTCPeerConnection):
2355         (WebCore::RTCPeerConnection::iceConnectionState):
2356         (WebCore::RTCPeerConnection::changeSignalingState):
2357         (WebCore::RTCPeerConnection::changeIceGatheringState):
2358         (WebCore::RTCPeerConnection::changeIceConnectionState):
2359         * Modules/mediastream/RTCPeerConnection.h:
2360         (RTCPeerConnection):
2361         * Modules/mediastream/RTCPeerConnection.idl:
2362         * dom/EventNames.h:
2363         (WebCore):
2364         * platform/mediastream/RTCPeerConnectionHandlerClient.h:
2365
2366 2013-03-22  Mike West  <mkwst@chromium.org>
2367
2368         Prefer 'KURL(ParsedURLString, String)' when dealing with known-good data.
2369         https://bugs.webkit.org/show_bug.cgi?id=112965
2370
2371         Reviewed by Alexey Proskuryakov.
2372
2373         In https://bugs.webkit.org/show_bug.cgi?id=112783#c6, Adam noted that
2374         it would be possible to use 'KURL(ParsedURLString, [url])' rather than
2375         'KURL(KURL(), [url])', since we knew that the URL in question is a
2376         value and absolute URL. This patch fixes the obvious instances of this
2377         pattern; there are several more 'KURL(KURL(), String)' calls in
2378         WebCore but these were the only places I was reasonably sure that bad
2379         data couldn't creep in.
2380
2381         * dom/Document.cpp:
2382         (WebCore::Document::updateBaseURL):
2383             'documentURI' is pulled from 'url()->string()'. It's safe.
2384         * page/ContentSecurityPolicy.cpp:
2385         (WebCore::gatherSecurityPolicyViolationEventData):
2386         (WebCore::ContentSecurityPolicy::reportViolation):
2387             'CallFrame::sourceURL()' is a known valid/absolute URL.
2388         * page/SecurityOrigin.cpp:
2389         (WebCore::SecurityOrigin::createFromDatabaseIdentifier):
2390         (WebCore::SecurityOrigin::create):
2391             The strings constructed here are certainly valid.
2392
2393 2013-03-22  Ilya Tikhonovsky  <loislo@chromium.org>
2394
2395         Web Inspector: Flame Chart. move overview window when user scrolls the chart.
2396         https://bugs.webkit.org/show_bug.cgi?id=113014
2397
2398         Reviewed by Yury Semikhatsky.
2399
2400         I found that I could use scaling mechanics in OverviewGrid for scaling the chart.
2401         But the dragging part was not so simple due to the different approaches in
2402         OverviewGrid and FlameChart. OverviewGrid used _windowLeft and _windowRight
2403         when FlameChart used _xOffset and _xScaleFactor and width.
2404         It was not practical and I rewrote the FlameChart mechanics
2405         and now it also uses _windowLeft _windowRight.
2406
2407         * inspector/front-end/FlameChart.js:
2408         (WebInspector.FlameChart):
2409         (WebInspector.FlameChart.Calculator.prototype._updateBoundaries):
2410         (WebInspector.FlameChart.Calculator.prototype.computePosition):
2411         (WebInspector.FlameChart.prototype._onWindowChanged):
2412         (WebInspector.FlameChart.prototype._startCanvasDragging):
2413         (WebInspector.FlameChart.prototype._canvasDragging):
2414         (WebInspector.FlameChart.prototype._onMouseMove):
2415         (WebInspector.FlameChart.prototype._onMouseWheel):
2416         (WebInspector.FlameChart.prototype._coordinatesToNodeIndex):
2417         (WebInspector.FlameChart.prototype._drawOverviewCanvas):
2418         (WebInspector.FlameChart.prototype.draw):
2419         (WebInspector.FlameChart.prototype._updateBoundaries):
2420         (WebInspector.FlameChart.prototype.update):
2421         * inspector/front-end/OverviewGrid.js:
2422         (WebInspector.OverviewGrid.prototype.setWindowPosition):
2423         (WebInspector.OverviewGrid.prototype.setWindow):
2424         (WebInspector.OverviewGrid.prototype.addEventListener):
2425         (WebInspector.OverviewGrid.prototype.zoom):
2426         (WebInspector.OverviewGrid.Window.prototype._zoom):
2427         * inspector/front-end/inspectorCommon.css:
2428         (.overview-grid-window-rulers):
2429
2430 2013-03-22  Steve Block  <steveblock@chromium.org>
2431
2432         Move GeolocationClient.h to Modules/geolocation/
2433         https://bugs.webkit.org/show_bug.cgi?id=112997
2434
2435         Reviewed by Kentaro Hara.
2436
2437         No new tests, no functional change.
2438
2439         * GNUmakefile.list.am:
2440         * Modules/geolocation/GeolocationClient.h: Renamed from Source/WebCore/page/GeolocationClient.h.
2441         (WebCore):
2442         (GeolocationClient):
2443         (WebCore::GeolocationClient::~GeolocationClient):
2444         * WebCore.vcproj/WebCore.vcproj:
2445         * WebCore.vcxproj/WebCore.vcxproj:
2446         * WebCore.vcxproj/WebCore.vcxproj.filters:
2447         * WebCore.xcodeproj/project.pbxproj:
2448
2449 2013-03-22  Sheriff Bot  <webkit.review.bot@gmail.com>
2450
2451         Unreviewed, rolling out r146534 and r146565.
2452         http://trac.webkit.org/changeset/146534
2453         http://trac.webkit.org/changeset/146565
2454         https://bugs.webkit.org/show_bug.cgi?id=113017
2455
2456         "r146534 caused perf regression on Chromium Linux x64"
2457         (Requested by yurys on #webkit).
2458
2459         * bindings/scripts/CodeGeneratorV8.pm:
2460         (GenerateNormalAttrSetter):
2461         (GenerateOverloadedFunction):
2462         (GenerateFunctionCallback):
2463         (GenerateFunction):
2464         (GenerateParametersCheck):
2465         (GenerateSingleConstructorCallback):
2466         (GenerateNonStandardFunction):
2467         (GenerateImplementation):
2468         (GenerateFunctionCallString):
2469         * bindings/scripts/IDLAttributes.txt:
2470         * bindings/scripts/test/V8/V8Float64Array.cpp:
2471         (WebCore):
2472         * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
2473         (WebCore):
2474         * bindings/scripts/test/V8/V8TestEventTarget.cpp:
2475         (WebCore):
2476         * bindings/scripts/test/V8/V8TestInterface.cpp:
2477         (WebCore):
2478         * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
2479         (WebCore):
2480         * bindings/scripts/test/V8/V8TestObj.cpp:
2481         (WebCore):
2482         * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
2483         (WebCore):
2484         * bindings/scripts/test/V8/V8TestTypedefs.cpp:
2485         (WebCore):
2486         * bindings/v8/CustomElementHelpers.cpp:
2487         * bindings/v8/CustomElementHelpers.h:
2488         (WebCore):
2489         (CustomElementHelpers):
2490         * bindings/v8/V8DOMConfiguration.cpp:
2491         (WebCore::V8DOMConfiguration::batchConfigureCallbacks):
2492         (WebCore::V8DOMConfiguration::configureTemplate):
2493         * bindings/v8/V8DOMConfiguration.h:
2494         (BatchedMethod):
2495         (V8DOMConfiguration):
2496         * bindings/v8/V8RecursionScope.cpp:
2497         (WebCore::V8RecursionScope::didLeaveScriptContext):
2498         * dom/CustomElementConstructor.cpp:
2499         (WebCore::CustomElementConstructor::createElement):
2500         * dom/CustomElementConstructor.h:
2501         (CustomElementConstructor):
2502         * dom/CustomElementRegistry.cpp:
2503         (WebCore::CustomElementRegistry::~CustomElementRegistry):
2504         * dom/CustomElementRegistry.h:
2505         (WebCore):
2506         (CustomElementRegistry):
2507         * dom/Document.cpp:
2508         (WebCore::Document::createElement):
2509         (WebCore::Document::registerElement):
2510         * dom/Document.h:
2511         * dom/Document.idl:
2512         * dom/Element.cpp:
2513         (WebCore::Element::parserSetAttributes):
2514         (WebCore::Element::cloneAttributesFromElement):
2515         * dom/Element.h:
2516         * dom/Element.idl:
2517         * dom/Node.idl:
2518         * dom/ShadowRoot.idl:
2519         * html/HTMLElement.idl:
2520         * html/parser/HTMLScriptRunner.cpp:
2521         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
2522         (WebCore::HTMLScriptRunner::runScript):
2523
2524 2013-03-22  Sudarsana Nagineni  <sudarsana.nagineni@intel.com>
2525
2526         [GStreamer] Memory leak in AudioFileReader::createBus()
2527         https://bugs.webkit.org/show_bug.cgi?id=112925
2528
2529         Reviewed by Martin Robinson.
2530
2531         Adopt the reference returned by g_timeout_source_new()
2532         to fix a memory leak.
2533
2534         No new tests. No change in behavior.
2535
2536         * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
2537         (WebCore::AudioFileReader::createBus):
2538
2539 2013-03-22  Steve Block  <steveblock@chromium.org>
2540
2541         Move page/Coordinates.[h|idl] to Modules/geolocation/
2542         https://bugs.webkit.org/show_bug.cgi?id=112945
2543
2544         Reviewed by Kentaro Hara.
2545
2546         No new tests, no functional change.
2547
2548         * CMakeLists.txt:
2549         * DerivedSources.make:
2550         * DerivedSources.pri:
2551         * GNUmakefile.list.am:
2552         * Modules/geolocation/Coordinates.h: Renamed from Source/WebCore/page/Coordinates.h.
2553         (WebCore):
2554         (Coordinates):
2555         (WebCore::Coordinates::create):
2556         (WebCore::Coordinates::isolatedCopy):
2557         (WebCore::Coordinates::latitude):
2558         (WebCore::Coordinates::longitude):
2559         (WebCore::Coordinates::altitude):
2560         (WebCore::Coordinates::accuracy):
2561         (WebCore::Coordinates::altitudeAccuracy):
2562         (WebCore::Coordinates::heading):
2563         (WebCore::Coordinates::speed):
2564         (WebCore::Coordinates::canProvideAltitude):
2565         (WebCore::Coordinates::canProvideAltitudeAccuracy):
2566         (WebCore::Coordinates::canProvideHeading):
2567         (WebCore::Coordinates::canProvideSpeed):
2568         (WebCore::Coordinates::Coordinates):
2569         * Modules/geolocation/Coordinates.idl: Renamed from Source/WebCore/page/Coordinates.idl.
2570         * Target.pri:
2571         * WebCore.gypi:
2572         * WebCore.vcproj/WebCore.vcproj:
2573         * WebCore.vcxproj/WebCore.vcxproj:
2574         * WebCore.vcxproj/WebCore.vcxproj.filters:
2575         * WebCore.xcodeproj/project.pbxproj:
2576
2577 2013-03-21  Hajime Morrita  <morrita@google.com>
2578
2579         Custom Elements: "readyCallback" lifecycle callback should be called.
2580         https://bugs.webkit.org/show_bug.cgi?id=112538
2581
2582         Reviewed by Elliott Sprehn.
2583
2584         This change allows each custom element definition to hook up its instantiation,
2585         namely "readyCallback" lifecycle callback.
2586
2587         The change has two parts:
2588         - 1. Tracking which Element objects to be created.
2589         - 2. Invoking appropriate JavaScript functions, which are readyCallback(),
2590           before the Element object is visible from page script.
2591
2592         For 1, CustomElementRegistry maintains list of "callback
2593         invocaions".  Each list item ("invocation") tracks the element
2594         which has a lifecycle callback to be invoked. Each invocation is
2595         registered when - Any custom element C++ object is instantiated.
2596         See changes on CustomElementConstructor.cpp.
2597
2598         This also happens when @is attribute is set by the parser or node
2599         cloning routine, which can turn a non-custom element into a
2600         type-extended custom element. See changes on Element.cpp.
2601
2602         For 2, CustomElementRegistry basically follows what
2603         MutationObserver is doing, and introduces a method called
2604         deliverLifecycleCallbacks(). This function flushes all pending
2605         callback invocations. You can think it as a dual of
2606         MutationObserver::deliverAllMutations().
2607
2608         The delivery function is called places where MutationObserver's
2609         deliverAllMutations() is called. In addition, it is also called
2610         just before returning from a set of DOM APIs. For example, it is
2611         called just before createElement() returns, so that possibly
2612         created custom element becomes ready through its readyCallback().
2613         Such APIs get "V8DeliverCustomElementCallbacks" IDL attribute. In
2614         principle, APIs which can create new custom element instnaces are
2615         marked. See CustomElementRegistry::CallbackDeliveryScope and
2616         changes on CodeGeneratorV8.pm.
2617
2618         We need this extra work because the readyCallback() needs to give
2619         an illusion so that JavaScript programmers feel like the
2620         readyCallback() callback being called just after it is created,
2621         instead of called on arbitrary late timing like MutationObserver
2622         notifications.
2623
2624         Tests: fast/dom/custom/lifecycle-ready-createElement-recursion.html
2625                fast/dom/custom/lifecycle-ready-createElement-reentrancy.html
2626                fast/dom/custom/lifecycle-ready-creation-api.html
2627                fast/dom/custom/lifecycle-ready-innerHTML.html
2628                fast/dom/custom/lifecycle-ready-parser-only.html
2629                fast/dom/custom/lifecycle-ready-parser-script.html
2630                fast/dom/custom/lifecycle-ready-paste.html
2631
2632         * bindings/scripts/CodeGeneratorV8.pm:
2633         - Hooked up CallbackDeliveryScope through V8DeliverCustomElementCallbacks attriute.
2634         (GenerateCustomElementInvocationScopeIfNeeded):
2635         (GenerateNormalAttrSetter):
2636         (GenerateFunction):
2637         * bindings/scripts/IDLAttributes.txt:
2638         * bindings/v8/CustomElementHelpers.cpp:
2639         (WebCore::CustomElementHelpers::invokeReadyCallbackIfNeeded):
2640         (WebCore::CustomElementHelpers::invokeReadyCallbacksIfNeeded):
2641         * bindings/v8/CustomElementHelpers.h:
2642         (CustomElementHelpers):
2643         * bindings/v8/V8RecursionScope.cpp: Added deliverAllLifecycleCallbacks()
2644         (WebCore::V8RecursionScope::didLeaveScriptContext):
2645         * dom/CustomElementConstructor.cpp:
2646         (WebCore::CustomElementConstructor::createElement):
2647         (WebCore::CustomElementConstructor::createElementInternal):
2648         * dom/CustomElementConstructor.h:
2649         (WebCore::CustomElementConstructor::isExtended):
2650         (CustomElementConstructor):
2651         * dom/CustomElementRegistry.cpp: Adding element tracking and invocation execution.
2652         (WebCore::CustomElementInvocation::CustomElementInvocation):
2653         (WebCore::CustomElementInvocation::~CustomElementInvocation):
2654         (WebCore::activeCustomElementRegistries):
2655         (WebCore::CustomElementRegistry::~CustomElementRegistry):
2656         (WebCore::CustomElementRegistry::didGiveTypeExtension):
2657         (WebCore::CustomElementRegistry::didCreateElement):
2658         (WebCore::CustomElementRegistry::activate):
2659         (WebCore::CustomElementRegistry::deactivate):
2660         (WebCore::CustomElementRegistry::deliverLifecycleCallbacks):
2661         (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacks):
2662         * dom/CustomElementRegistry.h:
2663         (CustomElementInvocation):
2664         (WebCore::CustomElementInvocation::element):
2665         (CallbackDeliveryScope):
2666         (WebCore::CustomElementRegistry::CallbackDeliveryScope::CallbackDeliveryScope):
2667         (WebCore::CustomElementRegistry::CallbackDeliveryScope::~CallbackDeliveryScope):
2668         (CustomElementRegistry):
2669         (WebCore::CustomElementRegistry::deliverAllLifecycleCallbacksIfNeeded):
2670         * dom/Document.cpp:
2671         (WebCore::Document::createElement):
2672         (WebCore::Document::didCreateCustomElement):
2673         * dom/Document.h:
2674         (Document):
2675         * dom/Document.idl:
2676         * dom/Element.cpp:
2677         (WebCore::Element::attributeChangedFromParserOrByCloning): Added to catch @is attribute
2678         (WebCore::Element::parserSetAttributes):
2679         (WebCore::Element::cloneAttributesFromElement):
2680         * dom/Element.h:
2681         * dom/Node.idl:
2682         * dom/ShadowRoot.idl:
2683         * html/HTMLElement.idl:
2684         * html/parser/HTMLScriptRunner.cpp: Added deliverAllLifecycleCallbacks()
2685         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent):
2686         (WebCore::HTMLScriptRunner::runScript):
2687
2688 2013-03-21  Jer Noble  <jer.noble@apple.com>
2689
2690         Crash in WebCore::MediaPlayer::cachedResourceLoader + 4
2691         https://bugs.webkit.org/show_bug.cgi?id=112977
2692
2693         Reviewed by Geoffrey Garen.
2694
2695         Speculative fix for a NULL-dereference crash. MediaPlayerPrivateAVFoundationObjC is the
2696         sole owner of a WebCoreAVFLoaderDelegate instance. It releases this instance in its destructor,
2697         but it is possible that, on another thread, the AVAssetResourceLoader has already begun
2698         using the delegate and in so doing has retained it. By the time the delegate method is fired
2699         on the main thread, the MediaPlayerPrivateAVFoundationObjC owner of the delegate has already
2700         been deleted, and the delegate's m_callback pointer is now pointing at freed memory.
2701
2702         In addition to calling -[AVAssetResourceLoader setDelegate:queue:] to avoid any not-yet-started
2703         delegate callbacks, MediaPlayerPrivateAVFoundationObjC should clear the WebCoreAVFLoaderDelegate
2704         m_callback ivar, to avoid calling into freed memory for already queued delegate callbacks.
2705
2706         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2707         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): Clear the m_loaderDelegate's callback pointer.
2708         (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): Check the value of m_callback before continuing.
2709         (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]): Ditto.
2710         (-[WebCoreAVFLoaderDelegate setCallback:]): Added simple setter.
2711
2712 2013-03-21  Takashi Sakamoto  <tasak@google.com>
2713
2714         XMLDocumentParser doesn't parse <template> correctly.
2715         https://bugs.webkit.org/show_bug.cgi?id=112328
2716
2717         Reviewed by Hajime Morrita.
2718
2719         XMLDocumentParser should check whether a parent node is attached or not
2720         when a new element is appended.
2721
2722         Test: fast/dom/HTMLTemplateElement/xhtml-with-titleElement-parsing-crash.xhtml
2723
2724         * xml/parser/XMLDocumentParserLibxml2.cpp:
2725         (WebCore::XMLDocumentParser::startElementNs):
2726         m_currentNode is a parent node of newElement, but it is updated by
2727         pushCurrentNode. So firstly stored copied m_curretNode's value into
2728         local currentNode and used the currentNode to check whether
2729         newElement's parent is attached or not.
2730
2731 2013-03-21  David Grogan  <dgrogan@chromium.org>
2732
2733         Unreviewed, rolling out r146560.
2734         http://trac.webkit.org/changeset/146560
2735         https://bugs.webkit.org/show_bug.cgi?id=112862
2736
2737         invalid parameter to histogram
2738
2739         * platform/leveldb/LevelDBDatabase.cpp:
2740         (WebCore::LevelDBDatabase::open):
2741
2742 2013-03-21  David Grogan  <dgrogan@chromium.org>
2743
2744         IndexedDB: Histogram available disk space on attempt to open database
2745         https://bugs.webkit.org/show_bug.cgi?id=112862
2746
2747         Reviewed by Adam Barth.
2748
2749         ChromeOS suspects they might be hitting disk corruption when the disks
2750         are nearly full. This patch logs the available space to either the
2751         "success" or the "fail" histogram as appropriate so that the
2752         distributions can be compared.
2753
2754         No new tests - I don't know of a good way to test histograms. Local
2755         printf testing didn't turn up any bugs.
2756
2757         * platform/leveldb/LevelDBDatabase.cpp:
2758         (WebCore::HistogramFreeSpace):
2759         (WebCore):
2760         (WebCore::LevelDBDatabase::open):
2761
2762 2013-03-21  Li Yin  <li.yin@intel.com>
2763
2764         FileAPI: Remove deprecation warning when ArrayBuffer is in Blob constructor.
2765         https://bugs.webkit.org/show_bug.cgi?id=88389
2766
2767         Reviewed by Kenneth Russell.
2768
2769         Spec: http://dev.w3.org/2006/webapi/FileAPI/#dfn-Blob
2770         Both ArrayBuffer and ArrayBufferView should be supported for Blob constructor.
2771
2772         Test: fast/files/blob-constructor.html.
2773
2774         * bindings/js/JSBlobCustom.cpp:
2775         (WebCore::JSBlobConstructor::constructJSBlob):
2776         * bindings/v8/custom/V8BlobCustom.cpp:
2777         (WebCore::V8Blob::constructorCustom):
2778         * fileapi/WebKitBlobBuilder.cpp:
2779         (WebCore::BlobBuilder::append): Remove the deprecated warning.
2780         * fileapi/WebKitBlobBuilder.h:
2781         (WebCore):
2782         (BlobBuilder):
2783
2784 2013-03-21  Takashi Sakamoto  <tasak@google.com>
2785
2786         [Shadow]: @host styles are not applied dynamically
2787         https://bugs.webkit.org/show_bug.cgi?id=112869
2788
2789         Reviewed by Elliott Sprehn.
2790
2791         Need to add features of @host @-rules to rule feature set.
2792
2793         Test: fast/dom/shadow/athost-apply-dynamically.html
2794
2795         * css/StyleScopeResolver.cpp:
2796         (WebCore::StyleScopeResolver::collectFeaturesTo):
2797
2798 2013-03-21  Hayato Ito  <hayato@chromium.org>
2799
2800         [Shadow] Provide an api of insertionParent().
2801         https://bugs.webkit.org/show_bug.cgi?id=112866
2802
2803         Add insertinParent binding to Element and Text.
2804         It's prefixed (webkitInsertionParent) and guarded by SHADOW_DOM flag.
2805
2806         The bug in the Shadow DOM spec is here:
2807         https://www.w3.org/Bugs/Public/show_bug.cgi?id=21067
2808
2809         Reviewed by Dimitri Glazkov.
2810
2811         Test: fast/dom/shadow/insertion-parent.html
2812
2813         * dom/Element.idl:
2814         * dom/Node.cpp:
2815         (WebCore::Node::insertionParentForBinding):
2816         (WebCore):
2817         * dom/Node.h:
2818         (Node):
2819         * dom/Text.idl:
2820
2821 2013-03-21  Tom Sepez  <tsepez@chromium.org>
2822
2823         Bypass XSSAuditor for asp.net servers.
2824         https://bugs.webkit.org/show_bug.cgi?id=112235
2825
2826         Reviewed by Adam Barth.
2827
2828         Similar to https://bugs.webkit.org/show_bug.cgi?id=81283, but the 
2829         fix to that bug failed to cover this particular comma-splicing case.
2830         
2831         Test: http/tests/security/xssAuditor/img-tag-with-comma.html
2832
2833         * html/parser/XSSAuditor.cpp:
2834         (WebCore::isTerminatingCharacter):
2835         Beware of comma-splicing tricks by stopping at commas.
2836
2837 2013-03-21  Brady Eidson  <beidson@apple.com>
2838
2839         If a previously loaded resource is later stored to the disk cache, replace the buffer with MMAP'ed memory.
2840         <rdar://problem/13414154> and https://bugs.webkit.org/show_bug.cgi?id=112943
2841
2842         Reviewed by Geoff Garen.
2843
2844         No new tests (No change in behavior.)
2845
2846         Give SharedBuffer the ability to replace its contents from another SharedBuffer:
2847         * platform/SharedBuffer.h:
2848         * platform/cf/SharedBufferCF.cpp:
2849         (WebCore::SharedBuffer:: tryReplaceContentsWithPlatformBuffer):
2850
2851         Forward along SharedBuffer's new ability to ResourceBuffer:
2852         * loader/mac/ResourceBuffer.mm:
2853         (WebCore::ResourceBuffer:: tryReplaceSharedBufferContents):
2854         * loader/ResourceBuffer.h:
2855
2856         Give CachedResource the ability to replace its encoded data buffer if appropriate:
2857         * loader/cache/CachedResource.cpp:
2858         (WebCore::CachedResource:: tryReplaceEncodedData):
2859         * loader/cache/CachedResource.h:
2860
2861         * WebCore.exp.in:
2862
2863 2013-03-21  Joshua Bell  <jsbell@chromium.org>
2864
2865         IndexedDB: Ensure script wrappers can be collected after context is stopped
2866         https://bugs.webkit.org/show_bug.cgi?id=112976
2867
2868         Reviewed by Adam Barth.
2869
2870         ActiveDOMObject::hasPendingActivity is called to see if script wrappers
2871         can be disposed of. Once the script execution context has stopped they
2872         should be free to go - include this in the checks.
2873
2874         No new tests - suggestions welcome.
2875
2876         * Modules/indexeddb/IDBDatabase.cpp:
2877         (WebCore::IDBDatabase::hasPendingActivity): Return false if stopped.
2878         (WebCore::IDBDatabase::stop): Don't bother calling empty super impl.
2879         * Modules/indexeddb/IDBRequest.cpp:
2880         (WebCore::IDBRequest::hasPendingActivity): Return false if stopped.
2881         (WebCore::IDBRequest::stop): Don't bother calling empty super impl.
2882         * Modules/indexeddb/IDBTransaction.cpp:
2883         (WebCore::IDBTransaction::hasPendingActivity): Return false if stopped.
2884         (WebCore::IDBTransaction::stop): Don't bother calling empty super impl.
2885
2886 2013-03-21  Russell McClellan  <russell.mcclellan@gmail.com>
2887
2888         Remove upcastPointer from ActiveDOMObject constructor
2889         https://bugs.webkit.org/show_bug.cgi?id=112858
2890
2891         Reviewed by Alexey Proskuryakov.
2892
2893         Removed pesky argument to ActiveDOMObject constructor that is no longer
2894         used.
2895
2896         No new tests (no change in behavior).
2897
2898         * Modules/battery/BatteryManager.cpp:
2899         (WebCore::BatteryManager::BatteryManager):
2900         * Modules/filesystem/DOMFileSystem.cpp:
2901         (WebCore::DOMFileSystem::DOMFileSystem):
2902         * Modules/filesystem/FileWriter.cpp:
2903         (WebCore::FileWriter::FileWriter):
2904         * Modules/geolocation/Geolocation.cpp:
2905         (WebCore::Geolocation::Geolocation):
2906         * Modules/indexeddb/IDBDatabase.cpp:
2907         (WebCore::IDBDatabase::IDBDatabase):
2908         * Modules/indexeddb/IDBRequest.cpp:
2909         (WebCore::IDBRequest::IDBRequest):
2910         * Modules/indexeddb/IDBTransaction.cpp:
2911         (WebCore::IDBTransaction::IDBTransaction):
2912         * Modules/mediasource/MediaSource.cpp:
2913         (WebCore::MediaSource::MediaSource):
2914         * Modules/mediastream/MediaStreamTrack.cpp:
2915         (WebCore::MediaStreamTrack::MediaStreamTrack):
2916         * Modules/mediastream/RTCDTMFSender.cpp:
2917         (WebCore::RTCDTMFSender::RTCDTMFSender):
2918         * Modules/mediastream/RTCPeerConnection.cpp:
2919         (WebCore::RTCPeerConnection::RTCPeerConnection):
2920         * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
2921         (WebCore::RTCSessionDescriptionRequestImpl::RTCSessionDescriptionRequestImpl):
2922         * Modules/mediastream/RTCStatsRequestImpl.cpp:
2923         (WebCore::RTCStatsRequestImpl::RTCStatsRequestImpl):
2924         * Modules/mediastream/RTCVoidRequestImpl.cpp:
2925         (WebCore::RTCVoidRequestImpl::RTCVoidRequestImpl):
2926         * Modules/networkinfo/NetworkInfoConnection.cpp:
2927         (WebCore::NetworkInfoConnection::NetworkInfoConnection):
2928         * Modules/notifications/Notification.cpp:
2929         (WebCore::Notification::Notification):
2930         * Modules/notifications/NotificationCenter.cpp:
2931         (WebCore::NotificationCenter::NotificationCenter):
2932         * Modules/speech/SpeechRecognition.cpp:
2933         (WebCore::SpeechRecognition::SpeechRecognition):
2934         * Modules/webaudio/AudioContext.cpp:
2935         (WebCore::AudioContext::AudioContext):
2936         * Modules/webdatabase/DatabaseContext.cpp:
2937         (WebCore::DatabaseContext::DatabaseContext):
2938         * Modules/websockets/WebSocket.cpp:
2939         (WebCore::WebSocket::WebSocket):
2940         * css/FontLoader.cpp:
2941         (WebCore::FontLoader::FontLoader):
2942         * dom/ActiveDOMObject.cpp:
2943         (WebCore::ActiveDOMObject::ActiveDOMObject):
2944         * dom/ActiveDOMObject.h:
2945         (ActiveDOMObject):
2946         * dom/ScriptExecutionContext.cpp:
2947         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects):
2948         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
2949         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
2950         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
2951         (WebCore::ScriptExecutionContext::didCreateActiveDOMObject):
2952         * dom/ScriptExecutionContext.h:
2953         (ScriptExecutionContext):
2954         (WebCore::ScriptExecutionContext::activeDOMObjects):
2955         * fileapi/FileReader.cpp:
2956         (WebCore::FileReader::FileReader):
2957         * html/HTMLMarqueeElement.cpp:
2958         (WebCore::HTMLMarqueeElement::HTMLMarqueeElement):
2959         * html/HTMLMediaElement.cpp:
2960         (WebCore::HTMLMediaElement::HTMLMediaElement):
2961         * html/canvas/WebGLRenderingContext.cpp:
2962         (WebCore):
2963         (WebCore::WebGLRenderingContext::WebGLRenderingContext):
2964         * loader/Prerenderer.cpp:
2965         (WebCore::Prerenderer::Prerenderer):
2966         * page/EventSource.cpp:
2967         (WebCore::EventSource::EventSource):
2968         * page/SuspendableTimer.cpp:
2969         (WebCore::SuspendableTimer::SuspendableTimer):
2970         * workers/AbstractWorker.cpp:
2971         (WebCore::AbstractWorker::AbstractWorker):
2972         * workers/WorkerContext.cpp:
2973         (WebCore::WorkerContext::hasPendingActivity):
2974         * xml/XMLHttpRequest.cpp:
2975         (WebCore::XMLHttpRequest::XMLHttpRequest):
2976
2977 2013-03-21  Alexey Proskuryakov  <ap@apple.com>
2978
2979         [Mac] Move NSOperationQueue out of NetworkingContext
2980         https://bugs.webkit.org/show_bug.cgi?id=112970
2981
2982         Reviewed by Brady Eidson.
2983
2984         WebCore clients do not need explicit control over what queue ResourceHandle works on,
2985         they just want to avoid blocking main thread.
2986
2987         * platform/network/ResourceHandleClient.h:
2988         (WebCore::ResourceHandleClient::usesAsyncCallbacks): Added. The name doesn't quite
2989         match what ResourceHandleMac currently does, but it will very soon.
2990
2991         * platform/network/NetworkingContext.h:
2992         (WebCore::NetworkingContext::scheduledRunLoopPairs):
2993         * platform/network/mac/ResourceHandleMac.mm:
2994         (WebCore::operationQueueForAsyncClients):
2995         (WebCore::ResourceHandle::start):
2996
2997 2013-03-21  Marja Hölttä  <marja@chromium.org>
2998
2999         [V8] Generate specialized callbacks for the main world
3000         https://bugs.webkit.org/show_bug.cgi?id=112430
3001
3002         Reviewed by Jochen Eisinger.
3003
3004         The new specialized bindings will be faster, because they don't need to
3005         do the "main world, isolated world or a worker" check, but can right
3006         away assume that we're in the main world.
3007
3008         This patch generates main world bindings for getters and setters of Node,
3009         Element and Document.
3010
3011         No new tests (updated existing binding tests).
3012
3013         * bindings/scripts/CodeGeneratorV8.pm:
3014         (GenerateOverloadedFunction):
3015         (GenerateFunctionCallback):
3016         (GenerateFunction):
3017         (GenerateParametersCheck):
3018         (GenerateSingleConstructorCallback):
3019         (GenerateNonStandardFunction):
3020         (GenerateImplementation):
3021         (GenerateFunctionCallString):
3022         * bindings/scripts/test/V8/V8Float64Array.cpp:
3023         (WebCore):
3024         * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
3025         (WebCore):
3026         * bindings/scripts/test/V8/V8TestEventTarget.cpp:
3027         (WebCore):
3028         * bindings/scripts/test/V8/V8TestInterface.cpp:
3029         (WebCore):
3030         * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
3031         (WebCore):
3032         * bindings/scripts/test/V8/V8TestObj.cpp:
3033         (WebCore):
3034         * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
3035         (WebCore):
3036         * bindings/scripts/test/V8/V8TestTypedefs.cpp:
3037         (WebCore):
3038         * bindings/v8/V8DOMConfiguration.cpp:
3039         (WebCore::V8DOMConfiguration::batchConfigureCallbacks):
3040         (WebCore::V8DOMConfiguration::configureTemplate):
3041         * bindings/v8/V8DOMConfiguration.h:
3042         (BatchedMethod):
3043         (V8DOMConfiguration):
3044         * dom/Document.idl:
3045         * dom/Element.idl:
3046         * dom/Node.idl:
3047
3048 2013-03-21  Elliott Sprehn  <esprehn@chromium.org>
3049
3050         Remove RenderObject::canHaveRegionStyle since nothing uses it
3051         https://bugs.webkit.org/show_bug.cgi?id=112973
3052
3053         Reviewed by Eric Seidel.
3054
3055         Nothing uses canHaveRegionStyle so we can remove it.
3056
3057         * rendering/RenderObject.h:
3058
3059 2013-03-21  Alok Priyadarshi  <alokp@chromium.org>
3060
3061         Mark GraphicsLayers as opaque when possible
3062         https://bugs.webkit.org/show_bug.cgi?id=70634
3063
3064         Reviewed by Simon Fraser.
3065
3066         Mark layers as opaque in a very simple case - any child renderer has an opaque background and covers the entire composited bounds. It is important to note that since we only consider the background, the only layer that can be marked opaque is the primary GraphicsLayer of a RenderLayer.
3067
3068         Tests: compositing/contents-opaque/background-clip.html
3069                compositing/contents-opaque/background-color.html
3070                compositing/contents-opaque/body-background-painted.html
3071                compositing/contents-opaque/body-background-skipped.html
3072                compositing/contents-opaque/layer-opacity.html
3073                compositing/contents-opaque/layer-transform.html
3074
3075         * rendering/RenderBox.cpp:
3076         (WebCore::skipBodyBackground):
3077         (WebCore):
3078         (WebCore::RenderBox::paintBackground):
3079         (WebCore::RenderBox::backgroundIsKnownToBeOpaqueInRect):
3080         * rendering/RenderBox.h:
3081         (RenderBox):
3082         * rendering/RenderLayer.cpp:
3083         (WebCore::RenderLayer::backgroundIsKnownToBeOpaqueInRect):
3084         (WebCore):
3085         (WebCore::RenderLayer::listBackgroundIsKnownToBeOpaqueInRect):
3086         * rendering/RenderLayer.h:
3087         (RenderLayer):
3088         * rendering/RenderLayerBacking.cpp:
3089         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
3090         * rendering/RenderLayerModelObject.h:
3091         (RenderLayerModelObject):
3092         (WebCore::RenderLayerModelObject::backgroundIsKnownToBeOpaqueInRect):
3093
3094 2013-03-21  Alexandru Chiculita  <achicu@adobe.com>
3095
3096         [CSS Shaders] Implement a StyleCustomFilterProgram cache
3097         https://bugs.webkit.org/show_bug.cgi?id=112602
3098
3099         Reviewed by Dean Jackson.
3100
3101         When the style is recalculated, the new computed RenderStyle is saved as the m_style of the
3102         RenderObject, even if the style was not different.
3103
3104         In the case of Custom Filters, a new StyleCustomFilterProgram was created at all times, but the
3105         actual equality check was done by comparing the pair of cached shaders from inside the StyleCustomFilterProgram.
3106
3107         Because of that the RenderLayer::styleChanged was not called when the new StyleCustomFilterProgram was created, so it
3108         will end up still knowing only about the previous StyleCustomFilterProgram.
3109
3110         The RenderLayer sets itself as a client of the StyleCustomFilterProgram, so that it can repaint itself
3111         when the program is loaded, but because RenderLayer::styleChanged is not called, it will not add itself as a client of the new
3112         StyleCustomFilterProgram.
3113
3114         StyleCustomFilterProgram waits until the first client to load the programs, so in this case it will just remain unloaded.
3115
3116         There was no crash, but just an assert in debug mode. Also, as a visible side-effect some frames were rendered using blank shaders, 
3117         resulting in a pass-through filter.
3118
3119         The fix would be to actually make the RenderStyle::diff detect the change of the StyleCustomFilterProgram
3120         using the pointer value and not the values. However, that will always invalidate the "filter" property because
3121         of the StyleCustomFilterProgram that always gets created during the recalculation time.
3122
3123         I've added StyleCustomFilterProgramCache to cache all the instances of the StyleCustomFilterPrograms that a
3124         StyleResolver allocates. This way, next time it will try to reuse previously allocated StyleCustomFilterPrograms. 
3125         The key of the cache is the CustomFilterProgramInfo, that combines the URLs to the shaders and a couple of other program settings.
3126
3127         StyleCustomFilterProgramCache is owned by the StyleResovler and StyleCustomFilterPrograms are responsible with
3128         removing themselves from the cache when the last reference goes away.
3129
3130         This change makes the previous "platform level" program cache obsolete and I will remove that in a future patch.
3131         https://bugs.webkit.org/show_bug.cgi?id=112844
3132
3133         Test: css3/filters/custom/custom-filter-reload.html
3134
3135         * GNUmakefile.list.am:
3136         * Target.pri:
3137         * WebCore.gypi:
3138         * WebCore.vcproj/WebCore.vcproj:
3139         * WebCore.xcodeproj/project.pbxproj:
3140         * css/StyleResolver.cpp:
3141         (WebCore::StyleResolver::lookupCustomFilterProgram): Lookup any similar programs in the cache. It will create a new pending 
3142         StyleCustomFilterProgram if there is no pre-cached version of the program.
3143         if no program is found. loadPendingShaders is responsible for adding the program in the cache if it is actually going to be used.
3144         (WebCore::StyleResolver::loadPendingShaders): At this point the program is final, so it's safe to add it to the cache.
3145         (WebCore::StyleResolver::createCustomFilterOperationWithInlineSyntax):
3146         * css/StyleResolver.h:
3147         (StyleResolver):
3148         * css/WebKitCSSShaderValue.cpp:
3149         (WebCore::WebKitCSSShaderValue::completeURL): Factored out the function to compute the complete URL of the resource.
3150         (WebCore::WebKitCSSShaderValue::cachedShader):
3151         * css/WebKitCSSShaderValue.h:
3152         (WebCore::toWebKitCSSShaderValue):
3153         (WebKitCSSShaderValue):
3154         * platform/graphics/filters/CustomFilterOperation.cpp:
3155         (WebCore::CustomFilterOperation::blend):
3156         * platform/graphics/filters/CustomFilterOperation.h:
3157         (WebCore::CustomFilterOperation::operator==): Removed. Programs should now compare by pointer. Kept it as
3158         private to catch any potential use of it.
3159         * rendering/style/StyleCustomFilterProgram.cpp: Copied from Source/WebCore/css/WebKitCSSShaderValue.h.
3160         (WebCore::StyleCustomFilterProgram::~StyleCustomFilterProgram): Destructor removes the program from the cache.
3161         * rendering/style/StyleCustomFilterProgram.h:
3162         (WebCore::StyleCustomFilterProgram::setVertexShader): Added an assert to check that the shader is not in the
3163         cache while the mutation happens. Otherwise the cache might have the wrong key.
3164         (WebCore::StyleCustomFilterProgram::setFragmentShader): Ditto.
3165         (WebCore::StyleCustomFilterProgram::isLoaded): Added more asserts to catch cases when the program is used with no clients.
3166         (StyleCustomFilterProgram):
3167         (WebCore::StyleCustomFilterProgram::hasPendingShaders):
3168         (WebCore::StyleCustomFilterProgram::inCache):
3169         (WebCore::StyleCustomFilterProgram::setCache): Function called when a program is added to / removed from the cache.
3170         (WebCore::StyleCustomFilterProgram::vertexShaderURL): Added methods to store the KURL that we used as keys in the cache.
3171         The same KURLs will be used to lookup and remove the filter at the end.
3172         (WebCore::StyleCustomFilterProgram::setVertexShaderURL):
3173         (WebCore::StyleCustomFilterProgram::fragmentShaderURL):
3174         (WebCore::StyleCustomFilterProgram::setFragmentShaderURL):
3175         (WebCore::StyleCustomFilterProgram::StyleCustomFilterProgram):
3176         * rendering/style/StyleCustomFilterProgramCache.cpp: Added.
3177         (WebCore::StyleCustomFilterProgramCache::programCacheKey):
3178         (WebCore::StyleCustomFilterProgramCache::StyleCustomFilterProgramCache):
3179         (WebCore::StyleCustomFilterProgramCache::~StyleCustomFilterProgramCache): Destructor removes itself from all the
3180         referenced StyleCustomFilterPrograms. This is to avoid issues with different destruction orders.
3181         (WebCore::StyleCustomFilterProgramCache::lookup):
3182         (WebCore::StyleCustomFilterProgramCache::add):
3183         (WebCore::StyleCustomFilterProgramCache::remove):
3184         * rendering/style/StyleCustomFilterProgramCache.h:
3185         (StyleCustomFilterProgramCache):
3186         * platform/graphics/texmap/coordinated/CoordinatedCustomFilterProgram.h:
3187         (WebCore::CoordinatedCustomFilterProgram::operator==: Removed. Programs should now compare by pointer.
3188
3189 2013-03-21  Joshua Bell  <jsbell@chromium.org>
3190
3191         IndexedDB: Ensure all API methods have IDB_TRACE macros
3192         https://bugs.webkit.org/show_bug.cgi?id=112963
3193
3194         Reviewed by Tony Chang.
3195
3196         Anntotate methods and callbacks that weren't already annotated
3197         with IDB_TRACE macros to assist in debugging, e.g. when using
3198         the chromium port's chrome://tracing visualization.
3199
3200         No new tests - just harmless diagnostic sprinkles.
3201
3202         * Modules/indexeddb/IDBDatabase.cpp:
3203         (WebCore::IDBDatabase::createObjectStore): Added IDB_TRACE macro call here.
3204         (WebCore::IDBDatabase::deleteObjectStore): ...and here.
3205         (WebCore::IDBDatabase::transaction): ...etc.
3206         (WebCore::IDBDatabase::close):
3207         (WebCore::IDBDatabase::onVersionChange):
3208         * Modules/indexeddb/IDBFactory.cpp:
3209         (WebCore::IDBFactory::getDatabaseNames):
3210         (WebCore::IDBFactory::open):
3211         (WebCore::IDBFactory::deleteDatabase):
3212         * Modules/indexeddb/IDBFactoryBackendImpl.cpp:
3213         (WebCore::IDBFactoryBackendImpl::getDatabaseNames):
3214         (WebCore::IDBFactoryBackendImpl::deleteDatabase):
3215         (WebCore::IDBFactoryBackendImpl::open):
3216         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3217         (WebCore::IDBOpenDBRequest::onBlocked):
3218
3219 2013-03-21  Christian Biesinger  <cbiesinger@chromium.org>
3220
3221         http://trac.webkit.org/changeset/146375 causing CrOS crashes
3222         https://bugs.webkit.org/show_bug.cgi?id=112958
3223
3224         Reviewed by Adam Barth.
3225
3226         Test: fast/flexbox/crash-anonymous-box.html
3227
3228         * rendering/RenderDeprecatedFlexibleBox.cpp:
3229         (WebCore::RenderDeprecatedFlexibleBox::RenderDeprecatedFlexibleBox):
3230         Anonymous renderers don't have a node in their constructor, so
3231         don't get document() in there.
3232
3233 2013-03-21  Mike West  <mkwst@chromium.org>
3234
3235         CSP 1.1: Fire a SecurityPolicyViolationEvent when violations occur.
3236         https://bugs.webkit.org/show_bug.cgi?id=112783
3237
3238         Reviewed by Adam Barth.
3239
3240         A new event type for Content Security Policy violations landed in
3241         http://wkrev.com/146305; this patch takes that stub, and wires it up to
3242         ContentSecurityPolicy::reportViolation such that violation events fire
3243         when resources are blocked.
3244
3245         This should bring WebKit up to date with the current description of
3246         CSP's event model in sections 3.3[1] and 3.4.1.3[2] of the editor's
3247         draft.
3248
3249         [1]: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#processing-model
3250         [2]: https://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html#firing-events-using-the-securitypolicyviolationevent-interface
3251
3252         Test: http/tests/security/contentSecurityPolicy/1.1/securitypolicyviolation-block-image.html
3253
3254         * page/ContentSecurityPolicy.cpp:
3255         (WebCore::gatherSecurityPolicyViolationEventData):
3256             Populate a SecurityPolicyViolationEventInit object with the various
3257             bits of data that should be passed into the event constructor.
3258
3259             This static method is strictly an implementation detail; it's not
3260             part of ContentSecurityPolicy's public API.
3261         (WebCore::ContentSecurityPolicy::reportViolation):
3262             Regardless of whether the policy has set a 'report-uri' directive
3263             or not, gather together all the data we'll need to fire an event,
3264             create the event, and queue it up for dispatching on the Document.
3265
3266 2013-03-21  Terry Anderson  <tdanderson@chromium.org>
3267
3268         [chromium] Remove SK_SUPPORT_HINTING_SCALE_FACTOR flag and code
3269         https://bugs.webkit.org/show_bug.cgi?id=112928
3270
3271         Reviewed by Stephen White.
3272
3273         This flag was only for ChromeOS builds with HighDPI. It is no longer needed and can be removed. 
3274         See http://crbug.com/17550
3275
3276         No new tests needed since this is just removing unused code.
3277
3278         * platform/graphics/chromium/OpaqueRectTrackingContentLayerDelegate.cpp:
3279         (WebCore::OpaqueRectTrackingContentLayerDelegate::paintContents):
3280         * platform/graphics/skia/PlatformContextSkia.cpp:
3281         (WebCore::PlatformContextSkia::PlatformContextSkia):
3282         (WebCore::PlatformContextSkia::setupPaintCommon):
3283         * platform/graphics/skia/PlatformContextSkia.h:
3284
3285 2013-03-21  Mike West  <mkwst@chromium.org>
3286
3287         Drop full URLs from cross-origin access errors caused by protocol mismatches.
3288         https://bugs.webkit.org/show_bug.cgi?id=112894
3289
3290         Reviewed by Timothy Hatcher.
3291
3292         Following up on http://wkbug.com/112813, this patch brings protocol
3293         mismatch errors into line with the new origin-only hotness. The message
3294         is also changed to display the URL's protocol rather than the origin's
3295         protocol: it makes a big difference for 'data:' URLs, for instance.
3296
3297         * page/DOMWindow.cpp:
3298         (WebCore::DOMWindow::crossDomainAccessErrorMessage):
3299
3300 2013-03-21  Stephen Chenney  <schenney@chromium.org>
3301
3302         SVG text path referencing parent text infinite loops
3303         https://bugs.webkit.org/show_bug.cgi?id=112078
3304
3305         Reviewed by Philip Rogers.
3306
3307         We do not check the target type when adding a resource reference for
3308         SVG Text Path's URI. This goes horribly wrong when the target is the
3309         text path's parent text element. In this patch we check that the target
3310         element of the text path is indeed a path element, as the spec
3311         requires. No other element type is allowed.
3312
3313         Note that RenderSVGTextPath enforces this check in the renderer code
3314         also, so if we get past this check via pending resources, it doesn't
3315         matter. You can't get into this situation with a pending reference
3316         because, by definition, the parent must be defined before the text
3317         path child.
3318
3319         Test: svg/text/textpath-referencing-text-crash.svg
3320
3321         * svg/SVGTextPathElement.cpp:
3322         (WebCore::SVGTextPathElement::buildPendingResource):
3323
3324 2013-03-21  Joshua Bell  <jsbell@chromium.org>
3325
3326         IndexedDB: Remove onVersionChange(string) plumbing
3327         https://bugs.webkit.org/show_bug.cgi?id=112712
3328
3329         Reviewed by Adam Barth.
3330
3331         Delete unused onVersionChange(string) overload.
3332
3333         No new tests - just deleting dead code.
3334
3335         * Modules/indexeddb/IDBDatabase.cpp: Delete onVersionChange(string) overload.
3336         * Modules/indexeddb/IDBDatabase.h: Ditto.
3337         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: Ditto.
3338         * Modules/indexeddb/IDBDatabaseCallbacks.h: Ditto.
3339         * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp: Ditto.
3340         * Modules/indexeddb/IDBDatabaseCallbacksImpl.h: Ditto.
3341
3342 2013-03-21  Philip Rogers  <pdr@google.com>
3343
3344         Correct bisector angle calculation for markers
3345         https://bugs.webkit.org/show_bug.cgi?id=112054
3346
3347         Reviewed by Stephen Chenney.
3348
3349         The SVG marker spec states that mid markers with orient=auto should be aligned with their
3350         x-axis along the bisector of the incoming (in) and outgoing (out) angles. Previously we
3351         calculated this bisector angle as:
3352             bisector = (in + out) / 2;
3353         Angles cannot be averaged this way! Consider in=90deg and out=-180deg: the bisector should
3354         be 135deg but a naive average gives -45deg. This patch corrects for the discontinuity in
3355         angle values with:
3356             bisector = (in + out + 360) / 2   // if |in - out| > 180
3357             bisector = (in + out) / 2         // otherwise
3358         This patch includes an exhaustive test of angle values.
3359
3360         Test: svg/custom/marker-orient-auto.html
3361
3362         * rendering/svg/SVGMarkerData.h:
3363         (WebCore::SVGMarkerData::currentAngle):
3364
3365 2013-03-21  Harald Alvestrand  <hta@google.com>
3366
3367         Expose the Type field of an RTCStatsReport
3368         https://bugs.webkit.org/show_bug.cgi?id=112951
3369
3370         Reviewed by Adam Barth.
3371
3372         Covered by an extension of an existing test.
3373
3374         * Modules/mediastream/RTCStatsReport.h:
3375         (WebCore::RTCStatsReport::type):
3376         * Modules/mediastream/RTCStatsReport.idl:
3377
3378 2013-03-21  Alexey Proskuryakov  <ap@apple.com>
3379
3380         Move non-trivial virtual functions out of ResourceHandleClient.h
3381         https://bugs.webkit.org/show_bug.cgi?id=112950
3382
3383         Reviewed by Brady Eidson.
3384
3385         * CMakeLists.txt:
3386         * GNUmakefile.list.am:
3387         * Target.pri:
3388         * WebCore.exp.in:
3389         * WebCore.gypi:
3390         * WebCore.vcproj/WebCore.vcproj:
3391         * WebCore.vcxproj/WebCore.vcxproj:
3392         * WebCore.vcxproj/WebCore.vcxproj.filters:
3393         * WebCore.xcodeproj/project.pbxproj:
3394         * platform/network/ResourceHandleClient.cpp: Added.
3395         (WebCore::ResourceHandleClient::ResourceHandleClient):
3396         (WebCore::ResourceHandleClient::~ResourceHandleClient):
3397         (WebCore::ResourceHandleClient::didReceiveBuffer):
3398         (WebCore::ResourceHandleClient::getBuffer):
3399         * platform/network/ResourceHandleClient.h:
3400
3401 2013-03-21  Florin Malita  <fmalita@chromium.org>
3402
3403         [SVG] Remove explicit LightSource dispatchers
3404         https://bugs.webkit.org/show_bug.cgi?id=112827
3405
3406         Reviewed by Stephen Chenney.
3407
3408         Convert LightSource setters to dynamic dispatch. This allows us to remove LightSource.cpp
3409         altogether.
3410
3411         No new tests: refactoring only.
3412
3413         * CMakeLists.txt:
3414         * GNUmakefile.list.am:
3415         * Target.pri:
3416         * WebCore.gypi:
3417         * WebCore.vcproj/WebCore.vcproj:
3418         * WebCore.vcxproj/WebCore.vcxproj:
3419         * WebCore.vcxproj/WebCore.vcxproj.filters:
3420         * WebCore.xcodeproj/project.pbxproj:
3421         * platform/graphics/filters/DistantLightSource.h:
3422         (DistantLightSource):
3423         * platform/graphics/filters/LightSource.cpp: Removed.
3424         * platform/graphics/filters/LightSource.h:
3425         (WebCore::LightSource::setAzimuth):
3426         (WebCore::LightSource::setElevation):
3427         (WebCore::LightSource::setX):
3428         (WebCore::LightSource::setY):
3429         (WebCore::LightSource::setZ):
3430         (WebCore::LightSource::setPointsAtX):
3431         (WebCore::LightSource::setPointsAtY):
3432         (WebCore::LightSource::setPointsAtZ):
3433         (WebCore::LightSource::setSpecularExponent):
3434         (WebCore::LightSource::setLimitingConeAngle):
3435         * platform/graphics/filters/PointLightSource.h:
3436         (PointLightSource):
3437         * platform/graphics/filters/SpotLightSource.h:
3438         (SpotLightSource):
3439
3440 2013-03-21  Igor Oliveira  <igor.o@sisa.samsung.com>
3441
3442         [Texmap] Implement support for OpenGLES EXT_unpack_subimage extension
3443         https://bugs.webkit.org/show_bug.cgi?id=108716
3444
3445         If the extension GL_EXT_unpack_subimage is supported, it adds GL_UNPACK_ROW_LENGTH,
3446         GL_UNPACK_SKIP_ROWS and GL_UNPACK_SKIP_PIXELS as valid enums to PixelStore.
3447
3448         Reviewed by Noam Rosenthal.
3449
3450         * platform/graphics/texmap/TextureMapperGL.cpp: