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