[V8] Do not create a local handle for a cached v8 string that is returned to V8 immed...
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-01-11  Kentaro Hara  <haraken@chromium.org>
2
3         [V8] Do not create a local handle for a cached v8 string that is returned to V8 immediately
4         https://bugs.webkit.org/show_bug.cgi?id=106557
5
6         Reviewed by Adam Barth.
7
8         Currently we are always creating a local handle for a cached
9         V8 string returned to V8:
10
11           Handle<Value> v8String(StringImpl* impl, Isolate* isolate) {
12             ...;
13             return Local<String>::New(isolate, m_cachedString);
14           }
15
16         However, we don't need to create a local handle in a case
17         where it is guaranteed that no V8 object allocation is conducted
18         before a control flow returns back to V8. In particular, in a case
19         where a cached V8 string is immediately returned to V8, we don't
20         need to create a local handle:
21
22           Handle<Value> xxxxAttrGetter() {
23             ...;
24             return v8String(imp->xxxx(), isolate);  // This can return a persistent handle safely.
25           }
26
27         This patch improves performance of div.id by 9.2%.
28
29         No tests. No change in behavior.
30
31         * bindings/scripts/CodeGeneratorV8.pm:
32         (GenerateNormalAttrGetter):
33         (GenerateCallbackImplementation):
34         (GenerateFunctionCallString):
35         (NativeToJSValue):
36         * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
37         (WebCore::TestEventConstructorV8Internal::attr1AttrGetter):
38         (WebCore::TestEventConstructorV8Internal::attr2AttrGetter):
39         * bindings/scripts/test/V8/V8TestException.cpp:
40         (WebCore::TestExceptionV8Internal::nameAttrGetter):
41         * bindings/scripts/test/V8/V8TestInterface.cpp:
42         (WebCore::TestInterfaceV8Internal::supplementalStaticAttrAttrGetter):
43         (WebCore::TestInterfaceV8Internal::supplementalStr1AttrGetter):
44         (WebCore::TestInterfaceV8Internal::supplementalStr2AttrGetter):
45         * bindings/scripts/test/V8/V8TestObj.cpp:
46         (WebCore::TestObjV8Internal::readOnlyStringAttrAttrGetter):
47         (WebCore::TestObjV8Internal::staticStringAttrAttrGetter):
48         (WebCore::TestObjV8Internal::stringAttrAttrGetter):
49         (WebCore::TestObjV8Internal::reflectedStringAttrAttrGetter):
50         (WebCore::TestObjV8Internal::reflectedURLAttrAttrGetter):
51         (WebCore::TestObjV8Internal::reflectedCustomURLAttrAttrGetter):
52         (WebCore::TestObjV8Internal::stringAttrWithGetterExceptionAttrGetter):
53         (WebCore::TestObjV8Internal::stringAttrWithSetterExceptionAttrGetter):
54         (WebCore::TestObjV8Internal::hashAttrGetter):
55         (WebCore::TestObjV8Internal::conditionalMethod1Callback):
56         * bindings/v8/V8Binding.h:
57         (WebCore::v8String):
58         (WebCore::v8StringOrNull):
59         (WebCore::v8StringOrUndefined):
60         * bindings/v8/V8ValueCache.cpp:
61         (WebCore::StringCache::v8ExternalStringSlow):
62         * bindings/v8/V8ValueCache.h:
63         (WebCore::StringCache::v8ExternalString):
64         (StringCache):
65
66 2013-01-11  Carlos Garcia Campos  <cgarcia@igalia.com>
67
68         Unreviewed. Fix make distcheck.
69
70         * GNUmakefile.list.am: Add missing header files.
71
72 2013-01-11  Xianzhu Wang  <wangxianzhu@chromium.org>
73
74         RenderLayerCompositor should let ScrollingCoordinator update main thread scrolling reasons after change of layers
75         https://bugs.webkit.org/show_bug.cgi?id=105652
76
77         Reviewed by Simon Fraser.
78
79         Let ScrollingCoordinator know the change of ViewportConstrainedNotCompositedReason in time.
80         By the way moved RenderLayerCompositor::FixedPositionLayerNotCompositedReason to RenderLayer::ViewportConstrainedNotCompositedReason.
81
82         Tests: compositing/layer-creation/fixed-position-in-view-dynamic.html
83                compositing/layer-creation/fixed-position-out-of-view-dynamic.html
84
85         * page/scrolling/ScrollingCoordinator.cpp:
86         (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
87         (WebCore::ScrollingCoordinator::mainThreadScrollingReasons):
88         (WebCore::ScrollingCoordinator::mainThreadScrollingReasonsAsText):
89         * page/scrolling/ScrollingCoordinator.h:
90         (ScrollingCoordinator):
91         * page/scrolling/mac/ScrollingCoordinatorMac.h:
92         (WebCore::ScrollingCoordinatorMac::hasVisibleSlowRepaintViewportConstrainedObjects):
93         * page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
94         (WebCore::logThreadedScrollingMode):
95         * rendering/RenderLayer.cpp:
96         (WebCore::RenderLayer::RenderLayer):
97         (WebCore::RenderLayer::paintLayer):
98         * rendering/RenderLayer.h:
99         (RenderLayer): Moved RenderLayerCompositor::FixedPositionLayerNotCompositedReason to here and renamed it to ViewportConstrainedNotCompositedReason.
100         (WebCore::RenderLayer::setViewportConstrainedNotCompositedReason):
101         (WebCore::RenderLayer::viewportConstrainedNotCompositedReason):
102         * rendering/RenderLayerCompositor.cpp:
103         (WebCore::RenderLayerCompositor::updateCompositingLayers):
104         (WebCore::RenderLayerCompositor::updateBacking): Now updates ViewportConstrainedNotCompositedReason here instead of in computeCompositingRequirements before so that the reason is updated in time.
105         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
106         (WebCore::RenderLayerCompositor::needsToBeComposited):
107         (WebCore::RenderLayerCompositor::requiresCompositingLayer):
108         (WebCore::RenderLayerCompositor::reasonForCompositing):
109         (WebCore::RenderLayerCompositor::requiresCompositingForPosition):
110         (WebCore::RenderLayerCompositor::reportMemoryUsage):
111         * rendering/RenderLayerCompositor.h:
112         (RenderLayerCompositor):
113
114 2013-01-11  Kenneth Russell  <kbr@google.com>
115
116         [Chromium] WebGL typed array constructor crashes on exception
117         https://bugs.webkit.org/show_bug.cgi?id=106308
118
119         Reviewed by Kentaro Hara.
120
121         Check for empty handles (indicating exception thrown) after calls
122         into V8 VM.
123
124         Added new case from Khronos typed array conformance tests to
125         fast/canvas/webgl/array-unit-tests.html.
126
127         * bindings/v8/custom/V8ArrayBufferViewCustom.h:
128         (WebCore::constructWebGLArray):
129             Check for empty handles after calls into V8 VM.
130
131 2013-01-11  Kentaro Hara  <haraken@chromium.org>
132
133         [V8] Slightly optimize getWrapperFast()
134         https://bugs.webkit.org/show_bug.cgi?id=106667
135
136         Reviewed by Adam Barth.
137
138         This patch improves an if condition in getWrapperFast(),
139         as commented in DOMDataStore.h.
140
141         This patch improves performance of div.firstChild from
142         15.1 ns to 14.0 ns (+7.8%), although I couldn't observe
143         performance improvement in Dromaeo/dom-traverse.
144
145         No tests. No change in behavior.
146
147         * bindings/v8/DOMDataStore.h:
148         (WebCore::DOMDataStore::getWrapperFast):
149
150 2013-01-11  Florin Malita  <fmalita@chromium.org>
151
152         [SVG] Suppress resource rebuilding for unattached and shadow elements
153         https://bugs.webkit.org/show_bug.cgi?id=106664
154
155         Reviewed by Dirk Schulze.
156
157         SVGStyledElement::buildPendingResourcesIfNeeded() can be called while cloning a subtree
158         (as nodes are inserted into the clone, while still detached) or when elements are inserted
159         into the shadow tree. Both of these cases are problematic for SVGUseElement and can trigger
160         indirect recursion in SVGUseElement::buildPendingResource.
161
162         Since shadow and !inDocument() nodes are of no interest to ID dependents (they cannot be
163         found by ID in the document), the patch short-circuits buildPendingResource() for these
164         cases.
165
166         Test: svg/custom/use-rebuild-resources-crash.svg
167
168         * svg/SVGStyledElement.cpp:
169         (WebCore::SVGStyledElement::buildPendingResourcesIfNeeded):
170
171 2013-01-11  Dominic Mazzoni  <dmazzoni@google.com>
172
173         AX: Computed hierarchical level is not consistent with aria-level
174         https://bugs.webkit.org/show_bug.cgi?id=106638
175
176         Reviewed by Chris Fleizach.
177
178         Make hierarchicalLevel computation 1-based to match the aria-level spec.
179
180         Extends an existing test: platform/mac/accessibility/aria-tree.html.
181
182         * accessibility/AccessibilityNodeObject.cpp:
183         (WebCore::AccessibilityNodeObject::hierarchicalLevel):
184         * accessibility/AccessibilityObject.h:
185         (AccessibilityObject):
186         * accessibility/mac/WebAccessibilityObjectWrapper.mm:
187         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
188
189 2013-01-11  Vsevolod Vlasov  <vsevik@chromium.org>
190
191         Web Inspector: Workspace should support several projects and should not have temporary UISourceCodes.
192         https://bugs.webkit.org/show_bug.cgi?id=105856
193
194         Reviewed by Pavel Feldman.
195
196         Workspace now supports several projects with the networkProject being a main one.
197         Replaced temporary UISourceCodes with specific projects (debugger and liveedit).
198         The concept of workspace reset on navigation is now replaced with project reset concept instead.
199         Introduced snippets project (that is not reset on navigation).
200         Script mappings are now reset on GlobalObjectCleared event.
201
202         * inspector/front-end/BreakpointManager.js:
203         (WebInspector.BreakpointManager):
204         (WebInspector.BreakpointManager.prototype._innerSetBreakpoint):
205         (WebInspector.BreakpointManager.prototype._filteredBreakpointLocations):
206         (WebInspector.BreakpointManager.prototype.toggleAllBreakpoints):
207         (WebInspector.BreakpointManager.prototype.removeAllBreakpoints):
208         (WebInspector.BreakpointManager.prototype._projectWillReset.get for):
209         (WebInspector.BreakpointManager.prototype._projectWillReset):
210         * inspector/front-end/CSSStyleModel.js:
211         (WebInspector.CSSStyleModel):
212         (WebInspector.CSSStyleModel.prototype._inspectedURLChanged):
213         (WebInspector.CSSStyleModel.prototype._resetSourceMappings):
214         (WebInspector.CSSStyleModelResourceBinding):
215         (WebInspector.CSSStyleModelResourceBinding.prototype._viaInspectorResourceURL):
216         (WebInspector.CSSStyleModelResourceBinding.prototype._reset):
217         * inspector/front-end/CompilerScriptMapping.js:
218         (WebInspector.CompilerScriptMapping):
219         (WebInspector.CompilerScriptMapping.prototype._debuggerReset):
220         * inspector/front-end/DebuggerScriptMapping.js:
221         * inspector/front-end/DefaultScriptMapping.js:
222         (WebInspector.DefaultScriptMapping):
223         (WebInspector.DefaultScriptMapping.prototype.addScript):
224         (WebInspector.DefaultScriptMapping.prototype._debuggerReset):
225         * inspector/front-end/ExtensionServer.js:
226         (WebInspector.ExtensionServer.prototype._onGetPageResources):
227         * inspector/front-end/FilteredItemSelectionDialog.js:
228         (WebInspector.OpenResourceDialog.show):
229         * inspector/front-end/LiveEditSupport.js:
230         (WebInspector.LiveEditSupport):
231         (WebInspector.LiveEditSupport.prototype.uiSourceCodeForLiveEdit):
232         (WebInspector.LiveEditSupport.prototype._debuggerReset):
233         * inspector/front-end/NetworkUISourceCodeProvider.js:
234         (WebInspector.NetworkUISourceCodeProvider):
235         (WebInspector.NetworkUISourceCodeProvider.prototype._mainFrameNavigated):
236         (WebInspector.NetworkUISourceCodeProvider.prototype._addFile):
237         (WebInspector.NetworkUISourceCodeProvider.prototype._reset):
238         * inspector/front-end/ResourceScriptMapping.js:
239         (WebInspector.ResourceScriptMapping):
240         (WebInspector.ResourceScriptMapping.prototype._uiSourceCodeAddedToWorkspace):
241         (WebInspector.ResourceScriptMapping.prototype._debuggerReset):
242         * inspector/front-end/RevisionHistoryView.js:
243         (WebInspector.RevisionHistoryView):
244         (WebInspector.RevisionHistoryView.prototype._projectWillReset):
245         * inspector/front-end/SASSSourceMapping.js:
246         (_bindUISourceCode):
247         * inspector/front-end/ScriptSnippetModel.js:
248         (WebInspector.ScriptSnippetModel):
249         (WebInspector.ScriptSnippetModel.prototype._addScriptSnippet):
250         (WebInspector.ScriptSnippetModel.prototype.reset):
251         * inspector/front-end/ScriptsNavigator.js:
252         * inspector/front-end/ScriptsPanel.js:
253         (WebInspector.ScriptsPanel):
254         (WebInspector.ScriptsPanel.prototype._addUISourceCode):
255         (WebInspector.ScriptsPanel.prototype._uiSourceCodeRemoved):
256         (WebInspector.ScriptsPanel.prototype._removeUISourceCodes):
257         (WebInspector.ScriptsPanel.prototype._debuggerWasDisabled):
258         (WebInspector.ScriptsPanel.prototype._debuggerReset):
259         (WebInspector.ScriptsPanel.prototype._projectWillReset):
260         (WebInspector.ScriptsPanel.prototype.canShowAnchorLocation):
261         (WebInspector.ScriptsPanel.prototype._revealExecutionLine):
262         (WebInspector.ScriptsPanel.prototype.showGoToSourceDialog):
263         * inspector/front-end/SimpleWorkspaceProvider.js:
264         (WebInspector.SimpleWorkspaceProvider):
265         (WebInspector.SimpleWorkspaceProvider.prototype.addFile):
266         (WebInspector.SimpleWorkspaceProvider.prototype.addFileForURL):
267         (WebInspector.SimpleWorkspaceProvider.prototype.reset):
268         * inspector/front-end/StylesSourceMapping.js:
269         (WebInspector.StylesSourceMapping):
270         (WebInspector.StylesSourceMapping.prototype._projectWillReset):
271         * inspector/front-end/TabbedEditorContainer.js:
272         (WebInspector.TabbedEditorContainer.prototype.reset):
273         * inspector/front-end/UISourceCode.js:
274         (WebInspector.UISourceCode.prototype.project):
275         * inspector/front-end/Workspace.js:
276         (WebInspector.WorkspaceController):
277         (WebInspector.WorkspaceController.prototype._inspectedURLChanged):
278         (WebInspector.Project):
279         (WebInspector.Project.prototype.name):
280         (WebInspector.Project.prototype.isServiceProject):
281         (WebInspector.Project.prototype._reset):
282         (WebInspector.Workspace):
283         (WebInspector.Workspace.prototype.uiSourceCodeForURL):
284         (WebInspector.Workspace.prototype.uiSourceCodeForURI):
285         (WebInspector.Workspace.prototype.addProject):
286         (WebInspector.Workspace.prototype.project):
287         (WebInspector.Workspace.prototype.projects):
288         (WebInspector.Workspace.prototype.uiSourceCodes):
289         (WebInspector.Workspace.prototype.projectForUISourceCode):
290         (WebInspector.Workspace.prototype.requestFileContent):
291         (WebInspector.Workspace.prototype.setFileContent):
292         (WebInspector.Workspace.prototype.searchInFileContent):
293         * inspector/front-end/inspector.js:
294         * inspector/front-end/utilities.js:
295
296 2013-01-11  Eugene Klyuchnikov  <eustas@chromium.org>
297
298         Web Inspector: [Resources] Make grid columns set configurable.
299         https://bugs.webkit.org/show_bug.cgi?id=105739
300
301         Reviewed by Pavel Feldman.
302
303         Added context menu on grid header to hide/show grid columns.
304         Hidden columns set is persisted.
305
306         * inspector/front-end/DataGrid.js:
307         Fixed show/hide behavior, introduced weight control.
308         * inspector/front-end/NetworkPanel.js:
309         Added member to track visibility of columns in detailerd mode. Added
310         context menu for grid header.
311
312 2013-01-11  Andras Becsi  <andras.becsi@digia.com>
313
314         [Qt] Fix the build if libxslt is not available but libxml2 is
315         https://bugs.webkit.org/show_bug.cgi?id=106661
316
317         Reviewed by Simon Hausmann.
318
319         On Linux building the xml parser sources fails if the needed libxslt
320         dependencies are not installed but libxml2 is.
321
322         * WebCore.pri: add libxml2 to pkg-config if not on mac.
323
324 2013-01-11  Stephen Chenney  <schenney@chromium.org>
325         Objects can be re-added to the AXObjectCache during removal
326         https://bugs.webkit.org/show_bug.cgi?id=104171
327
328         The problem occurs when a label's corresponding element is a sibling
329         that precedes it in the render tree, and the corresponding element is
330         removed. The corresponding element's AX render object is removed, but
331         then recreated when accessibilityIsIgnored() invokes correspondingControl()
332         on the label. The corresponding renderer then has an AX render object
333         that survives beyond the deleted renderer, leading to invalid memory
334         accesses.
335
336         The solution is to rearrange the calls to delete the renderer's AX
337         render object only when we are sure it will no longer be required.
338
339         Reviewed by Simon Fraser.
340
341         Test: accessibility/corresponding-control-deleted-crash.html
342
343         * rendering/RenderObject.cpp:
344         (WebCore::RenderObject::willBeDestroyed): Move the call to remove the
345         renderer from the AXCache to after the renderer is removed from the
346         render tree. This means that the AXObject still exists during renderer
347         removal, as we require.
348
349 2013-01-11  Allan Sandfeld Jensen  <allan.jensen@digia.com>
350
351         [Qt][WK1] Web Audio support
352         https://bugs.webkit.org/show_bug.cgi?id=106651
353
354         Reviewed by Jocelyn Turcotte.
355
356         Convert JavaScript Uint8Array to QByteArray. This conversion is necessary to support testRunner.setAudioData().
357
358         * bridge/qt/qt_runtime.cpp:
359         (JSC::Bindings::isJSUint8Array):
360         (Bindings):
361         (JSC::Bindings::valueRealType):
362         (JSC::Bindings::convertValueToQVariant):
363
364 2013-01-11  Anton Vayvod  <avayvod@chromium.org>
365
366         Text Autosizing - elements much narrower than its parent autosizing clusters should be autosized separately.
367         https://bugs.webkit.org/show_bug.cgi?id=105188
368
369         Reviewed by Kenneth Rohde Christiansen.
370
371         Some blocks of text might be narrower than their parent clusters and should be autosized separately.
372         This helps with autosizing for the pages implementing the sidebars as a narrow blocks of text with wide margins and
373         the main content being positioned atop this margin (or vice versa).
374
375         * rendering/TextAutosizer.cpp:
376         (WebCore::TextAutosizer::isContainerAutosizingCluster):
377
378             Returns true if the container is more than 200 pixels narrower than its parent cluster's lowest common
379             ancestor of all the text nodes.
380
381 2013-01-11  Andreas Kling  <akling@apple.com>
382
383         Remove unused CSSSelector(QualifiedName) constructor.
384         <http://webkit.org/b/106652>
385
386         Reviewed by Antti Koivisto.
387
388         * css/CSSSelector.h:
389         (CSSSelector):
390
391 2013-01-11  Zan Dobersek  <zandobersek@gmail.com>
392
393         [GTK] Disable the ENABLE_LEGACY_WEB_AUDIO feature define in release builds
394         https://bugs.webkit.org/show_bug.cgi?id=106577
395
396         Reviewed by Philippe Normand.
397
398         The Web Audio feature is not enabled in the release builds, so there's
399         no need to enable the legacy Web Audio API either.
400
401         No new tests - no new functionality.
402
403         * GNUmakefile.features.am.in:
404
405 2013-01-11  Antoine Quint  <graouts@apple.com>
406
407         Web Inspector: Option+Click on Node Expander Doesn't Work the First Time
408         https://bugs.webkit.org/show_bug.cgi?id=66868
409
410         Up to now, the TreeElement.prototype.expandRecursively() method would correctly
411         expand children recursively based on the provided depth, but would not wait to
412         perform this task until all child nodes had been populated, which means that this
413         would only work incrementally with one additional level of child nodes being shown
414         expanded in the DOM tree upon alt+clicking a given node with a deep hierarchy.
415         
416         In order to fix this, this patch adds a new optional argument to the DOMAgent's
417         requestChildNodes() methods to provide the depth at which we want to retrieve children
418         of a given node. The DOMAgent provides a new .getSubtree() method that calls
419         requestChildNodes() with the provided depth.
420
421         Then in ElementsTreeOutline, we subclass .expandRecursively() to first call DOMAgent's
422         new .getSubtree() method and then call the default implementation when all nodes
423         have been retrieved from the backend.
424
425         Reviewed by Pavel Feldman.
426
427         Tests: inspector-protocol/dom-request-child-nodes-depth.html
428                inspector/elements/expand-recursively.html
429
430         * inspector/Inspector.json: Add the new `depth` parameter to DOM.requestChildNodes().
431         * inspector/InspectorDOMAgent.cpp:
432         (WebCore::InspectorDOMAgent::pushChildNodesToFrontend): Add a new optional `depth` parameter
433         which defaults to 1.
434         (WebCore::InspectorDOMAgent::requestChildNodes): Add a new optional `depth` parameter
435         which defaults to 1 and allows -1 as an unbound value.
436         * inspector/InspectorDOMAgent.h:
437         (InspectorDOMAgent):
438         * inspector/front-end/DOMAgent.js:
439         (WebInspector.DOMNode.prototype.):
440         (WebInspector.DOMNode.prototype.getSubtree): New method allowing to specify at what depth
441         we want to retrieve children of a given node from the backend.
442         * inspector/front-end/ElementsTreeOutline.js:
443         (WebInspector.ElementsTreeElement.prototype.expandRecursively): Override default implementation
444         to first obtain the deepest subtree for the current node so that deep expansion happens as expected.
445
446 2013-01-11  Alexander Pavlov  <apavlov@chromium.org>
447
448         Web Inspector: [Elements] Search in the DOM tree does not scroll horizontally
449         https://bugs.webkit.org/show_bug.cgi?id=106648
450
451         Reviewed by Vsevolod Vlasov.
452
453         Scroll into view the first match in every tree element, if needed.
454
455         * inspector/front-end/ElementsPanel.js:
456         (WebInspector.ElementsPanel.prototype._highlightCurrentSearchResult):
457
458 2013-01-11  Andrey Adaikin  <aandrey@chromium.org>
459
460         Web Inspector: [Canvas] a minor follow-up to r137262
461         https://bugs.webkit.org/show_bug.cgi?id=106644
462
463         Reviewed by Pavel Feldman.
464
465         * inspector/InjectedScriptCanvasModuleSource.js:
466         (.):
467
468 2013-01-11  Kent Tamura  <tkent@chromium.org>
469
470         BaseDateAndTimeInputType should not inherit from TextFieldInputType
471         https://bugs.webkit.org/show_bug.cgi?id=106306
472
473         Reviewed by Hajime Morita.
474
475         Date/time input types don't need text-field features at all.
476
477         No new tests. This should not make any behavior changes except reduction
478         of memory usage.
479
480         * html/BaseDateAndTimeInputType.h:
481         Inherit InputType instead of TextFieldInputType.
482         (WebCore::BaseDateAndTimeInputType::BaseDateAndTimeInputType):
483         (BaseDateAndTimeInputType): Update function declarations.
484         * html/BaseDateAndTimeInputType.cpp:
485         Remove handleKeydownEvent and convertFromVisibleValue, which are for
486         TextFieldInputType.
487         (WebCore::BaseDateAndTimeInputType::shouldRespectListAttribute):
488         Added. This is necessary for <datalist> support. TextFieldInputType has
489         the same code.
490         (WebCore::BaseDateAndTimeInputType::valueMissing):
491         Added. This is necessary for validity.valueMissing. TextFieldInputType
492         has the same code.
493
494         * html/BaseChooserOnlyDateAndTimeInputType.cpp:
495         Remove unnecessary functions which cancel TextFieldInputType behavior.
496         * html/BaseChooserOnlyDateAndTimeInputType.h:
497         (BaseChooserOnlyDateAndTimeInputType): Remove declarations for them.
498
499         * html/BaseMultipleFieldsDateAndTimeInputType.cpp:
500         Remove unnecessary functions which cancel TextFieldInputType behavior.
501         * html/BaseMultipleFieldsDateAndTimeInputType.h:
502         (BaseMultipleFieldsDateAndTimeInputType):
503         Add SpinButtonOwner interface. We didn't need it because
504         TextFieldInputType implements it.
505
506 2013-01-11  Mary Wu  <mary.wu@torchmobile.com.cn>
507
508         [BlackBerry] Enable concatenating headers with same field name
509         https://bugs.webkit.org/show_bug.cgi?id=106625
510
511         Reviewed by Rob Buis.
512
513         RFC 2616 specifies that headers could concatenate with comma if they have
514         same field name. We should enable this if the header allows multiple values.
515
516         RIM PR# 275508, internally reviewed by Joe Mason
517
518         (WebCore):
519         (WebCore::isAppendableHeader):
520         (WebCore::NetworkJob::handleNotifyHeaderReceived):
521
522 2013-01-11  Jochen Eisinger  <jochen@chromium.org>
523
524         Connect UserGestureIndicator for mousedown and mouseup events
525         https://bugs.webkit.org/show_bug.cgi?id=105138
526
527         Reviewed by Adam Barth.
528
529         Ports that consume user gestures to prevent certain types of pop-ups
530         need to be able to connect mousedown and mouseup events, otherwise, a
531         single mouse click will allow for opening multiple pop-ups.
532
533         Note that a mousedown is not always followed by a mouseup and vice
534         versa, e.g. when the mousedown results in a context menu being shown, or
535         something is dragged into the page.
536
537         Test: platform/chromium/fast/events/popup-allowed-from-gesture-only-once-two-events.html
538
539         * page/EventHandler.cpp:
540         (WebCore::EventHandler::clear):
541         (WebCore::EventHandler::handleMousePressEvent):
542         (WebCore::EventHandler::handleMouseReleaseEvent):
543         * page/EventHandler.h:
544
545 2013-01-11  Eugene Klyuchnikov  <eustas@chromium.org>
546
547         Web Inspector: [Resources] "Delete" cookie deletes all cookies with matching name.
548         https://bugs.webkit.org/show_bug.cgi?id=105633
549
550         Reviewed by Pavel Feldman.
551
552         "Delete" cookie deletes all cookies with matching name,
553         ignoring domain and path.
554
555         * inspector/Inspector.json: Change argument "domain" to "url"
556         * inspector/InspectorPageAgent.cpp:
557         (WebCore::InspectorPageAgent::deleteCookie): Use url to delte cookies.
558         * inspector/InspectorPageAgent.h: Adopt new signature.
559         * inspector/front-end/CookieItemsView.js:
560         (WebInspector.CookieItemsView.prototype._deleteCookie): Ditto.
561
562 2013-01-11  KwangYong Choi  <ky0.choi@samsung.com>
563
564         [EFL] Fix unused parameter build error
565         https://bugs.webkit.org/show_bug.cgi?id=106639
566
567         Reviewed by Kentaro Hara.
568
569         Use UNUSED_PARAM macro to fix build error.
570
571         No new tests, no behavior change.
572
573         * platform/efl/EflScreenUtilities.cpp:
574         (WebCore::isUsingEcoreX):
575         * platform/efl/RenderThemeEfl.cpp:
576         (WebCore::RenderThemeEfl::supportsDataListUI):
577
578 2013-01-11  Pavel Feldman  <pfeldman@chromium.org>
579
580         Web Inspector [chromium]: Debugger.globalObjectCleared is not dispatched on reload after renderer swap
581         https://bugs.webkit.org/show_bug.cgi?id=106555
582
583         Reviewed by Vsevolod Vlasov.
584
585         Wrong ::enable was made virtual in the InspectorDebuggerAgent.
586
587         Test: inspector/debugger/debugger-scripts-reload.html
588
589         * inspector/InspectorDebuggerAgent.h:
590         (InspectorDebuggerAgent):
591         * inspector/PageDebuggerAgent.cpp:
592         (WebCore::PageDebuggerAgent::enable):
593         (WebCore::PageDebuggerAgent::disable):
594         * inspector/PageDebuggerAgent.h:
595         (PageDebuggerAgent):
596
597 2013-01-11  Vsevolod Vlasov  <vsevik@chromium.org>
598
599         Web Inspector: Refactoring, move NetworkWorkspaceProvider to NetworkUISourceCodeProvider.js and rename its parent to SimpleWorkspaceProvider.
600         https://bugs.webkit.org/show_bug.cgi?id=106635
601
602         Reviewed by Pavel Feldman.
603
604         * WebCore.gypi:
605         * WebCore.vcproj/WebCore.vcproj:
606         * inspector/compile-front-end.py:
607         * inspector/front-end/DebuggerScriptMapping.js:
608         (WebInspector.DebuggerScriptMapping):
609         * inspector/front-end/DefaultScriptMapping.js:
610         (WebInspector.DefaultScriptMapping):
611         (WebInspector.DefaultScriptMapping.prototype.addScript):
612         (WebInspector.DebuggerWorkspaceProvider):
613         (WebInspector.DebuggerWorkspaceProvider.prototype.addDebuggerFile):
614         * inspector/front-end/LiveEditSupport.js:
615         (WebInspector.LiveEditSupport):
616         (WebInspector.LiveEditSupport.prototype.uiSourceCodeForLiveEdit):
617         (WebInspector.LiveEditWorkspaceProvider):
618         (WebInspector.LiveEditWorkspaceProvider.prototype.addLiveEditFile):
619         * inspector/front-end/NetworkUISourceCodeProvider.js:
620         (WebInspector.NetworkWorkspaceProvider):
621         (WebInspector.NetworkWorkspaceProvider.prototype.addNetworkFile):
622         * inspector/front-end/SimpleWorkspaceProvider.js: Renamed from Source/WebCore/inspector/front-end/NetworkWorkspaceProvider.js.
623         (WebInspector.SimpleWorkspaceProvider):
624         (WebInspector.SimpleWorkspaceProvider.uriForURL):
625         (WebInspector.SimpleWorkspaceProvider.prototype.requestFileContent):
626         (WebInspector.SimpleWorkspaceProvider.prototype.setFileContent):
627         (WebInspector.SimpleWorkspaceProvider.prototype.searchInFileContent):
628         (WebInspector.SimpleWorkspaceProvider.prototype.addFile):
629         (WebInspector.SimpleWorkspaceProvider.prototype.removeFile):
630         (WebInspector.SimpleWorkspaceProvider.prototype.uniqueURI):
631         (WebInspector.SimpleWorkspaceProvider.prototype.reset):
632         * inspector/front-end/WebKit.qrc:
633         * inspector/front-end/inspector.html:
634         * inspector/front-end/inspector.js:
635
636 2013-01-10  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
637
638         On Linux, should be able to get spelling suggestions without selecting the misspelled word
639         https://bugs.webkit.org/show_bug.cgi?id=103520
640
641         Reviewed by Ryosuke Niwa.
642
643         Allow to get/insert spelling suggestions without selecting the misspelled word for
644         Linux WebKit ports. WebCore assumes that the misspelled word has to be selected
645         to get its suggestions.
646
647         In compliance with native application behaviour a new editing policy is introduced,
648         to do not highlight the misspelled word to just get its guesses.
649
650         No new tests, covered by context-menu-suggestions.html.
651
652         * WebCore.exp.in:
653         Remove _ZN7WebCore6Editor21isSelectionMisspelledEv symbol as Mac port doesn't
654         need it any longer.
655
656         * editing/EditingBehavior.h:
657         (EditingBehavior):
658         (WebCore::EditingBehavior::shouldAllowSpellingSuggestionsWithoutSelection):
659         Add a new behavior for Linux, to allow spelling suggestions without selecting
660         the misspelled word.
661
662         * editing/Editor.cpp:
663         (WebCore::Editor::isContinuousSpellCheckingEnabled):
664         Add missing const modifier, to use this method in 'misspelledWordAtCaretOrRange() const'.
665
666         (WebCore::Editor::misspelledWordAtCaretOrRange):
667         Allow to check spelling under the caret or selected word.
668         Does nothing for selection made on the multiple words.
669
670         (WebCore::Editor::misspelledSelectionString):
671         Return the misspelled selection.
672
673         (WebCore::Editor::guessesForMisspelledWord):
674         Remove 'Selection' from method name as it may return guesses without selection.
675
676         (WebCore::Editor::guessesForMisspelledOrUngrammatical):
677         Ditto.
678
679         * page/ContextMenuController.cpp:
680         (WebCore::ContextMenuController::contextMenuItemSelected):
681         Select the word under caret to meet the conditions from misspelledWordAtCaretOrRange.
682
683         (WebCore::ContextMenuController::populate):
684         Update guessesForMisspelledOrUngrammatical call.
685
686 2013-01-10  Hajime Morrita  <morrita@google.com>
687
688         https://bugs.webkit.org/show_bug.cgi?id=106283
689         [Shadow DOM] HTMLContentElement and HTMLShadowElement should be behind SHADOW_DOM
690
691         Reviewed by Kentaro Hara.
692
693         No new tests. Covered by existing tests.
694
695         This change moves <content> and <shadow> behind
696         ENABLE(SHADOW_DOM). Note that empty stub definitions are remaining
697         even after this change. They are for minimizing #if/#endif usage
698         and won't hurt code size.
699
700         * WebCore.exp.in:
701         * html/InputType.cpp:
702         (WebCore::InputType::destroyShadowSubtree):
703         * html/shadow/ContentDistributor.cpp:
704         (WebCore::ContentDistributor::distribute):
705         * html/shadow/HTMLContentElement.cpp:
706         (WebCore):
707         (WebCore::HTMLContentElement::create):
708         (WebCore::HTMLContentElement::HTMLContentElement):
709         * html/shadow/HTMLContentElement.h:
710         (WebCore):
711         (HTMLContentElement):
712         * html/shadow/HTMLShadowElement.cpp:
713         * html/shadow/HTMLShadowElement.h:
714         (WebCore):
715         (WebCore::isHTMLShadowElement):
716         (WebCore::toHTMLShadowElement):
717         * html/shadow/TextFieldDecorationElement.cpp:
718         (WebCore::TextFieldDecorationElement::decorate):
719         * testing/Internals.cpp:
720         (WebCore::Internals::createContentElement):
721         (WebCore::Internals::isValidContentSelect):
722
723 2013-01-10  Takashi Sakamoto  <tasak@google.com>
724
725         Implement CSSGroupingRule for @host @-rules and @supports.
726         https://bugs.webkit.org/show_bug.cgi?id=106418
727
728         Reviewed by Antti Koivisto.
729
730         CSSGroupingRule is to share code between CSSMediaRule, CSSSupportsRule
731         and CSSHostRule. @supports and @host @-rules are dervied from
732         CSSGroupingRule:
733         http://www.w3.org/TR/2012/WD-css3-conditional/#the-cssgroupingrule-interface
734         https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#css-host-rule-interface
735         Since @media is also derived from CSSGroupingRule and @region has the
736         same interface as CSSGroupingRule, modify to use CSSGroupingRule:
737         http://dev.w3.org/csswg/css3-regions/#the-at-region-style-rule
738
739         No new tests, because no new feature is implemented.
740
741         * CMakeLists.txt:
742         * GNUmakefile.list.am:
743         * Target.pri:
744         * WebCore.gypi:
745         * WebCore.vcproj/WebCore.vcproj:
746         * WebCore.xcodeproj/project.pbxproj:
747         Added CSSGroupingRule.h and CSSGroupingRule.cpp.
748         * css/CSSAllInOne.cpp:
749         Modified to include CSSGroupingRule.cpp.
750         * css/CSSGroupingRule.cpp: Added.
751         (WebCore):
752         (WebCore::CSSGroupingRule::CSSGroupingRule):
753         (WebCore::CSSGroupingRule::~CSSGroupingRule):
754         (WebCore::CSSGroupingRule::insertRule):
755         (WebCore::CSSGroupingRule::deleteRule):
756         (WebCore::CSSGroupingRule::appendCssTextForItems):
757         (WebCore::CSSGroupingRule::length):
758         (WebCore::CSSGroupingRule::item):
759         (WebCore::CSSGroupingRule::cssRules):
760         (WebCore::CSSGroupingRule::reattach):
761         (WebCore::CSSGroupingRule::reportMemoryUsage):
762         These codes are moved from CSSMediaRule and WebKitCSSRegionRule.
763         * css/CSSGroupingRule.h:
764         (WebCore):
765         (CSSGroupingRule):
766         * css/CSSMediaRule.cpp:
767         (WebCore::CSSMediaRule::CSSMediaRule):
768         (WebCore::CSSMediaRule::~CSSMediaRule):
769         Make CSSMediaRule inherit CSSGroupingRule.
770         (WebCore::CSSMediaRule::media):
771         (WebCore::CSSMediaRule::reattach):
772         Keep the code for updating media queries' CSSOMWrapper.
773         (WebCore::CSSMediaRule::reportMemoryUsage):
774         We need to report media queries' CSSOMWrapper memory usage.
775         (WebCore::CSSMediaRule::mediaQueries):
776         (WebCore::CSSMediaRule::cssText):
777         * css/CSSMediaRule.h:
778         * css/WebKitCSSRegionRule.cpp:
779         Make WebKitCSSRegionRule inherit CSSGroupingRule.
780         (WebCore::WebKitCSSRegionRule::WebKitCSSRegionRule):
781         (WebCore::WebKitCSSRegionRule::cssText):
782         * css/WebKitCSSRegionRule.h:
783         * css/StyleRule.h:
784         Added inlined accessor to obtain StyleRuleMedia* and StyleRuleRegion*
785         from StyleRuleBlock*.
786
787 2012-12-28  Andrey Adaikin  <aandrey@chromium.org>
788
789         Web Inspector: [Canvas] add an option to reload the page if there is an uninstrumented canvas
790         https://bugs.webkit.org/show_bug.cgi?id=105822
791
792         Reviewed by Pavel Feldman.
793
794         Show in the front-end an option to reload the page if there is an uninstrumented canvas.
795
796         * inspector/front-end/CanvasProfileView.js:
797         (WebInspector.CanvasProfileType):
798         (WebInspector.CanvasProfileType.prototype.decorationElement):
799         (WebInspector.CanvasProfileType.prototype._updateDecorationElement):
800         (WebInspector.CanvasProfileType.prototype._onReloadPageButtonClick):
801         * inspector/front-end/ProfileLauncherView.js:
802         (WebInspector.ProfileLauncherView.prototype.addProfileType):
803         * inspector/front-end/ProfilesPanel.js:
804         (WebInspector.ProfileType.prototype.decorationElement):
805
806 2013-01-10  Dimitri Glazkov  <dglazkov@chromium.org>
807
808         The word "selector" is somewhat redundant redundantly used in SelectorChecker.
809         https://bugs.webkit.org/show_bug.cgi?id=106413
810
811         In https://bugs.webkit.org/show_bug.cgi?id=105864, Antti suggested reducing some of the redundant uses of the word
812         "selector" in SelectorChecker. Here's a start.
813
814         Reviewed by Antti Koivisto.
815
816         Simple renames, no change in behavior.
817
818         * css/SelectorChecker.cpp:
819         (WebCore::SelectorChecker::match): Renamed.
820         (WebCore):
821         (WebCore::SelectorChecker::fastCheck): Ditto,
822         (WebCore::SelectorChecker::checkOne): Ditto.
823         * css/SelectorChecker.h:
824         (SelectorChecker):
825         * css/StyleResolver.cpp:
826         (WebCore::StyleResolver::collectMatchingRulesForList): Changed to use new name.
827         (WebCore::StyleResolver::ruleMatches): Renamed from checkSelector to better match argument and return value.
828         (WebCore::StyleResolver::checkRegionSelector): Changed to use new names.
829         * css/StyleResolver.h:
830         (StyleResolver):
831         * dom/SelectorQuery.cpp:
832         (WebCore::SelectorDataList::matches): Ditto.
833         (WebCore::SelectorDataList::execute): Ditto.
834         * html/shadow/ContentSelectorQuery.cpp:
835         (WebCore::ContentSelectorChecker::checkContentSelector): Ditto.
836
837 2013-01-10  John J. Barton  <johnjbarton@chromium.org>
838
839         Web Inspector: Pass the script url to the script-preprocessor script
840         https://bugs.webkit.org/show_bug.cgi?id=104384
841
842         Reviewed by Pavel Feldman.
843
844         Add url argument to the script-preprocessor script in PageAgent.reload()
845
846         Test: inspector/debugger/debugger-script-preprocessor.html
847
848         * bindings/v8/DebuggerScript.js:
849         * bindings/v8/ScriptDebugServer.cpp:
850         (WebCore::ScriptDebugServer::ScriptPreprocessor::ScriptPreprocessor):
851         (WebCore::ScriptDebugServer::ScriptPreprocessor::preprocessSourceCode):
852         (WebCore::ScriptDebugServer::handleV8DebugEvent):
853         * bindings/v8/custom/V8InjectedScriptManager.cpp:
854         (WebCore::InjectedScriptManager::createInjectedScript):
855
856 2013-01-10  Eugene Klyuchnikov  <eustas@chromium.org>
857
858         Web Inspector: DataGrid refactoring: make cell editing more generic.
859         https://bugs.webkit.org/show_bug.cgi?id=105849
860
861         Reviewed by Pavel Feldman.
862
863         Editing feature has been added to DataGrid to edit localStorage.
864         Column numbers (0 and 1) are hardcoded.
865
866         This patch makes column editing feature more generic: remove hardcoded
867         colums, take "editable" column property into account.
868
869         This patch is a prerequisite for cookie editing.
870
871         * inspector/front-end/DOMStorageItemsView.js:
872         Use meaningful column names.
873         * inspector/front-end/DataGrid.js:
874         (WebInspector.DataGrid.prototype._ondblclick): Check column editability.
875         (WebInspector.DataGrid.prototype._contextMenuInDataTable): Ditto.
876         (WebInspector.DataGridNode.prototype.createCell):
877         Supply cell element with column id.
878         (WebInspector.DataGrid.prototype.columnIdentifierFromNode):
879         Added utility method.
880         (WebInspector.DataGrid.prototype._nextEditableColumn): Ditto.
881         (WebInspector.DataGrid.prototype._keyDown): Calculate editable column.
882         (WebInspector.DataGrid.prototype._editingCommitted): Ditto.
883         (WebInspector.DataGrid.prototype._startEditing): Ditto.
884         (WebInspector.DataGrid.prototype._startEditingColumnOfDataGridNode):
885         Refined parameter type / name.
886         (WebInspector.DataGrid.prototype._resizerDragging):
887         Fix resizer index property names.
888         (WebInspector.DataGrid.prototype._startResizerDragging): Ditto.
889         (WebInspector.DataGrid.prototype._positionResizers): Ditto.
890         * inspector/front-end/NetworkPanel.js:
891         (WebInspector.NetworkLogView.prototype._updateDividersIfNeeded): Ditto.
892
893 2013-01-10  Matt Falkenhagen  <falken@chromium.org>
894
895         Elements must be reattached when inserted/removed from top layer
896         https://bugs.webkit.org/show_bug.cgi?id=105489
897
898         Reviewed by Julien Chaffraix.
899
900         Ensure a reattach occurs when an element is inserted/removed from top layer, so its renderer can be inserted correctly:
901         as a child of RenderView in top layer sibling order if it's in the top layer, and in the usual place otherwise.
902
903         We previously relied on style recalc to catch when an element is inserted/removed from the top layer, because it
904         only happens on dialog.show/close which toggle display: none. But that is incorrect because, for example, close()
905         followed immediately by show() results in no style change.
906
907         Tests: fast/dom/HTMLDialogElement/removed-element-is-removed-from-top-layer.html
908                fast/dom/HTMLDialogElement/top-layer-stacking-correct-order-remove-readd.html
909
910         * dom/Element.cpp:
911         (WebCore::Element::removedFrom): Call Document::removeFromTopLayer to let the element be removed from the top layer vector.
912         removeFromTopLayer calls Element::setIsInTopLayer(false) itself if needed.
913         (WebCore::Element::setIsInTopLayer): Ensure a reattach occurs if the element is already attached.
914
915 2013-01-10  Shinya Kawanaka  <shinyak@chromium.org>
916
917         When a selected node in nested ShadowDOM is deleted, selection have wrong range.
918         https://bugs.webkit.org/show_bug.cgi?id=106526
919
920         Reviewed by Ryosuke Niwa.
921
922         Since FrameSelection and htmlediting did not consider nested Shadow DOM, the FrameSelection still selects
923         removed elements if selected nodes in nested Shadow DOM are removed.
924
925         We have to use containsIncludingShadowDOM to handle with nested Shadow DOM correctly.
926
927         Test: fast/dom/shadow/selection-in-nested-shadow.html
928
929         * editing/FrameSelection.cpp:
930         (WebCore::removingNodeRemovesPosition):
931         * editing/htmlediting.cpp:
932         (WebCore::updatePositionForNodeRemoval):
933
934 2013-01-10  Hajime Morrita  <morrita@google.com>
935
936         [Shadow DOM] Refactoring: InsertionPoint could simplify its subclass hooks
937         https://bugs.webkit.org/show_bug.cgi?id=106614
938
939         Reviewed by Dimitri Glazkov.
940
941         This change simplifies InsertionPoint overrides and give some flexibility to it.
942
943         The change
944
945         - Removes InsertionPoint::isSelectValid(). now ContentSelectorQuery parses given selector anyway.
946           Invalid select attribute is handled by newly introduced matchTypeFor() method.
947         - Introduces InsertionPoint::matchTypeFor() to give a chance each InsertionPoint to decide whether it
948           accepts the given node as its distribution. Then it lets DetailsSummaryElement adopt it.
949         - Pulls some HTMLShadowElement overrides up to InsertionPoint so that other upcoming InsertionPoint
950           subclasses don't need to override them.
951
952         No new tests. Refactoring.
953
954         * html/HTMLDetailsElement.cpp:
955         (WebCore::DetailsSummaryElement::DetailsSummaryElement):
956         - Implemented matchTypeFor() to get rid of HTMLContentElement machinery which is compiled out in the upcoming change.
957         (DetailsSummaryElement):
958         * html/shadow/ContentSelectorQuery.cpp:
959         (WebCore::ContentSelectorQuery::ContentSelectorQuery):
960         (WebCore::ContentSelectorQuery::matches):
961         * html/shadow/HTMLContentElement.cpp:
962         (WebCore::HTMLContentElement::matchTypeFor): Added.
963         (WebCore):
964         * html/shadow/HTMLContentElement.h:
965         (HTMLContentElement):
966         (WebCore::isHTMLContentElement):
967         * html/shadow/HTMLShadowElement.cpp:
968         * html/shadow/HTMLShadowElement.h:
969         (HTMLShadowElement):
970         * html/shadow/InsertionPoint.cpp:
971         (WebCore::InsertionPoint::emptySelectorList): Moved from HTMLShadowElement.
972         (WebCore):
973         * html/shadow/InsertionPoint.h:
974         (WebCore::InsertionPoint::matchTypeFor): Added.
975         (WebCore::InsertionPoint::selectorList): Moved from HTMLShadowElement.
976         (InsertionPoint):
977         * testing/Internals.cpp:
978         (WebCore::Internals::isValidContentSelect):
979
980 2013-01-10  Dean Jackson  <dino@apple.com>
981
982         Plugin snapshot label should take device resolution and inset into account
983         https://bugs.webkit.org/show_bug.cgi?id=106619
984
985         Reviewed by Simon Fraser.
986
987         * rendering/RenderSnapshottedPlugIn.cpp:
988         (WebCore::RenderSnapshottedPlugIn::paintLabel): Take into account the inset in the label image.
989         (WebCore::RenderSnapshottedPlugIn::tryToFitStartLabel): Look at the page's device scale, and adjust the label image accordingly.
990
991 2013-01-10  James Robinson  <jamesr@chromium.org>
992
993         [chromium] Store scrollable layer's contents size for coordinated scrollable layers
994         https://bugs.webkit.org/show_bug.cgi?id=106518
995
996         Reviewed by Adrienne Walker.
997
998         This stores a scrollable layer's contentsSize in the scroll layer's bounds, which is otherwise not useful. This
999         value is currently calculated based on fragile knowledge of the tree structure immediately beneath a scrollable
1000         layer.
1001
1002         * page/scrolling/chromium/ScrollingCoordinatorChromium.cpp:
1003         (WebCore::ScrollingCoordinatorChromium::frameViewLayoutUpdated):
1004
1005 2013-01-10  Dan Beam  <dbeam@chromium.org>
1006
1007         Implement AutocompleteErrorEvent#reason
1008         https://bugs.webkit.org/show_bug.cgi?id=105568
1009
1010         Reviewed by Adam Barth.
1011
1012         Test: fast/events/constructors/autocomplete-error-event-constructor.html
1013
1014         * WebCore.gypi: Added AutocompleteErrorEvent.idl and AutocompleteErrorEvent.h for chromium port's build.
1015         * dom/AutocompleteErrorEvent.h: Added.
1016         (WebCore): Added new type of error named AutocompleteErrorEvent.
1017         (AutocompleteErrorEventInit): Added init params for AutocompleteErrorEvents (so initEvent() can be used).
1018         (AutocompleteErrorEvent): Added a new error event that inherits from Event but also has a reason for failure.
1019         (WebCore::AutocompleteErrorEvent::create): Factory function to create AutocompleteErrorEvents.
1020         (WebCore::AutocompleteErrorEvent::reason): The reason why a requestAutocomplete() invocation failed. Can be
1021                                                    "disabled", "cancel", or "invalid".
1022         (WebCore::AutocompleteErrorEvent::interfaceName): The name of the event's interface (for event.toString()).
1023         (WebCore::AutocompleteErrorEvent::AutocompleteErrorEvent): Various ways of constructing the error event.
1024         * dom/AutocompleteErrorEvent.idl: Added.
1025         * dom/EventNames.in: Added AutocompleteError to this list, based on REQUEST_AUTOCOMPLETE conditional.
1026         * html/HTMLFormElement.cpp: Updated form elements to dispatch AutocompleteErrorEvents on errors and to give
1027                                     more details (event.reason) when the request fails.
1028         (WebCore::HTMLFormElement::requestAutocomplete): Changed to newly added failure type "disabled".
1029         (WebCore::HTMLFormElement::finishRequestAutocomplete): Changed
1030         * html/HTMLFormElement.h: Added new results (ErrorDisabled, ErrorCancel, ErrorInvalid).
1031         * page/DOMWindow.idl: Added global event constructor for new AutocompleteErrorEvent() style event creation.
1032
1033 2013-01-10  Yong Li  <yoli@rim.com>
1034
1035         HTMLMediaElement::resume() should schedule a load rather than load immediately
1036         https://bugs.webkit.org/show_bug.cgi?id=106587
1037
1038         Reviewed by Eric Carlson.
1039
1040         It is not always safe to start the jobs at the time resume() is called. That is why the jobs are
1041         suspended. It can also be suspended again right after being resumed.
1042
1043         No new tests as there is no visible functional change, also it is a theoretically good-to-have change
1044         that doesn't fix any known cross-platform issue.
1045
1046         * html/HTMLMediaElement.cpp:
1047         (WebCore::HTMLMediaElement::resume): Replace load() with scheduleLoad().
1048
1049 2013-01-10  Adam Barth  <abarth@webkit.org>
1050
1051         Add an ENABLE macro and a WebCore::Setting for the threaded parser
1052         https://bugs.webkit.org/show_bug.cgi?id=106595
1053
1054         Reviewed by Benjamin Poulain.
1055
1056         This patch adds both a WebCore::Setting and an ENABLE macro for the
1057         threaded parser. We plan to keep the ENABLE macro off by default for a
1058         while. The runtime setting will let us more easily conduct A/B
1059         experiments when the time arises.
1060
1061         * page/Settings.in:
1062
1063 2013-01-10  Xianzhu Wang  <wangxianzhu@chromium.org>
1064
1065         Regression(r129944): Heap-use-after-free in WebCore::computeNonFastScrollableRegion
1066         https://bugs.webkit.org/show_bug.cgi?id=99515
1067
1068         Reviewed by Simon Fraser.
1069
1070         The object used-after-freed is a destructed FrameView that is still in the m_scrollableAreas set of the parent FrameView. Actually it has been removed from m_scrollableAreas when setParent(0), but then is added back in updateScrollableAreaSet() because its frameViewParent() is still not 0 (though parent() is already 0).
1071
1072         No new tests. The heap-use-after-free doesn't always cause crash so it can't be stably tested with a test case. Memory analysis tools like asan discovered the heap-use-after-free and verified that the patch can fix the issue.
1073
1074         * page/FrameView.cpp:
1075         (WebCore::FrameView::parentFrameView): Checks if the FrameView has been removed from the parent.
1076
1077 2013-01-10  John Mellor  <johnme@chromium.org>
1078
1079         Fix scale of screen.width, window.outerWidth and @media device-width when page scale not applied in compositor.
1080         https://bugs.webkit.org/show_bug.cgi?id=106460
1081
1082         Reviewed by Kenneth Rohde Christiansen.
1083
1084         screen.width, window.outerWidth and @media device-width should be in
1085         density independent (UI) pixels, not physical screen pixels.
1086
1087         This already works on most ports (including iOS). However Chrome for
1088         Android currently internally sizes its windows in physical screen pixels
1089         instead of density independent pixels, and this leaks through in the
1090         sizes provided to WebCore.
1091
1092         This patch scales these sizes appropriately before they reach JavaScript,
1093         on platforms where the applyPageScaleFactorInCompositor setting is false
1094         (i.e. just Chrome for Android). Once Chrome for Android switches over to
1095         the same coordinate space, the applyPageScaleFactorInCompositor setting
1096         will be removed, along with any code (such as this) that depends on it.
1097
1098         The effect of this patch on Chrome for Android when viewing a page with
1099         a width=device-width viewport on a Galaxy Nexus (720x1280 @ dPR 2) is:
1100             @media device-width      changes from 720 to 360
1101             screen.width             changes from 720 to 360
1102             screen.availWidth        changes from 720 to 360
1103             window.outerWidth        changes from 720 to 360
1104             window.innerWidth                    remains 360 (at overview zoom)
1105             @media width                         remains 360
1106             document.documentElement.clientWidth remains 360
1107             document.documentElement.offsetWidth remains 360
1108             document.documentElement.scrollWidth remains 360
1109             document.body.clientWidth            remains 360
1110             document.body.offsetWidth            remains 360
1111             document.body.scrollWidth            remains 360
1112         And similarly for heights (though they are slightly less than 640, since
1113         toolbars etc. get subtracted from the available height).
1114
1115         No new tests, as applyDeviceScaleFactorInCompositor appears to always be
1116         true in DumpRenderTree, so this situation cannot occur there.
1117
1118         * page/Settings.in:
1119             Added applyDeviceScaleFactorInCompositor setting, which allows
1120             detecting whether we need to normalize the scale.
1121         * platform/chromium/PlatformScreenChromium.cpp:
1122         (WebCore::toUserSpace):
1123             Static function for normalizing screen rect scale.
1124         (WebCore::screenRect):
1125             Uses toUserSpace.
1126         (WebCore::screenAvailableRect):
1127             Uses toUserSpace.
1128         * rendering/TextAutosizer.cpp:
1129         (WebCore::TextAutosizer::processSubtree):
1130             Use applyDeviceScaleFactorInCompositor instead of
1131             applyPageScaleFactorInCompositor, to scale the window rect correctly
1132             on platforms other than Chrome for Android.
1133
1134 2013-01-10  Florin Malita  <fmalita@chromium.org>
1135
1136         Rename GraphicsContext::addRoundedRectClip
1137         https://bugs.webkit.org/show_bug.cgi?id=106581
1138
1139         Reviewed by Simon Fraser.
1140
1141         This patch renames GraphicsContext::addRoundedRectClip to clipRoundedRect for consistency
1142         with the other GC clipping methods.
1143
1144         No new tests: no functional changes.
1145
1146         * WebCore.order:
1147         * platform/graphics/GraphicsContext.cpp:
1148         (WebCore::GraphicsContext::clipRoundedRect):
1149         * platform/graphics/GraphicsContext.h:
1150         (GraphicsContext):
1151         * platform/graphics/skia/GraphicsContextSkia.cpp:
1152         (WebCore::GraphicsContext::clipRoundedRect):
1153         * rendering/RenderBox.cpp:
1154         (WebCore::RenderBox::paintBoxDecorations):
1155         (WebCore::RenderBox::pushContentsClip):
1156         * rendering/RenderBoxModelObject.cpp:
1157         (WebCore::RenderBoxModelObject::clipRoundedInnerRect):
1158         (WebCore::RenderBoxModelObject::paintBorder):
1159         (WebCore::RenderBoxModelObject::drawBoxSideFromPath):
1160         * rendering/RenderLayer.cpp:
1161         (WebCore::RenderLayer::clipToRect):
1162         * rendering/RenderThemeChromiumWin.cpp:
1163         (WebCore):
1164         (WebCore::RenderThemeChromiumWin::paintTextFieldInternal):
1165         * rendering/RenderThemeMacShared.mm:
1166         (WebCore::RenderThemeMacShared::paintMenuListButtonGradients):
1167         (WebCore::RenderThemeMacShared::paintSliderTrack):
1168         * rendering/RenderThemeSafari.cpp:
1169         (WebCore::RenderThemeSafari::paintMenuListButtonGradients):
1170         (WebCore::RenderThemeSafari::paintSliderTrack):
1171         * rendering/RenderThemeWinCE.cpp:
1172         (WebCore::RenderThemeWinCE::paintSearchFieldCancelButton):
1173
1174 2013-01-10  Tommy Widenflycht  <tommyw@google.com>
1175
1176         MediaStream API: Adding the new id attribute to MediaStream and MediaStreamTrack
1177         https://bugs.webkit.org/show_bug.cgi?id=106564
1178
1179         Reviewed by Adam Barth.
1180
1181         Specification: http://dev.w3.org/2011/webrtc/editor/getusermedia.html
1182         MediaStream looses its label attribute and instead gets an id attribute.
1183         MediaStreamTrack gets an id attribute.
1184
1185         Not testable yet, will add tests in a followup patch.
1186
1187         * Modules/mediastream/MediaStream.h:
1188         (WebCore::MediaStream::label):
1189         (MediaStream):
1190         (WebCore::MediaStream::id):
1191         * Modules/mediastream/MediaStream.idl:
1192         * Modules/mediastream/MediaStreamTrack.cpp:
1193         (WebCore::MediaStreamTrack::id):
1194         (WebCore):
1195         * Modules/mediastream/MediaStreamTrack.h:
1196         * Modules/mediastream/MediaStreamTrack.idl:
1197         * platform/chromium/support/WebMediaStreamComponent.cpp:
1198         (WebKit::WebMediaStreamComponent::initialize):
1199         (WebKit):
1200         (WebKit::WebMediaStreamComponent::isEnabled):
1201         (WebKit::WebMediaStreamComponent::id):
1202         (WebKit::WebMediaStreamComponent::source):
1203         * platform/chromium/support/WebMediaStreamDescriptor.cpp:
1204         (WebKit::WebMediaStreamDescriptor::label):
1205         (WebKit):
1206         (WebKit::WebMediaStreamDescriptor::id):
1207         * platform/mediastream/MediaStreamComponent.h:
1208         (WebCore::MediaStreamComponent::id):
1209         (WebCore::MediaStreamComponent::MediaStreamComponent):
1210         (MediaStreamComponent):
1211         * platform/mediastream/MediaStreamDescriptor.h:
1212         (WebCore::MediaStreamDescriptor::create):
1213         (WebCore::MediaStreamDescriptor::id):
1214         (WebCore::MediaStreamDescriptor::MediaStreamDescriptor):
1215         (MediaStreamDescriptor):
1216
1217 2013-01-10  Ojan Vafai  <ojan@chromium.org>
1218
1219         Flexboxes incorrectly add the scrollbar width to the intrinsic width of fixed-width items
1220         https://bugs.webkit.org/show_bug.cgi?id=106591
1221
1222         Reviewed by Levi Weintraub.
1223
1224         The scrollbar width should only be added if the width of the flex item
1225         is not fixed.
1226
1227         Test: fast/css/fixed-width-intrinsic-width-excludes-scrollbars.html
1228
1229         * rendering/RenderBlock.cpp:
1230         (WebCore::RenderBlock::computePreferredLogicalWidths):
1231         Use shared helper method. This also happens to fix the vertical
1232         writing-mode case.
1233
1234         * rendering/RenderBox.cpp:
1235         (WebCore::RenderBox::instrinsicScrollbarLogicalWidth):
1236         (WebCore):
1237         * rendering/RenderBox.h:
1238         (RenderBox):
1239         Add a method for determining the scrollbar's contribution to the boxes
1240         intrinsic width.
1241
1242         * rendering/RenderDeprecatedFlexibleBox.cpp:
1243         (WebCore::RenderDeprecatedFlexibleBox::computePreferredLogicalWidths):
1244         * rendering/RenderFlexibleBox.cpp:
1245         (WebCore::RenderFlexibleBox::computePreferredLogicalWidths):
1246         Use shared code for determining the scrollbar width and only add the
1247         width when computing the intrinsic widths.
1248
1249         * rendering/RenderGrid.cpp:
1250         (WebCore::RenderGrid::computePreferredLogicalWidths):\
1251         Just adding a FIXME to account for scrollbar width.
1252
1253 2013-01-10  Nate Chapin  <japhet@chromium.org>
1254
1255         Replace unnecessary null-checks with an assert in MainResourceLoader::continueAfterNavigationPolicy.
1256         https://bugs.webkit.org/show_bug.cgi?id=106476
1257
1258         Reviewed by Alexey Proskuryakov.
1259
1260         * loader/MainResourceLoader.cpp:
1261         (WebCore::MainResourceLoader::continueAfterNavigationPolicy): Null-checks for resourceLoader were
1262             added in an abundance of caution in r139150. Given that we know the load hasn't been cancelled,
1263             resourceLoader can only be null if continueAfterNavigationPolicy() has already been called
1264             before when m_substituteData is valid. continueAfterNavigationPolicy() is only called for redirects,
1265             and SubstituteData doesn't support redirects, so it is correct to assert that resourceLoader is non-null.
1266
1267 2013-01-10  Levi Weintraub  <leviw@chromium.org>
1268
1269         ScrollingCoordinator touch event hit rects aren't converted to proper coordinates when in nested views
1270         https://bugs.webkit.org/show_bug.cgi?id=106383
1271
1272         Reviewed by James Robinson.
1273
1274         ScrollingCoordinator uses clippedOverflowRectForRepaint(0) to generate the bounds for a renderer's hit
1275         testing rect. The rect this returns is in the coordinates of its document. This change converts the
1276         rect to the outermost view's coordinate system using convertToContainingView.
1277
1278         Tests: platform/chromium/fast/events/touch/touch-hit-rects-in-iframe.html
1279
1280         * page/scrolling/ScrollingCoordinator.cpp:
1281         (WebCore::accumulateRendererTouchEventTargetRects):
1282
1283 2013-01-10  Levi Weintraub  <leviw@chromium.org>
1284
1285         Regression(r137939): Heap-use-after-free in WebCore::accumulateDocumentEventTargetRects
1286         https://bugs.webkit.org/show_bug.cgi?id=106454
1287
1288         Reviewed by James Robinson.
1289
1290         Correctly removing child Documents from their parent's tracked touch handler maps when detaching and
1291         when their last touch event handler is removed.
1292
1293         Test: fast/events/touch/nested-document-with-touch-handler-detached-crash.html
1294
1295         * dom/Document.cpp:
1296         (WebCore::Document::detach):
1297         (WebCore::Document::didRemoveEventTargetNode):
1298
1299 2013-01-10  Nate Chapin  <japhet@chromium.org>
1300
1301         REGRESSION(r138222): WebDocumentLoaderMac-related leaks seen on Leaks bot
1302         https://bugs.webkit.org/show_bug.cgi?id=106137
1303
1304         Reviewed by Brady Eidson.
1305
1306         Tested manually by comparing before and after leaks output for WK1-mac.
1307
1308         * loader/MainResourceLoader.cpp:
1309         (WebCore::MainResourceLoader::receivedError): Call dispatchDidFailLoading() if
1310             a SubstituteData load fails or is cancelled. Without this call, load counts
1311             are not balanced on WebDocumentLoaderMac and it is retained forever.
1312         (WebCore::MainResourceLoader::didFinishLoading):
1313
1314 2013-01-10  Robert Kroeger  <rjkroege@chromium.org>
1315
1316         Manually revert http://trac.webkit.org/changeset/136012
1317         https://bugs.webkit.org/show_bug.cgi?id=106580
1318
1319         Reviewed by Dimitri Glazkov.
1320
1321         136012 broke touch-scrolling of an overflow div in an iframe. Revert manually
1322         to work around conflicts.
1323
1324         * page/EventHandler.cpp:
1325         (WebCore::EventHandler::handleWheelEvent):
1326
1327 2013-01-10  Robert Hogan  <robert@webkit.org>
1328
1329         REGRESSION(r136967): margin-top + overflow:hidden causes incorrect layout for internal floated elements
1330         https://bugs.webkit.org/show_bug.cgi?id=106374
1331
1332         Reviewed by David Hyatt.
1333
1334         r136397 treated any self-collapsing block that had a clearance delta as though it was clearing a float, but
1335         blocks that avoid floats can get a clearance delta too. So just ensure there is clearance on the block when deciding
1336         whether we need to add the margin back in before placing the float.
1337
1338         Test: fast/block/margin-collapse/self-collapsing-block-with-overflow-hidden-and-float-child.html
1339
1340         * rendering/RenderBlockLineLayout.cpp:
1341         (WebCore::RenderBlock::LineBreaker::skipLeadingWhitespace):
1342
1343 2013-01-10  Alexander Pavlov  <apavlov@chromium.org>
1344
1345         Web Inspector: Color picker in Styles pane shows wrong initial color
1346         https://bugs.webkit.org/show_bug.cgi?id=106567
1347
1348         Reviewed by Pavel Feldman.
1349
1350         The RGB's G value for "crimson" was wrong.
1351
1352         * inspector/front-end/Color.js:
1353
1354 2013-01-10  Tony Chang  <tony@chromium.org>
1355
1356         Speed up supplemental dependency computation
1357         https://bugs.webkit.org/show_bug.cgi?id=106503
1358
1359         Reviewed by Adam Barth.
1360
1361         On my machine, generating supplemental IDL dependencies was taking about 18s
1362         because it has to run the C preprocessor on each IDL file. Avoid this by using
1363         a regular expression to find the Supplemental= value in each IDL file rather than
1364         doing a full parse. Now generating supplemental IDL dependencies is less than a
1365         second.
1366
1367         preprocess-idls.pl used to also check IDL attributes against IDLAttributes.txt.
1368         Move this code to run in generate-bindings.pl. This change revealed that
1369         TestRunner.idl uses PassContext so add that to IDLAttributes.txt.
1370
1371         No new tests, this is a build refactor. EWS bots should be green.
1372
1373         * DerivedSources.make: Remove --idlAttributesFile from preprocess-idls.pl and add it to generate-bindings.pl.
1374         * DerivedSources.pri: Remove --idlAttributesFile from preprocess-idls.pl and add it to generate-bindings.pl.
1375         * GNUmakefile.am: Remove --idlAttributesFile from preprocess-idls.pl and add it to generate-bindings.pl.
1376         * UseJSC.cmake: Remove --idlAttributesFile from preprocess-idls.pl and add it to generate-bindings.pl.
1377         * UseV8.cmake: Remove --idlAttributesFile from preprocess-idls.pl and add it to generate-bindings.pl.
1378         * WebCore.gyp/WebCore.gyp: Remove --idlAttributesFile from preprocess-idls.pl and add it to generate-bindings.pl.
1379         * bindings/scripts/IDLAttributes.txt: Add PassContext needed by TestRunner.idl.
1380         * bindings/scripts/generate-bindings.pl:
1381         (loadIDLAttributes): Moved from preprocess-idls.pl.
1382         (checkIDLAttributes): Moved from preprocess-idls.pl.
1383         (checkIfIDLAttributesExists): Moved from preprocess-idls.pl.
1384         * bindings/scripts/preprocess-idls.pl:
1385         (getSupplementalFromIDLFile): Helper method to get Supplemental=* quickly.
1386
1387 2013-01-10  Max Vujovic  <mvujovic@adobe.com>
1388
1389         [CSS Filters] RenderLayerCompositor::addToOverlapMap should take into account the filters outsets (ie. blur and drop-shadow)
1390         https://bugs.webkit.org/show_bug.cgi?id=94022
1391
1392         Reviewed by Simon Fraser.
1393
1394         When a layer has a filter that moves pixels, we need to add its entire bounds, including its
1395         outsets and children, to the overlap map. The filter can move the children's pixels
1396         anywhere in the layer, so we can't rely on the children's bounds.
1397
1398         Eventually, we should avoid adding children to the overlap map if the parent's bounds used
1399         for overlap testing already include the children. I've added a FIXME for this optimization.
1400
1401         Tests: compositing/filters/sw-layer-overlaps-hw-shadow.html
1402                compositing/filters/sw-nested-shadow-overlaps-hw-nested-shadow.html
1403                compositing/filters/sw-shadow-overlaps-hw-layer.html
1404                compositing/filters/sw-shadow-overlaps-hw-shadow.html
1405
1406         * rendering/RenderLayer.h:
1407         (WebCore::RenderLayer::overlapBounds):
1408             If necessary, return the calculated layer bounds, including the children. Otherwise,
1409             return the localBoundingBox.
1410         (RenderLayer):
1411         (WebCore::RenderLayer::overlapBoundsIncludeChildren):
1412             If the layer has a filter that moves pixels, return true.
1413         * rendering/RenderLayerCompositor.cpp:
1414         (WebCore::RenderLayerCompositor::addToOverlapMap):
1415             Add the overlapBounds instead of the localBoundingBox to the overlap map.
1416         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1417             Use the overlapBounds instead of the localBoundingBox for overlap testing.
1418
1419 2013-01-09  Ojan Vafai  <ojan@chromium.org>
1420
1421         intrinsic min-widths don't override width for file upload controls
1422         https://bugs.webkit.org/show_bug.cgi?id=106517
1423
1424         Reviewed by Tony Chang.
1425
1426         Separate out computing intrinsic width from perferred width so that
1427         we can use the intrinsic width correctly when applying min-width/max-width.
1428         The preferred width is the width used in its container's computation
1429         of its intrinsic width.
1430
1431         This is the first in a series of patches making this work across
1432         the render tree. 
1433
1434         Test: fast/forms/file/intrinsic-min-width-overrides-width.html
1435
1436         * rendering/RenderBox.cpp:
1437         (WebCore::RenderBox::minIntrinsicLogicalWidth):
1438         (WebCore):
1439         (WebCore::RenderBox::maxIntrinsicLogicalWidth):
1440         (WebCore::RenderBox::computeIntrinsicLogicalWidths):
1441         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
1442         * rendering/RenderBox.h:
1443         (RenderBox):
1444         * rendering/RenderFileUploadControl.cpp:
1445         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
1446         (WebCore):
1447         (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
1448         * rendering/RenderFileUploadControl.h:
1449         (RenderFileUploadControl):
1450
1451 2013-01-10  Victor Carbune  <victor@rosedu.org>
1452
1453         media/video-controls-captions.html fails after fixing https://bugs.webkit.org/show_bug.cgi?id=105536
1454         https://bugs.webkit.org/show_bug.cgi?id=106230
1455
1456         Reviewed by Eric Carlson.
1457
1458         Until Chromium has proper controls for lists of text tracks, the caption button
1459         needs to preserve its functionality.
1460
1461         Updated TestExpectations to reactivate test.
1462
1463         * html/HTMLMediaElement.cpp:
1464         (WebCore::HTMLMediaElement::setClosedCaptionsVisible): Added explicit call to updateTextTrackDisplay.
1465         This enables hiding the tracks immediately.
1466         * html/shadow/MediaControlElements.cpp:
1467         (WebCore::MediaControlTextTrackContainerElement::updateDisplay): Added extra check before rendering
1468         that captions should actually be displayed.
1469
1470 2013-01-10  Hajime Morrita  <morrita@google.com>
1471
1472         ComposedShadowTreeWalker shouldn't be exposed to non-ShadowDOM classes
1473         https://bugs.webkit.org/show_bug.cgi?id=106505
1474
1475         Reviewed by Dimitri Glazkov.
1476
1477         This change hides ComposedShadowTreeWalker from non-ShadowDOM classes by
1478
1479         - introducing thin wrapper functions on NodeRenderingTraversal and relacing
1480           CSTW callsites with it,
1481         - replacing ComposedShadowTreeWalker usage with AncestorChainWalker if possible and
1482         - moving AncestorChainWalker to its own file and including it on files
1483           which needs only AncestorChainWalker. This eliminates ComposedShadowTreeWalker.h inclusions.
1484
1485         No new tests. No behavior change.
1486
1487         * CMakeLists.txt:
1488         * GNUmakefile.list.am:
1489         * Target.pri:
1490         * WebCore.gypi:
1491         * WebCore.xcodeproj/project.pbxproj:
1492         * dom/AncestorChainWalker.cpp: Added. Extracted from ComposedShadowTreeWalker.cpp
1493         (WebCore):
1494         (WebCore::AncestorChainWalker::AncestorChainWalker):
1495         (WebCore::AncestorChainWalker::parent):
1496         * dom/AncestorChainWalker.h: Added. Extracted from ComposedShadowTreeWalker.h
1497         (WebCore):
1498         (AncestorChainWalker):
1499         (WebCore::AncestorChainWalker::get):
1500         (WebCore::AncestorChainWalker::crossingInsertionPoint):
1501         * dom/ComposedShadowTreeWalker.cpp:
1502         * dom/ComposedShadowTreeWalker.h:
1503         * dom/DOMAllInOne.cpp:
1504         * dom/ElementShadow.h:
1505         (WebCore::shadowOfParent):
1506         (WebCore):
1507         * dom/EventDispatcher.cpp:
1508         * dom/Node.cpp:
1509         * dom/NodeRenderingTraversal.cpp:
1510         (WebCore::NodeRenderingTraversal::nextInScope):
1511         (NodeRenderingTraversal):
1512         (WebCore::NodeRenderingTraversal::previousInScope): Added.
1513         (WebCore::NodeRenderingTraversal::parentInScope): Added.
1514         (WebCore::NodeRenderingTraversal::lastChildInScope): Added.
1515         * dom/NodeRenderingTraversal.h:
1516         (NodeRenderingTraversal):
1517         * dom/TreeScope.cpp:
1518         * html/HTMLLIElement.cpp:
1519         (WebCore::HTMLLIElement::attach):
1520         * page/EventHandler.cpp:
1521         * page/FocusController.cpp: Replacing CSTW with NRT
1522         (WebCore):
1523         (WebCore::FocusNavigationScope::focusNavigationScopeOf):
1524         (WebCore::FocusController::findNodeWithExactTabIndex):
1525         (WebCore::nextNodeWithGreaterTabIndex):
1526         (WebCore::previousNodeWithLowerTabIndex):
1527         (WebCore::FocusController::nextFocusableNode):
1528         (WebCore::FocusController::previousFocusableNode):
1529
1530 2013-01-10  Zan Dobersek  <zandobersek@gmail.com>
1531
1532         Remove the ENABLE_ANIMATION_API feature define occurences
1533         https://bugs.webkit.org/show_bug.cgi?id=106544
1534
1535         Reviewed by Simon Fraser.
1536
1537         The Animation API code was removed in r137243. The ENABLE_ANIMATION_API
1538         feature define handling still lingers in various build systems and configurations
1539         but is of no use, so it should be removed.
1540
1541         No new tests - no new functionality.
1542
1543         * Configurations/FeatureDefines.xcconfig:
1544         * GNUmakefile.features.am.in:
1545
1546 2013-01-10  Robert Phillips  <robertphillips@chromium.org>
1547
1548         Serialization of Gradients fails when PlatformContextSkia is not bitmap backed
1549         https://bugs.webkit.org/show_bug.cgi?id=106559
1550
1551         Reviewed by Stephen White.
1552
1553         This patch switches over from having platform/Skia improperly
1554         crack open the device to find the bitmap configuration to just
1555         specifying it directly.
1556
1557         No new tests. This bug is Chromium specific and only occurs in a
1558         debugging tool (when serializing to a Skia-specific file format).
1559
1560         * platform/graphics/skia/PlatformContextSkia.cpp:
1561         (WebCore::PlatformContextSkia::createCompatibleDevice):
1562
1563 2013-01-10  Alexander Pavlov  <apavlov@chromium.org>
1564
1565         The "outline-offset" property is not found in the computed style property list
1566         https://bugs.webkit.org/show_bug.cgi?id=106561
1567
1568         Reviewed by Alexis Menard.
1569
1570         Listed CSSPropertyOutlineOffset in the CSSComputedStyleDeclaration's computedProperties[].
1571
1572         Test: fast/css/getComputedStyle/getComputedStyle-outline-offset.html
1573
1574         * css/CSSComputedStyleDeclaration.cpp:
1575
1576 2013-01-10  David Faure  <faure@kde.org>
1577
1578         PluginPackage::freeLibraryTimerFired asserts if plugin got loaded again meanwhile
1579         https://bugs.webkit.org/show_bug.cgi?id=106463
1580
1581         Reviewed by Simon Hausmann.
1582
1583         No new tests, this code path will be tested by bug 106140.
1584
1585         * plugins/PluginPackage.cpp:
1586         (WebCore::PluginPackage::freeLibraryTimerFired): skip unloading if loaded again meanwhile.
1587
1588 2013-01-10  Alexander Pavlov  <apavlov@chromium.org>
1589
1590         CSSParser does not allow the absence of whitespace between "and" and "expression"
1591         https://bugs.webkit.org/show_bug.cgi?id=106458
1592
1593         Reviewed by Antti Koivisto.
1594
1595         The issue was that a construct similar to "and(max-width: 480px)" looks like a function call (token type FUNCTION), even though
1596         it is actually a MEDIA_AND followed by a parenthesized expression.
1597
1598         Test: fast/css/media-rule-no-whitespace.html
1599
1600         * css/CSSParser.cpp:
1601         (WebCore::CSSParser::detectFunctionTypeToken): Return if the detection has been successful.
1602         (WebCore::CSSParser::realLex): Test for media query tokens if function type detection has failed.
1603         * css/CSSParser.h:
1604
1605 2013-01-10  Alexis Menard  <alexis@webkit.org>
1606
1607         ASSERT_NOT_REACHED in StylePropertySet::fontValue when accessing font style property through JS after setting style font size.
1608         https://bugs.webkit.org/show_bug.cgi?id=88866
1609
1610         Reviewed by Alexander Pavlov.
1611
1612         StylePropertySet::fontValue always assumed that it was called using
1613         style.font after a subsequent call which set the shorthand font. The
1614         ASSERT_NOT_REACHED assumed that all longhands of the font shorthand not
1615         set by the shorthand itself were set to initial. While it's true when
1616         we set the font shorthand (i.e all longhands are set to implicit initial)
1617         it is not true when you set the longhands individually. For example setting
1618         font-size will not set other font properties to initial. It is the behavior of all
1619         other shorthands in WebKit. When reconstructing the shorthand other
1620         properties tests whether the value of each longhands is initial or not
1621         (if not then we omit the value, as we should always construct the
1622         shortest shorthand possible) or if the value is set or not (if set then
1623         we include it in the shorthand if not then we omit it). The comment
1624         removed was also talking about invalid font property potentially built
1625         by fontValue(). So far appendFontLonghandValueIfExplicit will always
1626         construct a valid value as it takes care of adding ' ' or '/' when
1627         needed, so the return value is parsable and correct.
1628
1629         Test: fast/css/font-shorthand-from-longhands.html
1630
1631         * css/StylePropertySet.cpp:
1632         (WebCore::StylePropertySet::appendFontLonghandValueIfExplicit):
1633         (WebCore::StylePropertySet::fontValue):
1634         * css/StylePropertySet.h:
1635
1636 2013-01-10  Sheriff Bot  <webkit.review.bot@gmail.com>
1637
1638         Unreviewed, rolling out r139306.
1639         http://trac.webkit.org/changeset/139306
1640         https://bugs.webkit.org/show_bug.cgi?id=106550
1641
1642         it broke inspector-protocol/nmi-webaudio-leak-test.html
1643         (Requested by loislo on #webkit).
1644
1645         * bindings/v8/V8PerIsolateData.cpp:
1646         (WebCore::V8PerIsolateData::reportMemoryUsage):
1647         * css/CSSMediaRule.cpp:
1648         (WebCore::CSSMediaRule::reportMemoryUsage):
1649         * css/CSSProperty.cpp:
1650         (WebCore::CSSProperty::reportMemoryUsage):
1651         * css/CSSStyleSheet.cpp:
1652         (WebCore::CSSStyleSheet::reportMemoryUsage):
1653         * css/MediaList.cpp:
1654         (WebCore::MediaList::reportMemoryUsage):
1655         * css/RuleSet.cpp:
1656         (WebCore::RuleData::reportMemoryUsage):
1657         (WebCore::RuleSet::reportMemoryUsage):
1658         (WebCore::RuleSet::RuleSetSelectorPair::reportMemoryUsage):
1659         * css/StyleResolver.cpp:
1660         (WebCore::StyleResolver::MatchedPropertiesCacheItem::reportMemoryUsage):
1661         (WebCore::StyleResolver::reportMemoryUsage):
1662         * css/StyleSheetContents.cpp:
1663         (WebCore::StyleSheetContents::reportMemoryUsage):
1664         * dom/TreeScope.cpp:
1665         (WebCore::TreeScope::reportMemoryUsage):
1666         * inspector/HeapGraphSerializer.cpp:
1667         (WebCore::HeapGraphSerializer::reportMemoryUsage):
1668         * inspector/InspectorMemoryAgent.cpp:
1669         * inspector/InspectorProfilerAgent.cpp:
1670         (WebCore::InspectorProfilerAgent::reportMemoryUsage):
1671         * inspector/MemoryInstrumentationImpl.cpp:
1672         (WebCore::MemoryInstrumentationClientImpl::reportMemoryUsage):
1673         * loader/DocumentLoader.cpp:
1674         (WebCore::DocumentLoader::reportMemoryUsage):
1675         * loader/FrameLoader.cpp:
1676         (WebCore::FrameLoader::reportMemoryUsage):
1677         * loader/MainResourceLoader.cpp:
1678         (WebCore::MainResourceLoader::reportMemoryUsage):
1679         * loader/Prerenderer.cpp:
1680         (WebCore::Prerenderer::reportMemoryUsage):
1681         * loader/ResourceLoader.cpp:
1682         (WebCore::ResourceLoader::reportMemoryUsage):
1683         * loader/cache/CachedImage.cpp:
1684         (WebCore::CachedImage::reportMemoryUsage):
1685         * page/Page.cpp:
1686         (WebCore::Page::reportMemoryUsage):
1687
1688 2013-01-10  Ilya Tikhonovsky  <loislo@chromium.org>
1689
1690         Web Inspector: Native Memory Instrumentation: fix instrumentation for already instrumented classes 2/N
1691         https://bugs.webkit.org/show_bug.cgi?id=106546
1692
1693         Reviewed by Vsevolod Vlasov.
1694
1695         Many nontrivial class members were instrumented in reportMemoryUsage methods.
1696
1697         * bindings/v8/V8PerIsolateData.cpp:
1698         (WebCore::V8PerIsolateData::reportMemoryUsage):
1699         * css/CSSMediaRule.cpp:
1700         (WebCore::CSSMediaRule::reportMemoryUsage):
1701         * css/CSSProperty.cpp:
1702         (WebCore::CSSProperty::reportMemoryUsage):
1703         * css/CSSStyleSheet.cpp:
1704         (WebCore::CSSStyleSheet::reportMemoryUsage):
1705         * css/MediaList.cpp:
1706         (WebCore::MediaList::reportMemoryUsage):
1707         * css/RuleSet.cpp:
1708         (WebCore::RuleData::reportMemoryUsage):
1709         (WebCore::RuleSet::reportMemoryUsage):
1710         (WebCore::RuleSet::RuleSetSelectorPair::reportMemoryUsage):
1711         * css/StyleResolver.cpp:
1712         (WebCore::StyleResolver::MatchedPropertiesCacheItem::reportMemoryUsage):
1713         (WebCore::StyleResolver::reportMemoryUsage):
1714         * css/StyleSheetContents.cpp:
1715         (WebCore::StyleSheetContents::reportMemoryUsage):
1716         * dom/TreeScope.cpp:
1717         (WebCore::TreeScope::reportMemoryUsage):
1718         * inspector/HeapGraphSerializer.cpp:
1719         (WebCore::HeapGraphSerializer::reportMemoryUsage):
1720         * inspector/InspectorMemoryAgent.cpp:
1721         * inspector/InspectorProfilerAgent.cpp:
1722         (WebCore::InspectorProfilerAgent::reportMemoryUsage):
1723         * inspector/MemoryInstrumentationImpl.cpp:
1724         (WebCore::MemoryInstrumentationClientImpl::reportMemoryUsage):
1725         * loader/DocumentLoader.cpp:
1726         (WebCore::DocumentLoader::reportMemoryUsage):
1727         * loader/FrameLoader.cpp:
1728         (WebCore::FrameLoader::reportMemoryUsage):
1729         * loader/MainResourceLoader.cpp:
1730         (WebCore::MainResourceLoader::reportMemoryUsage):
1731         * loader/Prerenderer.cpp:
1732         (WebCore::Prerenderer::reportMemoryUsage):
1733         * loader/ResourceLoader.cpp:
1734         (WebCore::ResourceLoader::reportMemoryUsage):
1735         * loader/cache/CachedImage.cpp:
1736         (WebCore::CachedImage::reportMemoryUsage):
1737         * page/Page.cpp:
1738         (WebCore::Page::reportMemoryUsage):
1739
1740 2013-01-10  Christophe Dumez  <christophe.dumez@intel.com>
1741
1742         [EFL] Add gstreamer 1.0.5 to jhbuild
1743         https://bugs.webkit.org/show_bug.cgi?id=106178
1744
1745         Reviewed by Laszlo Gombos.
1746
1747         Remove GSTREAMER_INTERFACES_LIBRARIES from EFL
1748         CMake configuration.
1749
1750         No new tests, no behavior change for layout tests.
1751
1752         * PlatformEfl.cmake:
1753
1754 2013-01-09  Christophe Dumez  <christophe.dumez@intel.com>
1755
1756         Unreviewed build fix after r139266.
1757
1758         r139266 broke the debug build of the gstreamer backend due
1759         to a missing header include.
1760
1761         No new tests, no behavior change.
1762
1763         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
1764
1765 2013-01-09  Alec Flett  <alecflett@chromium.org>
1766
1767         IndexedDB: Allow createIndex/createObjectStore to be asynchronous
1768         https://bugs.webkit.org/show_bug.cgi?id=106377
1769
1770         Reviewed by Tony Chang.
1771
1772         Migrate implementations of createIndex/deleteIndex,
1773         createObjectStore/deleteObjectStore over to IDBDatabaseBackendImpl,
1774         so that they can be asynchronous in multi-process ports.
1775
1776         Has the side effect of removing the last consumers of
1777         IDBIndexBackendImpl and IDBObjectStoreBackendImpl. The former
1778         is removed complete and the latter becomes a temporary namespace
1779         pending a further more mechanical code shuffle.
1780
1781         A key refactoring effect is that the IDBDatabaseBackendImpl
1782         now contains the authoritative IDBDatabaseMetadata hierarchy,
1783         and updates to it are consolidated in one place rather than
1784         scattered across a parallel object tree.
1785
1786         No new tests as this is just refactoring.
1787
1788         * Modules/indexeddb/IDBBackingStore.cpp: Simplify objectstore/index loading and propagate errors.
1789         (WebCore::IDBBackingStore::getObjectStores):
1790         (WebCore::IDBBackingStore::getIndexes):
1791         * Modules/indexeddb/IDBBackingStore.h:
1792         (IDBBackingStore):
1793         * Modules/indexeddb/IDBCursorBackendImpl.cpp: Dependency cleanup.
1794         * Modules/indexeddb/IDBCursorBackendImpl.h: Dependency cleanup.
1795         (WebCore):
1796         * Modules/indexeddb/IDBDatabase.cpp: Frontend IDBObjectStores no longer hold onto backend objects.
1797         (WebCore::IDBDatabase::createObjectStore):
1798         (WebCore::IDBDatabase::deleteObjectStore):
1799         * Modules/indexeddb/IDBDatabaseBackendImpl.cpp: Add all create/deleteIndex operations from IDBIndexBackendImpl.
1800         (WebCore::CreateObjectStoreOperation::create):
1801         (WebCore::CreateObjectStoreOperation::CreateObjectStoreOperation):
1802         (CreateObjectStoreOperation):
1803         (WebCore::DeleteObjectStoreOperation::create):
1804         (WebCore::DeleteObjectStoreOperation::DeleteObjectStoreOperation):
1805         (DeleteObjectStoreOperation):
1806         (WebCore::CreateObjectStoreAbortOperation::create):
1807         (WebCore::CreateObjectStoreAbortOperation::CreateObjectStoreAbortOperation):
1808         (CreateObjectStoreAbortOperation):
1809         (WebCore::DeleteObjectStoreAbortOperation::create):
1810         (WebCore::DeleteObjectStoreAbortOperation::DeleteObjectStoreAbortOperation):
1811         (DeleteObjectStoreAbortOperation):
1812         (CreateIndexOperation):
1813         (WebCore::CreateIndexOperation::create):
1814         (WebCore::CreateIndexOperation::CreateIndexOperation):
1815         (WebCore):
1816         (DeleteIndexOperation):
1817         (WebCore::DeleteIndexOperation::create):
1818         (WebCore::DeleteIndexOperation::DeleteIndexOperation):
1819         (CreateIndexAbortOperation):
1820         (WebCore::CreateIndexAbortOperation::create):
1821         (WebCore::CreateIndexAbortOperation::CreateIndexAbortOperation):
1822         (DeleteIndexAbortOperation):
1823         (WebCore::DeleteIndexAbortOperation::create):
1824         (WebCore::DeleteIndexAbortOperation::DeleteIndexAbortOperation):
1825         (WebCore::GetOperation::GetOperation):
1826         (WebCore::IDBDatabaseBackendImpl::addObjectStore):
1827         (WebCore::IDBDatabaseBackendImpl::removeObjectStore):
1828         (WebCore::IDBDatabaseBackendImpl::addIndex):
1829         (WebCore::IDBDatabaseBackendImpl::removeIndex):
1830         (WebCore::IDBDatabaseBackendImpl::openInternal):
1831         (WebCore::IDBDatabaseBackendImpl::metadata):
1832         (WebCore::IDBDatabaseBackendImpl::createObjectStore):
1833         (WebCore::CreateObjectStoreOperation::perform):
1834         (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
1835         (WebCore::IDBDatabaseBackendImpl::createIndex):
1836         (WebCore::CreateIndexOperation::perform):
1837         (WebCore::CreateIndexAbortOperation::perform):
1838         (WebCore::IDBDatabaseBackendImpl::deleteIndex):
1839         (WebCore::DeleteIndexOperation::perform):
1840         (WebCore::DeleteIndexAbortOperation::perform):
1841         (WebCore::IDBDatabaseBackendImpl::get):
1842         (WebCore::IDBDatabaseBackendImpl::put):
1843         (WebCore::IDBDatabaseBackendImpl::setIndexKeys):
1844         (WebCore::IDBDatabaseBackendImpl::count):
1845         (WebCore::DeleteRangeOperation::perform):
1846         (WebCore::DeleteObjectStoreOperation::perform):
1847         (WebCore::IDBDatabaseBackendImpl::deleteDatabaseFinal):
1848         (WebCore::IDBDatabaseBackendImpl::loadObjectStores): Load directly into metadata from backing store.
1849         (WebCore::CreateObjectStoreAbortOperation::perform):
1850         (WebCore::DeleteObjectStoreAbortOperation::perform):
1851         (WebCore::IDBDatabaseBackendImpl::VersionChangeAbortOperation::perform):
1852         * Modules/indexeddb/IDBDatabaseBackendImpl.h:
1853         (WebCore):
1854         (IDBDatabaseBackendImpl):
1855         (WebCore::IDBDatabaseBackendImpl::createObjectStore):
1856         (WebCore::IDBDatabaseBackendImpl::deleteObjectStore):
1857         * Modules/indexeddb/IDBIndexBackendImpl.cpp: Removed.
1858         * Modules/indexeddb/IDBIndexBackendImpl.h: Removed.
1859         * Modules/indexeddb/IDBObjectStore.cpp:
1860         (WebCore::IDBObjectStore::IDBObjectStore): Frontend IDBIndex objects no longer hold onto backend.
1861         (WebCore::IDBObjectStore::createIndex): 
1862         (WebCore::IDBObjectStore::deleteIndex):
1863         * Modules/indexeddb/IDBObjectStore.h:
1864         (WebCore::IDBObjectStore::create):
1865         (IDBObjectStore):
1866         * Modules/indexeddb/IDBObjectStoreBackendImpl.cpp:
1867         * Modules/indexeddb/IDBObjectStoreBackendImpl.h:
1868         (WebCore):
1869         (IDBObjectStoreBackendImpl):
1870         * Modules/indexeddb/IDBTransaction.cpp:
1871         (WebCore::IDBTransaction::objectStore):
1872         * Modules/indexeddb/IDBTransaction.h:
1873         * Modules/indexeddb/IDBTransactionBackendImpl.cpp:
1874         * Modules/indexeddb/IDBTransactionBackendImpl.h:
1875         (WebCore::IDBTransactionBackendImpl::objectStore):
1876         * WebCore.gypi:
1877         * WebCore.vcproj/WebCore.vcproj:
1878         * WebCore.xcodeproj/project.pbxproj:
1879
1880 2013-01-09  John J. Barton  <johnjbarton@chromium.org>
1881
1882         Web Inspector: Don't throw exceptions when we don't have a callstack
1883         https://bugs.webkit.org/show_bug.cgi?id=104849
1884
1885         Reviewed by Pavel Feldman.
1886
1887         Check array details.callFrames.length before accessing array;
1888
1889         No new tests, but this fix may help us find the cause of 'other' reasons.
1890
1891         * inspector/front-end/ScriptsPanel.js:
1892         (WebInspector.ScriptsPanel.prototype._debuggerPaused):
1893
1894 2013-01-09  Eugene Klyuchnikov  <eustas@chromium.org>
1895
1896         Web Inspector: [Network] Data grid header and content cells are misaligned.
1897         https://bugs.webkit.org/show_bug.cgi?id=105795
1898
1899         Reviewed by Pavel Feldman.
1900
1901         Header and content tables have different width -> same percent values
1902         turn to different cell widths.
1903
1904         * inspector/front-end/DataGrid.js: Add "corner" cell to all rows.
1905         * inspector/front-end/dataGrid.css: Apply "corner" rules to "td" nodes.
1906         (.data-grid .data-container): Remove artificial padding.
1907
1908 2013-01-09  Tien-Ren Chen  <trchen@chromium.org>
1909
1910         Make caret repainting container-aware
1911         https://bugs.webkit.org/show_bug.cgi?id=103955
1912
1913         Reviewed by Simon Fraser.
1914
1915         Only invalidate local rects on the caret's repaint container,
1916         instead of invalidating an absolute rect on the whole view.
1917
1918         Test: fast/repaint/caret-with-transformation.html
1919
1920         * editing/FrameSelection.cpp:
1921         (WebCore::caretRendersInsideNode):
1922         (WebCore::caretRenderer):
1923         (WebCore::FrameSelection::caretRenderer):
1924         (WebCore::DragCaretController::caretRenderer):
1925         (WebCore::repaintCaretForLocalRect):
1926         (WebCore::FrameSelection::recomputeCaretRect):
1927         (WebCore::CaretBase::invalidateCaretRect):
1928         (WebCore::FrameSelection::focusedOrActiveStateChanged):
1929         * editing/FrameSelection.h:
1930         * rendering/RenderView.cpp:
1931         (WebCore::RenderView::repaintSelection):
1932         * rendering/RenderView.h:
1933
1934 2013-01-09  Ryosuke Niwa  <rniwa@webkit.org>
1935
1936         Rebaseline the binding test after r139278.
1937
1938         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1939         (WebCore::JSTestEventTarget::getOwnPropertySlot):
1940
1941 2013-01-09  Ryosuke Niwa  <rniwa@webkit.org>
1942
1943         [JSC] REGRESSION(r135093): A form control with name=length overrides length property on form.elements
1944         https://bugs.webkit.org/show_bug.cgi?id=105775
1945
1946         Reviewed by Sam Weinig.
1947
1948         Fixed the bug by respecting properties on ancestor classes.
1949
1950         Test: fast/dom/collection-length-should-not-be-overridden.html
1951
1952         * bindings/js/JSDOMBinding.h:
1953         (WebCore::getStaticValueSlotEntryWithoutCaching): Added.
1954         * bindings/scripts/CodeGeneratorJS.pm:
1955         (GenerateGetOwnPropertySlotBody): Use getStaticValueSlotEntryWithoutCaching to climb up the class
1956         hierarchy.
1957
1958 2013-01-09  Kondapally Kalyan  <kalyan.kondapally@intel.com>
1959
1960         [EFL] [WebGL] Remove GLX dependencies from X11WindowResources..
1961         https://bugs.webkit.org/show_bug.cgi?id=106319
1962
1963         Reviewed by Kenneth Rohde Christiansen.
1964
1965         This patch removes GLX specific calls from X11WindowResources.
1966         This class is shared by both GLX and EGL implementations.
1967
1968         * platform/graphics/surfaces/glx/GLXSurface.cpp:
1969         (WebCore::GLXTransportSurface::setGeometry):
1970         * platform/graphics/surfaces/glx/X11WindowResources.cpp:
1971         (WebCore::X11OffScreenWindow::reSizeWindow):
1972
1973 2013-01-09  Huang Dongsung  <luxtella@company100.net>
1974
1975         Remove deviceScaleFactor argument in computeMinimumScaleFactorForContentContained().
1976         https://bugs.webkit.org/show_bug.cgi?id=106500
1977
1978         Reviewed by Kenneth Rohde Christiansen.
1979
1980         deviceScaleFactor argument is not used after r139189.
1981
1982         No new tests. Refactoring only.
1983
1984         * dom/ViewportArguments.cpp:
1985         (WebCore::computeMinimumScaleFactorForContentContained):
1986         * dom/ViewportArguments.h:
1987         (WebCore):
1988
1989 2013-01-09  Elliott Sprehn  <esprehn@gmail.com>
1990
1991         Node::containingShadowRoot should be constant time
1992         https://bugs.webkit.org/show_bug.cgi?id=106494
1993
1994         Reviewed by Dimitri Glazkov.
1995
1996         There's no reason to traverse up the tree to find the containing
1997         ShadowRoot when we already know if we're in a ShadowRoot by looking at
1998         the treeScope().
1999
2000         No new tests, just refactoring.
2001
2002         * dom/Node.cpp:
2003         (WebCore::Node::containingShadowRoot):
2004
2005 2013-01-09  Hajime Morrita  <morrita@google.com>
2006
2007         [Shadow DOM] Distribution related code on ElementShadow should be minimized.
2008         https://bugs.webkit.org/show_bug.cgi?id=106294
2009
2010         Reviewed by Dimitri Glazkov.
2011
2012         This change moves ElementShadow::m_selectFeatures,
2013         m_shouldCollectSelectFeatureSet and related methods to
2014         ContentDistributor.
2015
2016         There are also some renaming and small refactorings for better fit
2017         on new place:
2018
2019         - shouldCollectSelectFeatureSet is renamed needsSelectorRuleSet for conciseness.
2020         - setShouldCollectSelectFeatureSet() which used recursion morphed into
2021           iterative willAffectSelector().
2022         - ensureDistributionFromDocument() becomes a static method.
2023
2024         No new tests. Refactoring.
2025
2026         * WebCore.exp.in:
2027         * dom/Element.cpp:
2028         (WebCore::Element::shouldInvalidateDistributionWhenAttributeChanged):
2029         * dom/ElementShadow.cpp:
2030         (WebCore::ElementShadow::addShadowRoot):
2031         (WebCore::ElementShadow::removeAllShadowRoots):
2032         * dom/ElementShadow.h:
2033         (ElementShadow):
2034         (WebCore::ElementShadow::invalidateDistribution):
2035         (WebCore::ElementShadow::ensureDistribution):
2036         (WebCore::ElementShadow::didAffectSelector):
2037         (WebCore::ElementShadow::willAffectSelector):
2038         (WebCore::ElementShadow::containingShadow):
2039         (WebCore):
2040         * html/shadow/ContentDistributor.cpp:
2041         (WebCore::ScopeContentDistribution::registerInsertionPoint):
2042         (WebCore::ScopeContentDistribution::unregisterInsertionPoint):
2043         (WebCore::ContentDistributor::ContentDistributor):
2044         (WebCore::ContentDistributor::ensureDistribution):
2045         (WebCore):
2046         (WebCore::ContentDistributor::ensureDistributionFromDocument):
2047         (WebCore::ContentDistributor::invalidateDistribution):
2048         (WebCore::ContentDistributor::ensureSelectFeatureSet):
2049         (WebCore::ContentDistributor::collectSelectFeatureSetFrom):
2050         (WebCore::ContentDistributor::didAffectSelector):
2051         (WebCore::ContentDistributor::willAffectSelector):
2052         (WebCore::ContentDistributor::didShadowBoundaryChange):
2053         * html/shadow/ContentDistributor.h:
2054         (ScopeContentDistribution):
2055         (WebCore::ContentDistributor::needsSelectFeatureSet):
2056         (WebCore::ContentDistributor::setNeedsSelectFeatureSet):
2057         (ContentDistributor):
2058         (WebCore::ContentDistributor::setValidity):
2059         (WebCore::ContentDistributor::needsInvalidation):
2060         * html/shadow/HTMLContentElement.cpp:
2061         (WebCore::HTMLContentElement::parseAttribute):
2062         * html/shadow/HTMLContentElement.h:
2063         * html/shadow/HTMLShadowElement.cpp:
2064         (WebCore::HTMLShadowElement::olderShadowRoot):
2065         * html/shadow/InsertionPoint.cpp:
2066         (WebCore::InsertionPoint::getDistributedNodes):
2067         (WebCore::InsertionPoint::insertedInto):
2068         (WebCore::InsertionPoint::removedFrom):
2069         * html/shadow/InsertionPoint.h:
2070         (WebCore::InsertionPoint::canAffectSelector):
2071         * testing/Internals.cpp:
2072         (WebCore::Internals::hasSelectorForIdInShadow):
2073         (WebCore::Internals::hasSelectorForClassInShadow):
2074         (WebCore::Internals::hasSelectorForAttributeInShadow):
2075         (WebCore::Internals::hasSelectorForPseudoClassInShadow):
2076
2077 2013-01-09  Shinya Kawanaka  <shinyak@chromium.org>
2078
2079         Assert triggered in SelectorChecker::checkOneSelector when scrollbar (e.g. :horizontal) selector is specified.
2080         https://bugs.webkit.org/show_bug.cgi?id=106414
2081
2082         Reviewed by Dimitri Glazkov.
2083
2084         In SelectorChecker::checkOneSelector, scrollbar related pseudoType (e.g. :horizontal) is not handled anywhere.
2085         This caused ASSERT triggered. We have to check them.
2086
2087         Test: fast/css/scrollbar-crash.html
2088
2089         * css/SelectorChecker.cpp:
2090         (WebCore::SelectorChecker::checkOneSelector):
2091
2092 2013-01-09  Filip Pizlo  <fpizlo@apple.com>
2093
2094         Unreviewed, fix build after http://trac.webkit.org/changeset/139262
2095
2096         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
2097
2098 2013-01-09  Chris Rogers  <crogers@google.com>
2099
2100         Allow live/local audio input to be enabled only when needed
2101         https://bugs.webkit.org/show_bug.cgi?id=106490
2102
2103         Reviewed by Kenneth Russell.
2104         
2105         WebAudio can process live/local audio input using a MediaStreamAudioSourceNode.
2106         But currently the audio back-end is not able to know when/if audio input will be
2107         needed, so it needs to assume the worst and initialize the system to support potential
2108         audio input in all cases.  For some audio back-ends this can end up being less efficient
2109         than initializing for audio output only.  This patch adds the ability for the audio back-end
2110         to be able to initialize itself for audio input later on, only when/if it's needed.
2111
2112         * Modules/webaudio/AudioContext.cpp:
2113         (WebCore::AudioContext::createMediaStreamSource):
2114         * Modules/webaudio/AudioDestinationNode.h:
2115         (AudioDestinationNode):
2116         * Modules/webaudio/DefaultAudioDestinationNode.cpp:
2117         (WebCore::DefaultAudioDestinationNode::DefaultAudioDestinationNode):
2118         (WebCore::DefaultAudioDestinationNode::initialize):
2119         (WebCore::DefaultAudioDestinationNode::uninitialize):
2120         (WebCore::DefaultAudioDestinationNode::createDestination):
2121         (WebCore):
2122         (WebCore::DefaultAudioDestinationNode::enableInput):
2123         * Modules/webaudio/DefaultAudioDestinationNode.h:
2124         (DefaultAudioDestinationNode):
2125         * Modules/webaudio/OfflineAudioDestinationNode.h:
2126         (OfflineAudioDestinationNode):
2127         (WebCore::OfflineAudioDestinationNode::sampleRate):
2128         * platform/audio/AudioDestination.h:
2129         (AudioDestination):
2130         * platform/audio/gstreamer/AudioDestinationGStreamer.cpp:
2131         (WebCore::AudioDestination::create):
2132         * platform/audio/mac/AudioDestinationMac.cpp:
2133         (WebCore::AudioDestination::create):
2134
2135 2013-01-09  Tim Horton  <timothy_horton@apple.com>
2136
2137         Don't drop to huge tile mode if we're only slow-scrolling because of a page overlay
2138         https://bugs.webkit.org/show_bug.cgi?id=106502
2139         <rdar://problem/12959143>
2140
2141         Reviewed by Simon Fraser.
2142
2143         We only use the MainThreadScrollingReason "ForcedOnMainThread" if WebKit2 installs
2144         a page overlay (TiledCoreAnimationDrawingArea::didInstallPageOverlay), which clients
2145         can cause arbitrarily.
2146
2147         We probably should still use default-sized tiles in this case (this will also
2148         prevent us from falling into gigantic tiles for WebKit2 find-in-page, among other things).
2149
2150         * rendering/RenderLayerBacking.cpp:
2151         (WebCore::RenderLayerBacking::adjustTileCacheCoverage):
2152
2153 2013-01-09  Takashi Sakamoto  <tasak@google.com>
2154
2155         border-radius with box-shadow is not rendered correctly
2156         https://bugs.webkit.org/show_bug.cgi?id=106404
2157
2158         Reviewed by Hajime Morita.
2159
2160         RoundedRect::isRenderable is wrong. So RoundedRect::adjustRadii
2161         is invoked for renderable RoundedRects.
2162
2163         Test: fast/borders/border-radius-with-box-shadow.html
2164
2165         * platform/graphics/RoundedRect.cpp:
2166         (WebCore::RoundedRect::isRenderable):
2167         Have to compare topLeft's height plus bottomLeft's height with
2168         rect's height and to compare topRight's height plus bottomRight's
2169         height with rect's height.
2170
2171 2013-01-09  Joanmarie Diggs  <jdiggs@igalia.com>
2172
2173         [GTK] accessibility/aria-labelledby-overrides-label.html requires a proper baseline
2174         https://bugs.webkit.org/show_bug.cgi?id=105638
2175
2176         Reviewed by Martin Robinson.
2177
2178         The test was failing for two reasons:
2179         - AccessibilityRenderObject::correspondingLabelForControlElement() was
2180           not ignoring the ARIA labelled-by property
2181         - AccessibilityController::accessibleElementById() was not implemented
2182
2183         Because getting an element by ID cannot be done in the UIProcess, the
2184         decision was made to expose the element's ID as an accessible attribute
2185         of the object.
2186
2187         In addition, fixing the bug in AccessibilityRenderObject made it possible
2188         to eliminate the Gtk platform-specific expectations for another test.
2189
2190         No new tests; instead, the failing test was unskipped and a proper baseline
2191         provided.
2192
2193         * accessibility/AccessibilityRenderObject.cpp:
2194         (WebCore::AccessibilityRenderObject::correspondingLabelForControlElement):
2195         Return null for objects where hasTextAlternative() is true.
2196         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2197         (webkitAccessibleGetAttributes): Expose the element's ID as an accessible
2198         attribute.
2199
2200 2013-01-09  Tony Gentilcore  <tonyg@chromium.org>
2201
2202         Remove unused includes from HTMLTreeBuilder
2203         https://bugs.webkit.org/show_bug.cgi?id=106496
2204
2205         Reviewed by Levi Weintraub.
2206
2207         Noticed these while searching HTMLTreeBuilder for non-thread friendly deps.
2208
2209         No new tests because no new functionality.
2210
2211         * html/parser/HTMLTreeBuilder.cpp:
2212
2213 2013-01-09  Max Vujovic  <mvujovic@adobe.com>
2214
2215         [CSS Shaders] Detached identifier after mesh box type is not applied
2216         https://bugs.webkit.org/show_bug.cgi?id=105321
2217
2218         Reviewed by Dean Jackson.
2219
2220         Before this patch, if a "detached" identifier followed a mesh box type identifier, the
2221         detached identifier was not applied. In other words, the mesh would still be attached.
2222
2223         For example:
2224         -webkit-filter: custom(url(...) mix(url(...) normal source-atop), 1 1 border-box detached);
2225
2226         Although the mesh box type is being removed from the Filter Effects spec, for now, we
2227         continue to accept the mesh box type in parsing because of existing content. Eventually,
2228         custom filters will transition to an at-rule syntax, once it is defined.
2229
2230         Test: css3/filters/custom/custom-filter-detached-mesh-with-mesh-box-type.html
2231
2232         * css/CSSParser.cpp:
2233         (WebCore::CSSParser::parseCustomFilter):
2234             In CSSParser, do not add the mesh box type identifier to the list that will be passed to
2235             StyleResolver. StyleResolver is expecting a "detached" identifier in that position and
2236             does not interpret mesh box types.
2237
2238 2013-01-09  Dan Winship  <danw@gnome.org>
2239
2240         [Soup] Handle redirection inside WebKit
2241         https://bugs.webkit.org/show_bug.cgi?id=61122
2242         https://bugs.webkit.org/show_bug.cgi?id=88961
2243
2244         Reviewed by Martin Robinson.
2245
2246         Rather than using libsoup's built-in redirection handling (which
2247         doesn't do everything exactly the way WebKit wants, and can't
2248         handle redirects to non-http URIs anyway), process redirections
2249         ourselves.
2250
2251         No new tests; unskips a few existing tests.
2252
2253         * platform/network/ResourceHandleInternal.h:
2254         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2255         (ResourceHandleInternal):
2256         * platform/network/soup/ResourceError.h:
2257         (ResourceError):
2258         * platform/network/soup/ResourceErrorSoup.cpp:
2259         (WebCore::ResourceError::transportError):
2260         (WebCore):
2261         (WebCore::ResourceError::httpError):
2262         * platform/network/soup/ResourceHandleSoup.cpp:
2263         (WebCore):
2264         (WebCore::gotHeadersCallback):
2265         (WebCore::restartedCallback):
2266         (WebCore::shouldRedirect):
2267         (WebCore::doRedirect):
2268         (WebCore::redirectCloseCallback):
2269         (WebCore::redirectSkipCallback):
2270         (WebCore::cleanupSoupRequestOperation):
2271         (WebCore::sendRequestCallback):
2272         (WebCore::createSoupMessageForHandleAndRequest):
2273         (WebCore::createSoupRequestAndMessageForHandle):
2274         (WebCore::ResourceHandle::start):
2275
2276 2013-01-09  Florin Malita  <fmalita@chromium.org>
2277
2278         [Skia] Implement GraphicsContext::addRoundedRectClip() using SkCanvas::clipRRect()
2279         https://bugs.webkit.org/show_bug.cgi?id=106461
2280
2281         Reviewed by Stephen White.
2282
2283         This patch adds a Skia-specific version of GraphicsContext::addRoundedRectClip() to take
2284         advantage of the SkCanvas::clipRRect() primitive.
2285
2286         As a minor cleanup, the anonymous namespace in GraphicsContextSkia.cpp is extended to cover
2287         all the local helper functions.
2288
2289         No new tests: coverage provided by existing tests.
2290
2291         * platform/graphics/GraphicsContext.cpp:
2292         (WebCore):
2293         * platform/graphics/skia/GraphicsContextSkia.cpp:
2294         (WebCore::GraphicsContext::addRoundedRectClip):
2295         (WebCore):
2296         (WebCore::GraphicsContext::fillRoundedRect):
2297         * platform/graphics/skia/PlatformContextSkia.h:
2298         (WebCore::PlatformContextSkia::clipRRect):
2299         (WebCore):
2300
2301 2013-01-09  Andreas Kling  <akling@apple.com>
2302
2303         SVG-as-image: Throw out cached bitmap renderings after they sit unused for some time.
2304         <http://webkit.org/b/106484>
2305         <rdar://problem/12983216>
2306
2307         Reviewed by Antti Koivisto.
2308
2309         Add a one-shot timer to SVGImageCache to self-clear the bitmap cache 30 seconds after last access.
2310         This prevents us from keeping huge ImageBuffers around in memory for the lifetime of the elements
2311         referencing that particular SVG file. (The ownership model is actually a bit more complicated
2312         but that's irrelevant to this issue.)
2313
2314         10234kB progression on Membuster3.
2315
2316         * svg/graphics/SVGImageCache.cpp:
2317         (WebCore::SVGImageCache::SVGImageCache):
2318         (WebCore::SVGImageCache::~SVGImageCache):
2319         (WebCore::SVGImageCache::clearBitmapCache):
2320         (WebCore::SVGImageCache::cacheClearTimerFired):
2321         (WebCore::SVGImageCache::lookupOrCreateBitmapImageForRenderer):
2322         * svg/graphics/SVGImageCache.h:
2323         (SVGImageCache):
2324
2325 2013-01-09  Alexey Proskuryakov  <ap@apple.com>
2326
2327         Assertion failure in SubresourceLoader::didFail when reloading
2328         https://bugs.webkit.org/show_bug.cgi?id=101416
2329
2330         Reviewed by Nate Chapin.
2331
2332         Test: http/tests/cache/network-error-during-revalidation.html
2333
2334         * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didFail): Handle revalidation.
2335
2336 2013-01-09  Alexandru Chiculita  <achicu@adobe.com>
2337
2338         Assertion Failure in WebCore::RenderLayerCompositor::updateCompositingLayers
2339         https://bugs.webkit.org/show_bug.cgi?id=106419
2340
2341         Reviewed by Simon Fraser.
2342
2343         No new tests added, just un-skipped 3 existing tests.
2344
2345         RenderLayerCompositor::updateCompositingLayers is being called with a pending layout, so computing the
2346         layers at that point would be useless & error-prone as they will be using incorrect layout values. If a layout is pending it means that 
2347         RenderLayerCompositor::updateCompositingLayers would get called again after the pending layout ends, so any values calculated at that point would be
2348         overwritten immediately. This patch removes the old ASSERT and makes it a return instead.
2349
2350         * rendering/RenderLayerCompositor.cpp:
2351         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2352
2353 2013-01-09  Robert Hogan  <robert@webkit.org>
2354
2355         REGRESSION(r111439): Focus ring is rendered incorrectly in fast/inline/continuation-outlines-with-layers.html
2356         https://bugs.webkit.org/show_bug.cgi?id=106064
2357
2358         Reviewed by David Hyatt.
2359
2360         * rendering/RenderBlock.cpp:
2361         (WebCore::RenderBlock::paintObject): 
2362
2363 2013-01-09  Gregg Tavares  <gman@google.com>
2364
2365         Add stub for CanvasProxy
2366         https://bugs.webkit.org/show_bug.cgi?id=106275
2367
2368         Reviewed by Dean Jackson.
2369
2370         No new tests as no new fuctionality exposed.
2371
2372         * CMakeLists.txt:
2373         * DerivedSources.make:
2374         * DerivedSources.pri:
2375         * GNUmakefile.list.am:
2376         * Target.pri:
2377         * WebCore.gypi:
2378         * WebCore.xcodeproj/project.pbxproj:
2379         * html/canvas/CanvasProxy.cpp: Added.
2380         * html/canvas/CanvasProxy.h: Added.
2381         * html/canvas/CanvasProxy.idl: Added.
2382
2383 2013-01-09  Antti Koivisto  <antti@apple.com>
2384
2385         Release FastMalloc thread caches on memory warning
2386         https://bugs.webkit.org/show_bug.cgi?id=106471
2387
2388         Reviewed by Geoff Garen.
2389         
2390         FastMalloc keeps some memory in per-thread caches (currently 2MB each). We currently flush these caches on memory warning 
2391         for the main thread only. We should do it for other WebKit threads that use FastMalloc too.
2392
2393         Call WTF::releaseFastMallocFreeMemory in a bunch of WebCore support threads on memory warning. Unfortunately we don't have 
2394         an uniform way of doing threads so this requires bunch of thread type specific code.
2395         
2396         Looks to be ~1% progression in membuster3 final and maximum numbers.
2397
2398         * platform/mac/MemoryPressureHandlerMac.mm:
2399         (WebCore::MemoryPressureHandler::releaseMemory):
2400         * storage/StorageTask.cpp:
2401         (WebCore::StorageTask::performTask):
2402         * storage/StorageTask.h:
2403         (WebCore::StorageTask::createReleaseFastMallocFreeMemory):
2404         * storage/StorageThread.cpp:
2405         (WebCore::storageThreads):
2406         (WebCore):
2407         (WebCore::StorageThread::StorageThread):
2408         (WebCore::StorageThread::~StorageThread):
2409         (WebCore::StorageThread::releaseFastMallocFreeMemoryInAllThread):
2410         * storage/StorageThread.h:
2411         (StorageThread):
2412         * workers/WorkerThread.cpp:
2413         (WebCore::threadSetMutex):
2414         (WebCore::workerThreads):
2415         (WebCore::WorkerThread::workerThreadCount):
2416         (WebCore::WorkerThread::WorkerThread):
2417         (WebCore::WorkerThread::~WorkerThread):
2418         (WebCore::WorkerThread::releaseFastMallocFreeMemoryInAllThread):
2419         (WebCore):
2420         * workers/WorkerThread.h:
2421         (WorkerThread):
2422
2423 2013-01-09  Tony Gentilcore  <tonyg@chromium.org>
2424
2425         REGRESSION(r139141): Assertion failure in WebCore::HTMLConstructionSite::HTMLConstructionSite
2426         https://bugs.webkit.org/show_bug.cgi?id=106412
2427
2428         Reviewed by Darin Adler.
2429
2430         This corrects the assertion added in r139141. The assertion was designed to make sure that we are using the
2431         HTMLDocument class. XHTML documents also use HTMLDocument.
2432
2433         No new tests because no new functionality.
2434
2435         * html/parser/HTMLConstructionSite.cpp:
2436         (WebCore::HTMLConstructionSite::HTMLConstructionSite):
2437
2438 2013-01-08  Ojan Vafai  <ojan@chromium.org>
2439
2440         min-content gets the wrong value if min-width is set on some form controls
2441         https://bugs.webkit.org/show_bug.cgi?id=106389
2442
2443         Reviewed by Tony Chang.
2444
2445         Simplify the logic. The only exposed change in behavior is that
2446         m_minPreferredLogicalWidth gets set to m_maxPreferredLogicalWidth
2447         instead of 0 when min-width is set.
2448
2449         Test: fast/forms/min-content-form-controls.html
2450
2451         * rendering/RenderFileUploadControl.cpp:
2452         (WebCore::RenderFileUploadControl::computePreferredLogicalWidths):
2453         * rendering/RenderListBox.cpp:
2454         (WebCore::RenderListBox::computePreferredLogicalWidths):
2455         * rendering/RenderMenuList.cpp:
2456         (WebCore::RenderMenuList::computePreferredLogicalWidths):
2457         * rendering/RenderSlider.cpp:
2458         (WebCore::RenderSlider::computePreferredLogicalWidths):
2459         * rendering/RenderTextControl.cpp:
2460         (WebCore::RenderTextControl::computePreferredLogicalWidths):
2461
2462 2013-01-09  Abhishek Arya  <inferno@chromium.org>
2463
2464         Mitigate out-of-bounds access in InlineIterator
2465         https://bugs.webkit.org/show_bug.cgi?id=104812
2466
2467         Reviewed by Levi Weintraub.
2468
2469         Share code between InlineIterator::current and InlineIterator::previousInSameNode,
2470         thereby checking for access outside text renderer's length.
2471
2472         * rendering/InlineIterator.h:
2473         (InlineIterator):
2474         (WebCore::InlineIterator::characterAt):
2475         (WebCore):
2476         (WebCore::InlineIterator::current):
2477         (WebCore::InlineIterator::previousInSameNode):
2478
2479 2013-01-09  Yongjun Zhang  <yongjun_zhang@apple.com>
2480
2481         If ImageLoader's loadEventSender or errorEventSender fires after document is detached, the document will be leaked.
2482
2483         https://bugs.webkit.org/show_bug.cgi?id=106394
2484
2485         Reviewed by Alexey Proskuryakov.
2486
2487         ImageLoader's loadEventSender and errorEventSender schedule event dispatching in separate timers and refs
2488         the Element in updatedHasPendingEvent.  If the Document is detached before either eventSender dispatches,
2489         we would leak the Document since we bail out early in dispatchPendingLoadEvent or dispatchPendingErrorEvent,
2490         without deref-ing the Element itself.
2491
2492         No new tests.  Verified manually by using heap tool to count the living HTMLDocuments.
2493
2494         * loader/ImageLoader.cpp:
2495         (WebCore::ImageLoader::dispatchPendingLoadEvent): also call updatedHasPendingEvent to deref the Element if
2496                     the document is detached.
2497         (WebCore::ImageLoader::dispatchPendingErrorEvent): ditto.
2498
2499 2013-01-09  Dimitri Glazkov  <dglazkov@chromium.org>
2500
2501         Unreviewed, rolling out r139143.
2502         http://trac.webkit.org/changeset/139143
2503         https://bugs.webkit.org/show_bug.cgi?id=106135
2504
2505         Broke Chromium content_browsertests.
2506
2507         * platform/leveldb/LevelDBDatabase.cpp:
2508         (WebCore::LevelDBDatabase::open):
2509         (WebCore::LevelDBDatabase::openInMemory):
2510
2511 2013-01-09  Sam Weinig  <sam@webkit.org>
2512
2513         Add Settings.in and make_settings.pl to the project.
2514
2515         Reviewed by Anders Carlsson.
2516
2517         * WebCore.xcodeproj/project.pbxproj:
2518
2519 2013-01-09  Ojan Vafai  <ojan@chromium.org>
2520
2521         marquee special-case in RenderBlock is not needed
2522         https://bugs.webkit.org/show_bug.cgi?id=106396
2523
2524         Reviewed by Simon Fraser.
2525
2526         This was added in http://trac.webkit.org/changeset/105772. The layout test
2527         in that patch (which is disabled) works and the original site that was broken
2528         also still works.
2529
2530         * rendering/RenderBlock.cpp:
2531         (WebCore::RenderBlock::computePreferredLogicalWidths):
2532
2533 2013-01-09  Tony Chang  <tony@chromium.org>
2534
2535         Automatically generate Settings::unifiedTextCheckerEnabled
2536         https://bugs.webkit.org/show_bug.cgi?id=106382
2537
2538         Reviewed by Adam Barth.
2539
2540         No new tests, no change in behavior. This is covered by existing editing/spelling tests.
2541
2542         * page/Settings.cpp:
2543         (WebCore): Move default value into a global so we can generate the initializer.
2544         (WebCore::Settings::Settings): Remove initializer code that is now generated.
2545         * page/Settings.h:
2546         (Settings): Remove getters and setters.
2547         * page/Settings.in: Add entry to be generated.
2548         * testing/InternalSettings.cpp:
2549         (WebCore::InternalSettings::Backup::Backup): Remove backup since the generated code does this.
2550         (WebCore::InternalSettings::Backup::restoreTo): Remove restore code since the generated code does this.
2551         * testing/InternalSettings.h:
2552         (InternalSettings): Remove member variable.
2553         * testing/InternalSettings.idl: The getter was unused so it's being removed. The setter is now generated.
2554
2555 2013-01-09  Alexis Menard  <alexis@webkit.org>
2556
2557         Implement CSS computed style value for transition shorthand
2558         https://bugs.webkit.org/show_bug.cgi?id=105035
2559
2560         Reviewed by Dean Jackson.
2561
2562         Implement support for query the transition and webkit-transition
2563         shorthand from the computed style.
2564
2565         Test: transitions/transitions-parsing.html
2566
2567         * css/CSSComputedStyleDeclaration.cpp:
2568         (WebCore::createTransitionPropertyValue): Factor the code to create the
2569         correct value into a function to reuse it for the shorthand.
2570         (WebCore::getTransitionPropertyValue):
2571         (WebCore::createTimingFunctionValue): Little refactor, the intermediate
2572         local variables are not needed.
2573         (WebCore::getTimingFunctionValue):
2574         (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
2575
2576 2013-01-09  Hajime Morrita  <morrita@google.com>
2577
2578         Document::setActiveNode() should be Document::setActiveElement()
2579         https://bugs.webkit.org/show_bug.cgi?id=106437
2580
2581         Reviewed by Ojan Vafai.
2582
2583         No new tests. No functoinal change.
2584
2585         * dom/Document.cpp:
2586         (WebCore::Document::setActiveElement):
2587         (WebCore::Document::updateHoverActiveState):
2588         * dom/Document.h:
2589         (Document):
2590         * rendering/HitTestResult.cpp:
2591         (WebCore::HitTestResult::innerElement):
2592         (WebCore):
2593         * rendering/HitTestResult.h:
2594         (HitTestResult):
2595
2596 2013-01-09  Shinya Kawanaka  <shinyak@chromium.org>
2597
2598         [Shadow DOM]: ShadowRoot has wrong nodeName attribute
2599         https://bugs.webkit.org/show_bug.cgi?id=104995
2600
2601         Reviewed by Dimitri Glazkov.
2602
2603         According to the Shadow DOM spec, ShadowRoot.nodeName should return '#document-fragment' instead of '#shadow-root'.
2604         We remove ShadowRoot::nodeName.
2605
2606         No new tests, covered by existing tests.
2607
2608         * dom/ShadowRoot.cpp:
2609         * dom/ShadowRoot.h:
2610         (ShadowRoot):
2611
2612 2013-01-09  Zoltan Horvath  <zoltan@webkit.org>
2613
2614         [CSS Regions] Selecting text through nested regions causes weird and unclearable selection  
2615         https://bugs.webkit.org/show_bug.cgi?id=105641
2616
2617         Reviewed by David Hyatt.
2618
2619         If you have a region with a nested region inside what is rendered below the base region and you are trying select text
2620         starting from the base region and ending it in the nested region, firstly you got a weird selection, secondly you can't
2621         clear the selection. We could prevent this strange behavior by preventing the selection through different region flows.
2622
2623         Test: fast/regions/selecting-text-through-different-region-flows.html
2624
2625         * rendering/RenderView.cpp:
2626         (WebCore::RenderView::setSelection): Don't allow selection when trying to select different region flows.
2627
2628 2013-01-09  Hugo Parente Lima  <hugo.lima@openbossa.org>
2629
2630         Regression(r138681) : Add HAVE(ACCESSIBILITY) guard to atk files, fix for a fix.
2631         https://bugs.webkit.org/show_bug.cgi?id=106448
2632
2633         Reviewed by Gyuyoung Kim.
2634
2635         Some atk files don't use HAVE(ACCESSIBILITY). It might make build errors when
2636         the macro isn't enabled.
2637
2638         * accessibility/atk/WebKitAccessibleHyperlink.h:
2639         * accessibility/atk/WebKitAccessibleInterfaceAction.h:
2640         * accessibility/atk/WebKitAccessibleInterfaceComponent.h:
2641         * accessibility/atk/WebKitAccessibleInterfaceHypertext.h:
2642
2643 2013-01-09  Chris Fleizach  <cfleizach@apple.com>
2644
2645         AX: native popup buttons should not use textUnderElement for their title
2646         https://bugs.webkit.org/show_bug.cgi?id=106349
2647
2648         Reviewed by Ryosuke Niwa.
2649
2650         Chromium relies on the older title() method to return its title. As a result, we also
2651         need to handle the case of <select> element pop up buttons returning the textUnderElement().
2652
2653         No new tests. Fix existing break.
2654
2655         * accessibility/AccessibilityNodeObject.cpp:
2656         (WebCore::AccessibilityNodeObject::title):
2657
2658 2013-01-09  Jussi Kukkonen  <jussi.kukkonen@intel.com>
2659
2660         IndexedDB: Remove ASSERTs that can't assert but result in compiler warnings
2661         https://bugs.webkit.org/show_bug.cgi?id=106442
2662
2663         Reviewed by Kentaro Hara.
2664
2665         IDBLevelDBCoding::m_metaDataType has been changed to unsigned
2666         so ASSERT(m_metaDataType >= 0) is no longer useful: the compiler
2667         warnings however create build difficulties at least with EFL.
2668
2669         * Modules/indexeddb/IDBLevelDBCoding.cpp:
2670         (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::metaDataType):
2671         (WebCore::IDBLevelDBCoding::ObjectStoreMetaDataKey::compare):
2672
2673 2012-12-29  Ilya Tikhonovsky  <loislo@chromium.org>
2674
2675         Web Inspector: Native Memory Instrumentation: fix instrumentation for already instrumented classes 1/N
2676         https://bugs.webkit.org/show_bug.cgi?id=106445
2677
2678         Reviewed by Vsevolod Vlasov.
2679
2680         The patch has almost mechanical changes.
2681
2682         * bindings/v8/V8Binding.cpp:
2683         * bindings/v8/V8ValueCache.cpp:
2684         (WTF):
2685         (WebCore::StringCache::reportMemoryUsage):
2686         (WebCore):
2687         * dom/Document.cpp:
2688         (WebCore::Document::reportMemoryUsage):
2689         * dom/DocumentStyleSheetCollection.cpp:
2690         (WebCore::DocumentStyleSheetCollection::reportMemoryUsage):
2691         * dom/ElementRareData.cpp:
2692         (WebCore::ElementRareData::reportMemoryUsage):
2693         * loader/cache/CachedResource.cpp:
2694         (WebCore::CachedResource::reportMemoryUsage):
2695         * page/Frame.cpp:
2696         (WebCore::Frame::reportMemoryUsage):
2697         * page/Page.cpp:
2698         (WebCore::Page::reportMemoryUsage):
2699         * platform/graphics/skia/NativeImageSkia.cpp:
2700         (WebCore::NativeImageSkia::reportMemoryUsage):
2701         * platform/network/FormData.cpp:
2702         (WebCore::FormData::reportMemoryUsage):
2703         (WebCore):
2704         (WebCore::FormDataElement::reportMemoryUsage):
2705         * platform/network/FormData.h:
2706         (FormDataElement):
2707         * rendering/RenderView.cpp:
2708         (WebCore::RenderView::reportMemoryUsage):
2709         * rendering/style/StyleRareNonInheritedData.cpp:
2710         (WebCore::StyleRareNonInheritedData::reportMemoryUsage):
2711
2712 2013-01-09  Florin Malita  <fmalita@chromium.org>
2713
2714         [Skia] Implement GraphicsContext::fillRoundedRect() using SkCanvas::drawRRect()
2715         https://bugs.webkit.org/show_bug.cgi?id=106366
2716
2717         Reviewed by Stephen White.
2718
2719         Skia provides rounded-rect primitives, so we can avoid degrading fillRoundedRect() to
2720         drawPath().
2721
2722         Due to subtle pixel differences (not visually noticeable), switching from drawPath() to
2723         drawRRect() requires rebaselining some of the existing results.
2724
2725         No new tests: coverage provided by existing tests.
2726
2727         * platform/graphics/skia/GraphicsContextSkia.cpp:
2728         (WebCore::GraphicsContext::fillRoundedRect):
2729         * platform/graphics/skia/PlatformContextSkia.h:
2730         (WebCore::PlatformContextSkia::drawRRect):
2731         (WebCore):
2732
2733 2013-01-09  Arnaud Renevier  <a.renevier@sisa.samsung.com>
2734
2735         Web Inspector: cannot undock inspector when window size is too small
2736         https://bugs.webkit.org/show_bug.cgi?id=106054
2737
2738         Reviewed by Pavel Feldman.
2739
2740         Consider dockingUnavailable flag only when dockSide is in undocked
2741         state.
2742
2743         * inspector/front-end/DockController.js:
2744         (WebInspector.DockController.prototype._updateUI.get document):
2745
2746 2013-01-09  Zeno Albisser  <zeno@webkit.org>
2747
2748         [Qt] WebGL content is incomplete when using multiple canvas
2749         https://bugs.webkit.org/show_bug.cgi?id=106313
2750
2751         While we are using double buffering for WebGL,
2752         we do not use a drawable that implements a mechanism
2753         for swapping buffers.
2754         Therefore we have to make sure that all GL commands
2755         have been executed properly before copying the texture
2756         onto the GraphicsSurface.
2757
2758         Reviewed by Simon Hausmann.
2759
2760         * platform/graphics/qt/GraphicsContext3DQt.cpp:
2761         (WebCore::GraphicsContext3DPrivate::blitMultisampleFramebufferAndRestoreContext):
2762
2763 2013-01-09  Carlos Garcia Campos  <cgarcia@igalia.com>
2764
2765         Unreviewed. Fix make distcheck.
2766
2767         * GNUmakefile.list.am: Add missing headers.
2768
2769 2013-01-09  Zeno Albisser  <zeno@webkit.org>
2770
2771         [Qt][Mac] GraphicsSurface does not need glEnable/glDisable for texture targets.
2772         https://bugs.webkit.org/show_bug.cgi?id=106310
2773
2774         glEnable/glDisable for texture targets is only necessary
2775         when using the fixed function pipeline.
2776         Enabling or disabling the target might cause unexpected
2777         behavior to texture bindings and is therefore considered harmful.
2778
2779         Reviewed by Noam Rosenthal.
2780
2781         * platform/graphics/surfaces/mac/GraphicsSurfaceMac.cpp:
2782         (WebCore::createTexture):
2783         (WebCore::GraphicsSurfacePrivate::copyFromTexture):
2784         (WebCore::GraphicsSurface::platformCopyToGLTexture):
2785
2786 2013-01-09  Kunihiko Sakamoto  <ksakamoto@chromium.org>
2787
2788         INPUT_MULTIPLE_FIELDS_UI: min/max attributes should not make all fields read-only
2789         https://bugs.webkit.org/show_bug.cgi?id=106422
2790
2791         Reviewed by Kent Tamura.
2792
2793         Do not make day-field of date input and month-field of month input readonly
2794         even if min and max are the same.
2795
2796         Tests: fast/forms/date-multiple-fields/date-multiple-fields-readonly-subfield.html
2797                fast/forms/month-multiple-fields/month-multiple-fields-readonly-subfield.html
2798
2799         * html/shadow/DateTimeEditElement.cpp:
2800         (WebCore::DateTimeEditBuilder::visitField): Added check for date type.
2801
2802 2013-01-09  Kunihiko Sakamoto  <ksakamoto@chromium.org>
2803
2804         INPUT_MULTIPLE_FIELDS_UI: Step-up/-down of week field should respect min/max attributes
2805         https://bugs.webkit.org/show_bug.cgi?id=106416
2806
2807         Reviewed by Kent Tamura.
2808
2809         Make step-up/-down of the week field respect the min/max attributes of the element.
2810         Note that it still accepts any keyboard inputs (the element
2811         becomes 'invalid' state when out-of-range values entered).
2812
2813         Tests: fast/forms/week-multiple-fields/week-multiple-fields-readonly-subfield.html
2814                fast/forms/week-multiple-fields/week-multiple-fields-stepup-stepdown-from-renderer.html
2815
2816         * css/html.css: Add a CSS rule for week field.
2817         * html/shadow/DateTimeEditElement.cpp:
2818         (WebCore::DateTimeEditBuilder::visitField):
2819         Compute minimum/maximum values of week field from the min/max parameters of the element.
2820         * html/shadow/DateTimeFieldElements.cpp:
2821         (WebCore::DateTimeWeekFieldElement::DateTimeWeekFieldElement): Add mininum/maximum arguments.
2822         (WebCore::DateTimeWeekFieldElement::create): Ditto.
2823         (WebCore::DateTimeWeekFieldElement::clampValueForHardLimits): Added.
2824         * html/shadow/DateTimeFieldElements.h:
2825         (DateTimeWeekFieldElement): Add mininum/maximum arguments and declare clampValueForHardLimits.
2826
2827 2013-01-08  Arpita Bahuguna  <arpitabahuguna@gmail.com>
2828
2829         Caret is incorrectly painted for a contenteditable <div> containing a <br> in vertical writing mode
2830         https://bugs.webkit.org/show_bug.cgi?id=103621
2831
2832         Reviewed by Ryosuke Niwa.
2833
2834         While computing the caret rect for the given specific scenario, we
2835         canonicalize our position. For the upstream (or downstream) block flow
2836         candidates a check to ignore the nodes having renderers with zero height
2837         is carried out. This is where we fail our check in the vertical writing mode.
2838
2839         In the vertical writing mode, instead of verifying the height of the descendants
2840         of the candidate nodes, a check for their width should be carried out.
2841
2842         For our case, i.e. the <br> element contained inside the div, the bounding box
2843         in the vertical writing mode would have a width greater than zero and height
2844         equal to zero (as is to be expected in the vertical mode).
2845
2846         Thus, we need to make a check against the logical height. For the vertical
2847         writing mode, the logical height should return the width of the computed
2848         bounding box.
2849
2850         Test: editing/selection/caret-in-div-containing-br-in-vertical-mode.html
2851
2852         * dom/Position.cpp:
2853         (WebCore::Position::hasRenderedNonAnonymousDescendantsWithHeight):
2854         Have modified the code to verify against the logical height, instead
2855         of simply the height, both in case of RenderText and RenderBox.
2856         The logical height of the computed rects returns a value according
2857         to the writing mode.
2858
2859         For the RenderText a new function, linesLogicalBoundingBox() is called
2860         which returns the values depending on the writing mode.
2861         Similarly, on the RenderBox, pixelSnappedLogicalHeight() is called which
2862         too takes care of the writing mode internally. (borderBoundingBox()
2863         internally calls on the pixelSnappedRect).
2864
2865         * rendering/RenderText.cpp:
2866         (WebCore::RenderText::linesLogicalBoundingBox):
2867         (WebCore):
2868         * rendering/RenderText.h:
2869         (RenderText):
2870         New function is added to return the logical linesBoundingBox, i.e.,
2871         the width and height of the linesBoundingBox are set according to
2872         the writing mode.
2873
2874 2013-01-08  Tony Gentilcore  <tonyg@chromium.org>
2875
2876         Remove a few unused includes from HTMLTreeBuilder
2877         https://bugs.webkit.org/show_bug.cgi?id=106401
2878
2879         Reviewed by Adam Barth.
2880
2881         I happened to notice these while attempting to remove non-thread friendly deps from HTMLTreeBuilder.
2882
2883         No new tests because no new functionality.
2884
2885         * html/parser/HTMLTreeBuilder.cpp:
2886
2887 2013-01-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2888
2889         Regression(r138681): Add HAVE(ACCESSIBILITY) guard to atk files
2890         https://bugs.webkit.org/show_bug.cgi?id=106290
2891
2892         Reviewed by Martin Robinson.
2893
2894         Some atk files don't use HAVE(ACCESSIBILITY). It might make build errors when
2895         the macro isn't enabled.
2896
2897         * accessibility/atk/AXObjectCacheAtk.cpp:
2898         * accessibility/atk/WebKitAccessibleHyperlink.h:
2899         * accessibility/atk/WebKitAccessibleInterfaceAction.cpp:
2900         * accessibility/atk/WebKitAccessibleInterfaceAction.h:
2901         * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp:
2902         * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
2903         * accessibility/atk/WebKitAccessibleInterfaceDocument.h:
2904         * accessibility/atk/WebKitAccessibleInterfaceEditableText.cpp:
2905         * accessibility/atk/WebKitAccessibleInterfaceEditableText.h:
2906         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.cpp:
2907         * accessibility/atk/WebKitAccessibleInterfaceHyperlinkImpl.h:
2908         * accessibility/atk/WebKitAccessibleInterfaceHypertext.cpp:
2909         * accessibility/atk/WebKitAccessibleInterfaceImage.cpp:
2910         * accessibility/atk/WebKitAccessibleInterfaceImage.h:
2911         * accessibility/atk/WebKitAccessibleInterfaceSelection.cpp:
2912         * accessibility/atk/WebKitAccessibleInterfaceSelection.h:
2913         * accessibility/atk/WebKitAccessibleInterfaceTable.cpp:
2914         * accessibility/atk/WebKitAccessibleInterfaceTable.h:
2915         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2916         * accessibility/atk/WebKitAccessibleInterfaceText.h:
2917         * accessibility/atk/WebKitAccessibleInterfaceValue.cpp:
2918         * accessibility/atk/WebKitAccessibleInterfaceValue.h:
2919         * accessibility/atk/WebKitAccessibleUtil.cpp:
2920         * accessibility/atk/WebKitAccessibleUtil.h:
2921         * accessibility/atk/WebKitAccessibleWrapperAtk.h:
2922
2923 2013-01-08  Matt Falkenhagen  <falken@chromium.org>
2924
2925         Make NodeRenderingContext::parentRenderer and nextRenderer top layer aware
2926         https://bugs.webkit.org/show_bug.cgi?id=103477
2927
2928         Reviewed by Hajime Morita.
2929
2930         Original patch by Elliott Sprehn (minor code and layout tests added).
2931
2932         Instead of using adjustInsertionPointForTopLayerElement and reassigning
2933         pointers passed by reference we should just make nextRenderer and parentRenderer
2934         handle the top layer properly. Right now they would return the wrong values
2935         since we only correctly handle the top layer during renderer creation.
2936
2937         This makes handling of top layer elements consistent with handling of
2938         other special renderering systems like flow threads.
2939
2940         Tests: fast/dom/HTMLDialogElement/modal-dialog-in-replaced-renderer.html
2941                fast/dom/HTMLDialogElement/modal-dialog-in-table-column.html
2942                fast/dom/HTMLDialogElement/modal-dialog-sibling.html
2943
2944         * dom/NodeRenderingContext.cpp:
2945         (WebCore::isRendererReparented): Added this helper function. We must skip
2946         renderers that are reparented in nextRenderer and previousRenderer.
2947         (WebCore):
2948         (WebCore::adjustInsertionPointForTopLayerElement): Removed this method.
2949         (WebCore::NodeRenderingContext::nextRenderer):
2950         (WebCore::NodeRenderingContext::previousRenderer):
2951         (WebCore::NodeRenderingContext::parentRenderer):
2952         (WebCore::NodeRenderingContext::createRendererForElementIfNeeded):
2953
2954 2013-01-08  Kent Tamura  <tkent@chromium.org>
2955
2956         REGRESSION(r135836): Invalid user input for input[type=number] should be cleared by input.value=""
2957         https://bugs.webkit.org/show_bug.cgi?id=106284
2958
2959         Reviewed by Hajime Morita.
2960
2961         No new tests. Updates fast/forms/number/number/validity-badinput.html.
2962
2963         * html/NumberInputType.cpp:
2964         (WebCore::NumberInputType::setValue):
2965         If the new sanitized value is empty and innerTextValue is a bad input
2966         (it means !valueChanged && !innerTextValue().isEmpty() because the new
2967         sanitized value is empty), we need to update innerTextValue with the
2968         empty string.
2969         * html/NumberInputType.h:
2970         (NumberInputType): Declare setValue.
2971
2972 2013-01-08  Nate Chapin  <japhet@chromium.org>
2973
2974         REGRESSION(r138222?): [Mac WK1] http/tests/appcache/main-resource-redirect.html asserts in WebFrameLoaderClient::dispatchDidFinishLoading
2975         https://bugs.webkit.org/show_bug.cgi?id=106123
2976
2977         Reviewed by Alexey Proskuryakov.
2978
2979         No new tests, fixing an existing test.
2980
2981         * loader/MainResourceLoader.cpp:
2982         (WebCore::MainResourceLoader::continueAfterNavigationPolicy): Before calling m_resource->removeClient(this)
2983             and potentially canceling the ResourceLoader, ensure it won't send resource load callbacks.
2984         * loader/ResourceLoader.h:
2985         (WebCore::ResourceLoader::setSendCallbackPolicy):
2986
2987 2013-01-08  Alexandru Chiculita  <achicu@adobe.com>
2988
2989         Assert in RenderGeometryMap::mapToContainer
2990         https://bugs.webkit.org/show_bug.cgi?id=106068
2991
2992         Reviewed by Simon Fraser.
2993
2994         The assert was due to a pending layout, so the values used to compute the layer bounding boxes were incorrect.
2995         That was because of the Document::setVisualUpdatesAllowed mechanism, which triggers a compositor update
2996         and a repaint, but before this patch didn't check whether a layout was pending or not.
2997
2998         Added a check in Document::setVisualUpdatesAllowed for pending layouts and bailed when such case happened.
2999         A layout will come anyway and trigger the correct updates. Couldn't not force an inline layout at that time
3000         as this function is sometimes called really soon, when the WebKit parts are not fully created yet and updates were
3001         calling back into some client callbacks that were not ready.
3002
3003         Also added an assert in RenderLayerCompositor::updateCompositingLayers to check for other cases that might
3004         try to update the layers with a layout pending. That one led to finding an issue in the RenderMarquee, which
3005         was updating on a timer callback. It might happen that a layout is pending while this timer fires and it 
3006         tries to update the scroll position of the layers while a layout is still due.
3007
3008         There was already a protection to bail if a layout is pending in RenderMarquee::timerFired, so I've just broadened the scope
3009         to the whole RenderView to catch all the layout requests.
3010
3011         Tests: compositing/geometry/assert-layout-not-done.html
3012                compositing/geometry/assert-marquee-timer.html
3013
3014         * dom/Document.cpp:
3015         (WebCore::Document::setVisualUpdatesAllowed):
3016         * rendering/RenderLayerCompositor.cpp:
3017         (WebCore::RenderLayerCompositor::updateCompositingLayers):
3018         * rendering/RenderMarquee.cpp:
3019         (WebCore::RenderMarquee::timerFired):
3020
3021 2013-01-08  Justin Novosad  <junov@google.com>
3022
3023         CanvasRenderingContext2D::setFont argument may reference destroyed object
3024         https://bugs.webkit.org/show_bug.cgi?id=106385
3025
3026         Reviewed by Abhishek Arya.
3027
3028         No new tests: covered by fast/canvas/canvas-measureText.html
3029
3030         This is a re-write of r138994.  Fixing bug in setFont instead of
3031         workaround at call site. 
3032
3033         * html/canvas/CanvasRenderingContext2D.cpp:
3034         (WebCore::CanvasRenderingContext2D::setFont):
3035         (WebCore::CanvasRenderingContext2D::accessFont):
3036
3037 2013-01-08  David Grogan  <dgrogan@chromium.org>
3038
3039         IndexedDB: Provide LevelDB with IDBEnv instead of Env::Default
3040         https://bugs.webkit.org/show_bug.cgi?id=106135
3041
3042         Reviewed by Tony Chang.
3043
3044         IDBEnv only changes the name of the histogram where errors are logged.
3045
3046         * platform/leveldb/LevelDBDatabase.cpp:
3047         (WebCore::LevelDBDatabase::open):
3048         (WebCore::LevelDBDatabase::openInMemory):
3049
3050 2013-01-08  Brandon Jones  <bajones@chromium.org>
3051
3052         Make WebGLRenderingContext inherit from ActiveDOMObject
3053         https://bugs.webkit.org/show_bug.cgi?id=104733
3054
3055         Reviewed by Adam Barth.
3056
3057         When ActiveDOMObject::stop is called on the WebGLRenderingContext the
3058         DrawingBuffer and GraphicsContext3D instances are forcibly released in
3059         order to keep GPU memory utilization to a minimum.
3060
3061         Incorporated new layout test based on one just added to the WebGL
3062         conformance suite. Also tested manually by reloading and
3063         navigating between many WebGL apps.
3064
3065         Test: fast/canvas/webgl/context-release-upon-reload.html
3066
3067         * bindings/v8/custom/V8HTMLCanvasElementCustom.cpp:
3068         (WebCore::V8HTMLCanvasElement::getContextCallback):
3069             Removed garbage collection hack added in Bug 76255.
3070         * html/canvas/WebGLRenderingContext.cpp:
3071         (WebCore):
3072         (WebCore::WebGLRenderingContext::create):
3073             Call suspendIfNeeded per ActiveDOMObject contract.
3074         (WebCore::WebGLRenderingContext::WebGLRenderingContext):
3075             Call ActiveDOMObject constructor.
3076         (WebCore::WebGLRenderingContext::~WebGLRenderingContext):
3077             Call destroyGraphicsContext3D.
3078         (WebCore::WebGLRenderingContext::destroyGraphicsContext3D):
3079             Drop DrawingBuffer backing store and delete GraphicsContext3D.
3080         (WebCore::WebGLRenderingContext::hasPendingActivity):
3081             Always return false.
3082         (WebCore::WebGLRenderingContext::stop):
3083             Force lost context upon page reload or navigation.
3084         * html/canvas/WebGLRenderingContext.h:
3085         (WebGLRenderingContext):
3086             Inherit from ActiveDOMObject and override notifications.
3087         * platform/graphics/blackberry/DrawingBufferBlackBerry.cpp:
3088         (WebCore):
3089         (WebCore::DrawingBuffer::clearPlatformLayer):
3090             Add currently no-op implementation.
3091         * platform/graphics/cairo/DrawingBufferCairo.cpp:
3092         (WebCore):
3093         (WebCore::DrawingBuffer::clearPlatformLayer):
3094             Add currently no-op implementation.
3095         * platform/graphics/chromium/DrawingBufferChromium.cpp:
3096         (WebCore::DrawingBufferPrivate::clearTextureId):
3097             Clear texture ID from compositor's layer.
3098         (DrawingBufferPrivate):
3099         (WebCore::DrawingBuffer::framebuffer):
3100             Moved around to reduce number of #ifdefs.
3101         (WebCore):
3102         (WebCore::DrawingBuffer::platformLayer):
3103         (WebCore::DrawingBuffer::clearPlatformLayer):
3104             Tell compositor to stop referencing DrawingBuffer's texture.
3105         * platform/graphics/clutter/DrawingBufferClutter.cpp:
3106         (WebCore):
3107         (WebCore::DrawingBuffer::clearPlatformLayer):
3108             Add currently no-op implementation.
3109         * platform/graphics/gpu/DrawingBuffer.cpp:
3110         (WebCore::DrawingBuffer::clear):
3111             Call clearPlatformLayer before deleting OpenGL resources.
3112         * platform/graphics/gpu/DrawingBuffer.h:
3113         (DrawingBuffer):
3114             Add clearPlatformLayer.
3115         * platform/graphics/gpu/mac/DrawingBufferMac.mm:
3116         (WebCore):
3117         (WebCore::DrawingBuffer::clearPlatformLayer):
3118             Add currently no-op implementation.
3119         * platform/graphics/gpu/qt/DrawingBufferQt.cpp:
3120         (WebCore):
3121         (WebCore::DrawingBuffer::clearPlatformLayer):
3122             Add currently no-op implementation.
3123
3124 2013-01-08  Tony Gentilcore  <tonyg@chromium.org>
3125
3126         Remove dependency on Document from HTMLConstructionSite::inQuirksMode()
3127         https://bugs.webkit.org/show_bug.cgi?id=106375
3128
3129         Reviewed by Adam Barth.
3130
3131         This is another step towards removing main thread object dependencies
3132         from the parser.
3133
3134         No new tests because no new functionality.
3135
3136         * dom/Document.h:
3137         * html/HTMLDocument.cpp:
3138         * html/HTMLDocument.h:
3139         (HTMLDocument):
3140         * html/parser/HTMLConstructionSite.cpp:
3141         (WebCore::HTMLConstructionSite::HTMLConstructionSite):
3142         (WebCore::HTMLConstructionSite::setDefaultCompatibilityMode):
3143         (WebCore):
3144         (WebCore::HTMLConstructionSite::setCompatibilityMode):
3145         (WebCore::HTMLConstructionSite::setCompatibilityModeFromDoctype):
3146         (WebCore::HTMLConstructionSite::insertDoctype):
3147         (WebCore::HTMLConstructionSite::inQuirksMode):
3148         * html/parser/HTMLConstructionSite.h:
3149         (HTMLConstructionSite):
3150
3151 2013-01-08  Florin Malita  <fmalita@chromium.org>
3152
3153         Remove unused GraphicsContext::addInnerRoundedRectClip()
3154         https://bugs.webkit.org/show_bug.cgi?id=106376
3155
3156         Reviewed by Andreas Kling.
3157
3158         Since there don't seem to be any users left for it, remove addInnerRoundedRectClip().
3159
3160         No new tests: no functional changes.
3161
3162         * platform/graphics/GraphicsContext.h:
3163         (GraphicsContext):
3164         * platform/graphics/cairo/GraphicsContextCairo.cpp:
3165         * platform/graphics/cg/GraphicsContextCG.cpp:
3166         * platform/graphics/openvg/GraphicsContextOpenVG.cpp:
3167         * platform/graphics/qt/GraphicsContextQt.cpp:
3168         * platform/graphics/skia/GraphicsContextSkia.cpp:
3169         (WebCore):
3170         * platform/graphics/wince/GraphicsContextWinCE.cpp:
3171         * platform/graphics/wx/GraphicsContextWx.cpp:
3172
3173 2013-01-08  Justin Novosad  <junov@google.com>
3174
3175         Color bleeding with rounded rectangles on high dpi displays
3176         https://bugs.webkit.org/show_bug.cgi?id=106373
3177
3178         Reviewed by Simon Fraser.
3179
3180         Test: fast/backgrounds/gradient-background-leakage-hidpi.html
3181
3182         Avoid using the BackgroundBleedShrinkBackground draw strategy for
3183         RenderBox when border width is less than two layout units. This
3184         is because rounded rectangles are always snapped to integer layout
3185         coordinates, even with subpixel layout enabled.
3186
3187         * rendering/RenderBox.cpp:
3188         (WebCore::RenderBox::determineBackgroundBleedAvoidance):
3189
3190 2013-01-08  Elliott Sprehn  <esprehn@chromium.org>
3191
3192         Merge getLineAtIndex into RenderBlock::lineAtIndex
3193         https://bugs.webkit.org/show_bug.cgi?id=106379
3194
3195         Reviewed by Eric Seidel.
3196
3197         getLineAtIndex can be merged into lineAtIndex, which was it's only caller.
3198
3199         No new tests, just refactoring.
3200
3201         * rendering/RenderBlock.cpp:
3202         (WebCore::RenderBlock::lineAtIndex):
3203         (WebCore::RenderBlock::lineCount):
3204         * rendering/RenderBlock.h:
3205         (RenderBlock):
3206
3207 2013-01-08  Rafael Weinstein  <rafaelw@chromium.org>
3208
3209         [HTMLTemplateElement] Allow <template> content to be inspected
3210         https://bugs.webkit.org/show_bug.cgi?id=105839
3211
3212         Reviewed by Pavel Feldman.
3213
3214         In addition to the plumbing which allows template contents to be
3215         displayed within the inspector, this patch adds a manually-managed
3216         weakref from the template document back to its host document (typically
3217         the creator). This is required so that the inspector agent can be found
3218         for template elements.
3219
3220         * dom/Document.cpp:
3221         (WebCore::Document::~Document):
3222         (WebCore::Document::templateDocument):
3223         * dom/Document.h:
3224         (Document):
3225         (WebCore::Document::setTemplateDocumentHost):
3226         (WebCore::Document::templateDocumentHost):
3227         * editing/markup.cpp:
3228         (WebCore::createFragmentForInnerOuterHTML):
3229         * html/HTMLTemplateElement.cpp:
3230         (WebCore::HTMLTemplateElement::content):
3231         * inspector/Inspector.json:
3232         * inspector/InspectorDOMAgent.cpp:
3233         (WebCore::InspectorDOMAgent::buildObjectForNode):
3234         * inspector/InspectorInstrumentation.h:
3235         (WebCore::InspectorInstrumentation::instrumentingAgentsForDocument):
3236         * inspector/front-end/DOMAgent.js:
3237         (WebInspector.DOMNode):
3238         (WebInspector.DOMNode.prototype.hasChildNodes):
3239         (WebInspector.DOMNode.prototype._insertChild):
3240         (WebInspector.DOMNode.prototype._setChildrenPayload):
3241
3242 2013-01-08  Hajime Morrita  <morrita@google.com>
3243
3244         [Shadow DOM] Distribution related code on ShadowRoot should be minimized.
3245         https://bugs.webkit.org/show_bug.cgi?id=106282
3246
3247         Reviewed by Dimitri Glazkov.
3248
3249         ShadowRoot had a certain amount of logic which is dedicated for
3250         node distribution computation.  These code is going to be compiled
3251         out (Bug 103339) and better be part of the node distribution
3252         algorithm, which is ScopeContentDistribution class.
3253
3254         This change
3255
3256         - Renames ShadowRootContentDistributionData to
3257           ScopeContentDistribution.  New name is concise and a bit more
3258           meaningful: It owns per TreeScope distribution state.
3259         - Moves distribution related code from ShadowRoot to ScopeContentDistribution
3260
3261         No new tests. Refactoring.
3262
3263         * WebCore.exp.in:
3264         * css/StyleScopeResolver.cpp:
3265         (WebCore::StyleScopeResolver::styleSharingCandidateMatchesHostRules):
3266         (WebCore::StyleScopeResolver::matchHostRules):
3267         * dom/ComposedShadowTreeWalker.cpp:
3268         (WebCore::nodeCanBeDistributed):
3269         (WebCore::ComposedShadowTreeWalker::traverseBackToYoungerShadowRoot):
3270         (WebCore::ComposedShadowTreeWalker::traverseParentBackToYoungerShadowRootOrHost):
3271         (WebCore::AncestorChainWalker::parent):
3272         * dom/ElementShadow.cpp:
3273         (WebCore::ElementShadow::collectSelectFeatureSetFrom):
3274         * dom/ShadowRoot.cpp:
3275         (WebCore::ShadowRoot::insertedInto):
3276         (WebCore::ShadowRoot::removedFrom):
3277         (WebCore::ShadowRoot::ensureScopeDistribution):
3278         (WebCore::ShadowRoot::reportMemoryUsage):
3279         * dom/ShadowRoot.h:
3280         (WebCore):
3281         (ShadowRoot):
3282         (WebCore::ShadowRoot::scopeDistribution):
3283         * html/shadow/ContentDistributor.cpp:
3284         (WebCore::ScopeContentDistribution::ScopeContentDistribution):
3285         (WebCore::ScopeContentDistribution::invalidateInsertionPointList):
3286         (WebCore::ScopeContentDistribution::ensureInsertionPointList):
3287         (WebCore::ScopeContentDistribution::registerInsertionPoint):
3288         (WebCore::ScopeContentDistribution::unregisterInsertionPoint):
3289         (WebCore::ScopeContentDistribution::hasShadowElement):
3290         (WebCore):
3291         (WebCore::ScopeContentDistribution::hasContentElement):
3292         (WebCore::ScopeContentDistribution::countElementShadow):
3293         (WebCore::ScopeContentDistribution::hasInsertionPoint):
3294         (WebCore::ScopeContentDistribution::assignedTo):
3295         (WebCore::ContentDistributor::distribute):
3296         (WebCore::ContentDistributor::invalidate):
3297         * html/shadow/ContentDistributor.h:
3298         (ScopeContentDistribution):
3299         (WebCore::ScopeContentDistribution::registerElementShadow):
3300         (WebCore::ScopeContentDistribution::unregisterElementShadow):
3301         (WebCore::ScopeContentDistribution::hasElementShadow):
3302         * html/shadow/HTMLShadowElement.cpp:
3303         (WebCore::HTMLShadowElement::olderShadowRoot):
3304         * html/shadow/InsertionPoint.cpp:
3305         (WebCore::InsertionPoint::insertedInto):
3306         (WebCore::InsertionPoint::removedFrom):
3307         (WebCore::InsertionPoint::contains):
3308         (WebCore):
3309         (WebCore::resolveReprojection):
3310         * html/shadow/InsertionPoint.h:
3311         (InsertionPoint):
3312         (WebCore):
3313         * testing/Internals.cpp:
3314         (WebCore::Internals::hasShadowInsertionPoint):
3315         (WebCore::Internals::hasContentElement):
3316         (WebCore::Internals::countElementShadow):
3317
3318 2013-01-08  Tom Sepez  <tsepez@chromium.org>
3319
3320         Copy-paste preserves <embed> tags containing active content.
3321         https://bugs.webkit.org/show_bug.cgi?id=77625
3322
3323         Reviewed by Ryosuke Niwa.
3324
3325         Test: editing/pasteboard/paste-noplugin.html
3326
3327         * dom/FragmentScriptingPermission.h:
3328         (WebCore::scriptingContentIsAllowed):
3329         (WebCore::pluginContentIsAllowed):
3330         Add new permission to restrict plugin pasting.  Add inline functions to check
3331         the implications of each permission rather than having a list of raw comparisions
3332         sprinkled throughout the code. 
3333         
3334         * editing/markup.cpp:
3335         (WebCore::createFragmentFromMarkup):
3336         Revert back to unsafe plugin pasting regardless of caller's intentions when
3337         the settings allow it.
3338
3339         * dom/Element.cpp:
3340         (WebCore::Element::parserSetAttributes):
3341         * html/parser/HTMLConstructionSite.cpp:
3342         (WebCore::HTMLConstructionSite::insertScriptElement):
3343         * xml/parser/XMLDocumentParserLibxml2.cpp:
3344         (WebCore::XMLDocumentParser::endElementNs):
3345         * xml/parser/XMLDocumentParserQt.cpp:
3346         (WebCore::XMLDocumentParser::parseEndElement):
3347         Use new inline functions to check implications of permissions rather than raw
3348         comparisions.
3349         
3350         * html/parser/HTMLTreeBuilder.cpp:
3351         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
3352         (WebCore::HTMLTreeBuilder::processEndTag):
3353         Check if plugin pasting is allowed before inserting applet/embed/oject elements.
3354
3355         * page/Settings.in:
3356         Declaration of new unsafePluginPastingEnabled setting.
3357
3358         * platform/mac/PasteboardMac.mm:
3359         (WebCore::Pasteboard::documentFragment):
3360         * platform/blackberry/PasteboardBlackBerry.cpp:
3361         (WebCore::Pasteboard::documentFragment):
3362         * platform/chromium/DragDataChromium.cpp:
3363         (WebCore::DragData::asFragment):
3364         * platform/chromium/PasteboardChromium.cpp:
3365         (WebCore::Pasteboard::documentFragment):
3366         * platform/gtk/PasteboardGtk.cpp:
3367         (WebCore::Pasteboard::documentFragment):
3368         * platform/qt/DragDataQt.cpp:
3369         (WebCore::DragData::asFragment):
3370         * platform/qt/PasteboardQt.cpp:
3371         (WebCore::Pasteboard::documentFragment):
3372         * platform/win/ClipboardUtilitiesWin.cpp:
3373         (WebCore::fragmentFromCFHTML):
3374         (WebCore::fragmentFromHTML):
3375         * platform/wx/PasteboardWx.cpp:
3376         (WebCore::Pasteboard::documentFragment):
3377         Pass DisallowScriptingAndPluginContent enum value.
3378         
3379 2013-01-08  Alexis Menard  <alexis@webkit.org>
3380
3381         WebKit does not reject some cubic-bezier form values for transition-timing-function.
3382         https://bugs.webkit.org/show_bug.cgi?id=106369
3383
3384         Reviewed by Dean Jackson.
3385
3386         http://www.w3.org/TR/css3-transitions/#transition-timing-function-property
3387         describes restricitions on cubic-bezier values where the x values of
3388         the curve should be between [0, 1] and y values can exceed this range.
3389         WebKit was not following the specification by allowing x values
3390         exceeding the range.
3391         The spec also says that we should reject the defintion if the condition
3392         is not respected which is what the new code does.
3393
3394         Test: transitions/transitions-parsing.html
3395
3396         * css/CSSParser.cpp:
3397         (WebCore::CSSParser::parseAnimationTimingFunction):
3398
3399 2013-01-08  Andreas Kling  <akling@apple.com>
3400
3401         Heap-use-after-free in bool WebCore::SelectorChecker::checkOneSelector.
3402         <http://webkit.org/b/105834>
3403
3404         Reviewed by Antti Koivisto.
3405
3406         Suppress the DOMSubtreeModified event when synchronizing the "style" attribute and we've
3407         instantiated an Attr node wrapper for the said attribute.
3408
3409         Also added an assertion that Document's StyleResolver isn't cleared during style recalc,
3410         which will help us catch this kind of bug in the future.
3411
3412         Test: fast/dom/mutation-event-listener-with-dirty-inline-style-crash.html
3413
3414         * dom/Document.cpp:
3415         (WebCore::Document::styleResolverThrowawayTimerFired):
3416         * dom/Element.cpp:
3417         (WebCore::Element::setAttributeInternal):
3418
3419 2013-01-08  Sheriff Bot  <webkit.review.bot@gmail.com>
3420
3421         Unreviewed, rolling out r139096.
3422         http://trac.webkit.org/changeset/139096
3423         https://bugs.webkit.org/show_bug.cgi?id=106367
3424
3425         not a complete fix (Requested by bweinstein on #webkit).
3426
3427         * html/HTMLPlugInImageElement.cpp:
3428         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
3429
3430 2013-01-08  Brian Weinstein  <bweinstein@apple.com>
3431
3432         Plug-ins shouldn’t be added to list to autostart if you start a plugin in private browsing.
3433         https://bugs.webkit.org/show_bug.cgi?id=106348
3434         <rdar://problem/12968442>
3435
3436         Reviewed by Anders Carlsson.
3437
3438         * html/HTMLPlugInImageElement.cpp:
3439         (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Don't call addAutoStartOrigin if we are
3440             in private browsing mode.
3441
3442 2013-01-08  Chris Fleizach  <cfleizach@apple.com>
3443
3444         AX: native popup buttons should not use textUnderElement for their title
3445         https://bugs.webkit.org/show_bug.cgi?id=106349
3446
3447         Reviewed by Ryosuke Niwa.
3448
3449         Native popup buttons (<select> elements) were calculating its title based on the text
3450         under the element. When Bug 103794 introduced a more complete way of getting render text,
3451         it causes popup buttons to start returning a title.
3452         The fix is that we should not be calculating a title for a native popup button from its ch