e573602557103aede2462276100a980cd00267ce
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-09-16  Brady Eidson  <beidson@apple.com>
2
3         Have window.indexedDB.deleteDatabase return an IDBOpenDBRequest.
4         https://bugs.webkit.org/show_bug.cgi?id=149229
5
6         Reviewed by Alex Christensen.
7
8         Test: storage/indexeddb/modern/deletedatabase-request.html
9               storage/indexeddb/modern/deletedatabase-null-name-exception.html
10
11         * CMakeLists.txt:
12         * WebCore.xcodeproj/project.pbxproj:
13
14         * Modules/indexeddb/IDBDatabaseIdentifier.cpp: Added.
15         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
16         * Modules/indexeddb/IDBDatabaseIdentifier.h: Added.
17         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
18         (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
19         (WebCore::IDBDatabaseIdentifier::hash):
20         (WebCore::IDBDatabaseIdentifier::isValid):
21         (WebCore::IDBDatabaseIdentifier::operator==):
22         (WebCore::IDBDatabaseIdentifier::databaseName):
23         (WebCore::IDBDatabaseIdentifierHash::hash):
24         (WebCore::IDBDatabaseIdentifierHash::equal):
25         (WebCore::IDBDatabaseIdentifierHashTraits::isEmptyValue):
26
27         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
28         (WebCore::IDBClient::shouldThrowSecurityException):
29         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
30         (WebCore::IDBClient::IDBFactory::open):
31         (WebCore::IDBClient::IDBFactory::deleteDatabase):
32         * Modules/indexeddb/client/IDBFactoryImpl.h:
33
34         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
35         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
36         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
37         (WebCore::IDBClient::IDBOpenDBRequest::create):
38
39         * Modules/indexeddb/client/IDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
40         (WebCore::IDBClient::IDBRequest::IDBRequest):
41         (WebCore::IDBClient::IDBRequest::result):
42         (WebCore::IDBClient::IDBRequest::errorCode):
43         (WebCore::IDBClient::IDBRequest::error):
44         (WebCore::IDBClient::IDBRequest::source):
45         (WebCore::IDBClient::IDBRequest::transaction):
46         (WebCore::IDBClient::IDBRequest::readyState):
47         (WebCore::IDBClient::IDBRequest::eventTargetInterface):
48         (WebCore::IDBClient::IDBRequest::activeDOMObjectName):
49         (WebCore::IDBClient::IDBRequest::canSuspendForPageCache):
50         * Modules/indexeddb/client/IDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.h.
51
52         * platform/Logging.h:
53
54 2015-09-16  Chris Dumez  <cdumez@apple.com>
55
56         Add initial support for [Unforgeable] IDL extended attribute
57         https://bugs.webkit.org/show_bug.cgi?id=149147
58
59         Reviewed by Darin Adler.
60
61         Add initial support for [Unforgeable] IDL extended attribute:
62         https://heycam.github.io/webidl/#Unforgeable
63
64         In particular, attributes marked as unforgeable are now:
65         - on the instance rather than the prototype
66         - non-configurable. WebKit does not match the Web IDL specification
67           and most properties are currently non-configurable already. However,
68           I added an extra check for [Unforgeable] so that unforgeable
69           attributes stay unconfigurable if we later decide to match the spec
70           and mark properties as configurable.
71
72         Operation marked as unforgeable are now non-configurable. However, this
73         patch does not move them from the prototype to the instance yet. This
74         needs to be addressed in a follow-up patch as this is a larger change.
75
76         This patch also drops support for the undocumented
77         [OperationsNotDeletable] IDL extended attribute. It is no longer needed
78         now that we support [Unforgeable] and still support [NotDeletable] for
79         operations.
80
81         Test: fast/dom/unforgeable-attributes.html
82
83         * Modules/plugins/QuickTimePluginReplacement.idl:
84         Drop [OperationsNotDeletable] on the interface and mark the only
85         operation on this interface as [NotDeletable]. There is no behavior
86         change but this allows us to drop support for a non-standard and
87         undocumented IDL extended attribute.
88
89         * bindings/scripts/CodeGeneratorJS.pm:
90         (AttributeShouldBeOnInstance):
91         (GenerateAttributesHashTable):
92         (GenerateImplementation):
93         Add initial support for [Unforgeable] IDL extended attribute.
94
95         * bindings/scripts/IDLAttributes.txt:
96         Add [Unforgeable]. Drop [OperationsNotDeletable].
97
98         * crypto/CryptoKeyPair.idl:
99         Drop [OperationsNotDeletable] on the interface as this interface has
100         no operations.
101
102         * dom/Document.idl:
103         * page/DOMWindow.idl:
104         * page/Location.idl:
105         Mark attributes / interfaces as [Unforgeable] as per the latest HTML
106         specification:
107         https://html.spec.whatwg.org/multipage/dom.html#document
108         https://html.spec.whatwg.org/multipage/browsers.html#window
109         https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface
110
111 2015-09-16  Zalan Bujtas  <zalan@apple.com>
112
113         Simple line layout: Glitch selecting long text.
114         https://bugs.webkit.org/show_bug.cgi?id=149204
115         rdar://problem/22646472
116
117         Reviewed by Antti Koivisto.
118
119         When long text is split into multiple RenderText objects, we ignore renderer boundaries while
120         collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
121         This patch ensures that fragments with hypen character ignore renderer boundaries too.
122
123         Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
124
125         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
126         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
127
128 2015-09-16  Brady Eidson  <beidson@apple.com>
129
130         Remove stray logging string mistakenly left in r189746.
131
132         * Modules/indexeddb/legacy/LegacyFactory.cpp:
133         (WebCore::LegacyFactory::deleteDatabase):
134
135 2015-09-16  Chris Fleizach  <cfleizach@apple.com>
136
137         AX: No VoiceOver typing feedback in some search fields
138         https://bugs.webkit.org/show_bug.cgi?id=149177
139
140         Reviewed by Mario Sanchez Prada.
141
142         If SearchFieldRole is not marked as a TextControl, it does not end up returning the accessibilityValue,
143         which is needed to output the right text to VoiceOver.
144
145         Test: accessibility/ax-value-with-search.html
146
147         * accessibility/AccessibilityObject.cpp:
148         (WebCore::AccessibilityObject::isTextControl):
149
150 2015-09-16  Manuel Rego Casasnovas  <rego@igalia.com>
151
152         [css-grid] Grid container's height should include scrollbar
153         https://bugs.webkit.org/show_bug.cgi?id=149210
154
155         Reviewed by Sergio Villar Senin.
156
157         Add scrollbar's size in the grid container's height calculation at
158         RenderGrid::layoutGridItems().
159
160         Test: fast/css-grid-layout/grid-container-margin-border-padding-scrollbar.html
161
162         * rendering/RenderGrid.cpp:
163         (WebCore::RenderGrid::layoutGridItems): Include scrollbarLogicalHeight()
164         while computing the grid's logical height.
165
166 2015-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
167
168         Unreviewed. Fix GObject DOM bindings API break after r189676.
169
170         webkit_dom_character_data_append_data() used to raise exceptions.
171
172         * bindings/scripts/CodeGeneratorGObject.pm:
173         (FunctionUsedToRaiseException):
174
175 2015-09-15  Commit Queue  <commit-queue@webkit.org>
176
177         Unreviewed, rolling out r189847.
178         https://bugs.webkit.org/show_bug.cgi?id=149208
179
180         Asserts on all the tests (Requested by ap on #webkit).
181
182         Reverted changeset:
183
184         "Simple line layout: Glitch selecting long text."
185         https://bugs.webkit.org/show_bug.cgi?id=149204
186         http://trac.webkit.org/changeset/189847
187
188 2015-09-15  Zalan Bujtas  <zalan@apple.com>
189
190         Simple line layout: Glitch selecting long text.
191         https://bugs.webkit.org/show_bug.cgi?id=149204
192         rdar://problem/22646472
193
194         Reviewed by Antti Koivisto.
195
196         When long text is split into multiple RenderText objects, we ignore renderer boundaries while
197         collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
198         This patch ensures that fragments with hypen character ignore renderer boundaries too.
199
200         Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
201
202         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
203         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
204
205 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
206
207         GTK+ build fix attempt after r189841.
208
209         * PlatformGTK.cmake:
210
211 2015-09-15  Chris Dumez  <cdumez@apple.com>
212
213         Document.createElement(localName) does not handle correctly missing or null parameter
214         https://bugs.webkit.org/show_bug.cgi?id=149184
215         <rdar://problem/22565070>
216
217         Reviewed by Ryosuke Niwa.
218
219         Document.createElement(localName) does not handle correct missing or
220         null parameter:
221         - https://dom.spec.whatwg.org/#interface-document
222
223         As per the specification, the parameter is a non-nullable DOMString and
224         is mandatory. Therefore, as per Web IDL, we should have the following
225         behavior:
226         1. If the parameter is missing, we should throw an exception
227         2. If the parameter is null, we should convert it to the "null" string
228            and create a <null> element.
229
230         Chrome and Firefox behave according to the specification. However,
231         WebKit was doing:
232         1. Create a <undefined> element
233         2. Throw an InvalidCharacterError
234
235         This patch aligns WebKit's behavior with the specification and other
236         major browsers.
237
238         No new tests, already covered by existing tests.
239
240         * dom/Document.idl:
241
242 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
243
244         Add ShadowRoot interface and Element.prototype.attachShadow
245         https://bugs.webkit.org/show_bug.cgi?id=149187
246
247         Reviewed by Antti Koivisto.
248
249         Add back ShadowRoot IDL interface and Element.prototype.attachShadow in accordance with
250         http://w3c.github.io/webcomponents/spec/shadow/ at db27e6e36eab512d86edcdabb33ed27b5751acd7 excluding getSelection(),
251         elementFromPoint(), elementsFromPoint(), caretPositionFromPoint(), and styleSheets attribute on ShadowRoot interface.
252
253         The feature is enabled by default on Mac and iOS ports for testing and disabled by default elsewhere.
254
255         Also added HTMLElement::canHaveUserAgentShadowRoot which returns false by default and overridden elsewhere to return true
256         to distinguish elements for which attachShadow is supposed to throw NotSupported.
257         See https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
258
259         Tests: fast/shadow-dom/Element-interface-attachShadow.html
260                fast/shadow-dom/Element-interface-shadowRoot-attribute.html
261                fast/shadow-dom/ShadowRoot-interface.html
262
263         * CMakeLists.txt:
264         * Configurations/FeatureDefines.xcconfig:
265         * DerivedSources.cpp:
266         * DerivedSources.make:
267         * PlatformGTK.cmake:
268         * WebCore.vcxproj/WebCore.vcxproj:
269         * WebCore.vcxproj/WebCore.vcxproj.filters:
270         * WebCore.xcodeproj/project.pbxproj:
271         * css/SelectorChecker.cpp:
272         (WebCore::SelectorChecker::matchRecursively):
273         * dom/Element.cpp:
274         (WebCore::Element::bindingsOffsetParent):
275         (WebCore::Element::offsetParent):
276         (WebCore::Element::addShadowRoot):
277         (WebCore::Element::createShadowRoot):
278         (WebCore::Element::attachShadow): Added.
279         (WebCore::Element::bindingShadowRoot): Added. Returns null unless the attached shadow root is in the "open" mode.
280         * dom/Element.h:
281         * dom/Element.idl: Added attachShadow and shadowRoot. We only expose these to JS for now since Dictionary argument isn't
282         supported by other binding code.
283         * dom/ShadowRoot.cpp: Removed an unused enum.
284         * dom/ShadowRoot.h:
285         (WebCore::ShadowRoot::Type): Replaced old-style enum "ShadowRootType" by an enum class named "Type". Also added two new
286         values Open and Closed for author shadow roots.
287         (WebCore::ShadowRoot::type):
288         * dom/ShadowRoot.idl: Added.
289         * html/HTMLButtonElement.h:
290         * html/HTMLDetailsElement.h:
291         (HTMLButtonElement::canHaveUserAgentShadowRoot): Ditto.
292         * html/HTMLElement.h:
293         (WebCore::HTMLElement::canHaveUserAgentShadowRoot): Added. Returns false by default.
294         * html/HTMLInputElement.h:
295         * html/HTMLKeygenElement.h:
296         * html/HTMLMarqueeElement.h:
297         * html/HTMLMediaElement.h:
298         * html/HTMLMeterElement.h:
299         * html/HTMLPlugInElement.h:
300         * html/HTMLProgressElement.h:
301         * html/HTMLSelectElement.h:
302         * html/HTMLSummaryElement.h:
303         * html/HTMLTextAreaElement.h:
304         * html/shadow/InsertionPoint.h:
305         (ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints):
306         * rendering/RenderElement.cpp:
307         (WebCore::RenderElement::selectionPseudoStyle):
308         * rendering/RenderLayer.cpp:
309         (WebCore::rendererForScrollbar):
310         * svg/SVGElement.cpp:
311         (WebCore::SVGElement::correspondingUseElement):
312         * testing/Internals.cpp:
313         (WebCore::Internals::shadowRootType):
314
315 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
316
317         [Win] Unreviewed release fix after r189832
318
319         * platform/graphics/ca/win/PlatformCALayerWin.h: The implementation
320         should exist in Release builds as well.
321
322 2015-09-15  Benjamin Poulain  <bpoulain@apple.com>
323
324         Style invalidation affecting siblings does not work with inline-style changes
325         https://bugs.webkit.org/show_bug.cgi?id=149189
326
327         Reviewed by Antti Koivisto.
328
329         Style::resolveTree() made the assumption that inline style changes only affect
330         descendants and should not participate in "StyleRecalcAffectsNextSiblingElementStyle".
331         That was wrong. If the inline style change through CSSOM, it can cause the creation
332         of a style attribute, which is observable through "StyleRecalcAffectsNextSiblingElementStyle".
333
334         This patch removes the incorrect assumption. Style invalidation is always propagated now.
335
336         Tests: fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html
337                fast/css/style-attribute-invalidation-propagates-to-direct-siblings.html
338                fast/css/style-attribute-invalidation-propagates-to-indirect-siblings.html
339
340         * css/PropertySetCSSStyleDeclaration.cpp:
341         (WebCore::InlineCSSStyleDeclaration::didMutate): Deleted.
342         * dom/StyledElement.cpp:
343         (WebCore::StyledElement::inlineStyleChanged):
344         * dom/StyledElement.h:
345         (WebCore::StyledElement::invalidateStyleAttribute):
346         Clean up inline-style invalidation a tiny bit.
347
348         * style/StyleResolveTree.cpp:
349         (WebCore::Style::resolveTree):
350         Fix the bug.
351
352 2015-09-15  Joseph Pecoraro  <pecoraro@apple.com>
353
354         Web Inspector: Paused Debugger prevents page reload
355         https://bugs.webkit.org/show_bug.cgi?id=148174
356
357         Reviewed by Brian Burg.
358
359         When navigating the page while paused, suppress any pausing until the page
360         has completed navigation. If not paused and navigating, you can still pause
361         in pagehide and unload handlers or other late page events.
362
363         Could not write a reliable test for this at the moment.
364         InspectorTest.reloadPage has multiple issues with the output,
365         so I'll investigate making reload tests more reliable later.
366
367         * inspector/InspectorController.h:
368         * inspector/InspectorController.cpp:
369         (WebCore::InspectorController::resume): Deleted.
370         * loader/FrameLoader.cpp:
371         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
372         We now use existing InspectorInstrumentation functions instead of a method
373         on InspectorController during load. In dropping the method InspectorController
374         can drop a member variable no longer used.
375
376         * inspector/InspectorInstrumentation.h:
377         (WebCore::InspectorInstrumentation::willStartProvisionalLoad):
378         Add a new instrumentation hook.
379
380         * inspector/InspectorInstrumentation.cpp:
381         (WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
382         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
383         When starting or completing main frame navigations, let the PageDebuggerAgent do some work.
384
385         * inspector/PageDebuggerAgent.h:
386         * inspector/PageDebuggerAgent.cpp:
387         (WebCore::PageDebuggerAgent::mainFrameStartedLoading):
388         (WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
389         (WebCore::PageDebuggerAgent::mainFrameNavigated):
390         Suppress pausing if navigating while paused. Otherwise behave as normal.
391
392 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
393
394         [Win] Provide a means for viewing the layer tree
395         https://bugs.webkit.org/show_bug.cgi?id=149165
396
397         Reviewed by Simon Fraser.
398
399         Revise the old fprintf logic to generate a string
400         containing the layer tree so that it can be output
401         to the debugger (or elsewhere).
402
403         * platform/graphics/ca/PlatformCALayer.h: Rename 'printTree'
404         to 'printLayerTree', and make it available in release builds.
405         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
406         (WebCore::CACFLayerTreeHost::printLayerTree): Added. Calls into
407         the PlatformCALayer implementation.
408         * platform/graphics/ca/win/CACFLayerTreeHost.h:
409         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
410         (printIndent): Revise to use two-space indent and use StringBuilder.
411         (printTransform): Ditto.
412         (printColor): Added helper function.
413         (printLayer): Revised to output information on the layer contents.
414         (PlatformCALayerWin::printLayerTree): Renamed from 'printTree'.
415         (PlatformCALayerWin::printTree): Deleted.
416         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
417         (PlatformCALayerWinInternal::drawRepaintCounters): Drive-by fix. Match the
418         cocoa repaint counter logic by not painting counters for the layers that
419         contain the tile grid.
420         * platform/graphics/ca/win/PlatformCALayerWin.h:
421         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
422         (PlatformCALayerWinInternal::drawRepaintCounters):
423
424 2015-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
425
426         Nested isolates can cause an infinite loop when laying out bidi runs
427         https://bugs.webkit.org/show_bug.cgi?id=149153
428
429         Reviewed by David Hyatt.
430
431         When traversing bidi runs, we might encounter a run which is supposed to be isolated. In this
432         situation, we will append a placeholder run in the run list, and remember a pointer to these
433         isolated runs inside BidiResolver. Then, once we're done traversing the bidi runs, we return
434         to the isolated runs and handle them separately (and replace the placeholder with the result).
435
436         However, due to the fact that our BidiRuns start at leaf nodes, we have to keep track of which
437         local root of the render tree we were inspecting (to ensure that we visit the same node
438         multiple times if there are nested isolate spans). We were not correctly keeping track of this
439         local root, which was leading us to consider the same root multiple times, thereby leading to
440         an infinite loop.
441
442         The solution is simply to keep root information alongside the isolated run information inside
443         BidiResolver. However, BidiResolver is inside platform/, which means that this new type should
444         be a template argument, just like how BidiRun itself is a template argument.
445
446         This new type, BidiIsolatedRun, holds all the information that our isolate-revisiting logic
447         needs inside constructBidiRunsForSegment(). It also holds a reference to the placeholder run
448         which we will replace.
449
450         Test: fast/text/international/unicode-bidi-isolate-nested-crash.html
451
452         * platform/graphics/GraphicsContext.cpp:
453         (WebCore::GraphicsContext::drawBidiText): BidiIsolatedRun template argument is unused, so pass
454         in Void.
455         * platform/text/BidiResolver.h: Add template argument.
456         (WebCore::BidiResolver::isolatedRuns):
457         (WebCore::IsolatedRun>::~BidiResolver):
458         (WebCore::IsolatedRun>::appendRun):
459         (WebCore::IsolatedRun>::embed):
460         (WebCore::IsolatedRun>::checkDirectionInLowerRaiseEmbeddingLevel):
461         (WebCore::IsolatedRun>::lowerExplicitEmbeddingLevel):
462         (WebCore::IsolatedRun>::raiseExplicitEmbeddingLevel):
463         (WebCore::IsolatedRun>::commitExplicitEmbedding):
464         (WebCore::IsolatedRun>::updateStatusLastFromCurrentDirection):
465         (WebCore::IsolatedRun>::reorderRunsFromLevels):
466         (WebCore::IsolatedRun>::createBidiRunsForLine):
467         (WebCore::IsolatedRun>::setMidpointForIsolatedRun): Use references instead of pointers.
468         (WebCore::IsolatedRun>::midpointForIsolatedRun): Ditto.
469         (WebCore::Run>::~BidiResolver): Deleted.
470         (WebCore::Run>::appendRun): Deleted.
471         (WebCore::Run>::embed): Deleted.
472         (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
473         (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
474         (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
475         (WebCore::Run>::commitExplicitEmbedding): Deleted.
476         (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
477         (WebCore::Run>::reorderRunsFromLevels): Deleted.
478         (WebCore::Run>::createBidiRunsForLine): Deleted.
479         (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
480         (WebCore::Run>::midpointForIsolatedRun): Deleted.
481         * rendering/InlineIterator.h:
482         (WebCore::BidiIsolatedRun::BidiIsolatedRun): New type.
483         (WebCore::addPlaceholderRunForIsolatedInline): Create new type, and include local root
484         information.
485         (WebCore::IsolateTracker::addFakeRunIfNecessary): Include local root information.
486         (WebCore::InlineBidiResolver::appendRun): Ditto.
487         * rendering/RenderBlockLineLayout.cpp: Update for new BidiIsolatedRun type.
488         (WebCore::setUpResolverToResumeInIsolate):
489         (WebCore::constructBidiRunsForSegment):
490         * rendering/line/TrailingObjects.h:
491
492 2015-09-15  Brady Eidson  <beidson@apple.com>
493
494         Add empty IDBFactory implementation for Modern IDB.
495         https://bugs.webkit.org/show_bug.cgi?id=149191
496
497         Reviewed by Jer Noble.
498
499         No new tests (No behavior change).
500
501         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
502         (WebCore::DOMWindowIndexedDatabase::indexedDB):
503         
504         * Modules/indexeddb/client/IDBFactoryImpl.cpp: 
505         (WebCore::IDBClient::IDBFactory::create):
506         (WebCore::IDBClient::IDBFactory::IDBFactory):
507         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
508         (WebCore::IDBClient::IDBFactory::open):
509         (WebCore::IDBClient::IDBFactory::deleteDatabase):
510         (WebCore::IDBClient::IDBFactory::cmp):
511         * Modules/indexeddb/client/IDBFactoryImpl.h: 
512         
513         * CMakeLists.txt:
514         * WebCore.xcodeproj/project.pbxproj:
515         
516         * loader/EmptyClients.cpp:
517         * page/DatabaseProvider.h:
518
519 2015-09-15  Antti Koivisto  <antti@apple.com>
520
521         Split FontDescription into lower and higher level types
522         https://bugs.webkit.org/show_bug.cgi?id=149036
523
524         Reviewed by Darin Adler.
525
526         Currently FontDescription is used through the text subsystem. However much of the data it
527         carries is only needed by FontCascade and text layout but not by the lower level Font/FontCache
528         layer. This makes code confusing. For example families specified in FontDescription are ignored
529         at lower levels.
530
531         Split it into a low level FontDescription and a high level FontCascadeDescription type:
532
533         FontDescription <-> Font
534         FontCascadeDescription <-> FontCascade
535
536         The former only carries information that is needed to instantiate a Font or fetch it from the FontCache.
537         The latter has additional data for CSS font cascade semantics and other higher level features.
538
539 2015-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
540
541         GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
542         https://bugs.webkit.org/show_bug.cgi?id=149193
543
544         Reviewed by Anders Carlsson.
545
546         There are two users of BidiResolver, one which needs isolated runs (in RenderBlockLineLayout) and
547         one which doesn't (in GraphicsContext::drawBidiText()). Because of [1], the isolated runs vector
548         is migrating to a new type outside of platform/. Therefore, only the first user of BidiResolver
549         should have this member variable.
550
551         This is achieved by creating two subclasses of BidiResolver, and using the Curiously Repeating
552         Template pattern to downcast into specializations.
553
554         [1] https://bugs.webkit.org/show_bug.cgi?id=149153
555
556         No new tests because there is no behavior change.
557
558         * platform/text/BidiResolver.h:
559         (WebCore::BidiResolverBase::BidiResolverBase):
560         (WebCore::BidiResolverBase::increment):
561         (WebCore::BidiResolverBase::appendRun):
562         (WebCore::BidiResolverBase::incrementInternal):
563         (WebCore::IsolateRun>::~BidiResolverWithIsolate):
564         (WebCore::Subclass>::appendRunInternal):
565         (WebCore::Subclass>::embed):
566         (WebCore::Subclass>::checkDirectionInLowerRaiseEmbeddingLevel):
567         (WebCore::Subclass>::lowerExplicitEmbeddingLevel):
568         (WebCore::Subclass>::raiseExplicitEmbeddingLevel):
569         (WebCore::Subclass>::commitExplicitEmbedding):
570         (WebCore::Subclass>::updateStatusLastFromCurrentDirection):
571         (WebCore::Subclass>::reorderRunsFromLevels):
572         (WebCore::Subclass>::createBidiRunsForLine):
573         (WebCore::Subclass>::setMidpointForIsolatedRun):
574         (WebCore::Subclass>::midpointForIsolatedRun):
575         (WebCore::BidiResolver::BidiResolver): Deleted.
576         (WebCore::BidiResolver::increment): Deleted.
577         (WebCore::BidiResolver::isolatedRuns): Deleted.
578         (WebCore::Run>::~BidiResolver): Deleted.
579         (WebCore::Run>::appendRun): Deleted.
580         (WebCore::Run>::embed): Deleted.
581         (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
582         (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
583         (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
584         (WebCore::Run>::commitExplicitEmbedding): Deleted.
585         (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
586         (WebCore::Run>::reorderRunsFromLevels): Deleted.
587         (WebCore::Run>::createBidiRunsForLine): Deleted.
588         (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
589         (WebCore::Run>::midpointForIsolatedRun): Deleted.
590         * rendering/InlineIterator.h:
591         (WebCore::InlineBidiResolver::incrementInternal):
592         (WebCore::InlineBidiResolver::appendRunInternal):
593         (WebCore::InlineBidiResolver::increment): Deleted.
594         (WebCore::InlineBidiResolver::appendRun): Deleted.
595         * rendering/line/TrailingObjects.h:
596
597 2015-09-15  Chris Dumez  <cdumez@apple.com>
598
599         new Event() without parameter should throw
600         https://bugs.webkit.org/show_bug.cgi?id=149146
601         <rdar://problem/22565070>
602
603         Reviewed by Ryosuke Niwa.
604
605         new Event() without parameter should throw because the type parameter
606         is mandatory as per the specification:
607         https://dom.spec.whatwg.org/#interface-event
608
609         Both Firefox and Chrome throw in this case. However, WebKit was
610         creating an event whose type is the string "undefined". This patch
611         aligns our behavior with the specification and other major browsers.
612
613         No new tests, already covered by existing test.
614
615         * bindings/scripts/CodeGeneratorJS.pm:
616         (GenerateConstructorDefinition):
617         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
618         (WebCore::JSTestEventConstructorConstructor::constructJSTestEventConstructor):
619
620 2015-09-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
621
622         [GTK] Build failure with ACCELERATED_2D_CANVAS when cairo-gl has built with OpenGLESv2 support only.
623         https://bugs.webkit.org/show_bug.cgi?id=149172
624
625         Reviewed by Martin Robinson.
626
627         No new tests, no behavior change.
628
629         * platform/graphics/glx/GLContextGLX.cpp:
630         (WebCore::GLContextGLX::cairoDevice):
631
632 2015-09-15  Chris Dumez  <cdumez@apple.com>
633
634         Element.getAttributeNS() should return null if the attribute does not exist
635         https://bugs.webkit.org/show_bug.cgi?id=149180
636         <rdar://problem/22561011>
637
638         Reviewed by Ryosuke Niwa.
639
640         Element.getAttributeNS() should return null if the attribute does not
641         exist, similarly to what Element.getAttribute() does:
642         - https://dom.spec.whatwg.org/#element (both return a nullable DOMString).
643         - https://dom.spec.whatwg.org/#dom-element-getattributens (step 2)
644
645         Firefox and Chrome match the specification. However, WebKit was returning
646         an empty string for getAttributeNS() and null for getAttribute(). This
647         patch aligns WebKit's behavior with the specification and other browsers.
648
649         No new tests, already covered by existing tests.
650
651         * dom/Element.idl:
652
653 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
654
655         ContentDistribution should be only used for details elements
656         https://bugs.webkit.org/show_bug.cgi?id=149148
657
658         Reviewed by Antti Koivisto.
659
660         Extracted ShadowRootWithInsertionPoints out of ShadowRoot for HTMLDetailsElement and HTMLSummaryElement.
661
662         We don't add a separate .h and .cpp files since this is a temporary measure until we replace it with
663         a slot-based shadow DOM implementation.
664
665         No new tests. There should be no observable behavioral change.
666
667         * dom/Element.cpp:
668         (WebCore::Element::addShadowRoot): Removed the call to didShadowBoundaryChange since this function is only
669         called in ensureUserAgentShadowRoot. Also moved the call to didAddUserAgentShadowRoot for
670         HTMLDetailsElement's shadow root which uses this function instead of ensureUserAgentShadowRoot.
671         (WebCore::Element::removeShadowRoot): Removed the call to invalidateDistribution since it's only called by
672         ~Element.
673         (WebCore::Element::createShadowRoot):
674         (WebCore::Element::ensureUserAgentShadowRoot): Moved the call didAddUserAgentShadowRoot into addShadowRoot
675         since HTMLDetailsElement uses a subclass of ShadowRoot.
676         (WebCore::Element::childrenChanged):
677         (WebCore::Element::removeAllEventListeners):
678
679         * dom/Element.h:
680         (Element::addShadowRoot): Made this function a protected member as it's now used by HTMLDetailsElement.
681
682         * dom/ShadowRoot.cpp:
683         (WebCore::ShadowRoot::childrenChanged): Deleted.
684
685         * dom/ShadowRoot.h:
686         (WebCore::ShadowRoot::distributor): Made this a virtual function and return nullptr by default.
687         (WebCore::ShadowRoot::isOrphan):
688
689         * html/HTMLDetailsElement.cpp:
690         (WebCore::HTMLDetailsElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
691
692         * html/HTMLInputElement.cpp:
693         (WebCore::HTMLInputElement::runPostTypeUpdateTasks): Removed the call to invalidateDistribution since it's
694         only relevant for HTMLDetailsElement's shadow DOM.
695
696         * html/HTMLSummaryElement.cpp:
697         (WebCore::HTMLSummaryElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
698
699         * html/shadow/ContentDistributor.cpp:
700         (WebCore::ContentDistributor::distribute):
701         (WebCore::ContentDistributor::ensureDistribution):
702         (WebCore::ContentDistributor::invalidateDistribution):
703
704         * html/shadow/InsertionPoint.cpp:
705         (WebCore::InsertionPoint::childrenChanged):
706         (WebCore::InsertionPoint::insertedInto):
707         (WebCore::InsertionPoint::removedFrom):
708         (WebCore::findInsertionPointOf):
709         (WebCore::ShadowRootWithInsertionPoints::childrenChanged): Moved from ShadowRoot.
710
711         * html/shadow/InsertionPoint.h:
712         (WebCore::ShadowRootWithInsertionPoints::create): Added.
713         (WebCore::ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints): Added.
714
715 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
716
717         [Win] Tiled drawing is rendering more times than it should
718         https://bugs.webkit.org/show_bug.cgi?id=149144
719         <rdar://problem/22313905>
720
721         Reviewed by Simon Fraser.
722
723         Provide a more faithful implemenation of the Objective C tiled drawing logic.
724         (1) Create a new WebTiledBackingLayerWin class that represents a the
725             container of tiles. This matches the Objective C design.
726         (2) Move implementation of several methods (e.g., isOpaque) to the internal
727             class implementation so that the Tile Drawing logic can perform special
728             handling in these cases.
729         (3) Remove the duplicated Tiled Drawing logic from PlatformCALayerWinInternal,
730             since it was just duplicating code in TileController and TileGrid.
731         (4) Clean up the display callback code to avoid performing incorrect flipping
732             of the coordinate system.
733
734         * PlatformAppleWin.cmake: Add new WebTiledBackingLayerWin file.            
735         * WebCore.vcxproj/WebCore.vcxproj: Add the new WebTiledBackingLayerWin files.
736         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
737         * platform/graphics/ca/PlatformCALayer.cpp:
738         (PlatformCALayer::flipContext): Added convenience method.
739         (PlatformCALayer::drawRepaintIndicator): Ditto.
740         * platform/graphics/ca/TileGrid.cpp:
741         (TileGrid::platformCALayerPaintContents): Flip the context before drawing the repaint
742         indicator on Windows.
743         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
744         (PlatformCALayerWin::PlatformCALayerWin): Create a WebTiledBackingLayerWin
745         object if using tiled drawing.
746         (PlatformCALayerWin::~PlatformCALayerWin):
747         (PlatformCALayerWin::isOpaque): Move implementation to internal class.
748         (PlatformCALayerWin::setOpaque): Ditto.
749         (PlatformCALayerWin::setBorderWidth): Ditto.
750         (PlatformCALayerWin::setBorderColor): Ditto.
751         (PlatformCALayerWin::contentsScale): Ditto.
752         (PlatformCALayerWin::setContentsScale): Ditto.
753         (PlatformCALayerWin::cornerRadius): Ditto.
754         (PlatformCALayerWin::tiledBacking): Ditto.
755         (PlatformCALayerWin::drawTextAtPoint): New helper method to draw repaint counter
756         text. Needed to work around bug in CG.
757         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
758         (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Remove tiling-logic
759         related member variables.
760         (PlatformCALayerWinInternal::~PlatformCALayerWinInternal):
761         (shouldInvertBeforeDrawingContent): Added convenience method.
762         (shouldInvertBeforeDrawingRepaintCounters): Ditto.
763         (PlatformCALayerWinInternal::displayCallback):
764         (PlatformCALayerWinInternal::drawRepaintCounters): Helper method to
765         share code between the two layer classes.
766         (PlatformCALayerWinInternal::internalSetNeedsDisplay): use nullptr.
767         (PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
768         (PlatformCALayerWinInternal::setNeedsDisplayInRect): Move tiled code
769         to WebTiledBackingLayerWin and simplify the remaing code.
770         (PlatformCALayerWinInternal::setSublayers): Remove tile code.
771         (PlatformCALayerWinInternal::getSublayers): Ditto.
772         (PlatformCALayerWinInternal::removeAllSublayers): Ditto.
773         (PlatformCALayerWinInternal::insertSublayer): Ditto.
774         (PlatformCALayerWinInternal::sublayerCount): Ditto.
775         (PlatformCALayerWinInternal::indexOfSublayer): Ditto.
776         (PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
777         (PlatformCALayerWinInternal::setBounds): Ditto.
778         (PlatformCALayerWinInternal::setFrame): Ditto.
779         (PlatformCALayerWinInternal::isOpaque): Ditto.
780         (PlatformCALayerWinInternal::setOpaque): Ditto.
781         (PlatformCALayerWinInternal::contentsScale): Ditto.
782         (PlatformCALayerWinInternal::setContentsScale): Ditto.
783         (PlatformCALayerWinInternal::setBorderWidth): Ditto.
784         (PlatformCALayerWinInternal::setBorderColor): Ditto.
785         (layerTypeIsTiled): Deleted.
786         (PlatformCALayerWinInternal::constrainedSize): Deleted.
787         (PlatformCALayerWinInternal::tileDisplayCallback): Deleted.
788         (PlatformCALayerWinInternal::addTile): Deleted.
789         (PlatformCALayerWinInternal::removeTile): Deleted.
790         (PlatformCALayerWinInternal::tileAtIndex): Deleted.
791         (PlatformCALayerWinInternal::tileCount): Deleted.
792         (PlatformCALayerWinInternal::updateTiles): Deleted.
793         (PlatformCALayerWinInternal::drawTile): Deleted.
794         (PlatformCALayerWinInternal::createTileController): Deleted.
795         (PlatformCALayerWinInternal::tiledBacking): Deleted.
796         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
797         (WebCore::PlatformCALayerWinInternal::owner):
798         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: Added.
799         (WebTiledBackingLayerWin::WebTiledBackingLayerWin):
800         (WebTiledBackingLayerWin::~WebTiledBackingLayerWin):
801         (DisplayOnMainThreadContext::DisplayOnMainThreadContext):
802         (redispatchOnMainQueue):
803         (WebTiledBackingLayerWin::displayCallback):
804         (WebTiledBackingLayerWin::setNeedsDisplay):
805         (WebTiledBackingLayerWin::setNeedsDisplayInRect):
806         (WebTiledBackingLayerWin::setBounds):
807         (WebTiledBackingLayerWin::isOpaque):
808         (WebTiledBackingLayerWin::setOpaque):
809         (WebTiledBackingLayerWin::contentsScale):
810         (WebTiledBackingLayerWin::setContentsScale):
811         (WebTiledBackingLayerWin::setBorderWidth):
812         (WebTiledBackingLayerWin::setBorderColor):
813         (WebTiledBackingLayerWin::createTileController):
814         (WebTiledBackingLayerWin::tiledBacking):
815         (WebTiledBackingLayerWin::invalidate):
816         * platform/graphics/ca/win/WebTiledBackingLayerWin.h: Added.
817
818 2015-09-14  David Hyatt  <hyatt@apple.com>
819
820         [New Block-Inside-Inline Model] Implement margin collapsing across contiguous anonymous inline blocks.
821         https://bugs.webkit.org/show_bug.cgi?id=149132
822
823         Reviewed by Zalan Bujtas.
824
825         Added new tests inside fast/block/inside-inlines/
826
827         * rendering/InlineFlowBox.cpp:
828         (WebCore::InlineFlowBox::anonymousInlineBlock):
829         Change this accessor to be more robust and be willing to both recur (in case we ever do decide intermediate line boxes should exist)
830         and to type check. This is not currently needed, but I'm just being paranoid and future proof.
831
832         (WebCore::InlineFlowBox::addToLine):
833         Again, for thoroughness, I am making sure to propagate the hasAnonymousInlineBlock() bit through to parents. This is only needed
834         if we build intermediate line boxes for lines with anonymous inline blocks.
835
836         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
837         Anonymous inline blocks receive a layout via layoutBlockChild, in order to make sure that margin collapsing runs. This means
838         that unlike other line objects, the position of the child has been determined already. Therefore we simply set the position
839         of the line box that wraps the anonymous inline block to the already-computed position for that block.
840
841         Also patch the code that sets lineTop and lineBottom using the root box's dimensions. We don't really care about the root line
842         box on anonymous inline block lines and just want to set lineTop and lineBottom to fit the anonymous inline block.
843
844         * rendering/RenderBlockFlow.cpp:
845         (WebCore::RenderBlockFlow::collapseMargins):
846         (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
847         Refactor collapseMargins to call a helper function that can pass in a previous "sibling", and that can handle the child
848         being null. We do this to perform a margin collapse when anonymous inline blocks run up against regular lines (which is like
849         collapsing with a sibling block "child").
850
851         * rendering/RenderBlockFlow.h:
852         Tweak the MarginInfo constructor to take a const RenderBlockFlow. Tweak some line layout methods to pass in the LineLayoutState
853         so that MarginInfo is available during line layout.
854
855         * rendering/RenderBlockLineLayout.cpp:
856         (WebCore::RenderBlockFlow::createLineBoxes):
857         When we create a new line box, if it is not an anonymous inline block line and our previous line was, simulate a margin
858         collapse in order to possibly push the line box down or up. Re-use the pagination adjustment code to rewind line layout
859         and perform it again if pushed below a float.
860
861         (WebCore::constructBidiRunsForSegment):
862         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
863         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
864         (WebCore::RenderBlockFlow::layoutLineBoxes):
865         (WebCore::RenderBlockFlow::determineStartPosition):
866         (WebCore::RenderBlockFlow::matchedEndLine):
867         (WebCore::RenderBlockFlow::updateRegionForLine):
868         (WebCore::RenderBlockFlow::marginCollapseLinesFromStart):
869         Patch line layout to run margin collapsing when anonymous inline blocks are encountered. This involves making sure
870         margin info and float bottom positions are passed through so that layoutBlockChild can be properly called on
871         anonymous inline blocks that we encounter.
872
873         In addition line layout when it syncs dirty lines has to run margin collapsing on earlier lines in order to make
874         sure margin info is properly set up at the first dirty line position.
875
876         Note that there will be more improvements/changes in this area (dirty line syncing), as the current model is inefficient
877         when many anonymous inline blocks are scattered throughout a large-scale line box tree.
878
879         * rendering/RootInlineBox.cpp:
880         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
881         (WebCore::RootInlineBox::ascentAndDescentForBox):
882         Make sure to rely on the block layout code for the placement of the boxes themselves. Set up the line box code to not have
883         an effect on ascent/descent.
884
885         * rendering/line/BreakingContext.h:
886         (WebCore::BreakingContext::BreakingContext):
887         (WebCore::BreakingContext::handleReplaced):
888         When we encounter an anonymous inline block, lay it out when it is seen. We have to delay the layout, since we have
889         to be able to perform it mid-line-layout when the containing block's logical height is at the correct value and all previous
890         lines are placed. Margin info also has to be current.
891
892         * rendering/line/LineBreaker.cpp:
893         * rendering/line/LineBreaker.h:
894         Patched to pass LineLayoutState through so that the stuff we need to perform block layout is available (margin info and float vars).
895
896         * rendering/line/LineLayoutState.h:
897         Add the block layout margin and float bottom information to the line layout state so that we have it available when performing
898         layouts and margin collapses on anonymous inline block children.
899
900 2015-09-15  Brady Eidson  <beidson@apple.com>
901
902         Make the IDBAny::Type enum into an enum class.
903         https://bugs.webkit.org/show_bug.cgi?id=149169.
904
905         Reviewed by Oliver Hunt.
906
907         No new tests (Cleanup, no behavior change).
908
909         * Modules/indexeddb/IDBAny.h:
910         * Modules/indexeddb/legacy/LegacyAny.cpp:
911         (WebCore::LegacyAny::createInvalid):
912         (WebCore::LegacyAny::createNull):
913         (WebCore::LegacyAny::LegacyAny):
914         (WebCore::LegacyAny::domStringList):
915         (WebCore::LegacyAny::idbCursor):
916         (WebCore::LegacyAny::idbCursorWithValue):
917         (WebCore::LegacyAny::idbDatabase):
918         (WebCore::LegacyAny::idbFactory):
919         (WebCore::LegacyAny::idbIndex):
920         (WebCore::LegacyAny::idbObjectStore):
921         (WebCore::LegacyAny::idbTransaction):
922         (WebCore::LegacyAny::scriptValue):
923         (WebCore::LegacyAny::string):
924         (WebCore::LegacyAny::integer):
925         (WebCore::LegacyAny::legacyCursor):
926         (WebCore::LegacyAny::legacyCursorWithValue):
927         (WebCore::LegacyAny::legacyDatabase):
928         (WebCore::LegacyAny::legacyFactory):
929         (WebCore::LegacyAny::legacyIndex):
930         (WebCore::LegacyAny::legacyObjectStore):
931         (WebCore::LegacyAny::legacyTransaction):
932         * Modules/indexeddb/legacy/LegacyCursor.cpp:
933         (WebCore::LegacyCursor::LegacyCursor):
934         (WebCore::LegacyCursor::effectiveObjectStore):
935         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
936         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
937         (WebCore::LegacyOpenDBRequest::dispatchEvent):
938         * Modules/indexeddb/legacy/LegacyRequest.cpp:
939         (WebCore::LegacyRequest::getResultCursor):
940         (WebCore::effectiveObjectStore):
941         * bindings/js/JSIDBAnyCustom.cpp:
942         (WebCore::toJS):
943         * inspector/InspectorIndexedDBAgent.cpp:
944         * page/DatabaseProvider.h:
945
946 2015-09-15  Brady Eidson  <beidson@apple.com>
947
948         Move most IDB object encoding/decoding from WebKit2 to WebCore.
949         https://bugs.webkit.org/show_bug.cgi?id=149152
950
951         Reviewed by Alex Christensen.
952
953         No new tests (Cleanup, no behavior change).
954
955         * Modules/indexeddb/IDBDatabaseMetadata.h:
956         (WebCore::IDBDatabaseMetadata::encode):
957         (WebCore::IDBDatabaseMetadata::decode):
958         * Modules/indexeddb/IDBIndexMetadata.h:
959         (WebCore::IDBIndexMetadata::encode):
960         (WebCore::IDBIndexMetadata::decode):
961         * Modules/indexeddb/IDBKeyData.h:
962         (WebCore::IDBKeyData::encode):
963         (WebCore::IDBKeyData::decode):
964         * Modules/indexeddb/IDBKeyPath.h:
965         (WebCore::IDBKeyPath::encode):
966         (WebCore::IDBKeyPath::decode):
967         * Modules/indexeddb/IDBKeyRangeData.h:
968         (WebCore::IDBKeyRangeData::encode):
969         (WebCore::IDBKeyRangeData::decode):
970         * Modules/indexeddb/IDBObjectStoreMetadata.h:
971         (WebCore::IDBObjectStoreMetadata::encode):
972         (WebCore::IDBObjectStoreMetadata::decode):
973
974 2015-09-14  Brady Eidson  <beidson@apple.com>
975
976         Make the enum IDBKey::Type into a utility enum class.
977         https://bugs.webkit.org/show_bug.cgi?id=149149
978
979         Reviewed by Alex Christensen.
980
981         No new tests (Cleanup, no behavior change).
982
983         * Modules/indexeddb/IDBKey.cpp:
984         (WebCore::IDBKey::isValid):
985         (WebCore::IDBKey::compare):
986         * Modules/indexeddb/IDBKey.h:
987         (WebCore::IDBKey::createNumber):
988         (WebCore::IDBKey::createDate):
989         (WebCore::IDBKey::createMultiEntryArray):
990         (WebCore::IDBKey::createArray):
991         (WebCore::IDBKey::type):
992         (WebCore::IDBKey::array):
993         (WebCore::IDBKey::string):
994         (WebCore::IDBKey::date):
995         (WebCore::IDBKey::number):
996         (WebCore::IDBKey::compareTypes):
997         (WebCore::IDBKey::IDBKey):
998         * Modules/indexeddb/IDBKeyData.cpp:
999         (WebCore::IDBKeyData::IDBKeyData):
1000         (WebCore::IDBKeyData::maybeCreateIDBKey):
1001         (WebCore::IDBKeyData::isolatedCopy):
1002         (WebCore::IDBKeyData::encode):
1003         (WebCore::IDBKeyData::decode):
1004         (WebCore::IDBKeyData::compare):
1005         (WebCore::IDBKeyData::loggingString):
1006         (WebCore::IDBKeyData::setArrayValue):
1007         (WebCore::IDBKeyData::setStringValue):
1008         (WebCore::IDBKeyData::setDateValue):
1009         (WebCore::IDBKeyData::setNumberValue):
1010         * Modules/indexeddb/IDBKeyData.h:
1011         (WebCore::IDBKeyData::IDBKeyData):
1012         (WebCore::IDBKeyData::minimum):
1013         (WebCore::IDBKeyData::maximum):
1014         * Modules/indexeddb/IndexedDB.h:
1015         * bindings/js/IDBBindingUtilities.cpp:
1016         (WebCore::idbKeyToJSValue):
1017         (WebCore::createIDBKeyFromValue):
1018         (WebCore::createIDBKeyFromScriptValueAndKeyPath):
1019         (WebCore::generateIndexKeysForValue):
1020         * inspector/InspectorIndexedDBAgent.cpp:
1021
1022 2015-09-15  Javier Fernandez  <jfernandez@igalia.com>
1023
1024         [CSS Grid Layout] Using {row, column}-axis terms in alignment related logic
1025         https://bugs.webkit.org/show_bug.cgi?id=148942
1026
1027         Reviewed by Sergio Villar Senin.
1028
1029         This patch changes the names of several functions and variables
1030         defined to implement the alignment logic. We want to use from now
1031         on the terms row-axis and column-axis when referring to the
1032         alignment direction the logic is applied to.
1033
1034         No new tests, no new functionality.
1035
1036         * rendering/RenderGrid.cpp:
1037         (WebCore::RenderGrid::columnAxisOffsetForChild):
1038         (WebCore::RenderGrid::rowAxisOffsetForChild):
1039         (WebCore::RenderGrid::findChildLogicalPosition):
1040         * rendering/RenderGrid.h:
1041
1042 2015-09-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1043
1044         Remove all uses of PassRefPtr in WebCore/xml
1045         https://bugs.webkit.org/show_bug.cgi?id=149114
1046
1047         Reviewed by Darin Adler.
1048
1049         * dom/DecodedDataDocumentParser.h:
1050         * dom/DocumentParser.h:
1051         * dom/RawDataDocumentParser.h:
1052         * html/FTPDirectoryDocument.cpp:
1053         (WebCore::FTPDirectoryDocumentParser::append):
1054         * html/parser/HTMLDocumentParser.cpp:
1055         (WebCore::HTMLDocumentParser::append):
1056         * html/parser/HTMLDocumentParser.h:
1057         * html/parser/TextDocumentParser.cpp:
1058         (WebCore::TextDocumentParser::append):
1059         * html/parser/TextDocumentParser.h:
1060         * xml/NativeXPathNSResolver.cpp:
1061         (WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
1062         * xml/NativeXPathNSResolver.h:
1063         (WebCore::NativeXPathNSResolver::create):
1064         * xml/XMLErrors.cpp:
1065         (WebCore::createXHTMLParserErrorHeader):
1066         * xml/XMLHttpRequestProgressEventThrottle.cpp:
1067         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
1068         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
1069         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
1070         * xml/XMLHttpRequestProgressEventThrottle.h:
1071         * xml/XMLSerializer.h:
1072         * xml/XPathEvaluator.cpp:
1073         (WebCore::XPathEvaluator::createExpression):
1074         (WebCore::XPathEvaluator::createNSResolver):
1075         (WebCore::XPathEvaluator::evaluate):
1076         * xml/XPathEvaluator.h:
1077         * xml/XPathNodeSet.h: Fix style errors.
1078         (WebCore::XPath::NodeSet::NodeSet):
1079         (WebCore::XPath::NodeSet::append):
1080         * xml/XPathPath.cpp:
1081         (WebCore::XPath::Filter::evaluate):
1082         (WebCore::XPath::LocationPath::evaluate):
1083         * xml/XPathValue.h: ditto.
1084         (WebCore::XPath::Value::Value):
1085         (WebCore::XPath::Value::Data::create):
1086         (WebCore::XPath::Value::Data::Data):
1087         * xml/XSLTProcessor.cpp:
1088         (WebCore::XSLTProcessor::transformToDocument):
1089         (WebCore::XSLTProcessor::transformToFragment):
1090         * xml/XSLTProcessor.h:
1091         (WebCore::XSLTProcessor::setXSLStyleSheet):
1092         (WebCore::XSLTProcessor::importStylesheet):
1093         * xml/parser/XMLDocumentParser.cpp:
1094         (WebCore::XMLDocumentParser::append):
1095         * xml/parser/XMLDocumentParser.h:
1096
1097 2015-09-14  Dewei Zhu  <dewei_zhu@apple.com>
1098
1099         Polish code for r189579.
1100         https://bugs.webkit.org/show_bug.cgi?id=149131
1101
1102         Reviewed by Chris Dumez.
1103
1104         Use more self-explaining function name "characterSetWithUTF8Fallback" instead of
1105         "characterSetForBindings". Optimize the way to get text encoding.
1106
1107         * dom/Document.cpp:
1108         (WebCore::Document::characterSetWithUTF8Fallback):
1109         (WebCore::Document::encoding): Deleted.
1110         (WebCore::Document::characterSetForBindings): Deleted.
1111         * dom/Document.h:
1112         (WebCore::Document::encoding):
1113         (WebCore::Document::textEncoding):
1114         * dom/Document.idl:
1115         * loader/DocumentWriter.cpp:
1116         (WebCore::DocumentWriter::createDecoderIfNeeded):
1117         * loader/FormSubmission.cpp:
1118         (WebCore::encodingFromAcceptCharset):
1119
1120 2015-09-14  Chris Dumez  <cdumez@apple.com>
1121
1122         Drop non-standard [IsIndex] WebKit IDL extended attribute
1123         https://bugs.webkit.org/show_bug.cgi?id=149122
1124         <rdar://problem/22547139>
1125
1126         Reviewed by Darin Adler.
1127
1128         Drop non-standard [IsIndex] WebKit IDL extended attribute. This attribute
1129         causes us to throw an IndexSizeError if the input value is negative. Web
1130         IDL supports no such thing. Instead Web IDL supports:
1131         1. Default behavior: the input value wraps around if it does not fit.
1132         2. [EnforceRange]: A TypeError is thrown if the input value does not fit [1].
1133         3. [Clamp]: The input value will be clamped if it does not fit [2].
1134
1135         Our bindings generator supports all three. We don't need the non-standard
1136         [IsIndex].
1137
1138         We previously used [IsIndex] in places where we're supposed to wrap around
1139         as per Web IDL. Therefore, we threw for negative values but other browsers
1140         don't. For e.g., CharacterData.substringData(offset, -1) is supposed to
1141         return the substring from offset to the end of the string. It does so in
1142         Firefox and Chrome. However, WebKit was throwing an Exception.
1143
1144         This change impacts the CharacterData and the SVGTextContentElement
1145         API. The compatibility risk is low because we were throwing an exception
1146         for negative values and we now wrap the value around instead, as other
1147         browsers do.
1148
1149         No new tests, already covered by existing tests.
1150
1151         [1] https://heycam.github.io/webidl/#EnforceRange
1152         [2] https://heycam.github.io/webidl/#Clamp
1153
1154         * bindings/scripts/CodeGeneratorJS.pm:
1155         (GenerateParametersCheck): Deleted.
1156         * bindings/scripts/IDLAttributes.txt:
1157         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1158         (WebCore::jsTestEventTargetPrototypeFunctionItem):
1159         * bindings/scripts/test/TestEventTarget.idl:
1160         * dom/CharacterData.cpp:
1161         (WebCore::CharacterData::deleteData):
1162         (WebCore::CharacterData::replaceData):
1163         * dom/CharacterData.idl:
1164         * dom/ClientRectList.idl:
1165         * svg/SVGTextContentElement.cpp:
1166         (WebCore::SVGTextContentElement::getSubStringLength):
1167         (WebCore::SVGTextContentElement::selectSubString):
1168         * svg/SVGTextContentElement.idl:
1169
1170 2015-09-14  Chris Dumez  <cdumez@apple.com>
1171
1172         Document.createNodeIterator(null) / Document.createTreeWalker(null) should throw a TypeError
1173         https://bugs.webkit.org/show_bug.cgi?id=149126
1174         <rdar://problem/22564891>
1175
1176         Reviewed by Ryosuke Niwa.
1177
1178         Document.createNodeIterator(null) / Document.createTreeWalker(null)
1179         should throw a TypeError:
1180         https://dom.spec.whatwg.org/#interface-document
1181
1182         This is because the parameter is not nullable and Web IDL says we
1183         should throw a TypeError in this case.
1184
1185         Firefox and Chrome throw an exception in this case. This patch
1186         aligns our behavior with the specification and other major browsers.
1187
1188         No new tests, already covered by existing W3C test.
1189
1190         * dom/Document.cpp:
1191         (WebCore::Document::createNodeIterator):
1192         (WebCore::Document::createTreeWalker):
1193         * dom/Document.h:
1194         * dom/Document.idl:
1195         * dom/NodeIterator.cpp:
1196         (WebCore::NodeIterator::NodeIterator):
1197         * dom/NodeIterator.h:
1198         (WebCore::NodeIterator::create):
1199         * dom/Traversal.cpp:
1200         (WebCore::NodeIteratorBase::NodeIteratorBase):
1201         * dom/Traversal.h:
1202         * dom/TreeWalker.cpp:
1203         (WebCore::TreeWalker::TreeWalker):
1204         * dom/TreeWalker.h:
1205         (WebCore::TreeWalker::create):
1206
1207 2015-09-14  Alex Christensen  <achristensen@webkit.org>
1208
1209         Fix Windows clean build after r189746
1210
1211         * WebCore.vcxproj/copyForwardingHeaders.cmd:
1212         Copy headers from new legacy directory.
1213
1214 2015-09-14  Chris Dumez  <cdumez@apple.com>
1215
1216         window.HTMLDetailsElement should exist
1217         https://bugs.webkit.org/show_bug.cgi?id=149139
1218
1219         Reviewed by Ryosuke Niwa.
1220
1221         window.HTMLDetailsElement should exist:
1222         https://html.spec.whatwg.org/multipage/forms.html#the-details-element
1223
1224         Drop the [NoInterfaceObject] IDL extended attribute in WebKit to
1225         address the problem.
1226
1227         No new tests, already covered by existing tests.
1228
1229         * html/HTMLDetailsElement.idl:
1230
1231 2015-09-14  Alex Christensen  <achristensen@webkit.org>
1232
1233         Fix AppleWin CMake build
1234         https://bugs.webkit.org/show_bug.cgi?id=149137
1235
1236         Reviewed by Brent Fulgham.
1237
1238         * PlatformAppleWin.cmake:
1239         Spell Inband correctly.
1240         * css/makegrammar.pl:
1241         Add quotes so bison can be in a directory with spaces in it.        
1242
1243 2015-09-14  Alex Christensen  <achristensen@webkit.org>
1244
1245         [Win] Unreviewed build fix after r189746
1246
1247         * WebCore.vcxproj/WebCoreIncludeCommon.props:
1248         Include new legacy directory.
1249
1250 2015-09-14  Alex Christensen  <achristensen@webkit.org>
1251
1252         Progress towards CMake on Mac.
1253         https://bugs.webkit.org/show_bug.cgi?id=149123
1254
1255         Reviewed by Chris Dumez.
1256
1257         * CMakeLists.txt:
1258         Added some more files.
1259         * PlatformMac.cmake:
1260         Added more files and listed the strange ObjC bindings.
1261         * contentextensions/DFACombiner.cpp:
1262         * contentextensions/DFACombiner.h:
1263         Added preprocessor protection.
1264         * platform/FileSystem.h:
1265         Include utility.  It's needed to compile the different configurations.
1266         * platform/ScrollAnimator.cpp:
1267         ScrollAnimator is an abstract class on Mac.  Don't compile it.
1268         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1269         FontAntialiasingStateSaver.h is only used on iOS.
1270         * rendering/RenderThemeMac.mm:
1271         config.h needs to be outside the #if !PLATFORM(IOS) to compile correctly without precompiled headers.
1272
1273 2015-09-14  Brady Eidson  <beidson@apple.com>
1274
1275         Rename current concrete IDB implementation to "Legacy".
1276         https://bugs.webkit.org/show_bug.cgi?id=149118
1277
1278         Reviewed by Alex Christensen.
1279
1280         No new tests (No change in behavior).
1281
1282         This patch makes IDL bindings abstract.
1283         It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
1284         Finally it moves those files and their support classes to a "legacy" subfolder.
1285
1286         * CMakeLists.txt:
1287         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
1288         * Modules/indexeddb/IDBAny.cpp:
1289         * Modules/indexeddb/IDBAny.h:
1290         * Modules/indexeddb/IDBCursor.cpp:
1291         * Modules/indexeddb/IDBCursor.h:
1292         * Modules/indexeddb/IDBCursor.idl:
1293         * Modules/indexeddb/IDBCursorWithValue.cpp:
1294         * Modules/indexeddb/IDBCursorWithValue.h:
1295         * Modules/indexeddb/IDBCursorWithValue.idl:
1296         * Modules/indexeddb/IDBDatabase.cpp:
1297         * Modules/indexeddb/IDBDatabase.h:
1298         * Modules/indexeddb/IDBDatabase.idl:
1299         * Modules/indexeddb/IDBFactory.cpp:
1300         * Modules/indexeddb/IDBFactory.h:
1301         * Modules/indexeddb/IDBFactory.idl:
1302         * Modules/indexeddb/IDBIndex.cpp:
1303         * Modules/indexeddb/IDBIndex.h:
1304         * Modules/indexeddb/IDBIndex.idl:
1305         * Modules/indexeddb/IDBObjectStore.cpp:
1306         * Modules/indexeddb/IDBObjectStore.h:
1307         * Modules/indexeddb/IDBObjectStore.idl:
1308         * Modules/indexeddb/IDBOpenDBRequest.cpp:
1309         * Modules/indexeddb/IDBOpenDBRequest.h:
1310         * Modules/indexeddb/IDBOpenDBRequest.idl:
1311         * Modules/indexeddb/IDBRequest.cpp:
1312         * Modules/indexeddb/IDBRequest.h:
1313         * Modules/indexeddb/IDBRequest.idl:
1314         * Modules/indexeddb/IDBTransaction.cpp:
1315         * Modules/indexeddb/IDBTransaction.h:
1316         * Modules/indexeddb/IDBTransaction.idl:
1317         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
1318         * Modules/indexeddb/IDBVersionChangeEvent.h:
1319         * Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
1320         * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
1321         * Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
1322         * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
1323         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
1324         * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
1325         * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
1326         * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
1327         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
1328         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
1329         * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
1330         * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
1331         * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
1332         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
1333         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
1334         * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
1335         * Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
1336         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
1337         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
1338         * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
1339         * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
1340         * Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
1341         * Modules/indexeddb/legacy/LegacyAny.h: Added.
1342         * Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
1343         * Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
1344         * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
1345         * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
1346         * Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
1347         * Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
1348         * Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
1349         * Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
1350         * Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
1351         * Modules/indexeddb/legacy/LegacyIndex.h: Added.
1352         * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
1353         * Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
1354         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
1355         * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
1356         * Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
1357         * Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
1358         * Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
1359         * Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
1360         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
1361         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
1362         * WebCore.xcodeproj/project.pbxproj:
1363         * WebCore.vcxproj/WebCore.vcxproj:
1364
1365 2015-09-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1366
1367         [EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
1368         https://bugs.webkit.org/show_bug.cgi?id=149110
1369
1370         Reviewed by Csaba Osztrogonác.
1371
1372         It is not good implementation we support both create() factory function and public constructor.
1373         In EvasGLContext and EvasGLSurface cases, those have supported both. However create() factory is only
1374         used by EwkView. Thus let's remove the create() function, then EwkView creates EvasGLContext using
1375         std::make_unique<> directly.
1376
1377         * platform/graphics/efl/EvasGLContext.h:
1378         (WebCore::EvasGLContext::create): Deleted.
1379         * platform/graphics/efl/EvasGLSurface.h:
1380         (WebCore::EvasGLSurface::create): Deleted.
1381
1382 2015-09-09  Sergio Villar Senin  <svillar@igalia.com>
1383
1384         min-width/height should default to auto for grid items
1385         https://bugs.webkit.org/show_bug.cgi?id=146021
1386
1387         Reviewed by Darin Adler.
1388
1389         Based on Blink's r194408, r194863 and r194887 by <rego@igalia.com>.
1390
1391         From the spec (http://dev.w3.org/csswg/css-grid/#grid-items):
1392         "The auto value of min-width and min-height behaves on grid
1393         items in the relevant axis analogously to its behavior on flex
1394         items in the main axis."
1395
1396         From now on the default value for min-width and min-height for
1397         grid items is auto, meaning that in general, grid items won't
1398         shrink bellow their content.
1399
1400         The change is not exactly the same as the one in Blink because
1401         this one takes into account vertical writting modes, something
1402         that was not well handled in the original one.
1403
1404         Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
1405                fast/css-grid-layout/min-width-height-auto.html
1406
1407         * rendering/RenderBox.cpp:
1408         (WebCore::RenderBox::computeLogicalWidthInRegion):
1409         (WebCore::RenderBox::computeLogicalHeight):
1410
1411 2015-09-14  Manuel Rego Casasnovas  <rego@igalia.com>
1412
1413         [css-grid] Percentage columns should remove scrollbar's width
1414         https://bugs.webkit.org/show_bug.cgi?id=149116
1415
1416         Reviewed by Sergio Villar Senin.
1417
1418         Currently the calculation of percentage columns was not subtracting the
1419         scrollbar's size.
1420         Fixed RenderGrid::computeUsedBreadthOfSpecifiedLength()
1421         to avoid this problem.
1422
1423         Test: fast/css-grid-layout/grid-percent-track-scrollbar.html
1424
1425         * rendering/RenderGrid.cpp:
1426         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
1427
1428 2015-09-13  Chris Dumez  <cdumez@apple.com>
1429
1430         Improve Node pre-insertion validation when the parent is a Document
1431         https://bugs.webkit.org/show_bug.cgi?id=149109
1432         <rdar://problem/22560436>
1433
1434         Reviewed by Ryosuke Niwa.
1435
1436         Improve Node pre-insertion validation when the parent is a Document to
1437         match the specification:
1438         https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
1439         https://dom.spec.whatwg.org/#concept-node-replace
1440
1441         This affects the following API: Node.insertBefore(), Node.appendChild(),
1442         Node.replaceChild().
1443
1444         WebKit current fails to do the following checks whenever the parent is a
1445         Document from pre-insertion validation:
1446         1. If the inserted Node is a DocumentFragment, we should make sure it
1447           contains only one Element.
1448         -> This is because a Document can have only one child that is an
1449            Element [1].
1450         2.a. If an Element is inserted, we should make sure it is not inserted
1451              before a DocumentType.
1452         2.b. If a DocumentType is inserted, we should make sure it is not
1453              inserted after an Element.
1454         -> This is because the DocType must come before the optional Element
1455            child [1].
1456
1457         Firefox and Chrome already match the specification here. This patch
1458         aligns WebKit's behavior with those browsers and the specification.
1459
1460         [1] https://dom.spec.whatwg.org/#node-trees
1461
1462         No new tests, already covered by existing W3C tests.
1463
1464         * dom/ContainerNode.cpp:
1465         (WebCore::checkAcceptChild):
1466         (WebCore::checkAddChild):
1467         (WebCore::checkReplaceChild):
1468         (WebCore::ContainerNode::insertBefore):
1469         (WebCore::ContainerNode::appendChild):
1470         (WebCore::containsConsideringHostElements): Deleted.
1471         (WebCore::checkAcceptChildGuaranteedNodeTypes): Deleted.
1472         * dom/Document.cpp:
1473         (WebCore::Document::canAcceptChild):
1474         (WebCore::Document::cloneNodeInternal): Deleted.
1475         * dom/Document.h:
1476
1477 2015-09-13  Chris Dumez  <cdumez@apple.com>
1478
1479         Document.adoptNode() should be able to explicitly adopt a DocumentType node
1480         https://bugs.webkit.org/show_bug.cgi?id=149097
1481         <rdar://problem/22549345>
1482
1483         Reviewed by Ryosuke Niwa.
1484
1485         Document.adoptNode() should be able to explicitly adopt a DocumentType
1486         node as per the latest DOM specification:
1487         https://dom.spec.whatwg.org/#dom-document-adoptnode
1488
1489         Chrome and Firefox match the specidicaiton but WebKit was throwing a
1490         NotSupportedError.
1491
1492         No new tests, already covered by existing test.
1493
1494         * dom/Document.cpp:
1495         (WebCore::Document::adoptNode): Deleted.
1496
1497 2015-09-13  Chris Dumez  <cdumez@apple.com>
1498
1499         Document.title does not behave according to specification
1500         https://bugs.webkit.org/show_bug.cgi?id=149098
1501
1502         Reviewed by Ryosuke Niwa.
1503
1504         Update Document.title to behave according to the latest DOM specification:
1505         https://html.spec.whatwg.org/multipage/dom.html#document.title
1506
1507         In particular, the following Web-Exposed changes were made:
1508         1. The title Element should be the first title element in the document
1509            (in tree order) [1]. Previously, WebKit would use the first title
1510            Element *added* to the Document. Document.title returns the text
1511            content of the title Element so this change is web-exposed.
1512         2. If the title Element is replaced after the title has been set by the
1513            JS (via the document.title setter), we should update the value
1514            returned by the document.title getter. Previously, WebKit would set
1515            a flag if the title was explicitly set by JS via document.title
1516            setter and later title element changes would not override the title
1517            set by the JS. This behavior isn't specified and does not match the
1518            behavior of other browsers.
1519
1520         The new behavior is also consistent with the behavior of Firefox and
1521         Chrome.
1522
1523         Some refactoring was made for the sake of clarity now that our
1524         implementation has changed. See details below.
1525
1526         [1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2
1527
1528         No new tests, already covered by existing tests.
1529
1530         * dom/Document.cpp:
1531         (WebCore::Document::updateTitleFromTitleElement):
1532         New convenience method that calls updateTitle() with the text of the
1533         document's current title Element. If there is no title Element, it
1534         clears the title.
1535
1536         (WebCore::Document::updateTitleElement):
1537         Method which updates the Document's title Element whenever a title
1538         Element is added or removed from the Document. Once the title Element
1539         is updated, it takes care of calling updateTitleFromTitleElement() to
1540         update the Document's title.
1541
1542         (WebCore::Document::titleElementAdded):
1543         (WebCore::Document::titleElementRemoved):
1544         (WebCore::Document::titleElementTextChanged):
1545         New Document public API called by HTMLTitleElement / SVGTitleElement
1546         whenever a title Element is added / removed from the Document or
1547         whenever the title element's text has changed. These methods will
1548         take care of calling updateTitleElement() / updateTitleFromTitleElement()
1549         as necessary.
1550         Previously, we would only have 2 methods:
1551         - setTitleElement() which would be called whenever a title Element was
1552           added to the document or when its text had changed. The name was
1553           confusing because it would not necessarily set the document's title
1554           Element and it would be used both for title element update and a
1555           simple title update. This method has been split into 2:
1556           titleElementAdded() and titleElementTextChanged().
1557         - removeTitle() which would be called whenever a title Element was
1558           removed. The naming was confusing because it would not necessarily
1559           remove the Document's title Element. This is now called
1560           titleElementRemoved().
1561
1562         * html/HTMLTitleElement.cpp:
1563         (WebCore::HTMLTitleElement::insertedInto):
1564         Call the new titleElementAdded() instead of setTitleElement().
1565
1566         (WebCore::HTMLTitleElement::removedFrom):
1567         Call the new titleElementRemoved() instead of removeTitle().
1568
1569         (WebCore::HTMLTitleElement::childrenChanged):
1570         Call the new titleElementTextChanged() instead of
1571         setTitleElement() / removeTitle() as we don't really want
1572         to remove or add a title Element. We merely want to notify
1573         the document that the title element text has changed in
1574         case it is the current title Element of the Document.
1575
1576         (WebCore::HTMLTitleElement::computedTextWithDirection):
1577         Rename textWithDirection() to computedTextWithDirection() to
1578         make it clear it is not a simple getter and make it private
1579         as it is only used to set the m_title member which caches the
1580         computed text.
1581
1582         * html/HTMLTitleElement.h:
1583         Add new textWithDirection() getter which returns m_title. This
1584         is needed so that Document can query the title of the Element.
1585         Previously, HTMLTitleElement would pass directly m_title to
1586         the Document when calling Document::setTitleElement().
1587
1588         * svg/SVGTitleElement.cpp:
1589         (WebCore::SVGTitleElement::insertedInto):
1590         Call the new titleElementAdded() instead of setTitleElement().
1591
1592         (WebCore::SVGTitleElement::removedFrom):
1593         Call the new titleElementRemoved() instead of removeTitle().
1594
1595         (WebCore::SVGTitleElement::childrenChanged):
1596         Call the new titleElementTextChanged() instead of
1597         setTitleElement().
1598
1599 2015-09-13  Chris Dumez  <cdumez@apple.com>
1600
1601         document.lastModified should use the user's local time zone
1602         https://bugs.webkit.org/show_bug.cgi?id=149092
1603         <rdar://problem/22567705>
1604
1605         Reviewed by Ryosuke Niwa.
1606
1607         document.lastModified should use the user's local time zone:
1608         https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified
1609
1610         Chrome and Firefox comply with the specification but WebKit was using
1611         UTC. This patch aligns WebKit's behavior with the specification and
1612         other browsers.
1613
1614         No new tests, already covered by existing tests.
1615
1616         * dom/Document.cpp:
1617         (WebCore::Document::lastModified):
1618         (WebCore::Document::setCookieURL): Deleted.
1619
1620 2015-09-13  Chris Dumez  <cdumez@apple.com>
1621
1622         Node.baseURI should not return null for detached nodes
1623         https://bugs.webkit.org/show_bug.cgi?id=149104
1624         <rdar://problem/22559535>
1625
1626         Reviewed by Sam Weinig.
1627
1628         Node.baseURI should not return null for detached nodes. It should return
1629         the node document's base URL. The node document is set when the node is
1630         created so it is valid even if the node is detached [1]:
1631         https://dom.spec.whatwg.org/#dom-node-baseuri
1632
1633         WebKit was traversing the ancestors to find the base URL, which only
1634         works if the node is attached. Also, WebKit was taking into account
1635         the xml:base attribute when computing the baseURI.
1636
1637         Both Chrome and Firefox already dropped support for xml:base:
1638         https://code.google.com/p/chromium/issues/detail?id=341854
1639         https://bugzilla.mozilla.org/show_bug.cgi?id=903372
1640
1641         Firefox complies with the specification. Chrome's baseURI still only
1642         works for attached Nodes as their implementation still traverses the
1643         DOM tree, despite dropping support for xml:base.
1644
1645         This patch drops support xml:base when computing Node.baseURI, as
1646         Firefox, Chrome and the latest DOM specification do. It also makes
1647         Node.baseURI work for detached Nodes by returning the base URL of the
1648         node Document. This means we no longer have to traverse the Node's
1649         ancestors in the DOM tree. This is consistent with the behavior of
1650         Firefox and the latest DOM specification.
1651
1652         This patch does not drop the SVGElement.xmlbase attribute yet. However,
1653         we should probably consider making this change as well given that:
1654         - The SVG2 specification dropped it
1655         - Chrome dropped it.
1656         - It no longers impacts Node.baseURI
1657
1658         [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976
1659
1660         No new tests, already covered by existing test.
1661
1662         * dom/Document.cpp:
1663         (WebCore::Document::setContent): Deleted.
1664         * dom/Document.h:
1665         (WebCore::Document::inputCursor): Deleted.
1666         * dom/DocumentType.cpp:
1667         (WebCore::DocumentType::nodeName): Deleted.
1668         * dom/DocumentType.h:
1669         * dom/Element.cpp:
1670         (WebCore::Element::imageSourceURL): Deleted.
1671         (WebCore::Element::rendererIsNeeded): Deleted.
1672         (WebCore::Element::createElementRenderer): Deleted.
1673         (WebCore::Element::insertedInto): Deleted.
1674         * dom/Element.h:
1675         * dom/Node.cpp:
1676         (WebCore::Node::baseURI):
1677         * dom/Node.h:
1678         * svg/SVGElement.idl:
1679
1680 2015-09-13  Chris Dumez  <cdumez@apple.com>
1681
1682         CharacterData API parameters should not be optional
1683         https://bugs.webkit.org/show_bug.cgi?id=149101
1684         <rdar://problem/22546954>
1685
1686         Reviewed by Sam Weinig.
1687
1688         CharacterData API parameters should not be optional as per the DOM
1689         specification:
1690         https://dom.spec.whatwg.org/#characterdata
1691
1692         The parameters are also mandatory in Firefox and Chrome. However,
1693         those parameters are optional in WebKit. When DOMString parameters
1694         were omitted, we would use the "undefined" string instead. When
1695         unsigned long parameters were omitted, we would use 0 instead.
1696         This patch aligns our behavior with the specification and other
1697         major browsers.
1698
1699         No new tests, already covered by existing tests.
1700
1701         * dom/CharacterData.cpp:
1702         (WebCore::CharacterData::appendData):
1703         * dom/CharacterData.h:
1704         * dom/CharacterData.idl:
1705         * dom/Element.cpp:
1706         (WebCore::Element::mergeWithNextTextNode):
1707         * dom/Node.cpp:
1708         (WebCore::Node::normalize):
1709         * xml/parser/XMLDocumentParser.cpp:
1710         (WebCore::XMLDocumentParser::exitText):
1711
1712 2015-09-13  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1713
1714         Remove all uses of PassRefPtr in crypto, storage, and history
1715         https://bugs.webkit.org/show_bug.cgi?id=149091
1716
1717         Reviewed by Andreas Kling.
1718
1719         * crypto/CryptoKeyPair.cpp:
1720         (WebCore::CryptoKeyPair::CryptoKeyPair):
1721         * crypto/CryptoKeyPair.h:
1722         (WebCore::CryptoKeyPair::create):
1723         * crypto/SubtleCrypto.h:
1724         (WebCore::SubtleCrypto::create):
1725         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
1726         (WebCore::CryptoKeyRSA::create):
1727         * crypto/keys/CryptoKeyAES.cpp:
1728         (WebCore::CryptoKeyAES::generate):
1729         * crypto/keys/CryptoKeyAES.h:
1730         * crypto/keys/CryptoKeyHMAC.cpp:
1731         (WebCore::CryptoKeyHMAC::generate):
1732         * crypto/keys/CryptoKeyHMAC.h:
1733         * crypto/keys/CryptoKeyRSA.h:
1734         * crypto/mac/CryptoKeyRSAMac.cpp:
1735         (WebCore::CryptoKeyRSA::create):
1736         * history/BackForwardController.cpp:
1737         (WebCore::BackForwardController::BackForwardController):
1738         * history/BackForwardController.h:
1739         * history/HistoryItem.cpp:
1740         (WebCore::HistoryItem::setStateObject):
1741         (WebCore::HistoryItem::setFormData):
1742         * history/HistoryItem.h:
1743         (WebCore::HistoryItem::stateObject):
1744         * loader/EmptyClients.cpp:
1745         * page/Page.cpp:
1746         (WebCore::Page::Page):
1747         * storage/Storage.cpp:
1748         (WebCore::Storage::create):
1749         (WebCore::Storage::Storage):
1750         * storage/Storage.h:
1751         * storage/StorageArea.h:
1752         * storage/StorageMap.cpp:
1753         (WebCore::StorageMap::copy):
1754         (WebCore::StorageMap::setItem):
1755         (WebCore::StorageMap::setItemIgnoringQuota):
1756         (WebCore::StorageMap::removeItem):
1757         * storage/StorageMap.h:
1758         * storage/StorageNamespace.h:
1759
1760 2015-09-12  Chris Dumez  <cdumez@apple.com>
1761
1762         window.EventTarget should exist
1763         https://bugs.webkit.org/show_bug.cgi?id=149085
1764         <rdar://problem/22546774>
1765
1766         Reviewed by Sam Weinig.
1767
1768         Drop [NoInterfaceObject] for the EventTarget interface to match Chrome,
1769         Firefox and the specification:
1770         https://dom.spec.whatwg.org/#interface-eventtarget
1771
1772         No new tests, already covered by existing tests.
1773
1774         * dom/EventTarget.idl:
1775
1776 2015-09-12  Brian Burg  <bburg@apple.com>
1777
1778         Web Inspector: disambiguate inspected/frontend controllers and pages in backend code
1779         https://bugs.webkit.org/show_bug.cgi?id=149071
1780
1781         Reviewed by Joseph Pecoraro.
1782
1783         Be consistent about prefixing pages, inspector controllers, and window controllers
1784         with either "frontend" or "inspected", as appropriate. This change makes obvious some bugs
1785         in the frontend connection code, which are tracked by https://webkit.org/b/149006.
1786
1787         No new tests, no behavior change.
1788
1789         * WebCore.order:
1790         * inspector/InspectorClient.h:
1791         * inspector/InspectorController.cpp:
1792         (WebCore::InspectorController::inspectedPageDestroyed):
1793         (WebCore::InspectorController::show):
1794         (WebCore::InspectorController::close):
1795         * inspector/InspectorFrontendClientLocal.cpp:
1796         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
1797         (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
1798         (WebCore::InspectorFrontendClientLocal::canAttachWindow):
1799         (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
1800         (WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
1801         (WebCore::InspectorFrontendClientLocal::openInNewTab):
1802         (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
1803         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
1804         (WebCore::InspectorFrontendClientLocal::isUnderTest):
1805         * inspector/InspectorFrontendClientLocal.h:
1806         * inspector/InspectorOverlay.cpp:
1807         (WebCore::InspectorOverlay::freePage):
1808         * loader/EmptyClients.h:
1809
1810 2015-09-12  Chris Dumez  <cdumez@apple.com>
1811
1812         ChildNode.replaceWith() without argument should replace the node with an empty DocumentFragment
1813         https://bugs.webkit.org/show_bug.cgi?id=149073
1814         <rdar://problem/22547801>
1815
1816         Reviewed by Ryosuke Niwa.
1817
1818         ChildNode.replaceWith() without argument should replace the node with 
1819         an empty DocumentFragment, as per the specification:
1820         https://dom.spec.whatwg.org/#dom-childnode-replacewith
1821         https://dom.spec.whatwg.org/#converting-nodes-into-a-node
1822
1823         Previously, WebKit did not do anything in this case. This patch fixes
1824         it.
1825
1826         No new tests, already covered by existing test.
1827
1828         * dom/Node.cpp:
1829         (WebCore::Node::replaceWith):
1830
1831 2015-09-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1832
1833         Remove all uses of PassRefPtr in WebCore/plugins
1834         https://bugs.webkit.org/show_bug.cgi?id=149055
1835
1836         Reviewed by Darin Adler.
1837
1838         * plugins/DOMMimeType.cpp:
1839         (WebCore::DOMMimeType::DOMMimeType):
1840         (WebCore::DOMMimeType::enabledPlugin):
1841         * plugins/DOMMimeType.h:
1842         (WebCore::DOMMimeType::create):
1843         * plugins/DOMMimeTypeArray.cpp:
1844         (WebCore::DOMMimeTypeArray::item):
1845         * plugins/DOMMimeTypeArray.h:
1846         * plugins/DOMPlugin.cpp:
1847         (WebCore::DOMPlugin::item):
1848         * plugins/DOMPlugin.h:
1849         * plugins/DOMPluginArray.cpp:
1850         (WebCore::DOMPluginArray::item):
1851         * plugins/DOMPluginArray.h:
1852         * plugins/PluginViewBase.h:
1853         (WebCore::PluginViewBase::bindingInstance):
1854
1855 2015-09-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1856
1857         Remove all uses of PassRefPtr in WebCore/accessibility and WebCore/fileapi
1858         https://bugs.webkit.org/show_bug.cgi?id=149059
1859
1860         Reviewed by Darin Adler.
1861
1862         * accessibility/AXObjectCache.cpp:
1863         * accessibility/AccessibilityObject.cpp:
1864         (WebCore::rangeClosestToRange):
1865         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
1866         (WebCore::AccessibilityObject::selectionRange):
1867         (WebCore::AccessibilityObject::selectText):
1868         * accessibility/AccessibilityObject.h:
1869         * accessibility/ios/AXObjectCacheIOS.mm:
1870         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
1871         (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
1872         (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
1873         * accessibility/mac/AXObjectCacheMac.mm:
1874         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1875         (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
1876         * fileapi/FileList.h:
1877         (WebCore::FileList::append):
1878         * fileapi/WebKitBlobBuilder.cpp:
1879         (WebCore::BlobBuilder::append):
1880         * fileapi/WebKitBlobBuilder.h:
1881
1882 2015-09-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
1883
1884         SVGColor custom text format is different from the CSS color custom text format
1885         https://bugs.webkit.org/show_bug.cgi?id=148879
1886
1887         Reviewed by Daniel Bates.
1888
1889         Implement the serialization of a CSS color value as it is described in
1890         <https://drafts.csswg.org/cssom/#serializing-css-values>. Add the new
1891         function Color::cssText() which is refactored from the existing function
1892         Color::serialized(). Use the new function for serializing the SVGColor
1893         always and also for Color but only when the alpha component is not 1.
1894
1895         Test: svg/css/computed-style-rgb-color.html
1896
1897         * css/CSSPrimitiveValue.cpp:
1898         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Move the code
1899         for serializing the color from this function to Color::cssText().
1900         
1901         * platform/graphics/Color.cpp:
1902         (WebCore::Color::serialized): Call Color::cssText() if the alpha component
1903         is not 1 and delete the repeated code. 
1904         
1905         (WebCore::Color::cssText):
1906         * platform/graphics/Color.h: Add the new function to the header file.
1907         
1908         * svg/SVGColor.cpp:
1909         (WebCore::SVGColor::customCSSText): Call Color::cssText() always instead
1910         of calling Color::serialized() for serializing the SVGColor.
1911
1912 2015-09-11  Nan Wang  <n_wang@apple.com>
1913
1914         AX: ARIA 1.1 @aria-current
1915         https://bugs.webkit.org/show_bug.cgi?id=146012
1916
1917         Reviewed by Chris Fleizach.
1918
1919         Tests: accessibility/aria-current.html
1920                inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html
1921
1922         Added support for ARIA 1.1 aria-current.
1923
1924         * accessibility/AccessibilityObject.cpp:
1925         (WebCore::AccessibilityObject::invalidStatus):
1926         (WebCore::AccessibilityObject::ariaCurrentState):
1927         (WebCore::AccessibilityObject::hasTagName):
1928         * accessibility/AccessibilityObject.h:
1929         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1930         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
1931         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
1932         * html/HTMLAttributeNames.in:
1933         * inspector/InspectorDOMAgent.cpp:
1934         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
1935
1936 2015-09-11  Chris Dumez  <cdumez@apple.com>
1937
1938         DOMTokenList update steps for classList don't follow the spec
1939         https://bugs.webkit.org/show_bug.cgi?id=148589
1940         <rdar://problem/22547443>
1941
1942         Reviewed by Ryosuke Niwa and Darin Adler.
1943
1944         Update our DOMTokenList implementation to behave according to
1945         the latest DOM specification:
1946         https://dom.spec.whatwg.org/#interface-domtokenlist
1947
1948         In particular, the following changes were made:
1949         - The stringifier now returns the result of the ordered set serializer
1950           for tokens. This means that we drop duplicate spaces and extra spaces
1951           [1][2][3].
1952         - DOMSettableTokenList.value now returns the result of the ordered set
1953           serializer for tokens [4] as well.
1954         - When the DOMTokenList's tokens are updated and there is an associated
1955           Element attribute, we set the attribute value to be the the ordered
1956           set serializer for tokens. This is according to the DOMTokenList
1957           update steps in the specification [6]. Chrome does not match the
1958           specification either.
1959
1960         Edge browser behaves according to the specification already. Firefox was
1961         implementing this via [7] but no recent progress. This makes the JS API
1962         nicer to use and interest was shown by jQuery Team.
1963
1964         The following refactoring was done:
1965         - Merge ClassList / RelList into a single AttributeDOMTokenList class
1966           as their code is mostly duplicated and the only thing that changes
1967           is which attribute is associated (class vs rel). AttributeDOMTokenList
1968           now keeps the attribute name as a member so it could be used for any
1969           attribute. AttributeDOMTokenList overrides DOMTokenList's
1970           updateAfterTokenChange() to do update the attribute's value as per
1971           [6].
1972         - We no longer use a SpaceSplitString for the internal representation
1973           as we need to sanitize the tokens (drop duplicates and extra spaces).
1974           DOMTokenList now has an internal Vector<AtomicString> containing the
1975           tokens that is constructed from the algorithm in [2]. As a result,
1976           most of the logic is now in DOMTokenList instead of its subclasses
1977           which means that most methods are no longer virtual. We only have
1978           one virtual function named updateAfterTokenChange() to do the update
1979           steps as AttributeDOMTokenList needs to update the associated
1980           attribute.
1981
1982         This change does not seem to impact Dromaeo.
1983
1984         [1] https://dom.spec.whatwg.org/#concept-ordered-set-serializer
1985         [2] https://dom.spec.whatwg.org/#ordered%20sets
1986         [3] https://dom.spec.whatwg.org/#stringification-behavior
1987         [4] https://dom.spec.whatwg.org/#dom-domsettabletokenlist-value
1988         [5] https://dom.spec.whatwg.org/#dom-domtokenlist-contains (step 2)
1989         [6] https://dom.spec.whatwg.org/#concept-DTL-update
1990         [7] https://bugzilla.mozilla.org/show_bug.cgi?id=869788
1991
1992         No new tests, already covered by existing tests.
1993
1994         * dom/Element.cpp:
1995         (WebCore::Element::classAttributeChanged):
1996         When the class attribute changes, make sure to update the associated
1997         classList if there is one. We could do this lazily if it turns out
1998         to be a performance problem. However, chances are this is not as
1999         classList is rarely used and we only need to update the classList if
2000         it was ever accessed by JS for this Element.
2001
2002         (WebCore::Element::insertedInto):
2003         Drop call to clearClassListValueForQuirksMode() as we no longer need
2004         to maintain a separate SpaceSplitString for classes when in quirks
2005         mode. This is because AttributeDOMTokenList now has its own Vector
2006         of classes in their original cases. It therefore no longer relies on
2007         Element::classNames() which has its case folded when in quirks mode.
2008
2009         (WebCore::Element::classList):
2010         Return a AttributeDOMTokenList instead of a ClassList.
2011
2012         * html/AttributeDOMTokenList.h: Added.
2013         * html/AttributeDOMTokenList.cpp: Added.
2014         (WebCore::AttributeDOMTokenList::AttributeDOMTokenList):
2015         Call DOMTokenList::setValue() using the attribute's value so that
2016         DOMTokenList can initialize its token Vector.
2017
2018         (WebCore::AttributeDOMTokenList::attributeValueChanged):
2019         If the attribute value was changed by somebody else that the
2020         AttributeDOMTokenList, call DOMTokenList::setValue() so that it
2021         can update its token Vector.
2022
2023         (WebCore::AttributeDOMTokenList::updateAfterTokenChange):
2024         This is called whenever the token Vector is changed via JS. In
2025         this case, we update the associated attribute's value.
2026
2027         * html/ClassList.cpp: Removed.
2028         * html/ClassList.h: Removed.
2029         Now merged into AttributeDOMTokenList.
2030
2031         * html/DOMSettableTokenList.cpp:
2032         * html/DOMSettableTokenList.h:
2033         Get rid of most of the code as most of the logic is now in
2034         DOMTokenList parent class.
2035
2036         * html/DOMTokenList.cpp:
2037         (WebCore::DOMTokenList::validateToken):
2038         Use a String parameter instead of an AtomicString as this method does
2039         not need the input the be an AtomicString. This avoid atomizing
2040         String unnecessarily.
2041
2042         (WebCore::DOMTokenList::validateTokens):
2043         Use a modern loop.
2044
2045         (WebCore::DOMTokenList::contains):
2046         No longer use containsInternal() virtual function. We can now check
2047         the internal token Vector.
2048
2049         (WebCore::DOMTokenList::add):
2050         Now update the internal Vector. Use a modern loop and try to minimize
2051         Vector capacity reallocation.
2052
2053         (WebCore::DOMTokenList::remove):
2054         Now update the internal Vector.
2055
2056         (WebCore::DOMTokenList::toggle):
2057         Now update the internal Vector and refactor the code so that it is
2058         structured exactly as the algorithm in the specification for
2059         clarity.
2060
2061         (WebCore::DOMTokenList::value):
2062         Now return the result of the ordered set serializer for tokens. This
2063         method is used for:
2064         - The DOMSettableTokenList.value() getter
2065         - The DOMTokenList stringifier
2066         - As attribute value when updating the associated attribute in
2067           AttributeDOMTokenList.
2068
2069         (WebCore::DOMTokenList::setValue):
2070         Update the internal Vector using the algorithm in [2].
2071
2072         * html/DOMTokenList.h:
2073         (WebCore::DOMTokenList::length):
2074         No longer virtual, now returns the size of the internal token Vector.
2075
2076         (WebCore::DOMTokenList::item):
2077         No longer virtual, now returns the token at the given index in the
2078         internal Vector.
2079
2080         * html/HTMLAnchorElement.cpp:
2081         (WebCore::HTMLAnchorElement::relList):
2082         Now return a AttributeDOMTokenList.
2083
2084         * html/HTMLLinkElement.cpp:
2085         (WebCore::HTMLLinkElement::relList):
2086         Now return a AttributeDOMTokenList.
2087
2088         * html/RelList.cpp: Removed.
2089         * html/RelList.h: Removed.
2090         Now merged into AttributeDOMTokenList.
2091
2092 2015-09-11  Chris Dumez  <cdumez@apple.com>
2093
2094         Element.tagName should be upper-case for HTML elements in HTML documents
2095         https://bugs.webkit.org/show_bug.cgi?id=148843
2096         <rdar://problem/22559081>
2097
2098         Reviewed by Ryosuke Niwa.
2099
2100         Element.tagName should be upper-case for HTML elements in HTML documents,
2101         as per the DOM specification:
2102         https://dom.spec.whatwg.org/#dom-element-tagname
2103
2104         Previously, WebKit would fail to upper-case the tagname if the element's
2105         tag had a prefix. This patch corrects this. This aligns our behavior with
2106         Firefox, Chrome and IE.
2107
2108         No new tests, already covered by existing tests.
2109
2110         * html/HTMLElement.cpp:
2111         (WebCore::HTMLElement::nodeName):
2112
2113 2015-09-11  Chris Dumez  <cdumez@apple.com>
2114
2115         document.body = "text" should throw a TypeError, not a HierarchyRequestError
2116         https://bugs.webkit.org/show_bug.cgi?id=149057
2117         <rdar://problem/22567157>
2118
2119         Reviewed by Ryosuke Niwa.
2120
2121         document.body = "text" should throw a TypeError, not a
2122         HierarchyRequestError:
2123         https://html.spec.whatwg.org/multipage/dom.html#dom-document-body
2124
2125         This is because "text" is a DOMString and it cannot be converted into an
2126         HTMLElement?. Therefore, the WebIDL specification says we should throw a
2127         TypeError in this case.
2128
2129         Chrome and Firefox throw the right exception.
2130
2131         No new tests, already covered by existing test.
2132
2133         * dom/Document.idl:
2134
2135 2015-09-11  Andreas Kling  <akling@apple.com>
2136
2137         [JSC] Weak should only accept cell pointees.
2138         <https://webkit.org/b/148955>
2139
2140         Reviewed by Geoffrey Garen.
2141
2142         Update WebCore bindings for the new Weak and Weak-related signatures.
2143
2144         * bindings/js/JSCSSRuleListCustom.cpp:
2145         (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
2146         * bindings/js/JSCSSValueCustom.cpp:
2147         (WebCore::JSCSSValueOwner::isReachableFromOpaqueRoots):
2148         (WebCore::JSCSSValueOwner::finalize):
2149         * bindings/js/JSCallbackData.cpp:
2150         (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
2151         * bindings/js/JSCallbackData.h:
2152         * bindings/js/JSMutationObserverCustom.cpp:
2153         (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
2154         * bindings/js/JSNodeCustom.cpp:
2155         (WebCore::isReachableFromDOM):
2156         (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
2157         * bindings/js/JSNodeListCustom.cpp:
2158         (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
2159         * bindings/js/JSTextTrackCueCustom.cpp:
2160         (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
2161         * bindings/js/WebCoreTypedArrayController.cpp:
2162         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
2163         (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::finalize):
2164         * bindings/js/WebCoreTypedArrayController.h:
2165         * bindings/scripts/CodeGeneratorJS.pm:
2166         (GenerateHeader):
2167         (GenerateImplementation):
2168         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
2169         (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
2170         (WebCore::JSTestActiveDOMObjectOwner::finalize):
2171         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
2172         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
2173         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
2174         (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
2175         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
2176         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
2177         (WebCore::JSTestCustomNamedGetterOwner::isReachableFromOpaqueRoots):
2178         (WebCore::JSTestCustomNamedGetterOwner::finalize):
2179         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
2180         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2181         (WebCore::JSTestEventConstructorOwner::isReachableFromOpaqueRoots):
2182         (WebCore::JSTestEventConstructorOwner::finalize):
2183         * bindings/scripts/test/JS/JSTestEventConstructor.h:
2184         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
2185         (WebCore::JSTestEventTargetOwner::isReachableFromOpaqueRoots):
2186         (WebCore::JSTestEventTargetOwner::finalize):
2187         * bindings/scripts/test/JS/JSTestEventTarget.h:
2188         * bindings/scripts/test/JS/JSTestException.cpp:
2189         (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
2190         (WebCore::JSTestExceptionOwner::finalize):
2191         * bindings/scripts/test/JS/JSTestException.h:
2192         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2193         (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
2194         (WebCore::JSTestGenerateIsReachableOwner::finalize):
2195         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
2196         * bindings/scripts/test/JS/JSTestInterface.cpp:
2197         (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
2198         (WebCore::JSTestInterfaceOwner::finalize):
2199         * bindings/scripts/test/JS/JSTestInterface.h:
2200         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
2201         (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
2202         (WebCore::JSTestMediaQueryListListenerOwner::finalize):
2203         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
2204         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
2205         (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
2206         (WebCore::JSTestNamedConstructorOwner::finalize):
2207         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
2208         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2209         (WebCore::JSTestNondeterministicOwner::isReachableFromOpaqueRoots):
2210         (WebCore::JSTestNondeterministicOwner::finalize):
2211         * bindings/scripts/test/JS/JSTestNondeterministic.h:
2212         * bindings/scripts/test/JS/JSTestObj.cpp:
2213         (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
2214         (WebCore::JSTestObjOwner::finalize):
2215         * bindings/scripts/test/JS/JSTestObj.h:
2216         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
2217         (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
2218         (WebCore::JSTestOverloadedConstructorsOwner::finalize):
2219         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
2220         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
2221         (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
2222         (WebCore::JSTestOverrideBuiltinsOwner::finalize):
2223         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
2224         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
2225         (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
2226         (WebCore::JSTestSerializedScriptValueInterfaceOwner::finalize):
2227         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
2228         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
2229         (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
2230         (WebCore::JSTestTypedefsOwner::finalize):
2231         * bindings/scripts/test/JS/JSTestTypedefs.h:
2232         * bindings/scripts/test/JS/JSattribute.cpp:
2233         (WebCore::JSattributeOwner::isReachableFromOpaqueRoots):
2234         (WebCore::JSattributeOwner::finalize):
2235         * bindings/scripts/test/JS/JSattribute.h:
2236         * bindings/scripts/test/JS/JSreadonly.cpp:
2237         (WebCore::JSreadonlyOwner::isReachableFromOpaqueRoots):
2238         (WebCore::JSreadonlyOwner::finalize):
2239         * bindings/scripts/test/JS/JSreadonly.h:
2240         * bridge/runtime_root.cpp:
2241         (JSC::Bindings::RootObject::finalize):
2242         * bridge/runtime_root.h:
2243
2244 2015-09-10  Chris Fleizach  <cfleizach@apple.com>
2245
2246         AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
2247         https://bugs.webkit.org/show_bug.cgi?id=148891
2248
2249         Reviewed by Alexey Proskuryakov.
2250
2251         Asychronous focus setting DOES work on Yosemite, just not Mavericks.
2252
2253         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2254         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
2255         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
2256
2257 2015-09-10  David Hyatt  <hyatt@apple.com>
2258
2259         [New Block-Inside-Inline Model] Self-collapsing block check needs to account for anonymous inline blocks
2260         https://bugs.webkit.org/show_bug.cgi?id=149042
2261
2262         Reviewed by Dean Jackson.
2263
2264         Added new tests in fast/block/inside-inlines/
2265
2266         * rendering/InlineFlowBox.cpp:
2267         * rendering/InlineFlowBox.h:
2268         (WebCore::InlineFlowBox::anonymousInlineBlock):
2269         Add a new accessor to get the anonymousInlineBlock() for lines that wrap them.
2270
2271         * rendering/RenderBlock.cpp:
2272         (WebCore::RenderBlock::childrenPreventSelfCollapsing):
2273         (WebCore::RenderBlock::isSelfCollapsingBlock):
2274         isSelfCollapsingBlock() now calls a virtual method that checks lines/children called childrenPreventSelfCollapsing.
2275         This lets us farm out the lines check to the derived RenderBlockFlow class.
2276
2277         * rendering/RenderBlock.h:
2278         (WebCore::RenderBlock::childrenPreventSelfCollapsing):
2279         Added new virtual method for checking children.
2280
2281         * rendering/RenderBlockFlow.cpp:
2282         * rendering/RenderBlockFlow.h:
2283         (WebCore::RenderBlockFlow::childrenPreventSelfCollapsing):
2284         Overridden to ensure that blocks can still be self-collapsing if they only contain anonymous inline-block lines that
2285         are also self-collapsing.
2286
2287 2015-09-10  Jinyoung Hur  <hur.ims@navercorp.com>
2288
2289         [WebGL][GLES] bad shaders should not be linked not only for GL but also for GL ES
2290         https://bugs.webkit.org/show_bug.cgi?id=148794
2291
2292         Reviewed by Dean Jackson.
2293
2294         Checking bad shaders, precision matching and varyings packing are all valid for GL ES too.
2295
2296         Test: webgl/1.0.2/conformance/programs/program-test.html
2297
2298         * html/canvas/WebGLRenderingContextBase.cpp:
2299         (WebCore::WebGLRenderingContextBase::linkProgram):
2300
2301 2015-09-10  Jinyoung Hur  <hur.ims@navercorp.com>
2302
2303         Static variables in GraphicsContext3DOpenGLCommon should be avoided because of the race condition
2304         https://bugs.webkit.org/show_bug.cgi?id=148957
2305
2306         Reviewed by Dean Jackson.
2307
2308         There is no guarantee that only one thread calls GraphicsContext3D::compileShader() at a time so it would be 
2309         better to use a thread local storage variable rather than use a static variable.
2310
2311         No new tests. No behavioural changes.
2312
2313         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2314         (WebCore::getCurrentNameHashMapForShader):
2315         (WebCore::setCurrentNameHashMapForShader):
2316         (WebCore::nameHashForShader):
2317         (WebCore::GraphicsContext3D::compileShader):
2318         (WebCore::GraphicsContext3D::mappedSymbolName):
2319
2320 2015-09-10  Chris Dumez  <cdumez@apple.com>
2321
2322         Node.appendChild(null) / replaceChild(null, null) / removeChild(null) / insertBefore(null, ref) should throw a TypeError
2323         https://bugs.webkit.org/show_bug.cgi?id=148971
2324         <rdar://problem/22560883>
2325         <rdar://problem/22559225>
2326
2327         Reviewed by Ryosuke Niwa.
2328
2329         Node.appendChild(null) / replaceChild(null, null) / removeChild(null)
2330         and insertBefore(null, ref) should throw a TypeError instead of a
2331         NotFoundError, as per the specification:
2332         https://dom.spec.whatwg.org/#node
2333
2334         The parameters are not nullable so the Web IDL specification says
2335         we should throw a TypeError in this case.
2336
2337         This patch moves the null-checking from ContainerNode to the methods
2338         on Node. The null-checking is supposed to be done by the bindings code
2339         but our generator currently does not support this so we do the null
2340         checking as close to the bindings as possible. The bindings code is
2341         calling the methods on Node. This also makes sure we throw a TypeError
2342         for null-argument when the Node is not a ContainerNode. For e.g.
2343         Text.appendChild(null) should throw a TypeError too.
2344
2345         The methods on ContainerNode now take references insteaad of pointer
2346         parameters now that the null-checking is done at the call site in
2347         Node. This lead to a lot of code update as those methods are used
2348         a lot throughout the code base.
2349
2350         No new tests, already covered by pre-existing layout tests.
2351
2352 2015-09-10  Daniel Bates  <dabates@apple.com>
2353
2354         Write a test to ensure we don't regress processing of tasks when page defers loading
2355         https://bugs.webkit.org/show_bug.cgi?id=135882
2356         <rdar://problem/22550497>
2357
2358         Reviewed by Darin Adler.
2359
2360         Towards adding a test for <https://bugs.webkit.org/show_bug.cgi?id=135688>, add a window.internals
2361         function, setPageDefersLoading, to enable and disable whether the page defers loading.
2362
2363         Test: storage/websql/success-callback-when-page-defers-loading.html
2364
2365         * testing/Internals.cpp:
2366         (WebCore::Internals::resetToConsistentState): Reset defers loading for the page to false.
2367         (WebCore::Internals::setPageDefersLoading): Added.
2368         * testing/Internals.h:
2369         * testing/Internals.idl: Added IDL declaration setPageDefersLoading.
2370
2371 2015-09-10  Sergio Villar Senin  <svillar@igalia.com>
2372
2373         min-width/height should default to auto for flexbox items
2374         https://bugs.webkit.org/show_bug.cgi?id=146020
2375
2376         Reviewed by David Hyatt.
2377
2378         Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
2379
2380         As specified here
2381         http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
2382         value of min-{width|height} is auto for flex items.
2383
2384         In case this patch breaks any website (as it's changing the
2385         default value of those properties) the fix is likely to add:
2386
2387         min-width: 0;
2388         min-height: 0;
2389
2390         to any relevant flexitems.
2391
2392         Test: css3/flexbox/min-size-auto.html
2393
2394         * css/CSSComputedStyleDeclaration.cpp:
2395         (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
2396         (WebCore::ComputedStyleExtractor::propertyValue): Return auto
2397         for flex items if min-width/height is auto.
2398         * css/CSSParser.cpp:
2399         (WebCore::CSSParser::parseValue):
2400         * html/shadow/SliderThumbElement.cpp:
2401         * rendering/RenderBox.cpp:
2402         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
2403         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
2404         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
2405         (WebCore::RenderBox::computeLogicalHeight):
2406         (WebCore::RenderBox::computeLogicalHeightUsing):
2407         (WebCore::RenderBox::computeContentLogicalHeight):
2408         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
2409         (WebCore::RenderBox::computeReplacedLogicalWidth):
2410         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
2411         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
2412         (WebCore::RenderBox::computeReplacedLogicalHeight):
2413         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
2414         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2415         (WebCore::RenderBox::availableLogicalHeightUsing):
2416         (WebCore::RenderBox::computePositionedLogicalWidth):
2417         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2418         (WebCore::RenderBox::computePositionedLogicalHeight):
2419         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2420         * rendering/RenderBox.h:
2421         * rendering/RenderButton.h:
2422         * rendering/RenderFlexibleBox.cpp:
2423         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2424         (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
2425         (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
2426         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2427         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
2428         * rendering/RenderFlexibleBox.h:
2429         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
2430         * rendering/RenderFullScreen.h:
2431         * rendering/RenderGrid.cpp:
2432         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2433         * rendering/RenderMediaControlElements.h:
2434         * rendering/RenderMenuList.cpp:
2435         (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
2436         the min-width explicitly.
2437         * rendering/RenderMenuList.h:
2438         * rendering/RenderMultiColumnSet.cpp:
2439         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
2440         * rendering/RenderNamedFlowFragment.cpp:
2441         (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
2442         * rendering/RenderReplaced.cpp:
2443         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
2444         (WebCore::RenderReplaced::computeReplacedLogicalHeight):
2445         * rendering/RenderSlider.h:
2446         * rendering/RenderTextControl.h:
2447         * rendering/RenderTextControlSingleLine.cpp:
2448         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
2449         the min-width explicitly.
2450         * rendering/mathml/RenderMathMLBlock.h:
2451         * rendering/style/RenderStyle.h:
2452
2453 2015-09-10  ChangSeok Oh  <changseok.oh@collabora.com>
2454
2455         [GTK] Volume bar is broken
2456         https://bugs.webkit.org/show_bug.cgi?id=145639
2457
2458         Reviewed by Philippe Normand.
2459
2460         The ControlPart enum values' order has mismatched the one of values in CSSValueKeywords.in
2461         after r180965. The MediaVolumeSliderPart should be prior to the MediaVolumeSliderContainerpart.
2462
2463         Tests: media/click-volume-bar-not-pausing.html
2464                media/volume-bar-empty-when-muted.html
2465
2466         * platform/ThemeTypes.h:
2467
2468 2015-09-09  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
2469
2470         Remove all uses of PassRefPtr in WebCore/svg
2471         https://bugs.webkit.org/show_bug.cgi?id=148472
2472
2473         Reviewed by Darin Adler.
2474
2475         Clean up all uses of PassRefPtr in WebCore/svg.
2476
2477         * Modules/webaudio/AudioScheduledSourceNode.cpp:
2478         (WebCore::AudioScheduledSourceNode::addEventListener):
2479         * Modules/webaudio/AudioScheduledSourceNode.h:
2480         * Modules/webaudio/ScriptProcessorNode.cpp:
2481         (WebCore::ScriptProcessorNode::addEventListener):
2482         * Modules/webaudio/ScriptProcessorNode.h:
2483         * dom/EventListenerMap.cpp:
2484         (WebCore::copyListenersNotCreatedFromMarkupToTarget):
2485         * dom/EventTarget.cpp:
2486         (WebCore::EventTarget::addEventListener):
2487         * dom/EventTarget.h:
2488         * dom/MessagePort.cpp:
2489         (WebCore::MessagePort::addEventListener):
2490         * dom/MessagePort.h:
2491         * dom/Node.cpp:
2492         (WebCore::tryAddEventListener):
2493         (WebCore::Node::addEventListener):
2494         * dom/Node.h:
2495         * html/HTMLMediaElement.cpp:
2496         (WebCore::HTMLMediaElement::addEventListener):
2497         * html/HTMLMediaElement.h:
2498         * html/ImageDocument.cpp:
2499         (WebCore::ImageDocument::createDocumentStructure):
2500         * html/shadow/MediaControlsApple.cpp:
2501         (WebCore::MediaControlsApple::showClosedCaptionTrackList):
2502         * page/DOMWindow.cpp:
2503         (WebCore::DOMWindow::addEventListener):
2504         * page/DOMWindow.h:
2505         * rendering/svg/RenderSVGResourceFilter.cpp:
2506         (WebCore::RenderSVGResourceFilter::buildPrimitives):
2507         * svg/SVGElement.cpp:
2508         (WebCore::SVGElement::addEventListener):
2509         * svg/SVGElement.h:
2510         * svg/SVGPathElement.cpp:
2511         (WebCore::SVGPathElement::pathSegListChanged):
2512         * svg/SVGPathUtilities.cpp:
2513         (WebCore::appendSVGPathByteStreamFromSVGPathSeg):
2514         * svg/SVGPathUtilities.h:
2515         * svg/SVGTRefElement.cpp:
2516         (WebCore::SVGTRefTargetEventListener::attach):
2517         (WebCore::SVGTRefElement::buildPendingResource):
2518         * svg/graphics/filters/SVGFilterBuilder.cpp:
2519         (WebCore::SVGFilterBuilder::appendEffectToEffectReferences):
2520         * svg/graphics/filters/SVGFilterBuilder.h:
2521
2522 2015-09-09  Dewei Zhu  <dewei_zhu@apple.com>
2523
2524         Document.characterSet should return "UTF-8" instead of null by default.
2525         https://bugs.webkit.org/show_bug.cgi?id=148810
2526         <rdar://problem/22548727>
2527
2528         Reviewed by Ryosuke Niwa.
2529
2530         Document encoding should default to "UTF-8" as is specified in
2531         https://dom.spec.whatwg.org/#concept-document-encoding. This behavior
2532         is consistent with Firefox and Chrome.
2533
2534         * dom/Document.cpp:
2535         (WebCore::Document::encoding): Returns nullAtom according to declearation.
2536         (WebCore::Document::characterSetForBindings): Returns "UTF-8" by default instead of null String.
2537         * dom/Document.h:
2538         (WebCore::Document::charset):
2539         (WebCore::Document::inputEncoding): Deleted.
2540         (WebCore::Document::characterSet): Deleted.
2541         * dom/Document.idl:
2542         * dom/InlineStyleSheetOwner.cpp:
2543         (WebCore::InlineStyleSheetOwner::createSheet):
2544         * inspector/InspectorPageAgent.cpp:
2545         (WebCore::InspectorPageAgent::mainResourceContent):
2546         * inspector/InspectorResourceAgent.cpp:
2547         (WebCore::InspectorResourceAgent::didFinishLoading):
2548         (WebCore::InspectorResourceAgent::didFailLoading):
2549         * loader/DocumentWriter.cpp:
2550         (WebCore::DocumentWriter::createDecoderIfNeeded):
2551         * loader/FormSubmission.cpp:
2552         (WebCore::encodingFromAcceptCharset):
2553
2554 2015-09-09  Benjamin Poulain  <bpoulain@apple.com>
2555
2556         CSS general sibling selectors does not work without CSS JIT
2557         https://bugs.webkit.org/show_bug.cgi?id=148987
2558         rdar://problem/22559860
2559
2560         Reviewed by Andreas Kling.
2561
2562         When traversing with the indirect adjacent combinator, SelectorChecker
2563         was not setting the style invalidation flag on the right element.
2564
2565         Tests: fast/css/indirect-adjacent-style-invalidation-1.html
2566                fast/css/indirect-adjacent-style-invalidation-2.html
2567                fast/css/indirect-adjacent-style-invalidation-3.html
2568
2569         * css/SelectorChecker.cpp:
2570         (WebCore::SelectorChecker::matchRecursively):
2571
2572 2015-09-09  Joseph Pecoraro  <pecoraro@apple.com>
2573
2574         Web Inspector: Remove unused InspectorFrontendHost methods
2575         https://bugs.webkit.org/show_bug.cgi?id=149013
2576
2577         Reviewed by Brian Burg.
2578
2579         * inspector/InspectorFrontendHost.cpp:
2580         (WebCore::InspectorFrontendHost::canSaveAs): Deleted.
2581         (WebCore::InspectorFrontendHost::canInspectWorkers): Deleted.
2582         * inspector/InspectorFrontendHost.h:
2583         * inspector/InspectorFrontendHost.idl:
2584
2585 2015-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
2586
2587         ASSERTION FAILED: typesettingFeatures & (Kerning | Ligatures) in WebCore::applyFontTransforms
2588         https://bugs.webkit.org/show_bug.cgi?id=146194
2589
2590         Reviewed by Dean Jackson.
2591
2592         We might trigger shaping even if the author hasn't specified kerning or ligatures.
2593
2594         Test: fast/text/softbank-emoji-no-ligatures-nor-kerning.html
2595
2596         * platform/graphics/WidthIterator.cpp:
2597         (WebCore::isSoftBankEmoji):
2598         (WebCore::WidthIterator::applyFontTransforms):
2599         (WebCore::WidthIterator::advanceInternal):
2600         (WebCore::applyFontTransforms): Deleted.
2601         * platform/graphics/WidthIterator.h:
2602
2603 2015-09-09  Chris Dumez  <cdumez@apple.com>
2604
2605         Setting document.title when there is no title and no head element should no nothing
2606         https://bugs.webkit.org/show_bug.cgi?id=149005
2607         <rdar://problem/22567524>
2608
2609         Reviewed by Ryosuke Niwa.
2610
2611         Setting document.title when there is no title element and no head
2612         element should no nothing:
2613         - https://html.spec.whatwg.org/multipage/dom.html#document.title
2614
2615         Firefox and Chrome comply with the specification. However, WebKit
2616         was returning the updated title when querying document.title after
2617         setting it.
2618
2619         No new tests, covered by existing tests.
2620
2621         * dom/Document.cpp:
2622         (WebCore::Document::setTitle):
2623
2624 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
2625
2626         [css-grid] Percentage columns shouldn't include border and padding
2627         https://bugs.webkit.org/show_bug.cgi?id=148978
2628
2629         Reviewed by Sergio Villar Senin.
2630
2631         Subtract border and padding when we're calculating the breadth of the
2632         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
2633
2634         Added test to check the behavior for both columns and rows.
2635
2636         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
2637
2638         * rendering/RenderGrid.cpp:
2639         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2640
2641 2015-09-09  Commit Queue  <commit-queue@webkit.org>
2642
2643         Unreviewed, rolling out r189536 and r189538.
2644         https://bugs.webkit.org/show_bug.cgi?id=149002
2645
2646         broke tests on mac (Requested by alexchristensen on #webkit).
2647
2648         Reverted changesets:
2649
2650         "min-width/height should default to auto for flexbox items"
2651         https://bugs.webkit.org/show_bug.cgi?id=146020
2652         http://trac.webkit.org/changeset/189536
2653
2654         "[css-grid] Percentage columns shouldn't include border and
2655         padding"
2656         https://bugs.webkit.org/show_bug.cgi?id=148978
2657         http://trac.webkit.org/changeset/189538
2658
2659 2015-09-08  David Hyatt  <hyatt@apple.com>
2660
2661         REGRESSION: Inline-block baseline is wrong when zero-width replaced child is present
2662         https://bugs.webkit.org/show_bug.cgi?id=147452
2663         rdar://problem/21943074
2664
2665         Reviewed by Myles Maxfield.
2666
2667         Added new test in fast/inline-block
2668
2669         Treat zero width replaced elements the same as replaced elements with width. Instead of
2670         clearing floats based off having no committed width, we instead track both committed
2671         width and committed replaced objects. We do this with two new booleans in LineWidth
2672         so that we know when we have uncomitted and committed replaced objects.
2673
2674         * rendering/line/BreakingContext.h:
2675         (WebCore::BreakingContext::handleReplaced):
2676         (WebCore::BreakingContext::handleText):
2677         (WebCore::BreakingContext::canBreakAtThisPosition):
2678         (WebCore::BreakingContext::commitAndUpdateLineBreakIfNeeded):
2679         * rendering/line/LineWidth.cpp:
2680         (WebCore::LineWidth::LineWidth):
2681         (WebCore::LineWidth::commit):
2682         (WebCore::LineWidth::applyOverhang):
2683         * rendering/line/LineWidth.h:
2684         (WebCore::LineWidth::committedWidth):
2685         (WebCore::LineWidth::availableWidth):
2686         (WebCore::LineWidth::logicalLeftOffset):
2687         (WebCore::LineWidth::hasCommitted):
2688         (WebCore::LineWidth::addUncommittedWidth):
2689         (WebCore::LineWidth::addUncommittedReplacedWidth):
2690
2691 2015-09-09  Antti Koivisto  <antti@apple.com>
2692
2693         Split mixed font GlyphPage functionality to separate class
2694         https://bugs.webkit.org/show_bug.cgi?id=148965
2695
2696         Reviewed by Myles Maxfield.
2697
2698         Currently GlyphPage class is used for both immutable single font case (in Font) and
2699         for caching mixed font mappings (in FontCascadeFonts). It is cleaner to use separate
2700         classed for these cases. This will also make future improvements easier.
2701
2702         * platform/graphics/Font.cpp:
2703         (WebCore::Font::~Font):
2704         (WebCore::fillGlyphPage):
2705         (WebCore::createAndFillGlyphPage):
2706         (WebCore::Font::glyphPage):
2707         (WebCore::Font::glyphForCharacter):
2708         (WebCore::Font::glyphDataForCharacter):
2709         * platform/graphics/Font.h:
2710         * platform/graphics/FontCascadeFonts.cpp:
2711         (WebCore::MixedFontGlyphPage::MixedFontGlyphPage):
2712         (WebCore::MixedFontGlyphPage::glyphDataForCharacter):
2713         (WebCore::MixedFontGlyphPage::setGlyphDataForCharacter):
2714         (WebCore::MixedFontGlyphPage::setGlyphDataForIndex):
2715
2716             Mixed font pages are now an implementation detail of FontCascadeFonts.
2717
2718         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::glyphDataForCharacter):
2719         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setGlyphDataForCharacter):
2720         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::setSingleFontPage):
2721
2722             Cache entry is either shared single font GlyphPage or mutable MixedFontGlyphPage.
2723
2724         (WebCore::FontCascadeFonts::FontCascadeFonts):
2725         (WebCore::FontCascadeFonts::glyphDataForCharacter):
2726         (WebCore::FontCascadeFonts::pruneSystemFallbacks):
2727         * platform/graphics/FontCascadeFonts.h:
2728         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isNull):
2729         (WebCore::FontCascadeFonts::GlyphPageCacheEntry::isMixedFont):
2730         * platform/graphics/GlyphPage.h:
2731
2732             GlyphPage is now for single font mappings only.
2733             Use regular allocation instead of variable size tricks.
2734             It is always immutable after initialization (though currently a setter is still needed).
2735
2736         (WebCore::GlyphPage::create):
2737         (WebCore::GlyphPage::~GlyphPage):
2738         (WebCore::GlyphPage::count):
2739         (WebCore::GlyphPage::indexForCharacter):
2740         (WebCore::GlyphPage::glyphDataForCharacter):
2741         (WebCore::GlyphPage::glyphForCharacter):
2742         (WebCore::GlyphPage::glyphDataForIndex):
2743         (WebCore::GlyphPage::glyphForIndex):
2744         (WebCore::GlyphPage::setGlyphForIndex):
2745         (WebCore::GlyphPage::font):
2746         (WebCore::GlyphPage::GlyphPage):
2747         (WebCore::GlyphPage::createForMixedFonts): Deleted.
2748         (WebCore::GlyphPage::createCopyForMixedFonts): Deleted.
2749         (WebCore::GlyphPage::createForSingleFont): Deleted.
2750         (WebCore::GlyphPage::isImmutable): Deleted.
2751         (WebCore::GlyphPage::setImmutable): Deleted.
2752         (WebCore::GlyphPage::glyphAt): Deleted.
2753         (WebCore::GlyphPage::fontForCharacter): Deleted.
2754         (WebCore::GlyphPage::setGlyphDataForCharacter): Deleted.
2755         (WebCore::GlyphPage::setGlyphDataForIndex): Deleted.
2756         (WebCore::GlyphPage::hasPerGlyphFontData): Deleted.
2757         * platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp:
2758         (WebCore::GlyphPage::fill):
2759         * platform/graphics/mac/GlyphPageMac.cpp:
2760         (WebCore::GlyphPage::fill):
2761         * platform/graphics/opentype/OpenTypeVerticalData.cpp:
2762         (WebCore::OpenTypeVerticalData::substituteWithVerticalGlyphs):
2763         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
2764         (WebCore::GlyphPage::fill):
2765         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
2766         (WebCore::GlyphPage::fill):
2767         * svg/SVGFontData.cpp:
2768         (WebCore::SVGFontData::applySVGGlyphSelection):
2769         (WebCore::SVGFontData::fillSVGGlyphPage):
2770         (WebCore::SVGFontData::fillBMPGlyphs):
2771         (WebCore::SVGFontData::fillNonBMPGlyphs):
2772         * svg/SVGFontData.h:
2773         (WebCore::SVGFontData::verticalAdvanceY):
2774
2775 2015-09-09  Manuel Rego Casasnovas  <rego@igalia.com>
2776
2777         [css-grid] Percentage columns shouldn't include border and padding
2778         https://bugs.webkit.org/show_bug.cgi?id=148978
2779
2780         Reviewed by Sergio Villar Senin.
2781
2782         Subtract border and padding when we're calculating the breadth of the
2783         columns in LayoutGrid::computeUsedBreadthOfSpecifiedLength().
2784
2785         Added test to check the behavior for both columns and rows.
2786
2787         Test: fast/css-grid-layout/grid-percent-track-margin-border-padding.html
2788
2789         * rendering/RenderGrid.cpp:
2790         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2791
2792 2015-09-09  Chris Dumez  <cdumez@apple.com>
2793
2794         HTMLTableElement.tHead / tFoot / caption should be nullable
2795         https://bugs.webkit.org/show_bug.cgi?id=148991
2796
2797         Reviewed by Ryosuke Niwa.
2798
2799         According to the specification, HTMLTableElement.tHead / tFoot / caption
2800         should be nullable:
2801         https://html.spec.whatwg.org/multipage/tables.html#htmltableelement
2802
2803         Upon assigning null, we are supposed to remove the existing tHead / tFoot
2804         / caption element. However, we had a bug causing us to throw an exception
2805         after removing the element. This is because we would try to insert a null
2806         element and ContainerNode::insertBefore() throws when doing so.
2807
2808         Also, as per the specification, setting tHead / tFoot to something else
2809         than a thead / tfoot element should throw a HierarchyRequestError:
2810         https://html.spec.whatwg.org/multipage/tables.html#dom-table-thead
2811         https://html.spec.whatwg.org/multipage/tables.html#dom-table-tfoot
2812
2813         Previously, WebKit did not check the tag and was happy inserting the
2814         element as long as it was an HTMLTableSectionElement. This means that
2815         you could set a tfoot by assigning table.tHead.
2816
2817         This patch corrects both bugs and adds test coverage for it.
2818
2819         Test: fast/dom/HTMLTableElement/nullable-attributes.html
2820
2821         * html/HTMLTableElement.cpp:
2822         (WebCore::HTMLTableElement::setCaption):
2823         Only call insertBefore() if newCaption is not null as insertBefore()
2824         will throw an exception otherwise.
2825
2826         (WebCore::HTMLTableElement::setTHead):
2827         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
2828           null or a <thead> element, as per the specification.
2829         - Only call insertBefore() if newHead is not null as insertBefore()
2830           will throw an exception otherwise.
2831
2832         (WebCore::HTMLTableElement::setTFoot):
2833         - Throw a HierarchyRequestError if the HTMLTableSectionElement is not
2834           null or a <tfoot> element, as per the specification.
2835         - Only call insertBefore() if newFoot is not null as insertBefore()
2836           will throw an exception otherwise.
2837
2838         * html/HTMLTableElement.idl:
2839         Use [StrictTypeChecking] for these 3 attributes so that the bindings
2840         will throw a TypeError if the JS tries to assign a value with the
2841         wrong type. When the implementation is called with null, we now know
2842         this is because the JS assigned null (and not an invalid value).
2843         This is important as assigning null is valid since those attributes
2844         are nullable.
2845
2846 2015-06-26  Sergio Villar Senin  <svillar@igalia.com>
2847
2848         min-width/height should default to auto for flexbox items
2849         https://bugs.webkit.org/show_bug.cgi?id=146020
2850
2851         Reviewed by David Hyatt.
2852
2853         Based on Blink's r193665, r194062, r194887 and r195930 by <cbiesinger@chromium.org>.
2854
2855         As specified here
2856         http://dev.w3.org/csswg/css-flexbox/#min-size-auto the default
2857         value of min-{width|height} is auto for flex items.
2858
2859         In case this patch breaks any website (as it's changing the
2860         default value of those properties) the fix is likely to add:
2861
2862         min-width: 0;
2863         min-height: 0;
2864
2865         to any relevant flexitems.
2866
2867         Test: css3/flexbox/min-size-auto.html
2868
2869         * css/CSSComputedStyleDeclaration.cpp:
2870         (WebCore::isFlexOrGrid): New helper method to identify grids and flexs.
2871         (WebCore::ComputedStyleExtractor::propertyValue): Return auto
2872         for flex items if min-width/height is auto.
2873         * css/CSSParser.cpp:
2874         (WebCore::CSSParser::parseValue):
2875         * html/shadow/SliderThumbElement.cpp:
2876         * rendering/RenderBox.cpp:
2877         (WebCore::RenderBox::constrainLogicalHeightByMinMax):
2878         (WebCore::RenderBox::constrainContentBoxLogicalHeightByMinMax):
2879         (WebCore::RenderBox::computeLogicalWidthInRegionUsing):
2880         (WebCore::RenderBox::computeLogicalHeight):
2881         (WebCore::RenderBox::computeLogicalHeightUsing):
2882         (WebCore::RenderBox::computeContentLogicalHeight):
2883         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
2884         (WebCore::RenderBox::computeReplacedLogicalWidth):
2885         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
2886         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
2887         (WebCore::RenderBox::computeReplacedLogicalHeight):
2888         (WebCore::RenderBox::computeReplacedLogicalHeightRespectingMinMaxHeight):
2889         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
2890         (WebCore::RenderBox::availableLogicalHeightUsing):
2891         (WebCore::RenderBox::computePositionedLogicalWidth):
2892         (WebCore::RenderBox::computePositionedLogicalWidthUsing):
2893         (WebCore::RenderBox::computePositionedLogicalHeight):
2894         (WebCore::RenderBox::computePositionedLogicalHeightUsing):
2895         * rendering/RenderBox.h:
2896         * rendering/RenderButton.h:
2897         * rendering/RenderFlexibleBox.cpp:
2898         (WebCore::RenderFlexibleBox::computeMainAxisExtentForChild):
2899         (WebCore::RenderFlexibleBox::mainAxisExtentIsDefinite):
2900         (WebCore::RenderFlexibleBox::mainAxisLengthIsIndefinite):
2901         (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):
2902         (WebCore::RenderFlexibleBox::mainAxisOverflowForChild):
2903         * rendering/RenderFlexibleBox.h:
2904         (WebCore::RenderFlexibleBox::isFlexibleBoxImpl):
2905         * rendering/RenderFullScreen.h:
2906         * rendering/RenderGrid.cpp:
2907         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
2908         * rendering/RenderMediaControlElements.h:
2909         * rendering/RenderMenuList.cpp:
2910         (WebCore::RenderMenuList::adjustInnerStyle): Do not longer set
2911         the min-width explicitly.
2912         * rendering/RenderMenuList.h:
2913         * rendering/RenderMultiColumnSet.cpp:
2914         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
2915         * rendering/RenderNamedFlowFragment.cpp:
2916         (WebCore::RenderNamedFlowFragment::maxPageLogicalHeight):
2917         * rendering/RenderReplaced.cpp:
2918         (WebCore::RenderReplaced::computeReplacedLogicalWidth):
2919         (WebCore::RenderReplaced::computeReplacedLogicalHeight):
2920         * rendering/RenderSlider.h:
2921         * rendering/RenderTextControl.h:
2922         * rendering/RenderTextControlSingleLine.cpp:
2923         (WebCore::RenderTextControlSingleLine::createInnerBlockStyle): Do not longer set
2924         the min-width explicitly.
2925         * rendering/mathml/RenderMathMLBlock.h:
2926         * rendering/style/RenderStyle.h:
2927
2928 2015-09-08  Joseph Pecoraro  <pecoraro@apple.com>
2929
2930         Web Inspector: No need for [Custom] Implementation of some InspectorFrontendHost methods
2931         https://bugs.webkit.org/show_bug.cgi?id=148990
2932
2933         Reviewed by Timothy Hatcher.
2934
2935         * bindings/js/JSInspectorFrontendHostCustom.cpp:
2936         (WebCore::JSInspectorFrontendHost::platform): Deleted.
2937         (WebCore::JSInspectorFrontendHost::port): Deleted.
2938         * inspector/InspectorFrontendHost.cpp:
2939         (WebCore::InspectorFrontendHost::platform):
2940         (WebCore::InspectorFrontendHost::port):
2941         * inspector/InspectorFrontendHost.h:
2942         * inspector/InspectorFrontendHost.idl:
2943         Uncustomize a few basic functions.
2944
2945 2015-09-08  Michael Catanzaro  <mcatanzaro@igalia.com>
2946
2947         Crash when WebCore::SQLiteFileSystem::openDatabase is called from multiple threads
2948         https://bugs.webkit.org/show_bug.cgi?id=143245
2949
2950         Reviewed by Darin Adler.
2951
2952         sqlite3_initialize is documented to be thread-safe, and to be called automatically by the
2953         library when needed, so applications should never need to call it directly. The problem is,
2954         it's not thread-safe: we have documented instances of GNOME Builder, Devhelp, Epiphany, and
2955         cinnamon-screensaver crashing when sqlite3_initialize is called simultaneously in separate
2956         threads (usually inside sqlite3_open). So call it manually, guarded using std::call_once, to
2957         make sure that the library is fully initialized before the first call to sqlite3_open. It's
2958         a good idea to do this regardless, because the documentation says it could be required in
2959         a future release of SQLite. (Though the use of std::call_once should not be needed, and is
2960         only used to attempt to work around the crashes.)
2961
2962         This is a workaround for an SQLite bug that might have been fixed upstream, but the SQLite
2963         developers are not really confident in the thread-safety of this function, and have advised
2964         that we carry the workaround. Seems like a good idea.
2965
2966         * platform/sql/SQLiteDatabase.cpp:
2967         (WebCore::SQLiteDatabase::SQLiteDatabase):
2968
2969 2015-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
2970
2971         Unify symbolTablePut in JSLexicalEnvironment and JSSymbolTableObject
2972         https://bugs.webkit.org/show_bug.cgi?id=148783
2973
2974         Reviewed by Geoffrey Garen.
2975
2976         No behavior change.
2977
2978         * bindings/js/JSDOMWindowBase.cpp:
2979         (WebCore::JSDOMWindowBase::updateDocument):
2980
2981 2015-09-08  Brian Burg  <bburg@apple.com>
2982
2983         Several inspector-protocol tests are flaky with GuardMalloc
2984         https://bugs.webkit.org/show_bug.cgi?id=136715
2985
2986         Reviewed by Joseph Pecoraro.
2987
2988         Sometimes, the async dispatch task can outlive its owning frontend client.
2989         To avoid problems, make it refcounted instead and add a protector reference.
2990
2991         No new tests, covered by existing tests.
2992
2993         * inspector/InspectorFrontendClientLocal.cpp:
2994         (WebCore::InspectorBackendDispatchTask::create):
2995         (WebCore::InspectorBackendDispatchTask::dispatch):
2996         (WebCore::InspectorBackendDispatchTask::reset):
2997         (WebCore::InspectorBackendDispatchTask::timerFired):
2998         (WebCore::InspectorBackendDispatchTask::InspectorBackendDispatchTask):
2999         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
3000         (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
3001         * inspector/InspectorFrontendClientLocal.h:
3002
3003 2015-09-08  Chris Dumez  <cdumez@apple.com>
3004
3005         new Comment(undefined) / new Text(undefined) should use default's empty string
3006         https://bugs.webkit.org/show_bug.cgi?id=148973
3007         <rdar://problem/22548042>
3008
3009         Reviewed by Ryosuke Niwa.
3010
3011         new Comment(undefined) / new Text(undefined) should use default's empty string instead of converting
3012         undefined to the "undefined" string:
3013         - https://dom.spec.whatwg.org/#interface-comment (parameter is optional, default value is empty String)
3014         - https://dom.spec.whatwg.org/#text (ditto)
3015
3016         undefined should be treated as if the parameter is missing, in the case the parameter is optional, as
3017         per the Web IDL specification. This patch aligns WebKit's behavior with the specification and the
3018         behavior of Firefox and Chrome.
3019
3020         No new tests, already covered by existing tests.
3021
3022         * bindings/scripts/CodeGeneratorJS.pm:
3023         (GenerateParametersCheck):
3024         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3025         (WebCore::JSTestNamedConstructorNamedConstructor::constructJSTestNamedConstructor):
3026         * bindings/scripts/test/JS/JSTestObj.cpp:
3027         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringIsNullString):
3028
3029 2015-09-08  Chris Dumez  <cdumez@apple.com>
3030
3031         document.importNode(node, deep): deep's default value should be false
3032         https://bugs.webkit.org/show_bug.cgi?id=148959
3033         <rdar://problem/22558915>
3034
3035         Reviewed by Alexey Proskuryakov.
3036
3037         Switch deep parameter's default value for document.importNode() to
3038         false, as per the latest DOM specification:
3039         - https://dom.spec.whatwg.org/#interface-document
3040         - https://dom.spec.whatwg.org/#dom-document-importnode
3041
3042         Firefox and Chrome follow the specification. However, WebKit was using
3043         "true" for deep's default value.
3044
3045         No new tests, already covered by:
3046         imported/w3c/web-platform-tests/dom/nodes/Document-importNode.html
3047
3048         * dom/Document.h:
3049         (WebCore::Document::importNode):
3050
3051 2015-09-08  Per Arne Vollan  <peavo@outlook.com>
3052
3053         [Win][HighDPI] Video window placement is incorrect.
3054         https://bugs.webkit.org/show_bug.cgi?id=148954
3055
3056         Reviewed by Alex Christensen.
3057
3058         We need to scale window dimensions with device scale factor.
3059
3060         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
3061         (WebCore::MediaPlayerPrivateMediaFoundation::setSize):
3062
3063 2015-09-08  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3064
3065         Reduce uses of PassRefPtr in fileapi
3066         https://bugs.webkit.org/show_bug.cgi?id=148952
3067
3068         Reviewed by Andreas Kling.
3069
3070         Remove all uses of PassRefPtr in return type. Argument uses of PassRefPtr will be
3071         removed in near future.
3072
3073         * fileapi/FileError.h:
3074         (WebCore::FileError::create):
3075         * fileapi/FileReader.cpp:
3076         (WebCore::FileReader::arrayBufferResult):
3077         * fileapi/FileReader.h:
3078         * fileapi/FileReaderLoader.cpp:
3079         (WebCore::FileReaderLoader::arrayBufferResult):
3080         * fileapi/FileReaderLoader.h:
3081         * fileapi/FileReaderSync.cpp:
3082         (WebCore::FileReaderSync::readAsArrayBuffer):
3083         * fileapi/FileReaderSync.h:
3084         * fileapi/ThreadableBlobRegistry.cpp:
3085         (WebCore::ThreadableBlobRegistry::getCachedOrigin):
3086         * fileapi/ThreadableBlobRegistry.h:
3087
3088 2015-09-07  Chris Fleizach  <cfleizach@apple.com>
3089
3090         AX: Mavericks: Text cursor does not move along with VoiceOver cursor for text fields
3091         https://bugs.webkit.org/show_bug.cgi?id=148891
3092
3093         Reviewed by Mario Sanchez Prada.
3094
3095         Undo the asynchronous dispatch of accessibility setting values on pre El Capitan machines
3096         because it causes focus to not sync correctly.
3097
3098         Test: accessibility/mac/focus-moves-cursor.html
3099
3100         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3101         (-[WebAccessibilityObjectWrapper accessibilitySetValue:forAttribute:]):
3102         (-[WebAccessibilityObjectWrapper _accessibilitySetValue:forAttribute:]):
3103
3104 2015-09-07  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3105
3106         [CoordinatedGraphics] Remove ScrollingStateScrollingNodeCoordinatedGraphics.cpp
3107         https://bugs.webkit.org/show_bug.cgi?id=148931
3108
3109         Reviewed by Csaba Osztrogonác.
3110
3111         ScrollingStateScrollingNodeCoordinatedGraphics.cpp implements nothing. Removed it.
3112
3113         * PlatformEfl.cmake:
3114         * PlatformGTK.cmake:
3115         * WebCore.vcxproj/WebCore.vcxproj:
3116         * WebCore.vcxproj/WebCore.vcxproj.filters:
3117         * page/scrolling/coordinatedgraphics/ScrollingStateScrollingNodeCoordinatedGraphics.cpp: Removed.
3118
3119 2015-09-07  Daniel Bates  <dabates@apple.com>
3120
3121         ASSERT_WITH_SECURITY_IMPLICATION in WebCore::DocumentOrderedMap::get(); update form
3122         association after subtree insertion
3123         https://bugs.webkit.org/show_bug.cgi?id=148919
3124         <rdar://problem/21868036>
3125
3126         Reviewed by Andy Estes.
3127
3128         Currently we update the form association of a form control upon insertion into
3129         the document. Instead we should update the form association of a form control
3130         after its containing subtree is inserted into the document to avoid an assertion
3131         failure when the containing subtree has an element whose id is identical to both
3132         the id of some other element in the document and the name of the form referenced
3133         by the inserted form control.
3134
3135         Tests: fast/forms/update-form-owner-in-moved-subtree-assertion-failure-2.html
3136                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-3.html
3137                fast/forms/update-form-owner-in-moved-subtree-assertion-failure-4.html
3138                fast/forms/update-form-owner-in-moved-subtree-assertion-failure.html
3139
3140         * html/FormAssociatedElement.cpp:
3141         (WebCore::FormAssociatedElement::insertedInto): Moved resetFormOwner() from here
3142         to {HTMLFormControlElement, HTMLObjectElement}::finishedInsertingSubtree().
3143         * html/HTMLFormControlElement.cpp:
3144         (WebCore::HTMLFormControlElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree
3145         so that HTMLFormControlElement::finishedInsertingSubtree() is called.
3146         (WebCore::HTMLFormControlElement::finishedInsertingSubtree): Added; turn around and
3147         call FormAssociatedElement::resetFormOwner().
3148         * html/HTMLFormControlElement.h:
3149         * html/HTMLInputElement.cpp:
3150         (WebCore::HTMLInputElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
3151         that HTMLInputElement::finishedInsertingSubtree() is called and move logic to update radio button
3152         group from here...
3153         (WebCore::HTMLInputElement::finishedInsertingSubtree): to here.
3154         * html/HTMLInputElement.h:
3155         * html/HTMLObjectElement.cpp:
3156         (WebCore::HTMLObjectElement::insertedInto): Return InsertionShouldCallFinishedInsertingSubtree so
3157         that HTMLObjectElement::finishedInsertingSubtree() is called.
3158         (WebCore::HTMLObjectElement::finishedInsertingSubtree): Added; turn around and
3159         call FormAssociatedElement::resetFormOwner().
3160         * html/HTMLObjectElement.h:
3161         * html/HTMLSelectElement.cpp:
3162         (WebCore::HTMLSelectElement::insertedInto): Modified to return the result of
3163         HTMLFormControlElementWithState::insertedInto(), which may schedule a callback after subtree
3164         insertion.
3165         * html/HTMLTextFormControlElement.cpp:
3166         (WebCore::HTMLTextFormControlElement::insertedInto): Ditto.
3167
3168 2015-09-07  Antti Koivisto  <antti@apple.com>
3169
3170         Remove GlyphPage::mayUseMixedFontsWhenFilling
3171         https://bugs.webkit.org/show_bug.cgi?id=148928
3172
3173         Reviewed by Dan Bernstein.
3174
3175         http://trac.webkit.org/188566 removed support for composite fonts. We never need to use mixed
3176         glyph pages for fonts anymore.
3177
3178         * platform/graphics/Font.cpp:
3179         (WebCore::createAndFillGlyphPage):
3180         * platform/graphics/GlyphPage.h:
3181         (WebCore::GlyphPage::GlyphPage):
3182         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
3183         * platform/graphics/mac/GlyphPageMac.cpp:
3184         (WebCore::shouldUseCoreText):
3185         (WebCore::GlyphPage::fill):
3186         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling): Deleted.
3187
3188 2015-09-07  Antti Koivisto  <antti@apple.com>
3189
3190         Remove unneeded offset and length arguments from glyph page filling functions
3191         https://bugs.webkit.org/show_bug.cgi?id=148929
3192
3193         Reviewed by Andreas Kling.
3194
3195         They are always passed 0/GlyphPage::size.
3196
3197         * platform/graphics/Font.cpp:
3198         (WebCore::Font::~Font):
3199         (WebCore::fillGlyphPage):
3200         (WebCore::createAndFillGlyphPage):
3201         * platform/graphics/Font.h:
3202         * platform/graphics/GlyphPage.h:
3203         (WebCore::GlyphPage::setGlyphDataForIndex):
3204         * platform/graphics/mac/GlyphPageMac.cpp:
3205         (WebCore::GlyphPage::mayUseMixedFontsWhenFilling):
3206         (WebCore::GlyphPage::fill):
3207         * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp:
3208         (WebCore::GlyphPage::fill):
3209         * platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp:
3210         (WebCore::GlyphPage::fill):
3211         * svg/SVGFontData.cpp:
3212         (WebCore::SVGFontData::applySVGGlyphSelection):
3213         (WebCore::SVGFontData::fillSVGGlyphPage):
3214         (WebCore::SVGFontData::fillBMPGlyphs):
3215         (WebCore::SVGFontData::fillNonBMPGlyphs):
3216         * svg/SVGFontData.h:
3217         (WebCore::SVGFontData::verticalAdvanceY):
3218
3219 2015-09-06  Chris Dumez  <cdumez@apple.com>
3220
3221         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
3222         https://bugs.webkit.org/show_bug.cgi?id=148800
3223         <rdar://problem/22565782>
3224         <rdar://problem/22565485>
3225
3226         Reviewed by Geoffrey Garen.
3227
3228         dispatchEvent() should throw an InvalidStateError if the event's
3229         initialized flag is not set or its dispatch flag is set, and should
3230         allow dispatching events with an empty type as long as it is
3231         initialized:
3232         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
3233
3234         Previously, WebKit relied on the event type being empty to throw a
3235         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
3236         exception type is outdated and initializing Event.type to an empty
3237         string is legal.
3238
3239         No new tests, already covered by existing tests that were rebaselined.
3240
3241         * dom/Event.cpp:
3242         (WebCore::Event::Event):
3243         (WebCore::Event::initEvent):
3244         * dom/Event.h:
3245         (WebCore::Event::isInitialized):
3246         * dom/EventTarget.cpp:
3247         (WebCore::EventTarget::dispatchEvent):
3248
3249 2015-09-06  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3250
3251         XHR2 timeout property should allow late updates
3252         https://bugs.webkit.org/show_bug.cgi?id=98156
3253
3254         Reviewed by Darin Adler.
3255
3256         Adding a timer within XMLHttpRequest to handle timeouts for asynchronous requests.
3257         This allows easy update of the timeout even after request is sent.
3258         Timeout is still handled by the network backend for synchronous requests (Web worker context).
3259
3260         Covered by updated tests.
3261
3262         * xml/XMLHttpRequest.cpp:
3263         (WebCore::XMLHttpRequest::XMLHttpRequest): Adding timeout timer initialization.
3264         (WebCore::XMLHttpRequest::setTimeout): Updating timeout timer state if request is sent.
3265         (WebCore::XMLHttpRequest::createRequest): Starting timeout timer if needed.
3266         (WebCore::XMLHttpRequest::internalAbort): Stopping timeout timer if needed.
3267         (WebCore::XMLHttpRequest::didFail): Adding comment.
3268         (WebCore::XMLHttpRequest::didFinishLoading): Stopping timeout timer if needed.
3269         * xml/XMLHttpRequest.h:
3270
3271 2015-09-05  Jaehun Lim  <ljaehun.lim@samsung.com>
3272
3273         Remove unused macros from StyleResolver.cpp
3274         https://bugs.webkit.org/show_bug.cgi?id=148163
3275
3276         Reviewed by Andreas Kling.
3277
3278         HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL are not used after
3279         StyleBuilder refactoring.
3280
3281         No new tests because there is no behavior change.
3282
3283         * css/StyleResolver.cpp:
3284         Remove HANDLE_INHERIT and HANDLE_INHERIT_AND_INITIAL.
3285
3286 2015-09-05  Brian Burg  <bburg@apple.com>
3287
3288         Web Inspector: tighten up lifetimes for Agent-owned objects, and initialize agents using contexts
3289         https://bugs.webkit.org/show_bug.cgi?id=148625
3290
3291         Reviewed by Joseph Pecoraro.
3292
3293         All agents own their domain-specific frontend and backend dispatchers. Change so that
3294         they are initialized in constructors rather than when a frontend connects or disconnects.
3295         This may cause additional memory use, but this can be counteracted by lazily creating
3296         some agents that are not required for other agents to function (i.e., runtime and page agents).
3297
3298         To avoid adding frontend/backend dispatcher arguments to every single agent constructor,
3299         change agent construction to take a AgentContext or a subclass of it. This provides agents with
3300         references to objects in the owning InspectorEnvironment subclass that are guaranteed to
3301         outlive all agents. AgentContext and its subclasses follow the existing Agent class hierarchy.
3302
3303         No new tests, no behavior changed.
3304
3305         * bindings/js/WorkerScriptDebugServer.cpp:
3306         (WebCore::WorkerScriptDebugServer::WorkerScriptDebugServer):
3307         (WebCore::WorkerScriptDebugServer::addListener):
3308         (WebCore::WorkerScriptDebugServer::removeListener):
3309         (WebCore::WorkerScriptDebugServer::runEventLoopWhilePaused):
3310         * bindings/js/WorkerScriptDebugServer.h:
3311         * inspector/InspectorApplicationCacheAgent.cpp:
3312         (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
3313         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
3314         (WebCore::InspectorApplicationCacheAgent::getFramesWithManifests):
3315         (WebCore::InspectorApplicationCacheAgent::willDestroyFrontendAndBackend):
3316         * inspector/InspectorApplicationCacheAgent.h:
3317         * inspector/InspectorCSSAgent.cpp:
3318         (WebCore::InspectorCSSAgent::InspectorCSSAgent):
3319         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
3320         (WebCore::InspectorCSSAgent::willDestroyFrontendAndBackend):
3321         * inspector/InspectorCSSAgent.h:
3322         * inspector/InspectorController.cpp:
3323         (WebCore::InspectorController::InspectorController):
3324         * inspector/InspectorDOMAgent.cpp:
3325         (WebCore::InspectorDOMAgent::InspectorDOMAgent):
3326         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
3327         (WebCore::InspectorDOMAgent::willDestroyFrontendAndBackend):
3328         * inspector/InspectorDOMAgent.h:
3329         * inspector/InspectorDOMDebuggerAgent.cpp:
3330         (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
3331         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
3332         (WebCore::InspectorDOMDebuggerAgent::willDestroyFrontendAndBackend):
3333         * inspector/InspectorDOMDebuggerAgent.h:
3334         * inspector/InspectorDOMStorageAgent.cpp:
3335         (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
3336         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
3337         (WebCore::InspectorDOMStorageAgent::findStorageArea):
3338         (WebCore::InspectorDOMStorageAgent::willDestroyFrontendAndBackend):
3339         * inspector/InspectorDOMStorageAgent.h:
3340         * inspector/InspectorDatabaseAgent.cpp:
3341         (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
3342         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
3343         (WebCore::InspectorDatabaseAgent::willDestroyFrontendAndBackend):
3344         * inspector/InspectorDatabaseAgent.h:
3345         * inspector/InspectorIndexedDBAgent.cpp:
3346         (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
3347         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
3348         (WebCore::InspectorIndexedDBAgent::willDestroyFrontendAndBackend):
3349         * inspector/InspectorIndexedDBAgent.h:
3350         * inspector/InspectorInstrumentation.cpp:
3351         (WebCore::InspectorInstrumentation::didClearWindowObjectInWorldImpl):
3352         * inspector/InspectorLayerTreeAgent.cpp:
3353         (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
3354         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
3355         (WebCore::InspectorLayerTreeAgent::willDestroyFrontendAndBackend):
3356         * inspector/InspectorLayerTreeAgent.h:
3357         * inspector/InspectorPageAgent.cpp:
3358         (WebCore::InspectorPageAgent::InspectorPageAgent):
3359         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
3360         (WebCore::InspectorPageAgent::enable):
3361         (WebCore::InspectorPageAgent::reload):
3362         (WebCore::InspectorPageAgent::navigate):
3363         (WebCore::InspectorPageAgent::getCookies):
3364         (WebCore::InspectorPageAgent::deleteCookie):
3365         (WebCore::InspectorPageAgent::getResourceTree):
3366         (WebCore::InspectorPageAgent::searchInResources):
3367         (WebCore::InspectorPageAgent::getScriptExecutionStatus):
3368         (WebCore::InspectorPageAgent::setScriptExecutionDisabled):
3369         (WebCore::InspectorPageAgent::mainFrame):
3370         (WebCore::InspectorPageAgent::findFrameWithSecurityOrigin):
3371         (WebCore::InspectorPageAgent::buildObjectForFrame):
3372         (WebCore::InspectorPageAgent::buildObjectForFrameTree):
3373         (WebCore::InspectorPageAgent::setEmulatedMedia):
3374         (WebCore::InspectorPageAgent::getCompositingBordersVisible):
3375         (WebCore::InspectorPageAgent::setCompositingBordersVisible):
3376         (WebCore::InspectorPageAgent::snapshotNode):
3377         (WebCore::InspectorPageAgent::snapshotRect):
3378         (WebCore::InspectorPageAgent::archive):
3379         (WebCore::InspectorPageAgent::willDestroyFrontendAndBackend):
3380         * inspector/InspectorPageAgent.h:
3381         * inspector/InspectorReplayAgent.cpp:
3382         (WebCore::InspectorReplayAgent::InspectorReplayAgent):
3383         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
3384         (WebCore::InspectorReplayAgent::willDestroyFrontendAndBackend):
3385         * inspector/InspectorReplayAgent.h:
3386         * inspector/InspectorResourceAgent.cpp:
3387         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
3388         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
3389         (WebCore::InspectorResourceAgent::willDestroyFrontendAndBackend):
3390         * inspector/InspectorResourceAgent.h:
3391         * inspector/InspectorTimelineAgent.cpp:
3392         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
3393         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
3394         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
3395         (WebCore::InspectorTimelineAgent::page):
3396         * inspector/InspectorTimelineAgent.h:
3397         * inspector/InspectorWebAgentBase.h:
3398         (WebCore::WebAgentContext::WebAgentContext):
3399         (WebCore::PageAgentContext::PageAgentContext):
3400         (WebCore::WorkerAgentContext::WorkerAgentContext):
3401         (WebCore::InspectorAgentBase::InspectorAgentBase):
3402         * inspector/InspectorWorkerAgent.cpp:
3403         (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
3404         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
3405         (WebCore::InspectorWorkerAgent::willDestroyFrontendAndBackend):
3406         * inspector/InspectorWorkerAgent.h:
3407         * inspector/PageConsoleAgent.cpp:
3408         (WebCore::PageConsoleAgent::PageConsoleAgent):
3409         * inspector/PageConsoleAgent.h:
3410         * inspector/PageDebuggerAgent.cpp:
3411         (WebCore::PageDebuggerAgent::PageDebuggerAgent):
3412         (WebCore::PageDebuggerAgent::sourceMapURLForScript):
3413         (WebCore::PageDebuggerAgent::breakpointActionLog):
3414         (WebCore::PageDebuggerAgent::injectedScriptForEval):
3415         * inspector/PageDebuggerAgent.h:
3416         * inspector/PageRuntimeAgent.cpp:
3417         (WebCore::PageRuntimeAgent::PageRuntimeAgent):
3418         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
3419         (WebCore::PageRuntimeAgent::injectedScriptForEval):
3420         (WebCore::PageRuntimeAgent::reportExecutionContextCreation):
3421         (WebCore::PageRuntimeAgent::willDestroyFrontendAndBackend):
3422         * inspector/PageRuntimeAgent.h:
3423         * inspector/WebConsoleAgent.cpp:
3424         (WebCore::WebConsoleAgent::WebConsoleAgent):
3425         * inspector/WebConsoleAgent.h:
3426         * inspector/WebDebuggerAgent.cpp:
3427         (WebCore::WebDebuggerAgent::WebDebuggerAgent):
3428         * inspector/WebDebuggerAgent.h:
3429         * inspector/WorkerConsoleAgent.cpp:
3430         (WebCore::WorkerConsoleAgent::WorkerConsoleAgent):
3431         * inspector/WorkerConsoleAgent.h:
3432         * inspector/WorkerDebuggerAgent.cpp:
3433         (WebCore::WorkerDebuggerAgent::WorkerDebuggerAgent):
3434         (WebCore::WorkerDebuggerAgent::~WorkerDebuggerAgent):
3435         (WebCore::WorkerDebuggerAgent::interruptAndDispatchInspectorCommands):
3436         (WebCore::WorkerDebuggerAgent::breakpointActionLog):
3437         (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
3438         * inspector/WorkerDebuggerAgent.h:
3439         * inspector/WorkerInspectorController.cpp:
3440         (WebCore::WorkerInspectorController::WorkerInspectorController):
3441         * inspector/WorkerRuntimeAgent.cpp:
3442         (WebCore::WorkerRuntimeAgent::WorkerRuntimeAgent):
3443         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
3444         (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
3445         (WebCore::WorkerRuntimeAgent::willDestroyFrontendAndBackend):
3446         * inspector/WorkerRuntimeAgent.h:
3447
3448 2015-09-04  Brian Burg  <bburg@apple.com>
3449
3450         Web Inspector: agents should send messages through FrontendRouter instead of FrontendChannel
3451         https://bugs.webkit.org/show_bug.cgi?id=148492
3452
3453         Reviewed by Joseph Pecoraro.
3454
3455         Replace uses of FrontendChannel with FrontendRouter. Minor code cleanup along the way.
3456
3457         No new tests, no behavior changed.
3458
3459         * WebCore.vcxproj/WebCore.vcxproj:
3460         * WebCore.vcxproj/WebCore.vcxproj.filters:
3461         * WebCore.xcodeproj/project.pbxproj:
3462         * inspector/InspectorApplicationCacheAgent.cpp:
3463         (WebCore::InspectorApplicationCacheAgent::didCreateFrontendAndBackend):
3464         * inspector/InspectorApplicationCacheAgent.h:
3465         * inspector/InspectorCSSAgent.cpp:
3466         (WebCore::InspectorCSSAgent::didCreateFrontendAndBackend):
3467         * inspector/InspectorCSSAgent.h:
3468         * inspector/InspectorController.cpp:
3469         (WebCore::InspectorController::connectFrontend):
3470         (WebCore::InspectorController::~InspectorController): No need to call discardAgents().
3471         * inspector/InspectorDOMAgent.cpp:
3472         (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend):
3473         * inspector/InspectorDOMAgent.h:
3474         * inspector/InspectorDOMDebuggerAgent.cpp:
3475         (WebCore::InspectorDOMDebuggerAgent::didCreateFrontendAndBackend):
3476         * inspector/InspectorDOMDebuggerAgent.h:
3477         * inspector/InspectorDOMStorageAgent.cpp:
3478         (WebCore::InspectorDOMStorageAgent::didCreateFrontendAndBackend):
3479         * inspector/InspectorDOMStorageAgent.h:
3480         * inspector/InspectorDatabaseAgent.cpp:
3481         (WebCore::InspectorDatabaseAgent::didCreateFrontendAndBackend):
3482         * inspector/InspectorDatabaseAgent.h:
3483         * inspector/InspectorForwarding.h: Removed.
3484         * inspector/InspectorIndexedDBAgent.cpp:
3485         (WebCore::InspectorIndexedDBAgent::didCreateFrontendAndBackend):
3486         * inspector/InspectorIndexedDBAgent.h:
3487         * inspector/InspectorLayerTreeAgent.cpp:
3488         (WebCore::InspectorLayerTreeAgent::didCreateFrontendAndBackend):
3489         * inspector/InspectorLayerTreeAgent.h:
3490         * inspector/InspectorPageAgent.cpp:
3491         (WebCore::InspectorPageAgent::didCreateFrontendAndBackend):
3492         * inspector/InspectorPageAgent.h:
3493         * inspector/InspectorReplayAgent.cpp:
3494         (WebCore::InspectorReplayAgent::didCreateFrontendAndBackend):
3495         * inspector/InspectorReplayAgent.h:
3496         * inspector/InspectorResourceAgent.cpp:
3497         (WebCore::InspectorResourceAgent::didCreateFrontendAndBackend):
3498         * inspector/InspectorResourceAgent.h:
3499         * inspector/InspectorTimelineAgent.cpp:
3500         (WebCore::InspectorTimelineAgent::didCreateFrontendAndBackend):
3501         * inspector/InspectorTimelineAgent.h:
3502         * inspector/InspectorWebAgentBase.h:
3503         * inspector/InspectorWorkerAgent.cpp:
3504         (WebCore::InspectorWorkerAgent::didCreateFrontendAndBackend):
3505         * inspector/InspectorWorkerAgent.h:
3506         * inspector/PageRuntimeAgent.cpp:
3507         (WebCore::PageRuntimeAgent::didCreateFrontendAndBackend):
3508         * inspector/PageRuntimeAgent.h:
3509         * inspector/WorkerInspectorController.cpp:
3510         (WebCore::WorkerInspectorController::connectFrontend):
3511         * inspector/WorkerInspectorController.h:
3512         * inspector/WorkerRuntimeAgent.cpp:
3513         (WebCore::WorkerRuntimeAgent::didCreateFrontendAndBackend):
3514         * inspector/WorkerRuntimeAgent.h:
3515         * page/PageDebuggable.cpp:
3516         * testing/Internals.cpp:
3517
3518 2015-09-05  Joseph Pecoraro  <pecoraro@apple.com>
3519
3520         Add a new ResourceLoaderOption to avoid page defers loading mechanisms for inspector
3521         https://bugs.webkit.org/show_bug.cgi?id=148727
3522
3523         Reviewed by Antti Koivisto.
3524
3525         This will be tested shortly by inspector tests.
3526
3527         * loader/ResourceLoaderOptions.h:
3528         (WebCore::ResourceLoaderOptions::ResourceLoaderOptions):
3529         (WebCore::ResourceLoaderOptions::defersLoadingPolicy):
3530         (WebCore::ResourceLoaderOptions::setDefersLoadingPolicy):
3531         Add a new policy for defers loading. The default is to allow defers loading.
3532
3533         * loader/ResourceLoader.cpp:
3534         (WebCore::ResourceLoader::ResourceLoader):
3535         (WebCore::ResourceLoader::init):
3536         (WebCore::ResourceLoader::setDefersLoading):
3537         Respect the defers loading policy whenever we would set defers loading status.
3538
3539         * inspector/InspectorResourceAgent.cpp:
3540         (WebCore::InspectorResourceAgent::loadResource):
3541         Switch from incorrectly changing the defersLoading state of the loader
3542         to setting an option to disallow defers loading entirely for the loader.
3543
3544         * loader/DocumentLoader.cpp:
3545         (WebCore::DocumentLoader::startLoadingMainResource):
3546         * loader/MediaResourceLoader.cpp:
3547         (WebCore::MediaResourceLoader::start):
3548         * loader/NetscapePlugInStreamLoader.cpp:
3549         (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
3550         * loader/cache/CachedResourceLoader.cpp:
3551         (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
3552         (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
3553         * loader/icon/IconLoader.cpp:
3554         (WebCore::IconLoader::startLoading):
3555         * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp:
3556         (WebCore::WebCoreAVCFResourceLoader::startLoading):
3557         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3558         (WebCore::WebCoreAVFResourceLoader::startLoading):
3559         Add the new value to instance of the longhand ResourceLoaderOptions constructor.
3560
3561 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
3562
3563         Rename members of CanvasRenderingContext2D::State
3564         https://bugs.webkit.org/show_bug.cgi?id=148889
3565
3566         Reviewed by Tim Horton.
3567
3568         CanvasRenderingContext2D::State is a struct, so its members should not start with m_.
3569
3570         No new tests because there is no behavior change.
3571
3572         * html/canvas/CanvasRenderingContext2D.cpp:
3573         (WebCore::CanvasRenderingContext2D::State::State):
3574         (WebCore::CanvasRenderingContext2D::State::operator=):
3575         (WebCore::CanvasRenderingContext2D::restore):
3576         (WebCore::CanvasRenderingContext2D::setStrokeStyle):
3577         (WebCore::CanvasRenderingContext2D::setFillStyle):
3578         (WebCore::CanvasRenderingContext2D::lineWidth):
3579         (WebCore::CanvasRenderingContext2D::setLineWidth):
3580         (WebCore::CanvasRenderingContext2D::lineCap):
3581         (WebCore::CanvasRenderingContext2D::setLineCap):
3582         (WebCore::CanvasRenderingContext2D::lineJoin):
3583         (WebCore::CanvasRenderingContext2D::setLineJoin):
3584         (WebCore::CanvasRenderingContext2D::miterLimit):
3585         (WebCore::CanvasRenderingContext2D::setMiterLimit):
3586         (WebCore::CanvasRenderingContext2D::shadowOffsetX):
3587         (WebCore::CanvasRenderingContext2D::setShadowOffsetX):
3588         (WebCore::CanvasRenderingContext2D::shadowOffsetY):
3589         (WebCore::CanvasRenderingContext2D::setShadowOffsetY):
3590         (WebCore::CanvasRenderingContext2D::shadowBlur):
3591         (WebCore::CanvasRenderingContext2D::setShadowBlur):
3592         (WebCore::CanvasRenderingContext2D::shadowColor):
3593         (WebCore::CanvasRenderingContext2D::setShadowColor):
3594         (WebCore::CanvasRenderingContext2D::getLineDash):
3595         (WebCore::CanvasRenderingContext2D::setLineDash):
3596         (WebCore::CanvasRenderingContext2D::setWebkitLineDash):
3597         (WebCore::CanvasRenderingContext2D::lineDashOffset):
3598         (WebCore::CanvasRenderingContext2D::setLineDashOffset):
3599         (WebCore::CanvasRenderingContext2D::applyLineDash):
3600         (WebCore::CanvasRenderingContext2D::globalAlpha):
3601         (WebCore::CanvasRenderingContext2D::setGlobalAlpha):
3602         (WebCore::CanvasRenderingContext2D::globalCompositeOperation):
3603         (WebCore::CanvasRenderingContext2D::setGlobalCompositeOperation):
3604         (WebCore::CanvasRenderingContext2D::scale):
3605         (WebCore::CanvasRenderingContext2D::rotate):
3606         (WebCore::CanvasRenderingContext2D::translate):
3607         (WebCore::CanvasRenderingContext2D::transform):
3608         (WebCore::CanvasRenderingContext2D::setTransform):
3609         (WebCore::CanvasRenderingContext2D::setStrokeColor):
3610         (WebCore::CanvasRenderingContext2D::setFillColor):
3611         (WebCore::CanvasRenderingContext2D::fillInternal):
3612         (WebCore::CanvasRenderingContext2D::strokeInternal):
3613         (WebCore::CanvasRenderingContext2D::clipInternal):
3614         (WebCore::CanvasRenderingContext2D::isPointInPathInternal):
3615         (WebCore::CanvasRenderingContext2D::isPointInStrokeInternal):
3616         (WebCore::CanvasRenderingContext2D::clearRect):
3617         (WebCore::CanvasRenderingContext2D::fillRect):
3618         (WebCore::CanvasRenderingContext2D::strokeRect):
3619         (WebCore::CanvasRenderingContext2D::setShadow):
3620         (WebCore::CanvasRenderingContext2D::applyShadow):
3621         (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
3622         (WebCore::CanvasRenderingContext2D::drawImage):
3623         (WebCore::CanvasRenderingContext2D::transformAreaToDevice):
3624         (WebCore::CanvasRenderingContext2D::rectContainsCanvas):
3625         (WebCore::CanvasRenderingContext2D::compositeBuffer):
3626         (WebCore::CanvasRenderingContext2D::didDraw):
3627         (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal):
3628         (WebCore::CanvasRenderingContext2D::font):
3629         (WebCore::CanvasRenderingContext2D::setFont):
3630         (WebCore::CanvasRenderingContext2D::textAlign):
3631         (WebCore::CanvasRenderingContext2D::setTextAlign):
3632         (WebCore::CanvasRenderingContext2D::textBaseline):
3633         (WebCore::CanvasRenderingContext2D::setTextBaseline):
3634         (WebCore::CanvasRenderingContext2D::direction):
3635         (WebCore::CanvasRenderingContext2D::setDirection):
3636         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3637         (WebCore::CanvasRenderingContext2D::inflateStrokeRect):
3638         (WebCore::CanvasRenderingContext2D::imageSmoothingEnabled):
3639         (WebCore::CanvasRenderingContext2D::setImageSmoothingEnabled):
3640         * html/canvas/CanvasRenderingContext2D.h:
3641
3642 2015-09-04  Myles C. Maxfield  <mmaxfield@apple.com>
3643
3644         Crash when font completes downloading after calling 2D canvas setText() multiple times
3645         https://bugs.webkit.org/show_bug.cgi?id=148789
3646
3647         Reviewed by Darin Adler.
3648
3649         The CSSFontSelector has a list of clients, and when fonts complete downloading, these
3650         clients get a call back. CanvasRenderingContext2D::State is one such of these clients. However,
3651         the CSSFontSelector may be destroyed and recreated at any time. We were getting into a case
3652         where multiple CSSFontSelectors were thinking that the same CanvasRenderingContext2D::State were
3653         their client. When the CanvasRenderingContext2D::State was destroyed, it only unregistered
3654         itself from one of the CSSFontSelectors, which means the CSSFontSelector left over has a dangling
3655         pointer to it.
3656
3657         The solution is to implement a new helper class, FontProxy, to hold the
3658         CanvasRenderingContext2D::State's font, and maintain the invariant that this object is always
3659         registered to exactly one CSSFontSelector, and this CSSFontSelector is the one which is associated
3660         with the FontProxy's FontCascade object. This patch maintains this invariant, as well as protecting
3661         all access to the State's FontCascade object so no one can reach in and change it without going
3662         through functions which maintain the invariant.
3663
3664         Test: fast/canvas/font-selector-crash.html
3665
3666         * css/CSSFontSelector.cpp:
3667         (WebCore::CSSFontSelector::registerForInvalidationCallbacks):
3668         (WebCore::CSSFontSelector::unregisterForInvalidationCallbacks):
3669         (WebCore::CSSFontSelector::dispatchInvalidationCallbacks):
3670         * css/CSSFontSelector.h:
3671         * dom/Document.cpp:
3672         (WebCore::Document::fontsNeedUpdate):
3673         (WebCore::Document::fontSelector):
3674         (WebCore::Document::clearStyleResolver):
3675         * dom/Document.h:
3676         * html/canvas/CanvasRenderingContext2D.cpp:
3677         (WebCore::CanvasRenderingContext2D::State::State):
3678         (WebCore::CanvasRenderingContext2D::State::operator=):
3679         (WebCore::CanvasRenderingContext2D::FontProxy::~FontProxy):
3680         (WebCore::CanvasRenderingContext2D::FontProxy::FontProxy):
3681         (WebCore::CanvasRenderingContext2D::FontProxy::update):
3682         (WebCore::CanvasRenderingContext2D::FontProxy::fontsNeedUpdate):
3683         (WebCore::CanvasRenderingContext2D::FontProxy::initialize):
3684         (WebCore::CanvasRenderingContext2D::FontProxy::fontMetrics):
3685         (WebCore::CanvasRenderingContext2D::FontProxy::fontDescription):
3686         (WebCore::CanvasRenderingContext2D::FontProxy::width):
3687         (WebCore::CanvasRenderingContext2D::FontProxy::drawBidiText):
3688         (WebCore::CanvasRenderingContext2D::font):
3689         (WebCore::CanvasRenderingContext2D::setFont):
3690         (WebCore::CanvasRenderingContext2D::measureText):
3691         (WebCore::CanvasRenderingContext2D::drawTextInternal):
3692         (WebCore::CanvasRenderingContext2D::State::~State): Deleted.
3693         (WebCore::CanvasRenderingContext2D::State::fontsNeedUpdate): Deleted.
3694         (WebCore::CanvasRenderingContext2D::accessFont): Deleted.
3695         * html/canvas/CanvasRenderingContext2D.h:
3696         * platform/graphics/FontSelector.h:
3697
3698 2015-09-04  Commit Queue  <commit-queue@webkit.org>
3699
3700         Unreviewed, rolling out r189386.
3701         https://bugs.webkit.org/show_bug.cgi?id=148883
3702
3703         Made several event dispatch tests assert (Requested by ap on
3704         #webkit).
3705
3706         Reverted changeset:
3707
3708         "dispatchEvent() should throw an InvalidStateError if the
3709         event's initialized flag is not set"
3710         https://bugs.webkit.org/show_bug.cgi?id=148800
3711         http://trac.webkit.org/changeset/189386
3712
3713 2015-09-04  Joseph Pecoraro  <pecoraro@apple.com>
3714
3715         Web Inspector: Add tests for DOM highlight commands
3716         https://bugs.webkit.org/show_bug.cgi?id=148786
3717
3718         Reviewed by Timothy Hatcher.
3719
3720         Tests: inspector/dom/hideHighlight.html
3721                inspector/dom/highlightFrame.html
3722                inspector/dom/highlightNode.html
3723                inspector/dom/highlightQuad.html
3724                inspector/dom/highlightRect.html
3725
3726         * inspector/InspectorDOMAgent.cpp:
3727         (WebCore::InspectorDOMAgent::highlightNode):
3728         (WebCore::InspectorDOMAgent::highlightFrame):
3729         Include an error if a frame is not found.
3730
3731         * inspector/InspectorOverlay.cpp:
3732         (WebCore::InspectorOverlay::highlightQuad):
3733         Should have been checking the usePageCoordinates state of the incoming
3734         highlight configuration, not the one that will be replaced.
3735
3736 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
3737
3738         Remove unnecessary compiler guards from mm files
3739         https://bugs.webkit.org/show_bug.cgi?id=148797
3740
3741         Reviewed by Dan Bernstein.
3742
3743         * bindings/objc/DOMInternal.mm:
3744         * bridge/objc/objc_instance.mm:
3745
3746 2015-09-04  Eric Carlson  <eric.carlson@apple.com>
3747
3748         [mediacontrols] Test AirPlay picker button
3749         https://bugs.webkit.org/show_bug.cgi?id=148836
3750
3751         Reviewed by Dean Jackson.
3752
3753         Test: media/controls/airplay-picker.html
3754
3755         * Modules/mediacontrols/mediaControlsApple.js:
3756         (Controller.prototype.getCurrentControlsStatus.elements.forEach.):
3757         (Controller.prototype.getCurrentControlsStatus):
3758
3759 2015-09-04  Chris Dumez  <cdumez@apple.com>
3760
3761         dispatchEvent() should throw an InvalidStateError if the event's initialized flag is not set
3762         https://bugs.webkit.org/show_bug.cgi?id=148800
3763         <rdar://problem/22565782>
3764         <rdar://problem/22565485>
3765
3766         Reviewed by Geoffrey Garen.
3767
3768         dispatchEvent() should throw an InvalidStateError if the event's
3769         initialized flag is not set or its dispatch flag is set, and should
3770         allow dispatching events with an empty type as long as it is
3771         initialized:
3772         https://dom.spec.whatwg.org/#dom-eventtarget-dispatchevent (step 1)
3773
3774         Previously, WebKit relied on the event type being empty to throw a
3775         UNSPECIFIED_EVENT_TYPE_ERR: DOM Events Exception 0. However, this
3776         exception type is outdated and initializing Event.type to an empty
3777         string is legal.
3778
3779         No new tests, already covered by existing tests that were rebaselined.
3780
3781         * dom/Event.cpp:
3782         (WebCore::Event::Event):
3783         (WebCore::Event::initEvent):
3784         * dom/Event.h:
3785         (WebCore::Event::isInitialized):
3786         * dom/EventTarget.cpp:
3787         (WebCore::EventTarget::dispatchEvent):
3788
3789 2015-09-04  Beth Dakin  <bdakin@apple.com>
3790
3791         Speculative build fix.
3792
3793         * platform/spi/mac/NSEventSPI.h:
3794
3795 2015-09-04  Brian Burg  <bburg@apple.com>
3796
3797         Web Inspector: InspectorController should support multiple frontend channels
3798         https://bugs.webkit.org/show_bug.cgi?id=148538
3799
3800         Reviewed by Joseph Pecoraro.
3801
3802         No new tests, no behavior change from this patch. Teardown scenarios are
3803         covered by existing protocol and inspector tests running under DRT and WKTR.
3804
3805         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
3806         * WebCore.vcxproj/WebCore.vcxproj:
3807         * inspector/InspectorClient.h: Stop using forwarded types.
3808         * inspector/InspectorController.cpp:
3809         (WebCore::InspectorController::InspectorController):
3810         (WebCore::InspectorController::inspectedPageDestroyed):
3811         (WebCore::InspectorController::hasLocalFrontend):
3812         (WebCore::InspectorController::hasRemoteFrontend):
3813         (WebCore::InspectorController::connectFrontend):
3814         (WebCore::InspectorController::disconnectFrontend):
3815         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
3816         frontends and signals DisconnectReason::InspectedTargetDestroyed.
3817
3818         (WebCore::InspectorController::show):
3819         (WebCore::InspectorController::close):
3820         (WebCore::InspectorController::dispatchMessageFromFrontend):
3821         * inspector/InspectorController.h: Add default value for isAutomaticInspection.
3822         * inspector/InspectorDatabaseAgent.cpp:
3823         * inspector/InspectorIndexedDBAgent.cpp:
3824         * inspector/InspectorResourceAgent.cpp:
3825         * inspector/WorkerInspectorController.cpp: Use a router with a singleton channel
3826         that forwards messages over to the main page.
3827
3828         (WebCore::WorkerInspectorController::WorkerInspectorController):
3829         (WebCore::WorkerInspectorController::connectFrontend):
3830         (WebCore::WorkerInspectorController::disconnectFrontend):
3831         (WebCore::WorkerInspectorController::dispatchMessageFromFrontend):
3832         * inspector/WorkerInspectorController.h:
3833         * page/PageDebuggable.cpp:
3834         (WebCore::PageDebuggable::disconnect):
3835         * page/PageDebuggable.h:
3836         * testing/Internals.cpp: Clear the frontend client before disconnecting frontend channel.
3837         (WebCore::Internals::openDummyInspectorFrontend):
3838         (WebCore::Internals::closeDummyInspectorFrontend):
3839
3840 2015-09-04  Jer Noble  <jer.noble@apple.com>
3841
3842         [iOS] Enable media layout tests to run simultaneously by ignoring system-level interruptions
3843         https://bugs.webkit.org/show_bug.cgi?id=148807
3844
3845         Reviewed by Eric Carlson.
3846
3847         Add an internal property that, when set, will cause system-level interruption notifications
3848         (e.g., due to simultaneous media playback in separate processes) to be ignored by the
3849         PlatformMediaSessionManager, and cause the media playback sessions to continue normally, if
3850         inaudibly.
3851
3852         * platform/audio/PlatformMediaSessionManager.h:
3853         (WebCore::PlatformMediaSessionManager::willIgnoreSystemInterruptions):
3854         (WebCore::PlatformMediaSessionManager::setWillIgnoreSystemInterruptions):
3855         * platform/audio/ios/MediaSessionManagerIOS.mm:
3856         (-[WebMediaSessionHelper interruption:]):
3857         (-[WebMediaSessionHelper applicationWillEnterForeground:]):
3858         (-[WebMediaSessionHelper applicationDidBecomeActive:]):
3859         (-[WebMediaSessionHelper applicationWillResignActive:]):
3860         (-[WebMediaSessionHelper applicationDidEnterBackground:]):
3861         * testing/Internals.cpp:
3862         (WebCore::Internals::resetToConsistentState):
3863
3864 2015-09-04  Beth Dakin  <bdakin@apple.com>
3865
3866         Need to be able to test default behaviors on force click
3867         https://bugs.webkit.org/show_bug.cgi?id=148758
3868
3869         Reviewed by Tim Horton.
3870
3871         WKTR needs access to this.
3872         * platform/spi/mac/NSEventSPI.h:
3873
3874 2015-09-04  Dean Jackson  <dino@apple.com>
3875
3876         [mediacontrols] Test the ordering of elements in the controls panel
3877         https://bugs.webkit.org/show_bug.cgi?id=148804
3878         <rdar://problem/22579232>
3879
3880         Reviewed by Eric Carlson.
3881
3882         Add information about various controls elements to the status object.
3883
3884         Test: media/controls/elementOrder.html
3885
3886         * Modules/mediacontrols/mediaControlsApple.js:
3887
3888 2015-09-03  Dean Jackson  <dino@apple.com>
3889
3890         [mediacontrols] Expose bounding rectangles and computed style to testing
3891         https://bugs.webkit.org/show_bug.cgi?id=148755
3892         <rdar://problems/22567757>
3893
3894         Reviewed by Eric Carlson.
3895
3896         Expose more information on the internal objects to the testing
3897         framework, in particular the bounding client rectangle for an
3898         element as well as its computed style.
3899
3900         These new features are tested by media/controls/statusDisplay*.
3901
3902         * Modules/mediacontrols/mediaControlsApple.js:
3903         (Controller.prototype.getCurrentControlsStatus): Rearrage things so
3904         that it iterates over a list of objects, adding the common things
3905         as well as any extra property values.
3906
3907 2015-09-04  Chris Dumez  <cdumez@apple.com>
3908
3909         Document.body should return the first body / frameset child of the html element
3910         https://bugs.webkit.org/show_bug.cgi?id=148787
3911         <rdar://problem/22566850>
3912
3913         Reviewed by Ryosuke Niwa.
3914
3915         Document.body should return the *first* body / frameset child of the html
3916         element as per the specification:
3917         https://html.spec.whatwg.org/multipage/dom.html#the-body-element-2
3918
3919         Chrome and Firefox both behave correctly. However, WebKit was prioritizing
3920         frameset over body. This patch fixes this.
3921
3922         No new tests, already covered by existing test.
3923
3924         * dom/Document.cpp:
3925         (WebCore::Document::bodyOrFrameset):
3926
3927 2015-09-04  Csaba Osztrogonác  <ossy@webkit.org>
3928
3929         Fix the !ENABLE(VIDEO) build after r189023
3930         https://bugs.webkit.org/show_bug.cgi?id=148796
3931
3932         Reviewed by Eric Carlson.
3933
3934         * testing/Internals.idl:
3935
3936 2015-09-04  Ryosuke Niwa  <rniwa@webkit.org>
3937
3938         Range.isPointInRange check root node before verifying offset
3939         https://bugs.webkit.org/show_bug.cgi?id=148776
3940
3941         isPointInRange should never throw WrongDocumentError
3942         https://bugs.webkit.org/show_bug.cgi?id=148779
3943
3944         Reviewed by Darin Adler.
3945
3946         Fixed two bugs since they were inter-dependent on each other.
3947
3948         We use the same trick we used for comparePoint in r189327 to avoid O(n) operation in common cases
3949         and return false when either calls to compareBoundaryPoints yields a WrongDocumentError.
3950
3951         No new tests since this is covered by an existing W3C test.
3952
3953         * dom/Range.cpp:
3954         (WebCore::Range::isPointInRange):
3955         (WebCore::Range::comparePoint):
3956
3957 2015-09-03  Commit Queue  <commit-queue@webkit.org>
3958
3959         Unreviewed, rolling out r189338.
3960         https://bugs.webkit.org/show_bug.cgi?id=148785
3961
3962         Caused tons of crashes (Requested by cdumez on #webkit).
3963
3964         Reverted changeset:
3965
3966         "Web Inspector: InspectorController should support multiple
3967         frontend channels"
3968         https://bugs.webkit.org/show_bug.cgi?id=148538
3969         http://trac.webkit.org/changeset/189338
3970
3971 2015-09-03  Brian Burg  <bburg@apple.com>
3972
3973         Web Inspector: InspectorController should support multiple frontend channels
3974         https://bugs.webkit.org/show_bug.cgi?id=148538
3975
3976         Reviewed by Joseph Pecoraro.
3977
3978         No new tests, no behavior change from this patch. Teardown scenarios are
3979         covered by existing protocol and inspector tests running under DRT and WKTR.
3980
3981         * ForwardingHeaders/inspector/InspectorFrontendRouter.h: Added.
3982         * WebCore.vcxproj/WebCore.vcxproj:
3983         * inspector/InspectorClient.h: Stop using forwarded types.
3984         * inspector/InspectorController.cpp:
3985         (WebCore::InspectorController::InspectorController):
3986         (WebCore::InspectorController::inspectedPageDestroyed):
3987         (WebCore::InspectorController::hasLocalFrontend):
3988         (WebCore::InspectorController::hasRemoteFrontend):
3989         (WebCore::InspectorController::connectFrontend):
3990         (WebCore::InspectorController::disconnectFrontend):
3991         (WebCore::InspectorController::disconnectAllFrontends): Added. Disconnects all
3992         frontends and signals DisconnectReason::InspectedTargetDestroyed.
3993
3994         (WebCore::InspectorController::show):
3995         (WebCore::InspectorController::close):
3996         (WebCore::InspectorController::dispatchMessageFromFrontend):
3997   &