59a21341dceed6ce2709e2f8ac675b7d8108c00a
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-09-20  Chris Dumez  <cdumez@apple.com>
2
3         [CallWith=ScriptState] should pass ExecState to the implementation by reference
4         https://bugs.webkit.org/show_bug.cgi?id=149378
5
6         Reviewed by Sam Weinig.
7
8         [CallWith=ScriptState] should pass ExecState to the implementation by
9         reference instead of pointer, as it is expected to be non-null.
10
11         Also rename the ExecState variables from 'exec' to 'state' in the
12         bindings as this is the preferred naming convention.
13
14         * Modules/indexeddb/IDBCursor.h:
15         * Modules/indexeddb/IDBObjectStore.h:
16         * Modules/indexeddb/legacy/LegacyCursor.cpp:
17         (WebCore::LegacyCursor::update):
18         * Modules/indexeddb/legacy/LegacyCursor.h:
19         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
20         (WebCore::LegacyObjectStore::add):
21         (WebCore::LegacyObjectStore::put):
22         * Modules/indexeddb/legacy/LegacyObjectStore.h:
23         * Modules/mediastream/CapabilityRange.cpp:
24         (WebCore::scriptValue):
25         (WebCore::CapabilityRange::min):
26         (WebCore::CapabilityRange::max):
27         * Modules/mediastream/CapabilityRange.h:
28         * Modules/streams/ReadableStreamController.h:
29         (WebCore::ReadableStreamController::error):
30         (WebCore::ReadableStreamController::enqueue):
31         * bindings/scripts/CodeGeneratorJS.pm:
32         (GenerateEventListenerCall):
33         (GenerateGetOwnPropertySlotBody):
34         (GenerateHeader):
35         (GenerateOverloadedFunction):
36         (GetIndexedGetterExpression):
37         (GenerateImplementation):
38         (GenerateFunctionCastedThis):
39         (GenerateCallWith):
40         (GenerateArgumentsCountCheck):
41         (GenerateParametersCheck):
42         (GenerateReturnParameters):
43         (GenerateCallbackHeader):
44         (GenerateCallbackImplementation):
45         (GenerateImplementationFunctionCall):
46         (JSValueToNative):
47         (NativeToJSValue):
48         (GenerateOverloadedConstructorDefinition):
49         (GenerateConstructorDefinition):
50
51 2015-09-20  Youenn Fablet  <youenn.fablet@crf.canon.fr>
52
53         Remove XHR_TIMEOUT compilation guard
54         https://bugs.webkit.org/show_bug.cgi?id=149260
55
56         Reviewed by Benjamin Poulain.
57
58         Covered by existing tests.
59
60         * Configurations/FeatureDefines.xcconfig:
61         * xml/XMLHttpRequest.cpp:
62         (WebCore::XMLHttpRequest::XMLHttpRequest):
63         (WebCore::XMLHttpRequest::didFail):
64         (WebCore::XMLHttpRequest::didReachTimeout):
65         (WebCore::XMLHttpRequest::setTimeout):
66         (WebCore::XMLHttpRequest::setResponseType):
67         (WebCore::XMLHttpRequest::open):
68         (WebCore::XMLHttpRequest::createRequest):
69         (WebCore::XMLHttpRequest::internalAbort):
70         (WebCore::XMLHttpRequest::didFailRedirectCheck):
71         (WebCore::XMLHttpRequest::didSendData):
72         (WebCore::XMLHttpRequest::suspend):
73         * xml/XMLHttpRequest.h:
74         * xml/XMLHttpRequest.idl:
75
76 2015-09-20  Tim Horton  <timothy_horton@apple.com>
77
78         Add two missing files to the Xcode project
79
80         * WebCore.xcodeproj/project.pbxproj:
81         These are imported by files that are built for Mac, but missing from the project.
82
83 2015-09-19  Chris Dumez  <cdumez@apple.com>
84
85         [Web IDL] Add support for [PutForwards=XXX] IDL extended attribute
86         https://bugs.webkit.org/show_bug.cgi?id=149376
87
88         Reviewed by Darin Adler.
89
90         [Web IDL] Add support for [PutForwards=XXX] IDL extended attribute:
91         https://heycam.github.io/webidl/#PutForwards
92
93         As an initial proof of concept, use it for Document.location as per the
94         HTML specification, instead of using custom bindings:
95         https://html.spec.whatwg.org/multipage/dom.html#the-document-object
96
97         More attributes can be ported later.
98
99         No new tests, no web-exposed behavior change intended. Bindings tests
100         coverage was added.
101
102         * bindings/js/JSDocumentCustom.cpp:
103         Drop custom bindings for the location attribute setter.
104
105         * bindings/scripts/CodeGenerator.pm:
106         (GetAttributeFromInterface):
107         Add convenience function that returned an attribute from another
108         interface. This is used by [PutForwards] to retrieve the forwarded
109         attribute.
110
111         * bindings/scripts/CodeGeneratorJS.pm:
112         (IsReadonly):
113         (GenerateImplementation):
114         * bindings/scripts/IDLAttributes.txt:
115         Add support for [PutForwards=XXX] IDL extended attribute.
116
117         * bindings/scripts/test/GObject/WebKitDOMTestNode.cpp:
118         * bindings/scripts/test/GObject/WebKitDOMTestNode.h:
119         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
120         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
121         * bindings/scripts/test/JS/JSTestNode.cpp:
122         * bindings/scripts/test/JS/JSTestObj.cpp:
123         * bindings/scripts/test/ObjC/DOMTestNode.h:
124         * bindings/scripts/test/ObjC/DOMTestNode.mm:
125         * bindings/scripts/test/ObjC/DOMTestObj.h:
126         * bindings/scripts/test/ObjC/DOMTestObj.mm:
127         Add binding tests coverage for [PutForwards=XXX] IDL extended
128         attribute.
129
130         * dom/Document.idl:
131         Use [PutForwards=href] for Document.location attribute, as per the HTML
132         specification and stop using custom bindings for the setter. Also mark
133         the attribute as readonly as all attributes using [PutForwards] must be
134         marked as readonly as per the Web IDL specification.
135
136 2015-09-19  Chris Dumez  <cdumez@apple.com>
137
138         [WebIDL] Specify default parameter values where it is useful
139         https://bugs.webkit.org/show_bug.cgi?id=149331
140         <rdar://problem/22545600>
141
142         Reviewed by Darin Adler.
143
144         Specify default parameter values where it is useful in our IDL, that is
145         to say where undefined would be converted to something else than the
146         default value otherwise. This patch focuses on the HTML API.
147
148         This patch also adds support for default values for optional parameters
149         of string enumeration type as this was needed by the
150         CanvasRenderingContext2D API.
151
152         Test: fast/html/undefined-parameter-default-value.html
153
154         * bindings/scripts/CodeGeneratorJS.pm:
155         (GenerateParametersCheck):
156         Add support default values for optional parameters of string enumeration
157         type as this was needed by the CanvasRenderingContext2D API.
158
159         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
160         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
161         * bindings/scripts/test/JS/JSTestObj.cpp:
162         * bindings/scripts/test/ObjC/DOMTestObj.h:
163         * bindings/scripts/test/ObjC/DOMTestObj.mm:
164         * bindings/scripts/test/TestObj.idl:
165         Add bindings tests coverage for optional parameters of string enumeration
166         type and that have a default value.
167
168         * html/HTMLInputElement.idl:
169         Specify default parameter value for stepUp() / stepDown(). Without this,
170         stepUp(undefined) would be equivalent to calling stepUp(0) even though
171         it is supposed to be equivalent to calling stepUp(1).
172
173         * html/HTMLTableElement.idl:
174         * html/HTMLTableSectionElement.idl:
175         Specify default parameter value for insertRow(). Without this,
176         insertRow(undefined) would be equivalent to insertRow(0) instead of
177         insertRow(-1). This would prepend the row instead of appending it:
178         - https://html.spec.whatwg.org/#htmltableelement
179         - https://html.spec.whatwg.org/#htmltablesectionelement
180
181         * html/HTMLTableRowElement.idl:
182         Specify default parameter value for insertCell(). Without this,
183         insertCell(undefined) would be equivalent to insertCell(0) instead of
184         insertCell(-1). This would prepend the cell instead of appending it:
185         - https://html.spec.whatwg.org/#htmltablerowelement
186
187         * html/canvas/CanvasRenderingContext2D.idl:
188         Specify default value for CanvasWindingRule parameters so that calling
189         this with undefined will use the default enum value instead of using the
190         "undefined" string and then throwing because it is not a valid enum value:
191         - https://html.spec.whatwg.org/#canvasrenderingcontext2d
192
193 2015-09-19  Eric Carlson  <eric.carlson@apple.com>
194
195         Cleanup code that finds and loads a media engine
196         https://bugs.webkit.org/show_bug.cgi?id=149371
197
198         Reviewed by Darin Adler.
199
200         No new tests, no functional change.
201
202         * Modules/mediastream/MediaStream.cpp:
203         (WebCore::MediaStream::setRegistry): New, set the registry.
204         (WebCore::MediaStream::lookup): New, lookup a url in the registry.
205         * Modules/mediastream/MediaStream.h:
206
207         * html/HTMLMediaElement.cpp:
208         (WebCore::HTMLMediaElement::loadResource): Restructure and simplify the code that tries the 
209           different types of media engine so the code is easier to understand and modify.
210         (WebCore::HTMLMediaElement::createMediaPlayer): Clear m_mediaStreamSrcObject.
211
212         * platform/graphics/MediaPlayer.cpp:
213         (WebCore::buildMediaEnginesVector): Add some whitespace to make it easier to read.
214         (WebCore::bestMediaEngineForSupportParameters): Also process mediastream and mediasource urls.
215         (WebCore::MediaPlayer::load): ASSERT if called when the reload timer is active.
216         (WebCore::MediaPlayer::loadWithNextMediaEngine): Also process mediastream and mediasource urls.
217
218         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
219         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Don't test empty/null urls.
220
221         * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
222         (WebCore::MockMediaPlayerMediaSource::supportsType): Ditto.
223
224 2015-09-19  Chris Dumez  <cdumez@apple.com>
225
226         Get rid of most custom bindings for Location.idl
227         https://bugs.webkit.org/show_bug.cgi?id=149370
228
229         Reviewed by Darin Adler.
230
231         Get rid of most custom bindings for Location.idl by extending support
232         for the [CallWith=XXX] IDL extended attribute to support 2 additional
233         values: ActiveWindow and FirstWindow. Also introduce a
234         [SetterCallWith=XXX] alternative that passes the extra arguments to
235         the attribute setter only, as is needed by the Location attributes.
236
237         No new tests, no intended web-exposed behavior change.
238
239         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
240         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
241         * bindings/scripts/test/JS/JSTestObj.cpp:
242         * bindings/scripts/test/ObjC/DOMTestObj.h:
243         * bindings/scripts/test/ObjC/DOMTestObj.mm:
244         * bindings/scripts/test/TestObj.idl:
245         Add bindings tests coverage for [SetterCallWith=XXX].
246
247         * page/Location.idl:
248         Also drop [DoNotCheckSecurityOnSetter] on href attribute. It has
249         no effet as the interface does not have [CheckSecurity].
250
251 2015-09-19  Chris Dumez  <cdumez@apple.com>
252
253         Get rid of custom bindings for Document.location getter
254         https://bugs.webkit.org/show_bug.cgi?id=149369
255
256         Reviewed by Andreas Kling.
257
258         Get rid of custom bindings for Document.location getter by defining
259         a location getter on Document that calls the one on the document's
260         DOMWindow. The DOMWindow location getter already has an
261         isCurrentlyDisplayedInFrame() check so the document does not need
262         to do a null check on the frame.
263
264         No new tests, no web-exposed behavior change intended.
265
266         * bindings/js/JSDocumentCustom.cpp:
267         (WebCore::JSDocument::location): Deleted.
268         * dom/Document.cpp:
269         (WebCore::Document::location):
270         * dom/Document.h:
271         * dom/Document.idl:
272         * page/DOMWindow.cpp:
273         (WebCore::DOMWindow::location):
274
275 2015-09-18  Dean Jackson  <dino@apple.com>
276
277         Null dereference loading Blink layout test svg/filters/feImage-failed-load-crash.html
278         https://bugs.webkit.org/show_bug.cgi?id=149316
279         <rdar://problem/22749532>
280
281         Reviewed by Tim Horton.
282
283         If an feImage triggered loading a resource, and then was removed from the document,
284         we'd still try to notify its parent when the resource arrived (or failed).
285
286         Merge Blink commit:
287         https://chromium.googlesource.com/chromium/blink/+/9cbcfd7866bbaff0c4b3c4c8508b7c97b46d6e6a
288
289         Test: svg/filters/feImage-failed-load-crash.html
290
291         * svg/SVGFEImageElement.cpp:
292         (WebCore::SVGFEImageElement::notifyFinished): Add a null check to the parent element
293         before sending the notification.
294
295 2015-09-18  Dean Jackson  <dino@apple.com>
296
297         Null dereference loading Blink layout test svg/custom/use-href-attr-removal-crash.html
298         https://bugs.webkit.org/show_bug.cgi?id=149315
299         <rdar://problem/22749358>
300
301         Reviewed by Tim Horton.
302
303         We were not checking if the corresponding element referenced from
304         the SVG <use> actually existed before trying to set attributes on it.
305         The original Blink change is a little more detailed:
306         https://chromium.googlesource.com/chromium/blink/+/e2f1087f32bb088160ab7d59a715a1403ef267c7
307         However, we've significantly diverged at this point.
308
309         Tests: svg/custom/use-href-attr-removal-crash.html
310                svg/custom/use-href-attr-removal-crash2.svg
311                svg/custom/use-href-change-local-to-invalid-remote.html
312
313         * svg/SVGUseElement.cpp:
314         (WebCore::SVGUseElement::transferSizeAttributesToTargetClone):
315
316 2015-09-18  Commit Queue  <commit-queue@webkit.org>
317
318         Unreviewed, rolling out r189908.
319         https://bugs.webkit.org/show_bug.cgi?id=149368
320
321         Broke run-webkit-tests --pixel (Requested by ap on #webkit).
322
323         Reverted changeset:
324
325         "printing does not use minimum page zoom factor"
326         https://bugs.webkit.org/show_bug.cgi?id=108507
327         http://trac.webkit.org/changeset/189908
328
329 2015-09-18  Ryosuke Niwa  <rniwa@webkit.org>
330
331         Inserting or removing slot elements can cause a crash
332         https://bugs.webkit.org/show_bug.cgi?id=149365
333
334         Reviewed by Antti Koivisto.
335
336         HTMLSlotElement::insertedInto and removedFrom were doing completely non-sensical.
337
338         Since insertedInto and removedFrom are called on an element whenever it or its ancestor is inserted into
339         or removed from a container node, we can't always call addSlotElementByName removeSlotElementByName when
340         those functions are called. Instead, we need to check whether this slot has been inserted into or removed
341         from a container node that resides inside a shadow root.
342
343         Also reverted r189906 since the change was made upon a bogus assumption I had made.
344
345         Test: fast/shadow-dom/slot-removal-crash.html
346
347         * dom/Element.cpp:
348         (WebCore::Element::insertedInto): Added comments.
349         (WebCore::Element::removedFrom): Ditto.
350         (WebCore::Element::addShadowRoot): Reverted r189906.
351         (WebCore::Element::removeShadowRoot): Ditto.
352
353         * html/HTMLSlotElement.cpp:
354         (WebCore::HTMLSlotElement::insertedInto): When the insertion point's tree scope is different from ours,
355         the insertion happened to our shadow host or its ancestor. There is nothing to be done in that case since
356         the shadow tree was not modified (in particular, our relationship with our shadow root never changed).
357         We also don't do anything if we got inserted into a parent which is not inside a shadow tree.
358
359         (WebCore::HTMLSlotElement::removedFrom): Since Container::removeBetween sets the tree scope before this
360         function is getting called, we can't compare this element's treeScope with that of the "insertion" point.
361         They're always different regardless of whether the insertion point was in the same shadow tree to which
362         we belong or its shadow host's. However, since a node removed from a shadow tree is put into document's
363         tree scope before this function is called and InShadowTree flag is unset in Node::removedFrom at the end
364         of this function, this slot element is definitely being removed from its shadow root when isInShadowTree()
365         is true and the newly set tree scope is of the document. So call removeSlotElementByName if and only if
366         that condition holds.
367
368         (WebCore::HTMLSlotElement::getDistributedNodes): Explicitly check that we're inside a shadow root.
369
370 2015-09-18  Ryosuke Niwa  <rniwa@webkit.org>
371
372         REGRESSION(r150187): updateIdForTreeScope may not be called inside shadow trees
373         https://bugs.webkit.org/show_bug.cgi?id=149364
374
375         Reviewed by Antti Koivisto.
376
377         Since the tree scope is set to that of Document's inside removeBetween when a node is removed from a shadow tree,
378         oldScope != &treeScope() was already true inside Element::removedFrom. This can introduce an inconsistency in
379         DocumentOrderedMap which could result in a crash. Fixed the bug by checking it against document(), which is the
380         behavior we had prior to r150187.
381
382         Also added a consistency check in DocumentOrderedMap to catch bugs like this.
383
384         No new tests. New assertions fail in existing tests without this fix.
385
386         * dom/DocumentOrderedMap.cpp:
387         (WebCore::DocumentOrderedMap::add):
388         (WebCore::DocumentOrderedMap::remove):
389         (WebCore::DocumentOrderedMap::get):
390         * dom/DocumentOrderedMap.h:
391         * dom/Element.cpp:
392         (WebCore::Element::removedFrom):
393
394 2015-09-18  Antti Koivisto  <antti@apple.com>
395
396         Don't create renderers for children of shadow host
397         https://bugs.webkit.org/show_bug.cgi?id=149363
398
399         Reviewed by Ryosuke Niwa.
400
401         Test: fast/shadow-dom/css-scoping-shadow-root-hides-children.html
402
403         * dom/ShadowRoot.h:
404         * style/StyleResolveTree.cpp:
405         (WebCore::Style::attachRenderTree):
406         (WebCore::Style::resolveShadowTree):
407         (WebCore::Style::resolveChildren):
408         (WebCore::Style::resolveTree):
409
410 2015-09-08  Darin Adler  <darin@apple.com>
411
412         Refine and simplify some color-related code
413         https://bugs.webkit.org/show_bug.cgi?id=148961
414
415         Reviewed by Anders Carlsson.
416
417         Refactoring code that seems to be covered by existing tests.
418
419         * css/CSSParser.cpp:
420         (WebCore::CSSParser::parseColor): Handle the empty string efficiently so that
421         callers don't need to do that.
422
423         * platform/graphics/Color.h: Started adding comments about deprecation.
424         Added RGBA class for future use whenever we need an RGBA quadruplet rather than
425         a color with a color space. Added FIXME about future evoluation of the classes here.
426         Added OptionalColor so we can start removing the "invalid color" feature from Color.
427         Added roundAndClampColorChannel function.
428
429         * svg/ColorDistance.cpp: Removed.
430         * svg/ColorDistance.h: Removed.
431
432         * CMakeLists.txt: Removed ColorDistance.
433         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
434         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
435         * WebCore.xcodeproj/project.pbxproj: Ditto.
436         * svg/SVGAllInOne.cpp: Ditto.
437
438         * svg/SVGAnimatedColor.cpp:
439         (WebCore::SVGAnimatedColorAnimator::SVGAnimatedColorAnimator): Changed to take
440         a reference instead of a pointer.
441         (WebCore::SVGAnimatedColorAnimator::constructFromString): Simplified since the
442         SVGColor::colorFromRGBColorString will handle the empty string.
443         (WebCore::SVGAnimatedColorAnimator::addAnimatedTypes): Moved the code to add the
444         RGB channels of two colors here from ColorDistance::addColors since this is the
445         only place it was used.
446         (WebCore::currentColor): Refactored adjustForCurrentColor function into this.
447         Helper for the code below.
448         (WebCore::SVGAnimatedColorAnimator::calculateAnimatedValue): Refactored to use
449         the new currentColor function and replaced the use of the ColorDistance::clampColor
450         function here with a bit of code here in the one place it was used.
451         (WebCore::SVGAnimatedColorAnimator::calculateDistance): Moved the distance algorithm
452         here from ColorDistance::distance.
453
454         * svg/SVGAnimatedColor.h: Removed unneeded forward declaration, changed constructor
455         to take references instead of pointers, and made all class member functions private.
456
457         * svg/SVGAnimatedType.cpp:
458         (WebCore::SVGAnimatedType::setValueAsString): Removed special case for empty string,
459         since SVGColor::colorFromRGBColorString does the same thing.
460
461         * svg/SVGAnimatorFactory.h:
462         (WebCore::SVGAnimatorFactory::create): Pass references rather tha pointers to the
463         SVGAnimatedColorAnimator constructor.
464
465         * svg/SVGColor.cpp:
466         (WebCore::SVGColor::colorFromRGBColorString): Added more FIXMEs about the future of
467         this function.
468         (WebCore::SVGColor::setRGBColor): Fixed confusing verb tense.
469         (WebCore::SVGColor::customCSSText): Use ASCII literal for an ASCII literal.
470
471 2015-09-18  Eric Carlson  <eric.carlson@apple.com>
472
473         UserMediaClientMock leaks every test run
474         https://bugs.webkit.org/show_bug.cgi?id=149358
475
476         Reviewed by Tim Horton.
477
478         * platform/mock/UserMediaClientMock.h: Implement pageDestroyed.
479
480 2015-09-18  Alex Christensen  <achristensen@webkit.org>
481
482         190,000!
483
484 2015-09-18  Nan Wang  <n_wang@apple.com>
485
486         AX: Implement ARIA 1.1 @aria-current on iOS
487         https://bugs.webkit.org/show_bug.cgi?id=149297
488
489         Reviewed by Chris Fleizach.
490
491         Added support for iOS to query for aria-current status.
492         Also, enabled aria-current.html test on iOS.
493
494         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
495         (-[WebAccessibilityObjectWrapper accessibilityInvalidStatus]):
496         (-[WebAccessibilityObjectWrapper accessibilityARIACurrentStatus]):
497         (-[WebAccessibilityObjectWrapper accessibilityMathRootIndexObject]):
498
499 2015-09-18  Alex Christensen  <achristensen@webkit.org>
500
501         Fix Windows tests after switch to CMake.
502
503         * testing/js/WebCoreTestSupportPrefix.h:
504         Include cmakeconfig.h before wtf/Platform.h like we do in all the other precompiled headers
505         to have consistent features defined.
506
507 2015-09-18  Alexey Proskuryakov  <ap@apple.com>
508
509         REGRESSION (r189526): Nightlies don't work on Mavericks
510         https://bugs.webkit.org/show_bug.cgi?id=149215
511
512         Reviewed by Daniel Bates.
513
514         * platform/sql/SQLiteDatabase.cpp:
515         (WebCore::SQLiteDatabase::SQLiteDatabase): Fixed the check to work when cross-compiling
516         for 10.9 with 10.10 SDK.
517         (WebCore::SQLiteDatabase::disableThreadingChecks): Removed an obsolete version check -
518         WebCore has an #error elsewhere making sure that the version is higher than that.
519         (WebCore::SQLiteDatabase::authorizerFunction): Ditto.
520
521 2015-09-18  Alex Christensen  <achristensen@webkit.org>
522
523         CMake clean build fix after r189971.
524
525         * CMakeLists.txt:
526         Remove Entity.idl.
527
528 2015-09-18  Antti Koivisto  <antti@apple.com>
529
530         Support style isolation in shadow trees
531         https://bugs.webkit.org/show_bug.cgi?id=149353
532
533         Reviewed by Ryosuke Niwa.
534
535         Allow ShadowRoots to have their own StyleResolvers.
536
537         This patch just adds the mechanism, all shadow roots still use the document resolver.
538
539         * css/StyleResolver.h:
540         (WebCore::StyleResolverParentPusher::push):
541         (WebCore::StyleResolverParentPusher::~StyleResolverParentPusher):
542         * dom/Element.cpp:
543         (WebCore::Element::absoluteLinkURL):
544         (WebCore::Element::styleResolver):
545
546             Helper function for getting the right StyleResolver for the element.
547
548         (WebCore::Element::resolveStyle):
549
550             Helper function for resolving element style.
551
552         * dom/Element.h:
553         * dom/ShadowRoot.cpp:
554         (WebCore::ShadowRoot::~ShadowRoot):
555         (WebCore::ShadowRoot::styleResolver):
556         (WebCore::ShadowRoot::cloneNode):
557         * dom/ShadowRoot.h:
558         (WebCore::ShadowRoot::resetStyleInheritance):
559         * editing/EditingStyle.cpp:
560         (WebCore::styleFromMatchedRulesForElement):
561         * html/HTMLTitleElement.cpp:
562         (WebCore::HTMLTitleElement::computedTextWithDirection):
563         * html/canvas/CanvasRenderingContext2D.cpp:
564         (WebCore::CanvasRenderingContext2D::setFont):
565         * inspector/InspectorCSSAgent.cpp:
566         (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
567         * page/animation/KeyframeAnimation.cpp:
568         (WebCore::KeyframeAnimation::KeyframeAnimation):
569         * rendering/RenderElement.cpp:
570         (WebCore::RenderElement::getUncachedPseudoStyle):
571         (WebCore::RenderElement::containingBlockForFixedPosition):
572         * rendering/RenderNamedFlowFragment.cpp:
573         (WebCore::RenderNamedFlowFragment::checkRegionStyle):
574         (WebCore::RenderNamedFlowFragment::computeStyleInRegion):
575         * style/StyleResolveTree.cpp:
576         (WebCore::Style::styleForElement):
577         * svg/SVGElement.cpp:
578         (WebCore::SVGElement::customStyleForRenderer):
579         (WebCore::SVGElement::animatedSMILStyleProperties):
580         * svg/SVGElementRareData.h:
581         (WebCore::SVGElementRareData::overrideComputedStyle):
582
583 2015-09-18  Alex Christensen  <achristensen@webkit.org>
584
585         [Win] Fix bindings tests after r189934.
586
587         Reviewed by Brent Fulgham.
588
589         * bindings/scripts/preprocessor.pm:
590         (applyPreprocessor):
591         Bindings tests use /usr/bin/gcc from cygwin, which requires different flags.
592         If we're using gcc to preprocess, use it like we did before r189934.
593
594 2015-09-18  Eric Carlson  <eric.carlson@apple.com>
595
596         [MediaStream] Finish implementing MediaDevices.enumerateDevices
597         https://bugs.webkit.org/show_bug.cgi?id=149322
598         <rdar://problem/22750866>
599
600         Reviewed by Brent Fulgham.
601
602         Test: fast/mediastream/MediaDevices-enumerateDevices.html
603
604         * CMakeLists.txt: Add MediaDevicesRequest.cpp
605
606         * Modules/mediastream/MediaDeviceInfo.h: Add MediaDeviceInfoVector typedef.
607
608         * Modules/mediastream/MediaDevices.cpp:
609         (WebCore::MediaDevices::enumerateDevices): Use MediaDevicesRequest.
610         * Modules/mediastream/MediaDevices.h: EnumerateDevicePromise -> EnumerateDevicesPromise.
611         * Modules/mediastream/MediaDevices.idl:
612
613         * Modules/mediastream/MediaDevicesRequest.cpp: Added.
614         (WebCore::MediaDevicesRequest::create):
615         (WebCore::MediaDevicesRequest::MediaDevicesRequest):
616         (WebCore::MediaDevicesRequest::~MediaDevicesRequest):
617         (WebCore::MediaDevicesRequest::securityOrigin):
618         (WebCore::MediaDevicesRequest::contextDestroyed):
619         (WebCore::MediaDevicesRequest::start):
620         (WebCore::MediaDevicesRequest::didCompleteRequest):
621         (WebCore::MediaDevicesRequest::requestOrigin):
622         * Modules/mediastream/MediaDevicesRequest.h: Added.
623
624         * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
625         (WebCore::MediaStreamTrackSourcesRequest::MediaStreamTrackSourcesRequest):
626         (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
627         * Modules/mediastream/MediaStreamTrackSourcesRequest.h:
628
629         * Modules/mediastream/UserMediaRequest.cpp:
630         (WebCore::UserMediaRequest::enumerateDevices): Deleted.
631         * Modules/mediastream/UserMediaRequest.h:
632
633         * WebCore.xcodeproj/project.pbxproj: Add MediaDevicesRequest.cpp
634
635         * platform/mediastream/MediaDevicesPrivate.cpp: Removed.
636         * platform/mediastream/MediaDevicesPrivate.h: Removed.
637
638         * platform/mediastream/MediaStreamCreationClient.h:
639         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h:
640         (WebCore::MediaStreamTrackSourcesRequestClient::~MediaStreamTrackSourcesRequestClient):
641
642         * platform/mediastream/mac/AVCaptureDeviceManager.h:
643         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
644         (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optionally take an
645           AVCaptureSession instead of always allocating one.
646         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): Pass the AVCaptureSession
647           to verifyConstraintsForMediaType.
648
649         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
650         (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources):
651
652         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
653         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources):
654
655 2015-09-18  Chris Dumez  <cdumez@apple.com>
656
657         WebContent crash in WebCore::MemoryPressureHandler::releaseCriticalMemory() with GuardMalloc when preparing to suspend
658         https://bugs.webkit.org/show_bug.cgi?id=149350
659
660         Reviewed by Antti Koivisto.
661
662         in MemoryPressureHandler::releaseCriticalMemory(), iterate over a copy of
663         Document::allDocuments() instead of iterating over allDocuments() directly.
664         Also make sure the Documents are ref'd inside the copy.
665
666         This is needed because clearing the StyleResolver of a Document may cause
667         Documents to be unref'd and removed from the allDocument() HashSet.
668
669         No new tests, already covered by existing tests.
670
671         * platform/MemoryPressureHandler.cpp:
672         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
673
674 2015-09-18  Brent Fulgham  <bfulgham@apple.com>
675
676         [Win] Unreviewed build fix.
677
678         Non-cmake build does not include quotes in the file path, so a search
679         operation always failed.
680
681         * bindings/scripts/preprocessor.pm:
682         (applyPreprocessor):
683
684 2015-09-18  Chris Dumez  <cdumez@apple.com>
685
686         REGRESSION (r182449, Mavericks ONLY): Pages re-open empty after swiping back and scrolling on them
687         https://bugs.webkit.org/show_bug.cgi?id=149317
688         <rdar://problem/22521514>
689
690         Reviewed by Tim Horton.
691
692         Disable on Mavericks a PageCache optimization from r182449 which lets
693         into PageCache pages that only have certain types of pending loads
694         (images and XHR). This is because it has been determined via bisection
695         that this change is the one that introduced the bug on Mavericks.
696
697         * loader/DocumentLoader.cpp:
698         (WebCore::areAllLoadersPageCacheAcceptable):
699
700 2015-09-18  Brent Fulgham  <bfulgham@apple.com>
701
702         [Win] Use tiled drawing for main background layer
703         https://bugs.webkit.org/show_bug.cgi?id=149347
704         <rdar://problem/22759632>
705
706         Reviewed by Alex Christensen.
707
708         Turn on tiled drawing for the root layer when using
709         accelerated compositing on Windows. 
710
711         * page/Frame.h: Export the 'isMainFrame' method so that
712         it can be used by WebKit.dll.
713         * platform/graphics/ca/GraphicsLayerCA.cpp:
714         (WebCore::GraphicsLayerCA::getDebugBorderInfo): Use a full
715         pixel width on Windows, since it doesn't support High DPI (yet).
716         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
717         (PlatformCALayerWin::create): Use nullptr.
718         (toCACFFilterType): Ditto.
719         (layerTreeHostForLayer): Ditto.
720         (PlatformCALayer::platformCALayer): Ditto.
721          (PlatformCALayerWin::PlatformCALayerWin): Use the correct contents scaling
722         factor for new layers.
723         (PlatformCALayerWin::animationForKey): Use nullptr.
724         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp:
725         (WebTiledBackingLayerWin::displayCallback): Update assertion to
726         recognize LayerTypePageTiledBackingLayer as a valid layer to be used
727         in this display routine.
728
729 2015-09-18  Chris Dumez  <cdumez@apple.com>
730
731         Drop support for Entity Node type
732         https://bugs.webkit.org/show_bug.cgi?id=149239
733
734         Reviewed by Darin Adler.
735
736         Drop support for Entity DOM type. This legacy type has been dropped in
737         DOM4:
738         - https://dom.spec.whatwg.org/#dom-core-changes
739
740         Chrome [1] and Firefox [2] already dropped it. There is currently no
741         way to construct an Entity Node in WebKit.
742
743         [1] https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/k3tZGP2EANc
744         [2] https://developer.mozilla.org/en-US/docs/Web/API/Entity
745
746         No new tests, already covered by existing W3C test.
747
748         * DerivedSources.cpp:
749         * WebCore.xcodeproj/project.pbxproj:
750         * bindings/gobject/WebKitDOMPrivate.cpp:
751         (WebKit::wrap): Deleted.
752         * bindings/js/JSNodeCustom.cpp:
753         (WebCore::createWrapperInline): Deleted.
754         * bindings/objc/DOM.mm:
755         (kitClass): Deleted.
756         * dom/Document.cpp:
757         (WebCore::Document::importNode): Deleted.
758         (WebCore::Document::adoptNode): Deleted.
759         (WebCore::Document::childTypeAllowed): Deleted.
760         (WebCore::Document::canAcceptChild): Deleted.
761         * dom/Entity.h:
762         * dom/Entity.idl:
763         * dom/Node.cpp:
764         (WebCore::Node::isDefaultNamespace): Deleted.
765         (WebCore::Node::lookupPrefix): Deleted.
766         (WebCore::Node::lookupNamespaceURI): Deleted.
767         (WebCore::appendTextContent): Deleted.
768         (WebCore::Node::setTextContent): Deleted.
769         * dom/Node.h:
770         * dom/Range.cpp:
771         (WebCore::lengthOfContentsInNode): Deleted.
772         (WebCore::Range::processContentsBetweenOffsets): Deleted.
773         (WebCore::Range::insertNode): Deleted.
774         (WebCore::Range::checkNodeWOffset): Deleted.
775         (WebCore::Range::checkNodeBA): Deleted.
776         (WebCore::Range::selectNode): Deleted.
777         (WebCore::Range::selectNodeContents): Deleted.
778         (WebCore::Range::surroundContents): Deleted.
779         * editing/MarkupAccumulator.cpp:
780         (WebCore::MarkupAccumulator::appendStartMarkup): Deleted.
781         * xml/XPathUtil.cpp:
782         (WebCore::XPath::isValidContextNode): Deleted.
783
784 2015-09-17  Brian Burg  <bburg@apple.com>
785
786         ASSERT(!m_frontendRouter->hasLocalFrontend()) when running Web Inspector tests
787         https://bugs.webkit.org/show_bug.cgi?id=149006
788
789         Reviewed by Joseph Pecoraro.
790
791         The patch fixes two defects:
792
793             (1) the stub inspector frontend is not closed reliably when a test times out
794             (2) frontend clients and channels are sometimes connected to the wrong controllers
795
796         When an inspector test times out, the test runner requests (via the inspected page's controller)
797         that the inspector close. But, the stub frontend works independently of InspectorClient,
798         so the inspected page's InspectorController cannot close the stub frontend. The assertion
799         failed because the stub frontend's channel was still connected to the inspected page's controller.
800
801         The fix is to route requests for the inspector window to close through the FrontendClient's
802         closeWindow() method rather than InspectorClient, so that the stub frontend can react.
803         The other code paths (i.e., through close() and closeLocalFrontend()) have been removed.
804
805         Now that the stub frontend eagerly closes its channel before the Page gets GC'd, several
806         methods invoked during test teardown must be reordered to avoid using dangling pointers.
807
808         The stub frontend in Internals has been rewritten to properly disconnect itself
809         from both the frontend and inspected page's inspector controllers.
810
811         While fixing this bug, I noticed that we are inconsistent about which inspector controller
812         (the inspected page's or the frontend page's) receives the FrontendClient and which takes
813         FrontendChannels. It is now the case for all configurations that the FrontendClient is
814         connected to the frontend page's inspector controller, and FrontendChannels are connected
815         to the inspected page's inspector controller. In the WK2 case, the Inspector Process
816         has an attached frontend client, and its inspected Web Process has frontend channels.
817
818         No new tests, covered by existing tests.
819
820         * inspector/InspectorClient.h:
821         * inspector/InspectorController.cpp:
822         (WebCore::InspectorController::~InspectorController):
823         (WebCore::InspectorController::inspectedPageDestroyed):
824
825             This method is called from Page::~Page, so we should disconnect all frontends now
826             before subframes are detached from the page, making InspectorController inaccessible.
827
828         (WebCore::InspectorController::disconnectFrontend):
829
830             The teardown branch was never being run before, because we never disconnected the
831             frontend's channel correctly. Some agents use the overlay during teardown, so notify
832             agents before releasing the overlay page.
833
834         (WebCore::InspectorController::disconnectAllFrontends):
835
836             The actions from close() are inlined and rearranged here, similar to disconnectFrontend.
837             We have to notify agents before removing InspectorClient as some agents make use of it.
838
839         (WebCore::InspectorController::close): Deleted.
840         (WebCore::InspectorController::show): This assertion is vacuously true now.
841         * inspector/InspectorFrontendClientLocal.cpp:
842         (WebCore::InspectorFrontendClientLocal::inspectedPage): Added. Used by stub frontend.
843         * inspector/InspectorFrontendClientLocal.h:
844         (WebCore::InspectorFrontendClientLocal::frontendPage): Added.
845         * loader/EmptyClients.h:
846         * page/Page.cpp:
847         (WebCore::Page::~Page):
848
849             Notify inspector before detaching frames, otherwise it will not be possible to
850             cleanly disconnect the stub frontend's channel.
851
852         * testing/Internals.cpp:
853
854             Rewrite the stub frontend to better encapsulate its setup and teardown logic.
855
856         (WebCore::InspectorStubFrontend::frontendPage): Added.
857         (WebCore::InspectorStubFrontend::InspectorStubFrontend): Added.
858         (WebCore::InspectorStubFrontend::~InspectorStubFrontend): Added.
859         (WebCore::InspectorStubFrontend::closeWindow): Added.
860         (WebCore::InspectorStubFrontend::sendMessageToFrontend): Added.
861         (WebCore::Internals::openDummyInspectorFrontend):
862         (WebCore::Internals::closeDummyInspectorFrontend):
863         (WebCore::InspectorFrontendClientDummy::~InspectorFrontendClientDummy): Deleted.
864         (WebCore::InspectorFrontendClientDummy::InspectorFrontendClientDummy): Deleted.
865         (WebCore::InspectorFrontendChannelDummy::~InspectorFrontendChannelDummy): Deleted.
866         (WebCore::InspectorFrontendChannelDummy::InspectorFrontendChannelDummy): Deleted.
867         (WebCore::InspectorFrontendChannelDummy::sendMessageToFrontend): Deleted.
868         * testing/Internals.h:
869
870 2015-09-18  Chris Dumez  <cdumez@apple.com>
871
872         classList.toggle(name, force) treats undefined `force` argument as false
873         https://bugs.webkit.org/show_bug.cgi?id=148582
874         <rdar://problem/22545600>
875
876         Reviewed by Ryosuke Niwa.
877
878         classList.toggle(name, force) treats undefined `force` argument as false.
879         However, according to the Web IDL specification, we should treat undefined
880         as if the value was missing for optional parameters that do not have a
881         default value:
882         https://heycam.github.io/webidl/#dfn-overload-resolution-algorithm (Step 14.4).
883
884         For optional parameters that have a default value, undefined should be
885         converted into the default value. This is supported as of r189957.
886
887         In this patch, we use custom bindings to provide a spec-compliant version
888         of DOMTokenList.toggle(). Unfortunately, adding such support in the
889         bindings generator would be a non-trivial task (I guess, we would have to
890         generalize using WTF::Optional<> type for all optional parameters in our
891         implementation. Also we cannot use the default value support added in
892         r189957 because the toggle() implementation needs to be able to
893         distinguish all 3 states for the 'force' parameter: true, false or
894         missing.
895
896         The new behavior matches the behavior of Firefox and the specification.
897
898         Test: fast/dom/Element/class-list-toggle.html
899
900         * CMakeLists.txt:
901         * WebCore.vcxproj/WebCore.vcxproj:
902         * WebCore.vcxproj/WebCore.vcxproj.filters:
903         * WebCore.xcodeproj/project.pbxproj:
904         * bindings/js/JSBindingsAllInOne.cpp:
905         * bindings/js/JSDOMTokenListCustom.cpp: Added.
906         (WebCore::JSDOMTokenList::toggle):
907         * html/DOMTokenList.h:
908         * html/DOMTokenList.idl:
909
910 2015-09-17  Joseph Pecoraro  <pecoraro@apple.com>
911
912         Web Inspector: Remove unused canClearBrowserCookies / canClearBrowserCache protocol methods
913         https://bugs.webkit.org/show_bug.cgi?id=149307
914
915         Reviewed by Brian Burg.
916
917         * inspector/InspectorClient.h:
918         (WebCore::InspectorClient::canClearBrowserCache): Deleted.
919         (WebCore::InspectorClient::clearBrowserCache): Deleted.
920         (WebCore::InspectorClient::canClearBrowserCookies): Deleted.
921         (WebCore::InspectorClient::clearBrowserCookies): Deleted.
922         These were unimplemented by any ports.
923
924         * inspector/CommandLineAPIHost.cpp:
925         * inspector/InspectorController.cpp:
926         (WebCore::InspectorController::InspectorController):
927         * inspector/InspectorResourceAgent.cpp:
928         (WebCore::InspectorResourceAgent::InspectorResourceAgent):
929         (WebCore::InspectorResourceAgent::canClearBrowserCache): Deleted.
930         (WebCore::InspectorResourceAgent::clearBrowserCache): Deleted.
931         (WebCore::InspectorResourceAgent::canClearBrowserCookies): Deleted.
932         (WebCore::InspectorResourceAgent::clearBrowserCookies): Deleted.
933         * inspector/InspectorResourceAgent.h:
934         * inspector/InspectorTimelineAgent.cpp:
935         (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
936         * inspector/InspectorTimelineAgent.h:
937         * inspector/WorkerInspectorController.cpp:
938         (WebCore::WorkerInspectorController::WorkerInspectorController):
939         Remove uses of InspectorClient where it is no longer needed.
940
941 2015-09-16  Ryosuke Niwa  <rniwa@webkit.org>
942
943         Update features.json for Shadow DOM and Web Components
944         https://bugs.webkit.org/show_bug.cgi?id=149249
945
946         Reviewed by Antti Koivisto.
947
948         Updated the status of Shadow DOM and made myself the point of contact for shadow DOM and web components.
949
950         * features.json:
951
952 2015-09-17  Chris Dumez  <cdumez@apple.com>
953
954         [WebIDL] Add support for default parameter values
955         https://bugs.webkit.org/show_bug.cgi?id=149263
956         <rdar://problem/22545600>
957
958         Reviewed by Ryosuke Niwa.
959
960         Add support for default parameter values to our Web IDL parser and JS
961         bindings generator. This allows the bindings to convert undefined to
962         the parameter's default value for optional parameters:
963         https://heycam.github.io/webidl/#dfn-optional-argument-default-value
964
965         Previously, our bindings generator would just convert undefined to
966         0 / false / "undefined" for optional parameters, depending on the
967         parameter type.
968
969         This patch uses the new default parameter support to fix a bug in
970         document.createNodeIterator() / document.createTreeWalker()'s handling
971         of the whatToShow parameter:
972         https://dom.spec.whatwg.org/#document
973
974         WebKit currently was undefined to 0 in this case, even though it should
975         use the parameter's default value: OxFFFFFFFF.
976
977         I am planning to go through other optional parameters in a follow-up
978         patch and add default values where needed.
979
980         No new tests, already covered by existing layout tests and
981         added bindings tests coverage.
982
983         * bindings/scripts/CodeGeneratorJS.pm:
984         (GenerateParametersCheck):
985         * bindings/scripts/IDLParser.pm:
986         (parseOptionalOrRequiredArgument):
987         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
988         (webkit_dom_test_obj_method_with_optional_arg_and_default_value):
989         (webkit_dom_test_obj_method_with_optional_string_and_default_value):
990         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
991         * bindings/scripts/test/JS/JSTestObj.cpp:
992         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalArgAndDefaultValue):
993         (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValue):
994         * bindings/scripts/test/ObjC/DOMTestObj.h:
995         * bindings/scripts/test/ObjC/DOMTestObj.mm:
996         (-[DOMTestObj methodWithOptionalArgAndDefaultValue:]):
997         (-[DOMTestObj methodWithOptionalStringAndDefaultValue:]):
998         * bindings/scripts/test/TestObj.idl:
999         * dom/Document.idl:
1000
1001 2015-09-17  Dean Jackson  <dino@apple.com>
1002
1003         Multi-hop reference cycles not detected.
1004         https://bugs.webkit.org/show_bug.cgi?id=149181
1005
1006         Reviewed by Jon Honeycutt.
1007
1008         SVG's cycle detection was not picking up a
1009         case where an element was drawing a pattern, that
1010         referenced another pattern, that referenced another
1011         pattern, that referenced the original pattern.
1012
1013         The issue was that we were forgetting to check the
1014         children of the renderer itself, rather than just
1015         the children of the referenced renderers.
1016
1017         Found by running a test from Blink.
1018
1019         I also took the opportunity to clean up the debugging
1020         code that logs cycle detection.
1021
1022         Test: svg/custom/pattern-3-step-cycle.html
1023
1024         * platform/Logging.h: Add a new SVG channel. I can't believe we
1025         didn't already have one!
1026         * rendering/svg/SVGResourcesCycleSolver.cpp:
1027         (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): Check the referenced
1028         resources for cycles.
1029         (WebCore::SVGResourcesCycleSolver::resolveCycles): Logging update.
1030
1031 2015-09-17  Dean Jackson  <dino@apple.com>
1032
1033         Cyclic resources were not detected if the reference had deep containers
1034         https://bugs.webkit.org/show_bug.cgi?id=149182
1035
1036         Reviewed by Jon Honeycutt.
1037
1038         During our examination of the SVG rendering tree looking for cycles,
1039         if a resource pointed to something that had a nested structure, and
1040         one of the parent nodes in that structure was a container object
1041         without resources itself, we were not looking into the children.
1042
1043         Test: svg/custom/pattern-content-cycle-w-resourceless-container.html
1044
1045         * rendering/svg/SVGResourcesCycleSolver.cpp:
1046         (WebCore::SVGResourcesCycleSolver::resourceContainsCycles): We should still
1047         check all children resources, but not exit early if there are none. Instead
1048         we should recurse into any children.
1049         (WebCore::SVGResourcesCycleSolver::resolveCycles): Changes to some debug
1050         code that no longer compiled (it's still off by default, but at least
1051         it will work now).
1052
1053 2015-09-17  Myles C. Maxfield  <mmaxfield@apple.com>
1054
1055         REGRESSION(r188871): 50% regression in page load time of Wikipedia home page
1056         https://bugs.webkit.org/show_bug.cgi?id=149320
1057
1058         Reviewed by Daniel Bates.
1059
1060         This is due to <rdar://problem/22144016> about how language-specific
1061         font fallback is an order of magnitude slower than regular non-language-
1062         specific font-fallback. This performance problem has been fixed, but not
1063         for iOS 9.
1064
1065         No new tests because there is no correctness change.
1066
1067         * platform/graphics/ios/FontCacheIOS.mm:
1068         (WebCore::platformLookupFallbackFont):
1069
1070 2015-09-17  Ryosuke Niwa  <rniwa@webkit.org>
1071
1072         Add HTMLSlotElement, Element.slot, and NonDocumentTypeChildNode.assignedSlot
1073         https://bugs.webkit.org/show_bug.cgi?id=149241
1074
1075         Reviewed by Antti Koivisto.
1076
1077         Implement the slotting algorithm and related features: slot element, slot attribute, and assignedSlot
1078         as specified by https://w3c.github.io/webcomponents/spec/shadow/#slotting-algorithm
1079         as of 8bf56e8ea5521a7a911efd1cabeb2be0d5c3ca74.
1080
1081         The slotting algorithm is implemented by the newly introduced SlotAssignment class which is created on
1082         demand by ShadowRoot when a HTMLSlotElement is inserted into the shadow root. SlotAssignment contains
1083         a HashMap of a slot name to SlotInfo structure, which holds the number of slot elements of the said name,
1084         the first element if it's known, and an ordered list of the assigned nodes.
1085
1086         When there is exactly one slot element of a given name, "element" returns the slot element in O(1).
1087         When another slot of the same name is inserted into the same shadow tree, we increment "elementCount" and
1088         set "element" to nullptr since we don't know which slot element comes first in the tree order without O(n)
1089         tree traversal, which is lazily done in resolveAllSlotElements.
1090
1091         Observe that SlotInfo's "element" can be nullptr in two occasions: (1) when there is no slot element of
1092         the given name (SlotAssignment::assignSlots may insert such an entry), and (2) when there are more than
1093         one slot elements of the same name and we haven't run resolveAllSlotElements.
1094
1095         Resolving assigned nodes, on the other hand, is always O(n) unless all assignments are up to date, and
1096         lazily computed by assignSlots. This is because inserting or removing a node doesn't tell us the relative
1097         ordering of the node with respect to other nodes assigned to the same slot. For example, let's say we have
1098         child nodes (A, B, C, D) and (A, D) are assigned to slot Alpha and (B, C) are assigned to slot Beta. If we
1099         insert a new node E between nodes B and C and this node is assigned to slot Alpha, then we must create an
1100         ordered list (A, E, D) for slot Alpha. Unfortunately, determining where to insert E in this list can cost
1101         O(n) child traversal in the worst case.
1102
1103         Tests: fast/shadow-dom/HTMLSlotElement-interface.html
1104                fast/shadow-dom/NonDocumentTypeChildNode-interface-assignedSlot.html
1105
1106         * CMakeLists.txt:
1107         * DerivedSources.cpp:
1108         * DerivedSources.make:
1109         * WebCore.vcxproj/WebCore.vcxproj:
1110         * WebCore.vcxproj/WebCore.vcxproj.filters:
1111         * WebCore.xcodeproj/project.pbxproj:
1112         * dom/Element.cpp:
1113         (WebCore::Element::attributeChanged): Invalidate the slot assignments when slot attribute is changed.
1114         (WebCore::Element::childrenChanged): Ditto for when a child node is inserted or removed. We can avoid it
1115         when there is no default slot and only text nodes are removed or added in the future.
1116         * dom/Element.idl: Added slot attribute on Element.
1117         * dom/Node.cpp:
1118         (WebCore::Node::assignedSlot): Added. Returns the assigned slot if the slot is in an open shadow tree.
1119         * dom/Node.h:
1120         * dom/NonDocumentTypeChildNode.idl: Added assignedSlot. Only expose in JS for now to avoid generating
1121         the binding code for HTMLSlotElement in other languages.
1122         * dom/ShadowRoot.cpp:
1123         (WebCore::ShadowRoot::findAssignedSlot): Added. Forwards it to the implementation in SlotAssignment.
1124         (WebCore::ShadowRoot::addSlotElementByName): Ditto.
1125         (WebCore::ShadowRoot::removeSlotElementByName): Ditto.
1126         (WebCore::ShadowRoot::invalidateSlotAssignments): Ditto.
1127         (WebCore::ShadowRoot::assignedNodesForSlot): Ditto.
1128         * dom/ShadowRoot.h:
1129         (WebCore::ShadowRoot): Added m_slotAssignments as a member.
1130         * dom/SlotAssignment.cpp: Added.
1131         (WebCore::treatNullAsEmpty): Added. See https://w3c.github.io/webcomponents/spec/shadow/#dfn-default-slot
1132         (WebCore::SlotAssignment::findAssignedSlot): Find the slot element to which a given node is assigned.
1133         Since there could be multiple slot elements of the same name (or lack thereof), call findFirstSlotElement
1134         to find the first slot element.
1135         (WebCore::SlotAssignment::addSlotElementByName): Added. Called when a new slot element is inserted into
1136         the associated shadow tree. When a slot element's name is changed, removeSlotElementByName is called on
1137         with the old name before addSlotElementByName is called with the new name.
1138         (WebCore::SlotAssignment::removeSlotElementByName): Ditto for removal.
1139         (WebCore::SlotAssignment::assignedNodesForSlot): Added. Finds the ordered list of assigned nodes for
1140         a given slot element. When there are multiple slot elements of the same name, we return the list only if
1141         SlotInfo::element matches the argument. 
1142         (WebCore::SlotAssignment::findFirstSlotElement): Added. Resolves SlotInfo::element if needed.
1143         (WebCore::SlotAssignment::resolveAllSlotElements): Finds SlotInfo::element for all slots. We resolve all
1144         slots simultaneously to avoid doing O(number of nodes) tree traversal for O(number of slots) to avoid
1145         the worst case O(n^2) behavior when all nodes in the shadow tree are slot elements of the same name. 
1146         (WebCore::SlotAssignment::assignSlots): Added. Computes the slot assignments by traversing each child
1147         of the shadow host and adding to the appropriate SlotInfo::assignedNodes, creating a new entry if needed.
1148         * dom/SlotAssignment.h: Added.
1149         (WebCore::SlotAssignment::SlotAssignment):
1150         (WebCore::SlotAssignment::invalidate):
1151         (WebCore::SlotAssignment::SlotInfo::SlotInfo):
1152         (WebCore::SlotAssignment::SlotInfo::hasSlotElements):
1153         (WebCore::SlotAssignment::SlotInfo::hasDuplicatedSlotElements):
1154         (WebCore::SlotAssignment::SlotInfo::shouldResolveSlotElement):
1155         * html/HTMLAttributeNames.in: Added slot attribute.
1156         * html/HTMLSlotElement.cpp: Added.
1157         (WebCore::HTMLSlotElement::create):
1158         (WebCore::HTMLSlotElement::HTMLSlotElement):
1159         (WebCore::HTMLSlotElement::insertedInto): Calls addSlotElementByName.
1160         (WebCore::HTMLSlotElement::removedFrom): Calls removeSlotElementByName. Because the element had already
1161         been removed from the shadow tree, we can't use containingShadowRoot() to find the ShadowRoot here.
1162         (WebCore::HTMLSlotElement::attributeChanged): Calls removeSlotElementByName and addSlotElementByName.
1163         (WebCore::HTMLSlotElement::getDistributedNodes): Returns an ordered list of the assigned nodes.
1164         * html/HTMLSlotElement.h: Added.
1165         * html/HTMLSlotElement.idl: Added.
1166         * html/HTMLTagNames.in: Added slot element.
1167
1168 2015-09-17  Chris Dumez  <cdumez@apple.com>
1169
1170         Regression(r189881): release assertion hit in toJS(ExecState*, JSDOMGlobalObject*, DocumentFragment*)
1171         https://bugs.webkit.org/show_bug.cgi?id=149281
1172
1173         Reviewed by Ryosuke Niwa.
1174
1175         After r189881, we started generating a toJS() function for DocumentFragment
1176         as an optimization. DocumentFragment has a subclass (ShadowRoot) but the
1177         default toJS() implementation should have still been acceptable given that
1178         the subclass is not web-exposed and therefore does not have a JS wrapper.
1179
1180         However, the ShadowRoot interface was introduced shortly after in r189841
1181         and to toJS() implementation for DocumentFragment is now invalid. This
1182         patch introduces a ShadowRoot-aware custom implementation of toJS() for
1183         DocumentFragment to address the problem.
1184
1185         No new tests, already covered by:
1186         plugins/snapshotting/snapshot-plugin-not-quite-blocked-by-image.html
1187
1188         * bindings/js/JSDocumentFragmentCustom.cpp:
1189         (WebCore::createNewDocumentFragmentWrapper):
1190         (WebCore::toJSNewlyCreated):
1191         (WebCore::toJS):
1192         Provide a ShadowRoot-aware custom implementation of toJS() /
1193         toJSNewlyCreated() for DocumentFragment.
1194
1195         * bindings/js/JSNodeCustom.cpp:
1196         (WebCore::createWrapperInline):
1197         Fix bug in toJS() implementation for Node as it was not handling
1198         ShadowRoots properly either.
1199
1200         * dom/DocumentFragment.idl:
1201         Use [CustomToJSObject] so we can provide our own custom implementation
1202         of toJS().
1203
1204 2015-09-17  Antti Koivisto  <antti@apple.com>
1205
1206         De-template ContainerNodeAlgorithms
1207         https://bugs.webkit.org/show_bug.cgi?id=149286
1208
1209         Reviewed by Andreas Kling.
1210
1211         These are always used with ContainerNode/Node.
1212
1213         * dom/ContainerNode.cpp:
1214         (WebCore::ContainerNode::removeDetachedChildren):
1215         (WebCore::destroyRenderTreeIfNeeded):
1216         (WebCore::ContainerNode::takeAllChildrenFrom):
1217         (WebCore::ContainerNode::insertBeforeCommon):
1218         (WebCore::ContainerNode::appendChildCommon):
1219
1220             Make append a member for consistency with insert.
1221
1222         (WebCore::ContainerNode::notifyChildInserted):
1223         (WebCore::ContainerNode::notifyChildRemoved):
1224         (WebCore::ContainerNode::parserInsertBefore):
1225         (WebCore::ContainerNode::replaceChild):
1226         (WebCore::ContainerNode::appendChild):
1227         (WebCore::ContainerNode::parserAppendChild):
1228
1229             Also make rest of these ownership-taking functions take Ref<>&&.
1230
1231         * dom/ContainerNode.h:
1232         (WebCore::NoEventDispatchAssertion::NoEventDispatchAssertion):
1233         (WebCore::ContainerNode::setFirstChild):
1234         * dom/ContainerNodeAlgorithms.cpp:
1235         (WebCore::notifyChildNodeRemoved):
1236         (WebCore::addChildNodesToDeletionQueue):
1237         (WebCore::removeDetachedChildrenInContainer):
1238         (WebCore::collectFrameOwners):
1239         (WebCore::assertConnectedSubrameCountIsConsistent):
1240         (WebCore::disconnectSubframes):
1241         * dom/ContainerNodeAlgorithms.h:
1242         (WebCore::removeDetachedChildrenInContainer): Deleted.
1243         (WebCore::appendChildToContainer): Deleted.
1244         (WebCore::Private::NodeRemovalDispatcher::dispatch): Deleted.
1245         (WebCore::Private::addChildNodesToDeletionQueue): Deleted.
1246         * html/parser/HTMLConstructionSite.cpp:
1247         (WebCore::insert):
1248         (WebCore::executeInsertTask):
1249         (WebCore::executeReparentTask):
1250         (WebCore::executeInsertAlreadyParsedChildTask):
1251         * html/track/WebVTTParser.cpp:
1252         (WebCore::WebVTTTreeBuilder::constructTreeFromToken):
1253         * xml/XMLErrors.cpp:
1254         (WebCore::XMLErrors::appendErrorMessage):
1255         (WebCore::createXHTMLParserErrorHeader):
1256         (WebCore::XMLErrors::insertErrorMessageBlock):
1257         * xml/parser/XMLDocumentParser.cpp:
1258         (WebCore::XMLDocumentParser::enterText):
1259         (WebCore::toString):
1260         * xml/parser/XMLDocumentParserLibxml2.cpp:
1261         (WebCore::XMLDocumentParser::startElementNs):
1262         (WebCore::XMLDocumentParser::processingInstruction):
1263         (WebCore::XMLDocumentParser::cdataBlock):
1264         (WebCore::XMLDocumentParser::comment):
1265
1266 2015-09-17  Tim Horton  <timothy_horton@apple.com>
1267
1268         Block Objective-C exceptions in DictionaryLookup
1269         https://bugs.webkit.org/show_bug.cgi?id=149256
1270
1271         Reviewed by Anders Carlsson.
1272
1273         * editing/mac/DictionaryLookup.mm:
1274         (WebCore::DictionaryLookup::rangeForSelection):
1275         (WebCore::DictionaryLookup::rangeAtHitTestResult):
1276         (WebCore::expandSelectionByCharacters):
1277         (WebCore::DictionaryLookup::stringForPDFSelection):
1278         (WebCore::showPopupOrCreateAnimationController):
1279         (WebCore::DictionaryLookup::hidePopup):
1280         It is possible for Lookup to throw an exception if one of its
1281         related services dies for some reason. This shouldn't take down
1282         our UI process, so block the exceptions.
1283
1284 2015-09-17  Yusuke Suzuki  <utatane.tea@gmail.com>
1285
1286         [ES6] Add more fine-grained APIs and additional hooks to control module loader from WebCore
1287         https://bugs.webkit.org/show_bug.cgi?id=149129
1288
1289         Reviewed by Saam Barati.
1290
1291         No behavior change.
1292
1293         * bindings/js/JSDOMWindowBase.cpp:
1294         * bindings/js/JSWorkerGlobalScopeBase.cpp:
1295
1296 2015-09-17  Alex Christensen  <achristensen@webkit.org>
1297
1298         Switch AppleWin build to use CMake
1299         https://bugs.webkit.org/show_bug.cgi?id=149163
1300
1301         Reviewed by Brent Fulgham.
1302
1303         * bindings/scripts/preprocess-idls.pl:
1304         (CygwinPathIfNeeded):
1305         (WriteFileIfChanged):
1306         * bindings/scripts/preprocessor.pm:
1307         (applyPreprocessor):
1308         Fix new cygwin quirks.  Cygwin is now using some paths from CMake.
1309
1310 2015-09-17  Zalan Bujtas  <zalan@apple.com>
1311
1312         Remove integral snapping functions from InlineBox class.
1313         https://bugs.webkit.org/show_bug.cgi?id=136419
1314
1315         Reviewed by Simon Fraser.
1316
1317         We should not integral snap inlines during layout time.
1318
1319         Covered by existing tests.
1320
1321         * rendering/InlineBox.h:
1322         (WebCore::InlineBox::pixelSnappedLogicalLeft): Deleted.
1323         (WebCore::InlineBox::pixelSnappedLogicalRight): Deleted.
1324         (WebCore::InlineBox::pixelSnappedLogicalTop): Deleted.
1325         (WebCore::InlineBox::pixelSnappedLogicalBottom): Deleted.
1326         * rendering/InlineFlowBox.cpp:
1327         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
1328         (WebCore::InlineFlowBox::addBoxShadowVisualOverflow):
1329         (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
1330         (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
1331
1332 2015-09-17  Per Arne Vollan  <peavo@outlook.com>
1333
1334         [WinCairo] Compile error, include file not found.
1335         https://bugs.webkit.org/show_bug.cgi?id=149282
1336
1337         Reviewed by Alex Christensen.
1338
1339         * PlatformWin.cmake:
1340         Copy forwarding headers from new legacy directory, fixing CMake clean builds since r189746.
1341
1342 2015-09-17  Tim Horton  <timothy_horton@apple.com>
1343
1344         Delete some dead code
1345         https://bugs.webkit.org/show_bug.cgi?id=149255
1346
1347         Reviewed by Dan Bernstein.
1348
1349         No new tests, just cleanup.
1350
1351         * platform/RuntimeApplicationChecksIOS.h:
1352         * platform/RuntimeApplicationChecksIOS.mm:
1353         (WebCore::applicationIsEpicurious): Deleted.
1354         (WebCore::applicationIsMASH): Deleted.
1355         Nothing uses these application checks anymore.
1356
1357         * platform/ios/SoundIOS.mm:
1358         (WebCore::systemBeep):
1359         What a beep should be on iOS, I don't know.
1360         What it should not be is a NSLog.
1361
1362 2015-09-17  Saam barati  <sbarati@apple.com>
1363
1364         Interpreter::unwind() shouldn't be responsible for filtering out uncatchable exceptions
1365         https://bugs.webkit.org/show_bug.cgi?id=149228
1366
1367         Reviewed by Mark Lam.
1368
1369         No new tests, already covered by current tests. This is not an observable behavior change.
1370
1371         * bindings/js/JSNodeFilterCustom.cpp:
1372         (WebCore::JSNodeFilter::acceptNode):
1373
1374 2015-09-17  Zalan Bujtas  <zalan@apple.com>
1375
1376         column-rule-style: outset/inset doesn't work
1377         https://bugs.webkit.org/show_bug.cgi?id=148815
1378         <rdar://problem/22582644>
1379
1380         Reviewed by David Hyatt.
1381
1382         https://drafts.csswg.org/css-multicol-1/#crs
1383         The <‘border-style’> values are interpreted as in the collapsing border model.
1384
1385         Unskipped 4 multicolumn tests, 
1386
1387         * rendering/RenderMultiColumnSet.cpp:
1388         (WebCore::RenderMultiColumnSet::paintColumnRules):
1389         * rendering/RenderTableCell.cpp:
1390         (WebCore::collapsedBorderStyle): Deleted.
1391         * rendering/style/RenderStyle.h:
1392         (WebCore::collapsedBorderStyle):
1393
1394 2015-09-17  Chris Dumez  <cdumez@apple.com>
1395
1396         Range.deleteContents cannot delete DocType
1397         https://bugs.webkit.org/show_bug.cgi?id=148773
1398         <rdar://problem/22571280>
1399
1400         Reviewed by Ryosuke Niwa.
1401
1402         Range.deleteContents() was not able to delete a DocumentType Node, and
1403         was throwing a HIERARCHY_REQUEST_ERR. The DOM specification does not
1404         say we should throw in such case:
1405         https://dom.spec.whatwg.org/#dom-range-deletecontents
1406
1407         However, Range.extractContents() should still throw an exception
1408         if any of the contained children in a DocumentType Node:
1409         https://dom.spec.whatwg.org/#concept-range-extract (Step 12)
1410
1411         No new tests, already covered by existing test.
1412
1413         * dom/Range.cpp:
1414         (WebCore::Range::deleteContents):
1415         (WebCore::Range::extractContents):
1416         (WebCore::Range::checkDeleteExtract):
1417         * dom/Range.h:
1418
1419 2015-09-17  Eric Carlson  <eric.carlson@apple.com>
1420
1421         [Mac MediaStream] Cleanup capture source classes
1422         https://bugs.webkit.org/show_bug.cgi?id=149233
1423
1424         Reviewed by Jer Noble.
1425
1426         * platform/cf/CoreMediaSoftLink.cpp: Soft-link CMAudioFormatDescriptionGetStreamBasicDescription,
1427           CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer, and CMSampleBufferGetNumSamples.
1428         * platform/cf/CoreMediaSoftLink.h:
1429
1430         * platform/mediastream/mac/AVAudioCaptureSource.h:
1431         (WebCore::AVAudioCaptureSource::Observer::~Observer):
1432         * platform/mediastream/mac/AVAudioCaptureSource.mm:
1433         (WebCore::AVAudioCaptureSource::AVAudioCaptureSource): Initialize m_inputDescription.
1434         (WebCore::AVAudioCaptureSource::capabilities): 0 -> nullptr.
1435         (WebCore::AVAudioCaptureSource::addObserver): New, add an observer and tell it to prepare.
1436         (WebCore::AVAudioCaptureSource::removeObserver): New.
1437         (WebCore::operator==): Compare AudioStreamBasicDescription.
1438         (WebCore::operator!=):
1439         (WebCore::AVAudioCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Call 
1440           observer->prepare when passed a new stream description, call observer->process.
1441
1442         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
1443         (WebCore::refreshCaptureDeviceList): Set m_groupID and m_localizedName.
1444         (WebCore::AVCaptureDeviceManager::sessionSupportsConstraint): Invalid constraint names should
1445           be ignored, so return true when passed one.
1446         (WebCore::AVCaptureDeviceManager::getSourcesInfo): This just didn't work, fix it.
1447         (WebCore::AVCaptureDeviceManager::verifyConstraintsForMediaType): Optional constraints are
1448           optional so they don't need to be validated.
1449         (WebCore::AVCaptureDeviceManager::bestSourcesForTypeAndConstraints): m_audioSource -> m_audioAVMediaCaptureSource,
1450           m_videoSource -> m_videoAVMediaCaptureSource.
1451         (WebCore::AVCaptureDeviceManager::sourceWithUID): Ditto.
1452
1453         * platform/mediastream/mac/AVMediaCaptureSource.h:
1454         (WebCore::AVMediaCaptureSource::session):
1455         (WebCore::AVMediaCaptureSource::device):
1456         (WebCore::AVMediaCaptureSource::currentStates):
1457         (WebCore::AVMediaCaptureSource::constraints):
1458         (WebCore::AVMediaCaptureSource::statesDidChanged):
1459         (WebCore::AVMediaCaptureSource::createWeakPtr):
1460         (WebCore::AVMediaCaptureSource::buffer): Deleted.
1461         (WebCore::AVMediaCaptureSource::setBuffer): Deleted.
1462         * platform/mediastream/mac/AVMediaCaptureSource.mm:
1463         (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): Initilize m_weakPtrFactory.
1464         (WebCore::AVMediaCaptureSource::scheduleDeferredTask): New, call a function asynchronously on
1465           the main thread.
1466         (-[WebCoreAVMediaCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]): Don't
1467           dispatch calls to the main thread, let the derived classes do that if necessary.
1468
1469         * platform/mediastream/mac/AVVideoCaptureSource.h:
1470         (WebCore::AVVideoCaptureSource::width):
1471         (WebCore::AVVideoCaptureSource::height):
1472         (WebCore::AVVideoCaptureSource::previewLayer):
1473         (WebCore::AVVideoCaptureSource::currentFrameSampleBuffer):
1474         * platform/mediastream/mac/AVVideoCaptureSource.mm:
1475         (WebCore::AVVideoCaptureSource::setFrameRateConstraint): Remove unwanted logging.
1476         (WebCore::AVVideoCaptureSource::setupCaptureSession): Configure the AVCaptureVideoDataOutput so
1477           it delivers 32-bit BGRA samples.
1478         (WebCore::AVVideoCaptureSource::calculateFramerate): Return bool to signal if the frame rate
1479           changed.
1480         (WebCore::AVVideoCaptureSource::processNewFrame): New. Process sample buffer, invalidate cached
1481           image, signal when characteristics change.
1482         (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Schedule
1483           call to processNewFrame on the main thread so we do all video processing on main thread.
1484         (WebCore::AVVideoCaptureSource::currentFrameImage): Create and return a CVImageBuffer of the
1485           current video frame.
1486         (WebCore::AVVideoCaptureSource::paintCurrentFrameInContext): Draw the current frame to a context.
1487
1488 2015-09-15  Sergio Villar Senin  <svillar@igalia.com>
1489
1490         [CSS Grid Layout]  Using automatic (instead of min-content) minimums for 'auto' tracks
1491         https://bugs.webkit.org/show_bug.cgi?id=142329
1492
1493         Reviewed by Darin Adler.
1494
1495         Based on Blink's r198697 by <svillar@igalia.com> and r200478 by <jfernandez@igalia.com>
1496
1497         More precisely (syntax-wise), this would allow 'auto' to be used within the
1498         minmax() function (it's currently forbidden) and have the 'auto' keyword map
1499         to minmax(auto, auto) instead of minmax(min-content, max-content).
1500         - As a minimum, 'auto' would mean "use the specified minimum size, or if
1501         that is auto, treat as 0 or min-content per Flexbox rules".
1502         - As a maximum, 'auto' would mean "use the max-content size".
1503
1504         Regarding the implementation, a new phase is added to the track sizing
1505         algorithm called ResolveIntrinsicMinimums (the former ResolveIntrinsicMinimums
1506         is now called ResolveContentBasedMinimums which does not include 'auto'
1507         resolution) which will be run before any other. This phase uses the minimum
1508         size of grid items (as specified by min-width/height).
1509
1510         Tests: fast/css-grid-layout/grid-automatic-minimum-for-auto-columns.html
1511                fast/css-grid-layout/grid-automatic-minimum-for-auto-rows.html
1512
1513         * css/CSSParser.cpp:
1514         (WebCore::CSSParser::parseGridBreadth):
1515         * rendering/RenderGrid.cpp:
1516         (WebCore::RenderGrid::computeUsedBreadthOfMinLength):
1517         (WebCore::RenderGrid::computeUsedBreadthOfMaxLength):
1518         (WebCore::RenderGrid::minSizeForChild):
1519         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
1520         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
1521         (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase):
1522         (WebCore::RenderGrid::shouldProcessTrackForTrackSizeComputationPhase):
1523         (WebCore::RenderGrid::trackShouldGrowBeyondGrowthLimitsForTrackSizeComputationPhase):
1524         (WebCore::RenderGrid::markAsInfinitelyGrowableForTrackSizeComputationPhase):
1525         (WebCore::RenderGrid::updateTrackSizeForTrackSizeComputationPhase):
1526         (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
1527         * rendering/RenderGrid.h:
1528         * rendering/style/GridTrackSize.h:
1529         (WebCore::GridTrackSize::minTrackBreadth):
1530         (WebCore::GridTrackSize::maxTrackBreadth):
1531         (WebCore::GridTrackSize::cacheMinMaxTrackBreadthTypes):
1532         (WebCore::GridTrackSize::hasIntrinsicMinTrackBreadth):
1533         (WebCore::GridTrackSize::hasAutoMinTrackBreadth):
1534         (WebCore::GridTrackSize::hasAutoMaxTrackBreadth):
1535         (WebCore::GridTrackSize::hasMaxContentOrAutoMaxTrackBreadth):
1536         (WebCore::GridTrackSize::hasAutoOrMinContentMinTrackBreadthAndIntrinsicMaxTrackBreadth):
1537         (WebCore::GridTrackSize::hasMinContentMinTrackBreadthAndMinOrMaxContentMaxTrackBreadth): Deleted.
1538
1539 2015-09-17  Javier Fernandez  <jfernandez@igalia.com>
1540
1541         [CSS Grid Layout] Relayout whenever Box Alignment properties change
1542         https://bugs.webkit.org/show_bug.cgi?id=148070
1543
1544         Reviewed by Darin Adler.
1545
1546         We were Reattaching the styles to the RenderTree whenever Content Alignment
1547         properties (align-items and justify-items) changed their values, since the
1548         Self Alignment properties depend on such values to resolve 'auto' values
1549         during layout.
1550
1551         This patch removes such restriction, since we resolve the auto values
1552         whenever we access the alignment properties. The only thing we need to
1553         do is to mark a grid item for layout whenever the Default Alignment
1554         properties change from/to stretch, since it implies a resize of the grid
1555         items using 'auto' values for the Self Alignment properties.
1556
1557         Tests: fast/css-grid-layout/relayout-align-items-changed.html
1558                fast/css-grid-layout/relayout-align-self-changed.html
1559                fast/css-grid-layout/relayout-justify-items-changed.html
1560                fast/css-grid-layout/relayout-justify-self-changed.html
1561                fast/repaint/align-items-change.html
1562                fast/repaint/align-items-overflow-change.html
1563                fast/repaint/align-self-change.html
1564                fast/repaint/align-self-overflow-change.html
1565                fast/repaint/justify-items-change.html
1566                fast/repaint/justify-items-legacy-change.html
1567                fast/repaint/justify-items-overflow-change.html
1568                fast/repaint/justify-self-change.html
1569                fast/repaint/justify-self-overflow-change.html
1570
1571         * rendering/RenderGrid.cpp:
1572         (WebCore::defaultAlignmentIsStretch):
1573         (WebCore::RenderGrid::styleDidChange):
1574         * rendering/RenderGrid.h:
1575         * rendering/style/RenderStyle.cpp:
1576         (WebCore::RenderStyle::resolveAlignmentOverflow):
1577         (WebCore::RenderStyle::changeRequiresLayout):
1578         * style/StyleResolveTree.cpp:
1579         (WebCore::Style::determineChange): Deleted.
1580
1581 2015-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
1582
1583         printing does not use minimum page zoom factor
1584         https://bugs.webkit.org/show_bug.cgi?id=108507
1585
1586         Reviewed by Darin Adler.
1587
1588         * page/PrintContext.cpp:
1589         (WebCore::PrintContext::beginAndComputePageRectsWithPageSize):
1590         Helper function to share common code from numberOfPages() and
1591         spoolAllPagesWithBoundaries().
1592         (WebCore::PrintContext::numberOfPages): Use beginAndComputePageRectsWithPageSize().
1593         (WebCore::PrintContext::spoolAllPagesWithBoundaries): Use
1594         beginAndComputePageRectsWithPageSize() and don't flip the Y axis
1595         for non Cocoa platforms.
1596         * page/PrintContext.h:
1597
1598 2015-09-16  Ryosuke Niwa  <rniwa@webkit.org>
1599
1600         removeShadow shouldn't call ChildNodeRemovalNotifier with the shadow host as the removal point
1601         https://bugs.webkit.org/show_bug.cgi?id=149244
1602
1603         Reviewed by Antti Koivisto.
1604
1605         Since a shadow host is in a different tree than nodes in its shadow tree, it's incorrect to call
1606         removedFrom with the shadow host as the removal point. This causes HTMLSlotElement::removedFrom
1607         which will be added in the bug 149241 to call methods on a wrong ShadowRoot.
1608
1609         We still keep the ad-hoc behavior of using the shadow host as the insertion/removal point when
1610         calling insertedInto and removedFrom on the shadow root itself to update the InDocument node flag.
1611         We may want to re-visit this design in the future.
1612
1613         No new tests since I couldn't quite create a reduction. However, tests I'm adding in the bug 149241
1614         will crash without this change.
1615
1616         I separated this patch from the bug 149241 to isolate the high-risk code change here.
1617
1618         * dom/Element.cpp:
1619         (WebCore::Element::addShadowRoot): Call insertedInto on ShadowRoot, and then call it on all its
1620         children separately with the insertion point set to the shadow root since insertedInto relies on
1621         insertion point's inDocument flag to be true when the shadow host is in the document.
1622         (WebCore::Element::removeShadowRoot): Ditto in the reverse order.
1623
1624 2015-09-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1625
1626         Remove all uses of PassRefPtr in WebCore/inspector
1627         https://bugs.webkit.org/show_bug.cgi?id=149156
1628
1629         Reviewed by Darin Adler.
1630
1631         * inspector/DOMEditor.cpp:
1632         (WebCore::DOMEditor::InsertBeforeAction::InsertBeforeAction):
1633         (WebCore::DOMEditor::ReplaceChildNodeAction::ReplaceChildNodeAction):
1634         (WebCore::DOMEditor::insertBefore):
1635         (WebCore::DOMEditor::replaceChild):
1636         * inspector/DOMEditor.h:
1637         * inspector/DOMPatchSupport.cpp:
1638         (WebCore::DOMPatchSupport::removeChildAndMoveToNew):
1639         * inspector/InspectorDOMAgent.cpp:
1640         (WebCore::InspectorDOMAgent::highlightSelector):
1641         * inspector/InspectorDatabaseAgent.cpp:
1642         (WebCore::InspectorDatabaseAgent::didOpenDatabase):
1643         * inspector/InspectorDatabaseAgent.h:
1644         * inspector/InspectorDatabaseInstrumentation.h:
1645         * inspector/InspectorDatabaseResource.h:
1646         (WebCore::InspectorDatabaseResource::setDatabase):
1647         * inspector/InspectorFrontendHost.cpp:
1648         (WebCore::FrontendMenuProvider::create):
1649         * inspector/InspectorInstrumentation.cpp:
1650         (WebCore::InspectorInstrumentation::didOpenDatabaseImpl):
1651         * inspector/InspectorLayerTreeAgent.h:
1652         * inspector/InspectorOverlay.cpp:
1653         (WebCore::InspectorOverlay::highlightNodeList):
1654         * inspector/InspectorOverlay.h:
1655         * inspector/InspectorPageAgent.cpp:
1656         (WebCore::InspectorPageAgent::sharedBufferContent):
1657         * inspector/InspectorPageAgent.h:
1658         * inspector/InspectorResourceAgent.cpp:
1659         * inspector/InspectorTimelineAgent.cpp:
1660         (WebCore::startProfiling):
1661         (WebCore::stopProfiling):
1662         (WebCore::InspectorTimelineAgent::stopFromConsole):
1663         * inspector/InspectorTimelineAgent.h:
1664         * inspector/InspectorWorkerResource.h:
1665         (WebCore::InspectorWorkerResource::create):
1666         * inspector/InstrumentingAgents.h:
1667         * inspector/NetworkResourcesData.cpp:
1668         (WebCore::createOtherResourceTextDecoder):
1669         (WebCore::NetworkResourcesData::addResourceSharedBuffer):
1670         * inspector/NetworkResourcesData.h:
1671         * inspector/TimelineRecordFactory.cpp:
1672         (WebCore::createQuad):
1673         * inspector/WebInjectedScriptHost.h:
1674         * inspector/WebInjectedScriptManager.cpp:
1675         (WebCore::WebInjectedScriptManager::WebInjectedScriptManager):
1676         * inspector/WebInjectedScriptManager.h:
1677
1678 2015-09-16  Brady Eidson  <beidson@apple.com>
1679
1680         Have window.indexedDB.open return an IDBOpenDBRequest.
1681         https://bugs.webkit.org/show_bug.cgi?id=149234
1682
1683         Reviewed by Alex Christensen.
1684
1685         Test: storage/indexeddb/modern/opendatabase-request.html
1686
1687         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
1688         (WebCore::IDBClient::IDBFactory::open):
1689         (WebCore::IDBClient::IDBFactory::openInternal):
1690         * Modules/indexeddb/client/IDBFactoryImpl.h:
1691
1692 2015-09-16  Antti Koivisto  <antti@apple.com>
1693
1694         Turn ChildNodeInsertion/RemovalNotifier classes into functions
1695         https://bugs.webkit.org/show_bug.cgi?id=149236
1696
1697         Reviewed by Ryosuke Niwa.
1698
1699         Less architecture, more readability.
1700
1701         * dom/ContainerNode.cpp:
1702         (WebCore::ContainerNode::notifyChildInserted):
1703         (WebCore::ContainerNode::notifyChildRemoved):
1704         (WebCore::ContainerNode::removeChildren):
1705         * dom/ContainerNodeAlgorithms.cpp:
1706         (WebCore::notifyDescendantInsertedIntoDocument):
1707         (WebCore::notifyDescendantInsertedIntoTree):
1708         (WebCore::notifyNodeInsertedIntoDocument):
1709         (WebCore::notifyNodeInsertedIntoTree):
1710         (WebCore::notifyChildNodeInserted):
1711         (WebCore::notifyNodeRemovedFromDocument):
1712         (WebCore::notifyNodeRemovedFromTree):
1713         (WebCore::notifyChildNodeRemoved):
1714         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoDocument): Deleted.
1715         (WebCore::ChildNodeInsertionNotifier::notifyDescendantInsertedIntoTree): Deleted.
1716         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromDocument): Deleted.
1717         (WebCore::ChildNodeRemovalNotifier::notifyDescendantRemovedFromTree): Deleted.
1718         * dom/ContainerNodeAlgorithms.h:
1719         (WebCore::ChildNodeInsertionNotifier::ChildNodeInsertionNotifier): Deleted.
1720         (WebCore::ChildNodeRemovalNotifier::ChildNodeRemovalNotifier): Deleted.
1721         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoDocument): Deleted.
1722         (WebCore::ChildNodeInsertionNotifier::notifyNodeInsertedIntoTree): Deleted.
1723         (WebCore::ChildNodeInsertionNotifier::notify): Deleted.
1724         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromDocument): Deleted.
1725         (WebCore::ChildNodeRemovalNotifier::notifyNodeRemovedFromTree): Deleted.
1726         (WebCore::ChildNodeRemovalNotifier::notify): Deleted.
1727         * dom/Element.cpp:
1728         (WebCore::Element::addShadowRoot):
1729         (WebCore::Element::removeShadowRoot):
1730         (WebCore::Element::createShadowRoot):
1731
1732 2015-09-16  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1733
1734         Remove all uses of PassRefPtr in WebCore/bindings
1735         https://bugs.webkit.org/show_bug.cgi?id=149207
1736
1737         Reviewed by Darin Adler.
1738
1739         If RefPtr<>&& argument is passed to new variable or other function, we use copyRef() or WTF::move().
1740         copyRef() should be used when the argument continues to be used in following code. If it is final use
1741         inside function, we have to use WTF::move().
1742
1743         * bridge/NP_jsobject.cpp:
1744         * bridge/NP_jsobject.h:
1745         * bridge/c/CRuntimeObject.cpp:
1746         (JSC::Bindings::CRuntimeObject::CRuntimeObject):
1747         * bridge/c/CRuntimeObject.h:
1748         (JSC::Bindings::CRuntimeObject::create):
1749         * bridge/c/c_instance.cpp:
1750         (JSC::Bindings::CInstance::CInstance):
1751         * bridge/c/c_instance.h:
1752         (JSC::Bindings::CInstance::create):
1753         * bridge/jsc/BridgeJSC.cpp:
1754         (JSC::Bindings::Array::Array):
1755         (JSC::Bindings::Instance::Instance):
1756         * bridge/jsc/BridgeJSC.h:
1757         * bridge/objc/ObjCRuntimeObject.h:
1758         (JSC::Bindings::ObjCRuntimeObject::create):
1759         * bridge/objc/ObjCRuntimeObject.mm:
1760         (JSC::Bindings::ObjCRuntimeObject::ObjCRuntimeObject):
1761         * bridge/objc/WebScriptObjectProtocol.h:
1762         * bridge/objc/objc_instance.h:
1763         * bridge/objc/objc_instance.mm:
1764         (ObjcInstance::ObjcInstance):
1765         (ObjcInstance::create):
1766         * bridge/objc/objc_runtime.h:
1767         * bridge/objc/objc_runtime.mm:
1768         (JSC::Bindings::ObjcArray::ObjcArray):
1769         * bridge/runtime_object.cpp:
1770         (JSC::Bindings::RuntimeObject::RuntimeObject):
1771         * bridge/runtime_object.h:
1772         * bridge/runtime_root.cpp:
1773         (JSC::Bindings::RootObject::create):
1774         * bridge/runtime_root.h:
1775
1776 2015-09-16  Chris Dumez  <cdumez@apple.com>
1777
1778         Element's attribute NS API should defined treat undefined namespace as null
1779         https://bugs.webkit.org/show_bug.cgi?id=149238
1780         <rdar://problem/22562204>
1781
1782         Reviewed by Ryosuke Niwa.
1783
1784         Element's attribute NS API should treat defined undefined namespace as null
1785         instead of converting it to the "undefined" String. This is because the
1786         namespace parameter is a nullable String as per the DOM spec:
1787         - https://dom.spec.whatwg.org/#element
1788
1789         The attribute is nullable and WebIDL says undefined should be converted
1790         to null for nullable parameters:
1791         - https://heycam.github.io/webidl/#es-nullable-type (step 3)
1792
1793         Firefox follows the specification.
1794
1795         No new tests, already covered by existing test.
1796
1797         * dom/Element.idl:
1798
1799 2015-09-16  Chris Dumez  <cdumez@apple.com>
1800
1801         Possible small iOS PLT regression from r189537
1802         https://bugs.webkit.org/show_bug.cgi?id=149232
1803
1804         Reviewed by Ryosuke Niwa.
1805
1806         r189537 may have regressed PLT a bit on iOS. That change added a couple
1807         of extra branches to throw exceptions. This patch marks those branches
1808         as UNLIKELY() as we already do for other similar checks in the JS
1809         bindings.
1810
1811         * bindings/scripts/CodeGeneratorJS.pm:
1812         (GenerateImplementation):
1813         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1814         (webkit_dom_test_obj_get_property):
1815         (webkit_dom_test_obj_class_init):
1816         (webkit_dom_test_obj_get_strict_type_checking_attribute):
1817         (webkit_dom_test_obj_set_strict_type_checking_attribute):
1818         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1819         * bindings/scripts/test/JS/JSTestObj.cpp:
1820         (WebCore::jsTestObjStrictTypeCheckingAttribute):
1821         (WebCore::setJSTestObjStrictTypeCheckingAttribute):
1822         * bindings/scripts/test/ObjC/DOMTestObj.h:
1823         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1824         (-[DOMTestObj strictTypeCheckingAttribute]):
1825         (-[DOMTestObj setStrictTypeCheckingAttribute:]):
1826         * bindings/scripts/test/TestObj.idl:
1827         * html/HTMLTableElement.cpp:
1828         (WebCore::HTMLTableElement::setTHead):
1829         (WebCore::HTMLTableElement::setTFoot):
1830
1831 2015-09-16  Joseph Pecoraro  <pecoraro@apple.com>
1832
1833         Web Inspector: Fix common typo "supress" => "suppress"
1834         https://bugs.webkit.org/show_bug.cgi?id=149199
1835
1836         Reviewed by Gyuyoung Kim.
1837
1838         * html/shadow/ContentDistributor.h:
1839         (WebCore::ContentDistributor::needsDistribution):
1840         * page/ContentSecurityPolicy.cpp:
1841         (WebCore::ContentSecurityPolicy::reportViolation):
1842         * platform/NotImplemented.h:
1843         * platform/graphics/ca/win/LayerChangesFlusher.cpp:
1844         (WebCore::LayerChangesFlusher::hookCallback):
1845         * platform/mac/HIDGamepadProvider.cpp:
1846         (WebCore::HIDGamepadProvider::deviceRemoved):
1847         * platform/win/makesafeseh.asm:
1848
1849 2015-09-16  Chris Dumez  <cdumez@apple.com>
1850
1851         WebIDL: Rename [ReturnNewObject] to [NewObject] and use it more consistently in DOM
1852         https://bugs.webkit.org/show_bug.cgi?id=149192
1853
1854         Reviewed by Darin Adler.
1855
1856         Rename [ReturnNewObject] to [NewObject] and use it more consistently in
1857         DOM.
1858
1859         This aligns our IDL extended attribute naming with standard Web IDL:
1860         https://heycam.github.io/webidl/#NewObject
1861
1862         We already have [ReturnNewObject] in most places that the DOM
1863         specification uses [NewObject] but we are missing a few so I'll
1864         fix this as well:
1865         https://dom.spec.whatwg.org/#interface-document
1866
1867         Using [NewObject] lets the bindings generator know that the API in
1868         question always returns new objects and that we can bypass the check
1869         for existing wrappers and directly create a new wrapper for the
1870         returned object.
1871
1872         This patch also adds support for generating the toJSNewlyCreated()
1873         utility function for most types. Previously, to use [ReturnNewObject]
1874         for a new type, you needed to add the type to a hard-coded list in
1875         the bindings generator then provide your own implementation for
1876         toJSNewlyCreated() as custom bindings.
1877
1878         No new-exposed behavior change.
1879
1880         * bindings/js/JSDocumentCustom.cpp:
1881         * bindings/js/JSEventCustom.cpp:
1882         * bindings/js/JSNodeListCustom.cpp:
1883         Add toJSNewlyCreated() custom implementation for Node, Event and
1884         Document, that shares code with the existing toJS() implementation for
1885         those types.
1886
1887         * bindings/js/JSCDATASectionCustom.cpp: Removed.
1888         * bindings/js/JSTextCustom.cpp: Removed.
1889         * bindings/js/JSTouchCustom.cpp: Removed.
1890         * bindings/js/JSTouchListCustom.cpp: Removed.
1891         Drop several custom bindings files as the bindings generator is
1892         now able to generate the toJSNewlyCreated() utility function for
1893         most types.
1894
1895         * bindings/scripts/CodeGeneratorJS.pm:
1896         - Rename [ReturnNewObject] to [NewObject].
1897         - Generate a toJSNewlyCreated() whenever we generate a toJS() already.
1898           Get rid of the hard-coded list of types that need a
1899           toJSNewlyCreated().
1900
1901         * bindings/scripts/IDLAttributes.txt:
1902         Rename [ReturnNewObject] to [NewObject].
1903
1904         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
1905         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
1906         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
1907         * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
1908         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
1909         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
1910         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
1911         * bindings/scripts/test/JS/JSTestEventConstructor.h:
1912         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1913         * bindings/scripts/test/JS/JSTestEventTarget.h:
1914         * bindings/scripts/test/JS/JSTestException.cpp:
1915         * bindings/scripts/test/JS/JSTestException.h:
1916         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
1917         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
1918         * bindings/scripts/test/JS/JSTestInterface.cpp:
1919         * bindings/scripts/test/JS/JSTestInterface.h:
1920         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
1921         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
1922         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
1923         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
1924         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
1925         * bindings/scripts/test/JS/JSTestNondeterministic.h:
1926         * bindings/scripts/test/JS/JSTestObj.cpp:
1927         * bindings/scripts/test/JS/JSTestObj.h:
1928         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
1929         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
1930         * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
1931         * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
1932         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
1933         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
1934         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
1935         * bindings/scripts/test/JS/JSTestTypedefs.h:
1936         * bindings/scripts/test/JS/JSattribute.cpp:
1937         * bindings/scripts/test/JS/JSattribute.h:
1938         * bindings/scripts/test/JS/JSreadonly.cpp:
1939         * bindings/scripts/test/JS/JSreadonly.h:
1940         Rebaseline bindings tests.
1941
1942         * dom/Attr.idl:
1943         * dom/CDATASection.idl:
1944         * dom/Comment.idl:
1945         * dom/DocumentFragment.idl:
1946         * dom/DocumentType.idl:
1947         * dom/EntityReference.idl:
1948         * dom/ProcessingInstruction.idl:
1949         Add [JSGenerateToJSObject] so that the bindings generator generates
1950         a toJS() / toJSNewlyCreated() for this type. While it is not strictly
1951         needed, it avoids falling back to using the toJS() from Node which
1952         calls the virtual nodeType() function to determine the node type.
1953         This change was made for efficiency purposes.
1954
1955         * dom/DOMImplementation.idl:
1956         Rename [ReturnNewObject] to [NewObject] and add it to createHTMLDocument()
1957         as well, as per the specification:
1958         https://dom.spec.whatwg.org/#interface-domimplementation
1959
1960         * dom/Document.idl:
1961         Rename [ReturnNewObject] to [NewObject] and add it to more operations
1962         as per he DOM specification:
1963         https://dom.spec.whatwg.org/#document
1964
1965         * dom/Node.idl:
1966         Add [NewObject] to cloneNode() as per the DOM specification:
1967         https://dom.spec.whatwg.org/#node
1968
1969         * dom/ParentNode.idl:
1970         Add [NewObject] to querySelectorAll() as per the DOM specification:
1971         https://dom.spec.whatwg.org/#parentnode
1972
1973         * dom/Range.idl:
1974         Add [NewObject] for several operations, as per the DOM specification:
1975         https://dom.spec.whatwg.org/#interface-range
1976
1977 2015-09-16  Brady Eidson  <beidson@apple.com>
1978
1979         Have window.indexedDB.deleteDatabase return an IDBOpenDBRequest.
1980         https://bugs.webkit.org/show_bug.cgi?id=149229
1981
1982         Reviewed by Alex Christensen.
1983
1984         Test: storage/indexeddb/modern/deletedatabase-request.html
1985               storage/indexeddb/modern/deletedatabase-null-name-exception.html
1986
1987         * CMakeLists.txt:
1988         * WebCore.xcodeproj/project.pbxproj:
1989
1990         * Modules/indexeddb/IDBDatabaseIdentifier.cpp: Added.
1991         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
1992         * Modules/indexeddb/IDBDatabaseIdentifier.h: Added.
1993         (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier):
1994         (WebCore::IDBDatabaseIdentifier::isHashTableDeletedValue):
1995         (WebCore::IDBDatabaseIdentifier::hash):
1996         (WebCore::IDBDatabaseIdentifier::isValid):
1997         (WebCore::IDBDatabaseIdentifier::operator==):
1998         (WebCore::IDBDatabaseIdentifier::databaseName):
1999         (WebCore::IDBDatabaseIdentifierHash::hash):
2000         (WebCore::IDBDatabaseIdentifierHash::equal):
2001         (WebCore::IDBDatabaseIdentifierHashTraits::isEmptyValue):
2002
2003         * Modules/indexeddb/client/IDBFactoryImpl.cpp:
2004         (WebCore::IDBClient::shouldThrowSecurityException):
2005         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
2006         (WebCore::IDBClient::IDBFactory::open):
2007         (WebCore::IDBClient::IDBFactory::deleteDatabase):
2008         * Modules/indexeddb/client/IDBFactoryImpl.h:
2009
2010         * Modules/indexeddb/client/IDBOpenDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
2011         (WebCore::IDBClient::IDBOpenDBRequest::IDBOpenDBRequest):
2012         * Modules/indexeddb/client/IDBOpenDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
2013         (WebCore::IDBClient::IDBOpenDBRequest::create):
2014
2015         * Modules/indexeddb/client/IDBRequestImpl.cpp: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.cpp.
2016         (WebCore::IDBClient::IDBRequest::IDBRequest):
2017         (WebCore::IDBClient::IDBRequest::result):
2018         (WebCore::IDBClient::IDBRequest::errorCode):
2019         (WebCore::IDBClient::IDBRequest::error):
2020         (WebCore::IDBClient::IDBRequest::source):
2021         (WebCore::IDBClient::IDBRequest::transaction):
2022         (WebCore::IDBClient::IDBRequest::readyState):
2023         (WebCore::IDBClient::IDBRequest::eventTargetInterface):
2024         (WebCore::IDBClient::IDBRequest::activeDOMObjectName):
2025         (WebCore::IDBClient::IDBRequest::canSuspendForPageCache):
2026         * Modules/indexeddb/client/IDBRequestImpl.h: Copied from Source/WebCore/Modules/indexeddb/client/IDBFactoryImpl.h.
2027
2028         * platform/Logging.h:
2029
2030 2015-09-16  Chris Dumez  <cdumez@apple.com>
2031
2032         Add initial support for [Unforgeable] IDL extended attribute
2033         https://bugs.webkit.org/show_bug.cgi?id=149147
2034
2035         Reviewed by Darin Adler.
2036
2037         Add initial support for [Unforgeable] IDL extended attribute:
2038         https://heycam.github.io/webidl/#Unforgeable
2039
2040         In particular, attributes marked as unforgeable are now:
2041         - on the instance rather than the prototype
2042         - non-configurable. WebKit does not match the Web IDL specification
2043           and most properties are currently non-configurable already. However,
2044           I added an extra check for [Unforgeable] so that unforgeable
2045           attributes stay unconfigurable if we later decide to match the spec
2046           and mark properties as configurable.
2047
2048         Operation marked as unforgeable are now non-configurable. However, this
2049         patch does not move them from the prototype to the instance yet. This
2050         needs to be addressed in a follow-up patch as this is a larger change.
2051
2052         This patch also drops support for the undocumented
2053         [OperationsNotDeletable] IDL extended attribute. It is no longer needed
2054         now that we support [Unforgeable] and still support [NotDeletable] for
2055         operations.
2056
2057         Test: fast/dom/unforgeable-attributes.html
2058
2059         * Modules/plugins/QuickTimePluginReplacement.idl:
2060         Drop [OperationsNotDeletable] on the interface and mark the only
2061         operation on this interface as [NotDeletable]. There is no behavior
2062         change but this allows us to drop support for a non-standard and
2063         undocumented IDL extended attribute.
2064
2065         * bindings/scripts/CodeGeneratorJS.pm:
2066         (AttributeShouldBeOnInstance):
2067         (GenerateAttributesHashTable):
2068         (GenerateImplementation):
2069         Add initial support for [Unforgeable] IDL extended attribute.
2070
2071         * bindings/scripts/IDLAttributes.txt:
2072         Add [Unforgeable]. Drop [OperationsNotDeletable].
2073
2074         * crypto/CryptoKeyPair.idl:
2075         Drop [OperationsNotDeletable] on the interface as this interface has
2076         no operations.
2077
2078         * dom/Document.idl:
2079         * page/DOMWindow.idl:
2080         * page/Location.idl:
2081         Mark attributes / interfaces as [Unforgeable] as per the latest HTML
2082         specification:
2083         https://html.spec.whatwg.org/multipage/dom.html#document
2084         https://html.spec.whatwg.org/multipage/browsers.html#window
2085         https://html.spec.whatwg.org/multipage/browsers.html#the-location-interface
2086
2087 2015-09-16  Zalan Bujtas  <zalan@apple.com>
2088
2089         Simple line layout: Glitch selecting long text.
2090         https://bugs.webkit.org/show_bug.cgi?id=149204
2091         rdar://problem/22646472
2092
2093         Reviewed by Antti Koivisto.
2094
2095         When long text is split into multiple RenderText objects, we ignore renderer boundaries while
2096         collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
2097         This patch ensures that fragments with hypen character ignore renderer boundaries too.
2098
2099         Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
2100
2101         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2102         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2103
2104 2015-09-16  Brady Eidson  <beidson@apple.com>
2105
2106         Remove stray logging string mistakenly left in r189746.
2107
2108         * Modules/indexeddb/legacy/LegacyFactory.cpp:
2109         (WebCore::LegacyFactory::deleteDatabase):
2110
2111 2015-09-16  Chris Fleizach  <cfleizach@apple.com>
2112
2113         AX: No VoiceOver typing feedback in some search fields
2114         https://bugs.webkit.org/show_bug.cgi?id=149177
2115
2116         Reviewed by Mario Sanchez Prada.
2117
2118         If SearchFieldRole is not marked as a TextControl, it does not end up returning the accessibilityValue,
2119         which is needed to output the right text to VoiceOver.
2120
2121         Test: accessibility/ax-value-with-search.html
2122
2123         * accessibility/AccessibilityObject.cpp:
2124         (WebCore::AccessibilityObject::isTextControl):
2125
2126 2015-09-16  Manuel Rego Casasnovas  <rego@igalia.com>
2127
2128         [css-grid] Grid container's height should include scrollbar
2129         https://bugs.webkit.org/show_bug.cgi?id=149210
2130
2131         Reviewed by Sergio Villar Senin.
2132
2133         Add scrollbar's size in the grid container's height calculation at
2134         RenderGrid::layoutGridItems().
2135
2136         Test: fast/css-grid-layout/grid-container-margin-border-padding-scrollbar.html
2137
2138         * rendering/RenderGrid.cpp:
2139         (WebCore::RenderGrid::layoutGridItems): Include scrollbarLogicalHeight()
2140         while computing the grid's logical height.
2141
2142 2015-09-16  Carlos Garcia Campos  <cgarcia@igalia.com>
2143
2144         Unreviewed. Fix GObject DOM bindings API break after r189676.
2145
2146         webkit_dom_character_data_append_data() used to raise exceptions.
2147
2148         * bindings/scripts/CodeGeneratorGObject.pm:
2149         (FunctionUsedToRaiseException):
2150
2151 2015-09-15  Commit Queue  <commit-queue@webkit.org>
2152
2153         Unreviewed, rolling out r189847.
2154         https://bugs.webkit.org/show_bug.cgi?id=149208
2155
2156         Asserts on all the tests (Requested by ap on #webkit).
2157
2158         Reverted changeset:
2159
2160         "Simple line layout: Glitch selecting long text."
2161         https://bugs.webkit.org/show_bug.cgi?id=149204
2162         http://trac.webkit.org/changeset/189847
2163
2164 2015-09-15  Zalan Bujtas  <zalan@apple.com>
2165
2166         Simple line layout: Glitch selecting long text.
2167         https://bugs.webkit.org/show_bug.cgi?id=149204
2168         rdar://problem/22646472
2169
2170         Reviewed by Antti Koivisto.
2171
2172         When long text is split into multiple RenderText objects, we ignore renderer boundaries while
2173         collecting wrapping positions (so that we don't end up wrapping unbreakable fragments at the end of each renderer).
2174         This patch ensures that fragments with hypen character ignore renderer boundaries too.
2175
2176         Test: fast/text/multiple-renderers-with-hypen-on-boundary.html
2177
2178         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2179         (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
2180
2181 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
2182
2183         GTK+ build fix attempt after r189841.
2184
2185         * PlatformGTK.cmake:
2186
2187 2015-09-15  Chris Dumez  <cdumez@apple.com>
2188
2189         Document.createElement(localName) does not handle correctly missing or null parameter
2190         https://bugs.webkit.org/show_bug.cgi?id=149184
2191         <rdar://problem/22565070>
2192
2193         Reviewed by Ryosuke Niwa.
2194
2195         Document.createElement(localName) does not handle correct missing or
2196         null parameter:
2197         - https://dom.spec.whatwg.org/#interface-document
2198
2199         As per the specification, the parameter is a non-nullable DOMString and
2200         is mandatory. Therefore, as per Web IDL, we should have the following
2201         behavior:
2202         1. If the parameter is missing, we should throw an exception
2203         2. If the parameter is null, we should convert it to the "null" string
2204            and create a <null> element.
2205
2206         Chrome and Firefox behave according to the specification. However,
2207         WebKit was doing:
2208         1. Create a <undefined> element
2209         2. Throw an InvalidCharacterError
2210
2211         This patch aligns WebKit's behavior with the specification and other
2212         major browsers.
2213
2214         No new tests, already covered by existing tests.
2215
2216         * dom/Document.idl:
2217
2218 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
2219
2220         Add ShadowRoot interface and Element.prototype.attachShadow
2221         https://bugs.webkit.org/show_bug.cgi?id=149187
2222
2223         Reviewed by Antti Koivisto.
2224
2225         Add back ShadowRoot IDL interface and Element.prototype.attachShadow in accordance with
2226         http://w3c.github.io/webcomponents/spec/shadow/ at db27e6e36eab512d86edcdabb33ed27b5751acd7 excluding getSelection(),
2227         elementFromPoint(), elementsFromPoint(), caretPositionFromPoint(), and styleSheets attribute on ShadowRoot interface.
2228
2229         The feature is enabled by default on Mac and iOS ports for testing and disabled by default elsewhere.
2230
2231         Also added HTMLElement::canHaveUserAgentShadowRoot which returns false by default and overridden elsewhere to return true
2232         to distinguish elements for which attachShadow is supposed to throw NotSupported.
2233         See https://w3c.github.io/webcomponents/spec/shadow/#widl-Element-attachShadow-ShadowRoot-ShadowRootInit-shadowRootInitDict
2234
2235         Tests: fast/shadow-dom/Element-interface-attachShadow.html
2236                fast/shadow-dom/Element-interface-shadowRoot-attribute.html
2237                fast/shadow-dom/ShadowRoot-interface.html
2238
2239         * CMakeLists.txt:
2240         * Configurations/FeatureDefines.xcconfig:
2241         * DerivedSources.cpp:
2242         * DerivedSources.make:
2243         * PlatformGTK.cmake:
2244         * WebCore.vcxproj/WebCore.vcxproj:
2245         * WebCore.vcxproj/WebCore.vcxproj.filters:
2246         * WebCore.xcodeproj/project.pbxproj:
2247         * css/SelectorChecker.cpp:
2248         (WebCore::SelectorChecker::matchRecursively):
2249         * dom/Element.cpp:
2250         (WebCore::Element::bindingsOffsetParent):
2251         (WebCore::Element::offsetParent):
2252         (WebCore::Element::addShadowRoot):
2253         (WebCore::Element::createShadowRoot):
2254         (WebCore::Element::attachShadow): Added.
2255         (WebCore::Element::bindingShadowRoot): Added. Returns null unless the attached shadow root is in the "open" mode.
2256         * dom/Element.h:
2257         * dom/Element.idl: Added attachShadow and shadowRoot. We only expose these to JS for now since Dictionary argument isn't
2258         supported by other binding code.
2259         * dom/ShadowRoot.cpp: Removed an unused enum.
2260         * dom/ShadowRoot.h:
2261         (WebCore::ShadowRoot::Type): Replaced old-style enum "ShadowRootType" by an enum class named "Type". Also added two new
2262         values Open and Closed for author shadow roots.
2263         (WebCore::ShadowRoot::type):
2264         * dom/ShadowRoot.idl: Added.
2265         * html/HTMLButtonElement.h:
2266         * html/HTMLDetailsElement.h:
2267         (HTMLButtonElement::canHaveUserAgentShadowRoot): Ditto.
2268         * html/HTMLElement.h:
2269         (WebCore::HTMLElement::canHaveUserAgentShadowRoot): Added. Returns false by default.
2270         * html/HTMLInputElement.h:
2271         * html/HTMLKeygenElement.h:
2272         * html/HTMLMarqueeElement.h:
2273         * html/HTMLMediaElement.h:
2274         * html/HTMLMeterElement.h:
2275         * html/HTMLPlugInElement.h:
2276         * html/HTMLProgressElement.h:
2277         * html/HTMLSelectElement.h:
2278         * html/HTMLSummaryElement.h:
2279         * html/HTMLTextAreaElement.h:
2280         * html/shadow/InsertionPoint.h:
2281         (ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints):
2282         * rendering/RenderElement.cpp:
2283         (WebCore::RenderElement::selectionPseudoStyle):
2284         * rendering/RenderLayer.cpp:
2285         (WebCore::rendererForScrollbar):
2286         * svg/SVGElement.cpp:
2287         (WebCore::SVGElement::correspondingUseElement):
2288         * testing/Internals.cpp:
2289         (WebCore::Internals::shadowRootType):
2290
2291 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
2292
2293         [Win] Unreviewed release fix after r189832
2294
2295         * platform/graphics/ca/win/PlatformCALayerWin.h: The implementation
2296         should exist in Release builds as well.
2297
2298 2015-09-15  Benjamin Poulain  <bpoulain@apple.com>
2299
2300         Style invalidation affecting siblings does not work with inline-style changes
2301         https://bugs.webkit.org/show_bug.cgi?id=149189
2302
2303         Reviewed by Antti Koivisto.
2304
2305         Style::resolveTree() made the assumption that inline style changes only affect
2306         descendants and should not participate in "StyleRecalcAffectsNextSiblingElementStyle".
2307         That was wrong. If the inline style change through CSSOM, it can cause the creation
2308         of a style attribute, which is observable through "StyleRecalcAffectsNextSiblingElementStyle".
2309
2310         This patch removes the incorrect assumption. Style invalidation is always propagated now.
2311
2312         Tests: fast/css/style-attribute-invalidation-propagates-to-counted-siblings.html
2313                fast/css/style-attribute-invalidation-propagates-to-direct-siblings.html
2314                fast/css/style-attribute-invalidation-propagates-to-indirect-siblings.html
2315
2316         * css/PropertySetCSSStyleDeclaration.cpp:
2317         (WebCore::InlineCSSStyleDeclaration::didMutate): Deleted.
2318         * dom/StyledElement.cpp:
2319         (WebCore::StyledElement::inlineStyleChanged):
2320         * dom/StyledElement.h:
2321         (WebCore::StyledElement::invalidateStyleAttribute):
2322         Clean up inline-style invalidation a tiny bit.
2323
2324         * style/StyleResolveTree.cpp:
2325         (WebCore::Style::resolveTree):
2326         Fix the bug.
2327
2328 2015-09-15  Joseph Pecoraro  <pecoraro@apple.com>
2329
2330         Web Inspector: Paused Debugger prevents page reload
2331         https://bugs.webkit.org/show_bug.cgi?id=148174
2332
2333         Reviewed by Brian Burg.
2334
2335         When navigating the page while paused, suppress any pausing until the page
2336         has completed navigation. If not paused and navigating, you can still pause
2337         in pagehide and unload handlers or other late page events.
2338
2339         Could not write a reliable test for this at the moment.
2340         InspectorTest.reloadPage has multiple issues with the output,
2341         so I'll investigate making reload tests more reliable later.
2342
2343         * inspector/InspectorController.h:
2344         * inspector/InspectorController.cpp:
2345         (WebCore::InspectorController::resume): Deleted.
2346         * loader/FrameLoader.cpp:
2347         (WebCore::FrameLoader::continueLoadAfterNavigationPolicy):
2348         We now use existing InspectorInstrumentation functions instead of a method
2349         on InspectorController during load. In dropping the method InspectorController
2350         can drop a member variable no longer used.
2351
2352         * inspector/InspectorInstrumentation.h:
2353         (WebCore::InspectorInstrumentation::willStartProvisionalLoad):
2354         Add a new instrumentation hook.
2355
2356         * inspector/InspectorInstrumentation.cpp:
2357         (WebCore::InspectorInstrumentation::willStartProvisionalLoadImpl):
2358         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2359         When starting or completing main frame navigations, let the PageDebuggerAgent do some work.
2360
2361         * inspector/PageDebuggerAgent.h:
2362         * inspector/PageDebuggerAgent.cpp:
2363         (WebCore::PageDebuggerAgent::mainFrameStartedLoading):
2364         (WebCore::PageDebuggerAgent::mainFrameStoppedLoading):
2365         (WebCore::PageDebuggerAgent::mainFrameNavigated):
2366         Suppress pausing if navigating while paused. Otherwise behave as normal.
2367
2368 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
2369
2370         [Win] Provide a means for viewing the layer tree
2371         https://bugs.webkit.org/show_bug.cgi?id=149165
2372
2373         Reviewed by Simon Fraser.
2374
2375         Revise the old fprintf logic to generate a string
2376         containing the layer tree so that it can be output
2377         to the debugger (or elsewhere).
2378
2379         * platform/graphics/ca/PlatformCALayer.h: Rename 'printTree'
2380         to 'printLayerTree', and make it available in release builds.
2381         * platform/graphics/ca/win/CACFLayerTreeHost.cpp:
2382         (WebCore::CACFLayerTreeHost::printLayerTree): Added. Calls into
2383         the PlatformCALayer implementation.
2384         * platform/graphics/ca/win/CACFLayerTreeHost.h:
2385         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2386         (printIndent): Revise to use two-space indent and use StringBuilder.
2387         (printTransform): Ditto.
2388         (printColor): Added helper function.
2389         (printLayer): Revised to output information on the layer contents.
2390         (PlatformCALayerWin::printLayerTree): Renamed from 'printTree'.
2391         (PlatformCALayerWin::printTree): Deleted.
2392         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2393         (PlatformCALayerWinInternal::drawRepaintCounters): Drive-by fix. Match the
2394         cocoa repaint counter logic by not painting counters for the layers that
2395         contain the tile grid.
2396         * platform/graphics/ca/win/PlatformCALayerWin.h:
2397         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2398         (PlatformCALayerWinInternal::drawRepaintCounters):
2399
2400 2015-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
2401
2402         REGRESSION(r155554): Nested isolates can cause an infinite loop when laying out bidi runs
2403         https://bugs.webkit.org/show_bug.cgi?id=149153
2404
2405         Reviewed by David Hyatt.
2406
2407         When traversing bidi runs, we might encounter a run which is supposed to be isolated. In this
2408         situation, we will append a placeholder run in the run list, and remember a pointer to these
2409         isolated runs inside BidiResolver. Then, once we're done traversing the bidi runs, we return
2410         to the isolated runs and handle them separately (and replace the placeholder with the result).
2411
2412         However, due to the fact that our BidiRuns start at leaf nodes, we have to keep track of which
2413         local root of the render tree we were inspecting (to ensure that we visit the same node
2414         multiple times if there are nested isolate spans). We were not correctly keeping track of this
2415         local root, which was leading us to consider the same root multiple times, thereby leading to
2416         an infinite loop.
2417
2418         The solution is simply to keep root information alongside the isolated run information inside
2419         BidiResolver. However, BidiResolver is inside platform/, which means that this new type should
2420         be a template argument, just like how BidiRun itself is a template argument.
2421
2422         This new type, BidiIsolatedRun, holds all the information that our isolate-revisiting logic
2423         needs inside constructBidiRunsForSegment(). It also holds a reference to the placeholder run
2424         which we will replace.
2425
2426         Test: fast/text/international/unicode-bidi-isolate-nested-crash.html
2427
2428         * platform/graphics/GraphicsContext.cpp:
2429         (WebCore::GraphicsContext::drawBidiText): BidiIsolatedRun template argument is unused, so pass
2430         in Void.
2431         * platform/text/BidiResolver.h: Add template argument.
2432         (WebCore::BidiResolver::isolatedRuns):
2433         (WebCore::IsolatedRun>::~BidiResolver):
2434         (WebCore::IsolatedRun>::appendRun):
2435         (WebCore::IsolatedRun>::embed):
2436         (WebCore::IsolatedRun>::checkDirectionInLowerRaiseEmbeddingLevel):
2437         (WebCore::IsolatedRun>::lowerExplicitEmbeddingLevel):
2438         (WebCore::IsolatedRun>::raiseExplicitEmbeddingLevel):
2439         (WebCore::IsolatedRun>::commitExplicitEmbedding):
2440         (WebCore::IsolatedRun>::updateStatusLastFromCurrentDirection):
2441         (WebCore::IsolatedRun>::reorderRunsFromLevels):
2442         (WebCore::IsolatedRun>::createBidiRunsForLine):
2443         (WebCore::IsolatedRun>::setMidpointForIsolatedRun): Use references instead of pointers.
2444         (WebCore::IsolatedRun>::midpointForIsolatedRun): Ditto.
2445         (WebCore::Run>::~BidiResolver): Deleted.
2446         (WebCore::Run>::appendRun): Deleted.
2447         (WebCore::Run>::embed): Deleted.
2448         (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
2449         (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
2450         (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
2451         (WebCore::Run>::commitExplicitEmbedding): Deleted.
2452         (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
2453         (WebCore::Run>::reorderRunsFromLevels): Deleted.
2454         (WebCore::Run>::createBidiRunsForLine): Deleted.
2455         (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
2456         (WebCore::Run>::midpointForIsolatedRun): Deleted.
2457         * rendering/InlineIterator.h:
2458         (WebCore::BidiIsolatedRun::BidiIsolatedRun): New type.
2459         (WebCore::addPlaceholderRunForIsolatedInline): Create new type, and include local root
2460         information.
2461         (WebCore::IsolateTracker::addFakeRunIfNecessary): Include local root information.
2462         (WebCore::InlineBidiResolver::appendRun): Ditto.
2463         * rendering/RenderBlockLineLayout.cpp: Update for new BidiIsolatedRun type.
2464         (WebCore::setUpResolverToResumeInIsolate):
2465         (WebCore::constructBidiRunsForSegment):
2466         * rendering/line/TrailingObjects.h:
2467
2468 2015-09-15  Brady Eidson  <beidson@apple.com>
2469
2470         Add empty IDBFactory implementation for Modern IDB.
2471         https://bugs.webkit.org/show_bug.cgi?id=149191
2472
2473         Reviewed by Jer Noble.
2474
2475         No new tests (No behavior change).
2476
2477         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
2478         (WebCore::DOMWindowIndexedDatabase::indexedDB):
2479         
2480         * Modules/indexeddb/client/IDBFactoryImpl.cpp: 
2481         (WebCore::IDBClient::IDBFactory::create):
2482         (WebCore::IDBClient::IDBFactory::IDBFactory):
2483         (WebCore::IDBClient::IDBFactory::getDatabaseNames):
2484         (WebCore::IDBClient::IDBFactory::open):
2485         (WebCore::IDBClient::IDBFactory::deleteDatabase):
2486         (WebCore::IDBClient::IDBFactory::cmp):
2487         * Modules/indexeddb/client/IDBFactoryImpl.h: 
2488         
2489         * CMakeLists.txt:
2490         * WebCore.xcodeproj/project.pbxproj:
2491         
2492         * loader/EmptyClients.cpp:
2493         * page/DatabaseProvider.h:
2494
2495 2015-09-15  Antti Koivisto  <antti@apple.com>
2496
2497         Split FontDescription into lower and higher level types
2498         https://bugs.webkit.org/show_bug.cgi?id=149036
2499
2500         Reviewed by Darin Adler.
2501
2502         Currently FontDescription is used through the text subsystem. However much of the data it
2503         carries is only needed by FontCascade and text layout but not by the lower level Font/FontCache
2504         layer. This makes code confusing. For example families specified in FontDescription are ignored
2505         at lower levels.
2506
2507         Split it into a low level FontDescription and a high level FontCascadeDescription type:
2508
2509         FontDescription <-> Font
2510         FontCascadeDescription <-> FontCascade
2511
2512         The former only carries information that is needed to instantiate a Font or fetch it from the FontCache.
2513         The latter has additional data for CSS font cascade semantics and other higher level features.
2514
2515 2015-09-15  Myles C. Maxfield  <mmaxfield@apple.com>
2516
2517         GraphicsContext::drawBidiText()'s BidiResolver should not have isolated runs
2518         https://bugs.webkit.org/show_bug.cgi?id=149193
2519
2520         Reviewed by Anders Carlsson.
2521
2522         There are two users of BidiResolver, one which needs isolated runs (in RenderBlockLineLayout) and
2523         one which doesn't (in GraphicsContext::drawBidiText()). Because of [1], the isolated runs vector
2524         is migrating to a new type outside of platform/. Therefore, only the first user of BidiResolver
2525         should have this member variable.
2526
2527         This is achieved by creating two subclasses of BidiResolver, and using the Curiously Repeating
2528         Template pattern to downcast into specializations.
2529
2530         [1] https://bugs.webkit.org/show_bug.cgi?id=149153
2531
2532         No new tests because there is no behavior change.
2533
2534         * platform/text/BidiResolver.h:
2535         (WebCore::BidiResolverBase::BidiResolverBase):
2536         (WebCore::BidiResolverBase::increment):
2537         (WebCore::BidiResolverBase::appendRun):
2538         (WebCore::BidiResolverBase::incrementInternal):
2539         (WebCore::IsolateRun>::~BidiResolverWithIsolate):
2540         (WebCore::Subclass>::appendRunInternal):
2541         (WebCore::Subclass>::embed):
2542         (WebCore::Subclass>::checkDirectionInLowerRaiseEmbeddingLevel):
2543         (WebCore::Subclass>::lowerExplicitEmbeddingLevel):
2544         (WebCore::Subclass>::raiseExplicitEmbeddingLevel):
2545         (WebCore::Subclass>::commitExplicitEmbedding):
2546         (WebCore::Subclass>::updateStatusLastFromCurrentDirection):
2547         (WebCore::Subclass>::reorderRunsFromLevels):
2548         (WebCore::Subclass>::createBidiRunsForLine):
2549         (WebCore::Subclass>::setMidpointForIsolatedRun):
2550         (WebCore::Subclass>::midpointForIsolatedRun):
2551         (WebCore::BidiResolver::BidiResolver): Deleted.
2552         (WebCore::BidiResolver::increment): Deleted.
2553         (WebCore::BidiResolver::isolatedRuns): Deleted.
2554         (WebCore::Run>::~BidiResolver): Deleted.
2555         (WebCore::Run>::appendRun): Deleted.
2556         (WebCore::Run>::embed): Deleted.
2557         (WebCore::Run>::checkDirectionInLowerRaiseEmbeddingLevel): Deleted.
2558         (WebCore::Run>::lowerExplicitEmbeddingLevel): Deleted.
2559         (WebCore::Run>::raiseExplicitEmbeddingLevel): Deleted.
2560         (WebCore::Run>::commitExplicitEmbedding): Deleted.
2561         (WebCore::Run>::updateStatusLastFromCurrentDirection): Deleted.
2562         (WebCore::Run>::reorderRunsFromLevels): Deleted.
2563         (WebCore::Run>::createBidiRunsForLine): Deleted.
2564         (WebCore::Run>::setMidpointForIsolatedRun): Deleted.
2565         (WebCore::Run>::midpointForIsolatedRun): Deleted.
2566         * rendering/InlineIterator.h:
2567         (WebCore::InlineBidiResolver::incrementInternal):
2568         (WebCore::InlineBidiResolver::appendRunInternal):
2569         (WebCore::InlineBidiResolver::increment): Deleted.
2570         (WebCore::InlineBidiResolver::appendRun): Deleted.
2571         * rendering/line/TrailingObjects.h:
2572
2573 2015-09-15  Chris Dumez  <cdumez@apple.com>
2574
2575         new Event() without parameter should throw
2576         https://bugs.webkit.org/show_bug.cgi?id=149146
2577         <rdar://problem/22565070>
2578
2579         Reviewed by Ryosuke Niwa.
2580
2581         new Event() without parameter should throw because the type parameter
2582         is mandatory as per the specification:
2583         https://dom.spec.whatwg.org/#interface-event
2584
2585         Both Firefox and Chrome throw in this case. However, WebKit was
2586         creating an event whose type is the string "undefined". This patch
2587         aligns our behavior with the specification and other major browsers.
2588
2589         No new tests, already covered by existing test.
2590
2591         * bindings/scripts/CodeGeneratorJS.pm:
2592         (GenerateConstructorDefinition):
2593         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
2594         (WebCore::JSTestEventConstructorConstructor::constructJSTestEventConstructor):
2595
2596 2015-09-15  Carlos Alberto Lopez Perez  <clopez@igalia.com>
2597
2598         [GTK] Build failure with ACCELERATED_2D_CANVAS when cairo-gl has built with OpenGLESv2 support only.
2599         https://bugs.webkit.org/show_bug.cgi?id=149172
2600
2601         Reviewed by Martin Robinson.
2602
2603         No new tests, no behavior change.
2604
2605         * platform/graphics/glx/GLContextGLX.cpp:
2606         (WebCore::GLContextGLX::cairoDevice):
2607
2608 2015-09-15  Chris Dumez  <cdumez@apple.com>
2609
2610         Element.getAttributeNS() should return null if the attribute does not exist
2611         https://bugs.webkit.org/show_bug.cgi?id=149180
2612         <rdar://problem/22561011>
2613
2614         Reviewed by Ryosuke Niwa.
2615
2616         Element.getAttributeNS() should return null if the attribute does not
2617         exist, similarly to what Element.getAttribute() does:
2618         - https://dom.spec.whatwg.org/#element (both return a nullable DOMString).
2619         - https://dom.spec.whatwg.org/#dom-element-getattributens (step 2)
2620
2621         Firefox and Chrome match the specification. However, WebKit was returning
2622         an empty string for getAttributeNS() and null for getAttribute(). This
2623         patch aligns WebKit's behavior with the specification and other browsers.
2624
2625         No new tests, already covered by existing tests.
2626
2627         * dom/Element.idl:
2628
2629 2015-09-15  Ryosuke Niwa  <rniwa@webkit.org>
2630
2631         ContentDistribution should be only used for details elements
2632         https://bugs.webkit.org/show_bug.cgi?id=149148
2633
2634         Reviewed by Antti Koivisto.
2635
2636         Extracted ShadowRootWithInsertionPoints out of ShadowRoot for HTMLDetailsElement and HTMLSummaryElement.
2637
2638         We don't add a separate .h and .cpp files since this is a temporary measure until we replace it with
2639         a slot-based shadow DOM implementation.
2640
2641         No new tests. There should be no observable behavioral change.
2642
2643         * dom/Element.cpp:
2644         (WebCore::Element::addShadowRoot): Removed the call to didShadowBoundaryChange since this function is only
2645         called in ensureUserAgentShadowRoot. Also moved the call to didAddUserAgentShadowRoot for
2646         HTMLDetailsElement's shadow root which uses this function instead of ensureUserAgentShadowRoot.
2647         (WebCore::Element::removeShadowRoot): Removed the call to invalidateDistribution since it's only called by
2648         ~Element.
2649         (WebCore::Element::createShadowRoot):
2650         (WebCore::Element::ensureUserAgentShadowRoot): Moved the call didAddUserAgentShadowRoot into addShadowRoot
2651         since HTMLDetailsElement uses a subclass of ShadowRoot.
2652         (WebCore::Element::childrenChanged):
2653         (WebCore::Element::removeAllEventListeners):
2654
2655         * dom/Element.h:
2656         (Element::addShadowRoot): Made this function a protected member as it's now used by HTMLDetailsElement.
2657
2658         * dom/ShadowRoot.cpp:
2659         (WebCore::ShadowRoot::childrenChanged): Deleted.
2660
2661         * dom/ShadowRoot.h:
2662         (WebCore::ShadowRoot::distributor): Made this a virtual function and return nullptr by default.
2663         (WebCore::ShadowRoot::isOrphan):
2664
2665         * html/HTMLDetailsElement.cpp:
2666         (WebCore::HTMLDetailsElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
2667
2668         * html/HTMLInputElement.cpp:
2669         (WebCore::HTMLInputElement::runPostTypeUpdateTasks): Removed the call to invalidateDistribution since it's
2670         only relevant for HTMLDetailsElement's shadow DOM.
2671
2672         * html/HTMLSummaryElement.cpp:
2673         (WebCore::HTMLSummaryElement::create): Uses ShadowRootWithInsertionPoints instead of ShadowRoot.
2674
2675         * html/shadow/ContentDistributor.cpp:
2676         (WebCore::ContentDistributor::distribute):
2677         (WebCore::ContentDistributor::ensureDistribution):
2678         (WebCore::ContentDistributor::invalidateDistribution):
2679
2680         * html/shadow/InsertionPoint.cpp:
2681         (WebCore::InsertionPoint::childrenChanged):
2682         (WebCore::InsertionPoint::insertedInto):
2683         (WebCore::InsertionPoint::removedFrom):
2684         (WebCore::findInsertionPointOf):
2685         (WebCore::ShadowRootWithInsertionPoints::childrenChanged): Moved from ShadowRoot.
2686
2687         * html/shadow/InsertionPoint.h:
2688         (WebCore::ShadowRootWithInsertionPoints::create): Added.
2689         (WebCore::ShadowRootWithInsertionPoints::ShadowRootWithInsertionPoints): Added.
2690
2691 2015-09-15  Brent Fulgham  <bfulgham@apple.com>
2692
2693         [Win] Tiled drawing is rendering more times than it should
2694         https://bugs.webkit.org/show_bug.cgi?id=149144
2695         <rdar://problem/22313905>
2696
2697         Reviewed by Simon Fraser.
2698
2699         Provide a more faithful implemenation of the Objective C tiled drawing logic.
2700         (1) Create a new WebTiledBackingLayerWin class that represents a the
2701             container of tiles. This matches the Objective C design.
2702         (2) Move implementation of several methods (e.g., isOpaque) to the internal
2703             class implementation so that the Tile Drawing logic can perform special
2704             handling in these cases.
2705         (3) Remove the duplicated Tiled Drawing logic from PlatformCALayerWinInternal,
2706             since it was just duplicating code in TileController and TileGrid.
2707         (4) Clean up the display callback code to avoid performing incorrect flipping
2708             of the coordinate system.
2709
2710         * PlatformAppleWin.cmake: Add new WebTiledBackingLayerWin file.            
2711         * WebCore.vcxproj/WebCore.vcxproj: Add the new WebTiledBackingLayerWin files.
2712         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
2713         * platform/graphics/ca/PlatformCALayer.cpp:
2714         (PlatformCALayer::flipContext): Added convenience method.
2715         (PlatformCALayer::drawRepaintIndicator): Ditto.
2716         * platform/graphics/ca/TileGrid.cpp:
2717         (TileGrid::platformCALayerPaintContents): Flip the context before drawing the repaint
2718         indicator on Windows.
2719         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2720         (PlatformCALayerWin::PlatformCALayerWin): Create a WebTiledBackingLayerWin
2721         object if using tiled drawing.
2722         (PlatformCALayerWin::~PlatformCALayerWin):
2723         (PlatformCALayerWin::isOpaque): Move implementation to internal class.
2724         (PlatformCALayerWin::setOpaque): Ditto.
2725         (PlatformCALayerWin::setBorderWidth): Ditto.
2726         (PlatformCALayerWin::setBorderColor): Ditto.
2727         (PlatformCALayerWin::contentsScale): Ditto.
2728         (PlatformCALayerWin::setContentsScale): Ditto.
2729         (PlatformCALayerWin::cornerRadius): Ditto.
2730         (PlatformCALayerWin::tiledBacking): Ditto.
2731         (PlatformCALayerWin::drawTextAtPoint): New helper method to draw repaint counter
2732         text. Needed to work around bug in CG.
2733         * platform/graphics/ca/win/PlatformCALayerWinInternal.cpp:
2734         (PlatformCALayerWinInternal::PlatformCALayerWinInternal): Remove tiling-logic
2735         related member variables.
2736         (PlatformCALayerWinInternal::~PlatformCALayerWinInternal):
2737         (shouldInvertBeforeDrawingContent): Added convenience method.
2738         (shouldInvertBeforeDrawingRepaintCounters): Ditto.
2739         (PlatformCALayerWinInternal::displayCallback):
2740         (PlatformCALayerWinInternal::drawRepaintCounters): Helper method to
2741         share code between the two layer classes.
2742         (PlatformCALayerWinInternal::internalSetNeedsDisplay): use nullptr.
2743         (PlatformCALayerWinInternal::setNeedsDisplay): Ditto.
2744         (PlatformCALayerWinInternal::setNeedsDisplayInRect): Move tiled code
2745         to WebTiledBackingLayerWin and simplify the remaing code.
2746         (PlatformCALayerWinInternal::setSublayers): Remove tile code.
2747         (PlatformCALayerWinInternal::getSublayers): Ditto.
2748         (PlatformCALayerWinInternal::removeAllSublayers): Ditto.
2749         (PlatformCALayerWinInternal::insertSublayer): Ditto.
2750         (PlatformCALayerWinInternal::sublayerCount): Ditto.
2751         (PlatformCALayerWinInternal::indexOfSublayer): Ditto.
2752         (PlatformCALayerWinInternal::sublayerAtIndex): Ditto.
2753         (PlatformCALayerWinInternal::setBounds): Ditto.
2754         (PlatformCALayerWinInternal::setFrame): Ditto.
2755         (PlatformCALayerWinInternal::isOpaque): Ditto.
2756         (PlatformCALayerWinInternal::setOpaque): Ditto.
2757         (PlatformCALayerWinInternal::contentsScale): Ditto.
2758         (PlatformCALayerWinInternal::setContentsScale): Ditto.
2759         (PlatformCALayerWinInternal::setBorderWidth): Ditto.
2760         (PlatformCALayerWinInternal::setBorderColor): Ditto.
2761         (layerTypeIsTiled): Deleted.
2762         (PlatformCALayerWinInternal::constrainedSize): Deleted.
2763         (PlatformCALayerWinInternal::tileDisplayCallback): Deleted.
2764         (PlatformCALayerWinInternal::addTile): Deleted.
2765         (PlatformCALayerWinInternal::removeTile): Deleted.
2766         (PlatformCALayerWinInternal::tileAtIndex): Deleted.
2767         (PlatformCALayerWinInternal::tileCount): Deleted.
2768         (PlatformCALayerWinInternal::updateTiles): Deleted.
2769         (PlatformCALayerWinInternal::drawTile): Deleted.
2770         (PlatformCALayerWinInternal::createTileController): Deleted.
2771         (PlatformCALayerWinInternal::tiledBacking): Deleted.
2772         * platform/graphics/ca/win/PlatformCALayerWinInternal.h:
2773         (WebCore::PlatformCALayerWinInternal::owner):
2774         * platform/graphics/ca/win/WebTiledBackingLayerWin.cpp: Added.
2775         (WebTiledBackingLayerWin::WebTiledBackingLayerWin):
2776         (WebTiledBackingLayerWin::~WebTiledBackingLayerWin):
2777         (DisplayOnMainThreadContext::DisplayOnMainThreadContext):
2778         (redispatchOnMainQueue):
2779         (WebTiledBackingLayerWin::displayCallback):
2780         (WebTiledBackingLayerWin::setNeedsDisplay):
2781         (WebTiledBackingLayerWin::setNeedsDisplayInRect):
2782         (WebTiledBackingLayerWin::setBounds):
2783         (WebTiledBackingLayerWin::isOpaque):
2784         (WebTiledBackingLayerWin::setOpaque):
2785         (WebTiledBackingLayerWin::contentsScale):
2786         (WebTiledBackingLayerWin::setContentsScale):
2787         (WebTiledBackingLayerWin::setBorderWidth):
2788         (WebTiledBackingLayerWin::setBorderColor):
2789         (WebTiledBackingLayerWin::createTileController):
2790         (WebTiledBackingLayerWin::tiledBacking):
2791         (WebTiledBackingLayerWin::invalidate):
2792         * platform/graphics/ca/win/WebTiledBackingLayerWin.h: Added.
2793
2794 2015-09-14  David Hyatt  <hyatt@apple.com>
2795
2796         [New Block-Inside-Inline Model] Implement margin collapsing across contiguous anonymous inline blocks.
2797         https://bugs.webkit.org/show_bug.cgi?id=149132
2798
2799         Reviewed by Zalan Bujtas.
2800
2801         Added new tests inside fast/block/inside-inlines/
2802
2803         * rendering/InlineFlowBox.cpp:
2804         (WebCore::InlineFlowBox::anonymousInlineBlock):
2805         Change this accessor to be more robust and be willing to both recur (in case we ever do decide intermediate line boxes should exist)
2806         and to type check. This is not currently needed, but I'm just being paranoid and future proof.
2807
2808         (WebCore::InlineFlowBox::addToLine):
2809         Again, for thoroughness, I am making sure to propagate the hasAnonymousInlineBlock() bit through to parents. This is only needed
2810         if we build intermediate line boxes for lines with anonymous inline blocks.
2811
2812         (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2813         Anonymous inline blocks receive a layout via layoutBlockChild, in order to make sure that margin collapsing runs. This means
2814         that unlike other line objects, the position of the child has been determined already. Therefore we simply set the position
2815         of the line box that wraps the anonymous inline block to the already-computed position for that block.
2816
2817         Also patch the code that sets lineTop and lineBottom using the root box's dimensions. We don't really care about the root line
2818         box on anonymous inline block lines and just want to set lineTop and lineBottom to fit the anonymous inline block.
2819
2820         * rendering/RenderBlockFlow.cpp:
2821         (WebCore::RenderBlockFlow::collapseMargins):
2822         (WebCore::RenderBlockFlow::collapseMarginsWithChildInfo):
2823         Refactor collapseMargins to call a helper function that can pass in a previous "sibling", and that can handle the child
2824         being null. We do this to perform a margin collapse when anonymous inline blocks run up against regular lines (which is like
2825         collapsing with a sibling block "child").
2826
2827         * rendering/RenderBlockFlow.h:
2828         Tweak the MarginInfo constructor to take a const RenderBlockFlow. Tweak some line layout methods to pass in the LineLayoutState
2829         so that MarginInfo is available during line layout.
2830
2831         * rendering/RenderBlockLineLayout.cpp:
2832         (WebCore::RenderBlockFlow::createLineBoxes):
2833         When we create a new line box, if it is not an anonymous inline block line and our previous line was, simulate a margin
2834         collapse in order to possibly push the line box down or up. Re-use the pagination adjustment code to rewind line layout
2835         and perform it again if pushed below a float.
2836
2837         (WebCore::constructBidiRunsForSegment):
2838         (WebCore::RenderBlockFlow::layoutRunsAndFloats):
2839         (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
2840         (WebCore::RenderBlockFlow::layoutLineBoxes):
2841         (WebCore::RenderBlockFlow::determineStartPosition):
2842         (WebCore::RenderBlockFlow::matchedEndLine):
2843         (WebCore::RenderBlockFlow::updateRegionForLine):
2844         (WebCore::RenderBlockFlow::marginCollapseLinesFromStart):
2845         Patch line layout to run margin collapsing when anonymous inline blocks are encountered. This involves making sure
2846         margin info and float bottom positions are passed through so that layoutBlockChild can be properly called on
2847         anonymous inline blocks that we encounter.
2848
2849         In addition line layout when it syncs dirty lines has to run margin collapsing on earlier lines in order to make
2850         sure margin info is properly set up at the first dirty line position.
2851
2852         Note that there will be more improvements/changes in this area (dirty line syncing), as the current model is inefficient
2853         when many anonymous inline blocks are scattered throughout a large-scale line box tree.
2854
2855         * rendering/RootInlineBox.cpp:
2856         (WebCore::RootInlineBox::alignBoxesInBlockDirection):
2857         (WebCore::RootInlineBox::ascentAndDescentForBox):
2858         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
2859         an effect on ascent/descent.
2860
2861         * rendering/line/BreakingContext.h:
2862         (WebCore::BreakingContext::BreakingContext):
2863         (WebCore::BreakingContext::handleReplaced):
2864         When we encounter an anonymous inline block, lay it out when it is seen. We have to delay the layout, since we have
2865         to be able to perform it mid-line-layout when the containing block's logical height is at the correct value and all previous
2866         lines are placed. Margin info also has to be current.
2867
2868         * rendering/line/LineBreaker.cpp:
2869         * rendering/line/LineBreaker.h:
2870         Patched to pass LineLayoutState through so that the stuff we need to perform block layout is available (margin info and float vars).
2871
2872         * rendering/line/LineLayoutState.h:
2873         Add the block layout margin and float bottom information to the line layout state so that we have it available when performing
2874         layouts and margin collapses on anonymous inline block children.
2875
2876 2015-09-15  Brady Eidson  <beidson@apple.com>
2877
2878         Make the IDBAny::Type enum into an enum class.
2879         https://bugs.webkit.org/show_bug.cgi?id=149169.
2880
2881         Reviewed by Oliver Hunt.
2882
2883         No new tests (Cleanup, no behavior change).
2884
2885         * Modules/indexeddb/IDBAny.h:
2886         * Modules/indexeddb/legacy/LegacyAny.cpp:
2887         (WebCore::LegacyAny::createInvalid):
2888         (WebCore::LegacyAny::createNull):
2889         (WebCore::LegacyAny::LegacyAny):
2890         (WebCore::LegacyAny::domStringList):
2891         (WebCore::LegacyAny::idbCursor):
2892         (WebCore::LegacyAny::idbCursorWithValue):
2893         (WebCore::LegacyAny::idbDatabase):
2894         (WebCore::LegacyAny::idbFactory):
2895         (WebCore::LegacyAny::idbIndex):
2896         (WebCore::LegacyAny::idbObjectStore):
2897         (WebCore::LegacyAny::idbTransaction):
2898         (WebCore::LegacyAny::scriptValue):
2899         (WebCore::LegacyAny::string):
2900         (WebCore::LegacyAny::integer):
2901         (WebCore::LegacyAny::legacyCursor):
2902         (WebCore::LegacyAny::legacyCursorWithValue):
2903         (WebCore::LegacyAny::legacyDatabase):
2904         (WebCore::LegacyAny::legacyFactory):
2905         (WebCore::LegacyAny::legacyIndex):
2906         (WebCore::LegacyAny::legacyObjectStore):
2907         (WebCore::LegacyAny::legacyTransaction):
2908         * Modules/indexeddb/legacy/LegacyCursor.cpp:
2909         (WebCore::LegacyCursor::LegacyCursor):
2910         (WebCore::LegacyCursor::effectiveObjectStore):
2911         * Modules/indexeddb/legacy/LegacyObjectStore.cpp:
2912         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp:
2913         (WebCore::LegacyOpenDBRequest::dispatchEvent):
2914         * Modules/indexeddb/legacy/LegacyRequest.cpp:
2915         (WebCore::LegacyRequest::getResultCursor):
2916         (WebCore::effectiveObjectStore):
2917         * bindings/js/JSIDBAnyCustom.cpp:
2918         (WebCore::toJS):
2919         * inspector/InspectorIndexedDBAgent.cpp:
2920         * page/DatabaseProvider.h:
2921
2922 2015-09-15  Brady Eidson  <beidson@apple.com>
2923
2924         Move most IDB object encoding/decoding from WebKit2 to WebCore.
2925         https://bugs.webkit.org/show_bug.cgi?id=149152
2926
2927         Reviewed by Alex Christensen.
2928
2929         No new tests (Cleanup, no behavior change).
2930
2931         * Modules/indexeddb/IDBDatabaseMetadata.h:
2932         (WebCore::IDBDatabaseMetadata::encode):
2933         (WebCore::IDBDatabaseMetadata::decode):
2934         * Modules/indexeddb/IDBIndexMetadata.h:
2935         (WebCore::IDBIndexMetadata::encode):
2936         (WebCore::IDBIndexMetadata::decode):
2937         * Modules/indexeddb/IDBKeyData.h:
2938         (WebCore::IDBKeyData::encode):
2939         (WebCore::IDBKeyData::decode):
2940         * Modules/indexeddb/IDBKeyPath.h:
2941         (WebCore::IDBKeyPath::encode):
2942         (WebCore::IDBKeyPath::decode):
2943         * Modules/indexeddb/IDBKeyRangeData.h:
2944         (WebCore::IDBKeyRangeData::encode):
2945         (WebCore::IDBKeyRangeData::decode):
2946         * Modules/indexeddb/IDBObjectStoreMetadata.h:
2947         (WebCore::IDBObjectStoreMetadata::encode):
2948         (WebCore::IDBObjectStoreMetadata::decode):
2949
2950 2015-09-14  Brady Eidson  <beidson@apple.com>
2951
2952         Make the enum IDBKey::Type into a utility enum class.
2953         https://bugs.webkit.org/show_bug.cgi?id=149149
2954
2955         Reviewed by Alex Christensen.
2956
2957         No new tests (Cleanup, no behavior change).
2958
2959         * Modules/indexeddb/IDBKey.cpp:
2960         (WebCore::IDBKey::isValid):
2961         (WebCore::IDBKey::compare):
2962         * Modules/indexeddb/IDBKey.h:
2963         (WebCore::IDBKey::createNumber):
2964         (WebCore::IDBKey::createDate):
2965         (WebCore::IDBKey::createMultiEntryArray):
2966         (WebCore::IDBKey::createArray):
2967         (WebCore::IDBKey::type):
2968         (WebCore::IDBKey::array):
2969         (WebCore::IDBKey::string):
2970         (WebCore::IDBKey::date):
2971         (WebCore::IDBKey::number):
2972         (WebCore::IDBKey::compareTypes):
2973         (WebCore::IDBKey::IDBKey):
2974         * Modules/indexeddb/IDBKeyData.cpp:
2975         (WebCore::IDBKeyData::IDBKeyData):
2976         (WebCore::IDBKeyData::maybeCreateIDBKey):
2977         (WebCore::IDBKeyData::isolatedCopy):
2978         (WebCore::IDBKeyData::encode):
2979         (WebCore::IDBKeyData::decode):
2980         (WebCore::IDBKeyData::compare):
2981         (WebCore::IDBKeyData::loggingString):
2982         (WebCore::IDBKeyData::setArrayValue):
2983         (WebCore::IDBKeyData::setStringValue):
2984         (WebCore::IDBKeyData::setDateValue):
2985         (WebCore::IDBKeyData::setNumberValue):
2986         * Modules/indexeddb/IDBKeyData.h:
2987         (WebCore::IDBKeyData::IDBKeyData):
2988         (WebCore::IDBKeyData::minimum):
2989         (WebCore::IDBKeyData::maximum):
2990         * Modules/indexeddb/IndexedDB.h:
2991         * bindings/js/IDBBindingUtilities.cpp:
2992         (WebCore::idbKeyToJSValue):
2993         (WebCore::createIDBKeyFromValue):
2994         (WebCore::createIDBKeyFromScriptValueAndKeyPath):
2995         (WebCore::generateIndexKeysForValue):
2996         * inspector/InspectorIndexedDBAgent.cpp:
2997
2998 2015-09-15  Javier Fernandez  <jfernandez@igalia.com>
2999
3000         [CSS Grid Layout] Using {row, column}-axis terms in alignment related logic
3001         https://bugs.webkit.org/show_bug.cgi?id=148942
3002
3003         Reviewed by Sergio Villar Senin.
3004
3005         This patch changes the names of several functions and variables
3006         defined to implement the alignment logic. We want to use from now
3007         on the terms row-axis and column-axis when referring to the
3008         alignment direction the logic is applied to.
3009
3010         No new tests, no new functionality.
3011
3012         * rendering/RenderGrid.cpp:
3013         (WebCore::RenderGrid::columnAxisOffsetForChild):
3014         (WebCore::RenderGrid::rowAxisOffsetForChild):
3015         (WebCore::RenderGrid::findChildLogicalPosition):
3016         * rendering/RenderGrid.h:
3017
3018 2015-09-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3019
3020         Remove all uses of PassRefPtr in WebCore/xml
3021         https://bugs.webkit.org/show_bug.cgi?id=149114
3022
3023         Reviewed by Darin Adler.
3024
3025         * dom/DecodedDataDocumentParser.h:
3026         * dom/DocumentParser.h:
3027         * dom/RawDataDocumentParser.h:
3028         * html/FTPDirectoryDocument.cpp:
3029         (WebCore::FTPDirectoryDocumentParser::append):
3030         * html/parser/HTMLDocumentParser.cpp:
3031         (WebCore::HTMLDocumentParser::append):
3032         * html/parser/HTMLDocumentParser.h:
3033         * html/parser/TextDocumentParser.cpp:
3034         (WebCore::TextDocumentParser::append):
3035         * html/parser/TextDocumentParser.h:
3036         * xml/NativeXPathNSResolver.cpp:
3037         (WebCore::NativeXPathNSResolver::NativeXPathNSResolver):
3038         * xml/NativeXPathNSResolver.h:
3039         (WebCore::NativeXPathNSResolver::create):
3040         * xml/XMLErrors.cpp:
3041         (WebCore::createXHTMLParserErrorHeader):
3042         * xml/XMLHttpRequestProgressEventThrottle.cpp:
3043         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchReadyStateChangeEvent):
3044         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchEvent):
3045         (WebCore::XMLHttpRequestProgressEventThrottle::dispatchDeferredEvents):
3046         * xml/XMLHttpRequestProgressEventThrottle.h:
3047         * xml/XMLSerializer.h:
3048         * xml/XPathEvaluator.cpp:
3049         (WebCore::XPathEvaluator::createExpression):
3050         (WebCore::XPathEvaluator::createNSResolver):
3051         (WebCore::XPathEvaluator::evaluate):
3052         * xml/XPathEvaluator.h:
3053         * xml/XPathNodeSet.h: Fix style errors.
3054         (WebCore::XPath::NodeSet::NodeSet):
3055         (WebCore::XPath::NodeSet::append):
3056         * xml/XPathPath.cpp:
3057         (WebCore::XPath::Filter::evaluate):
3058         (WebCore::XPath::LocationPath::evaluate):
3059         * xml/XPathValue.h: ditto.
3060         (WebCore::XPath::Value::Value):
3061         (WebCore::XPath::Value::Data::create):
3062         (WebCore::XPath::Value::Data::Data):
3063         * xml/XSLTProcessor.cpp:
3064         (WebCore::XSLTProcessor::transformToDocument):
3065         (WebCore::XSLTProcessor::transformToFragment):
3066         * xml/XSLTProcessor.h:
3067         (WebCore::XSLTProcessor::setXSLStyleSheet):
3068         (WebCore::XSLTProcessor::importStylesheet):
3069         * xml/parser/XMLDocumentParser.cpp:
3070         (WebCore::XMLDocumentParser::append):
3071         * xml/parser/XMLDocumentParser.h:
3072
3073 2015-09-14  Dewei Zhu  <dewei_zhu@apple.com>
3074
3075         Polish code for r189579.
3076         https://bugs.webkit.org/show_bug.cgi?id=149131
3077
3078         Reviewed by Chris Dumez.
3079
3080         Use more self-explaining function name "characterSetWithUTF8Fallback" instead of
3081         "characterSetForBindings". Optimize the way to get text encoding.
3082
3083         * dom/Document.cpp:
3084         (WebCore::Document::characterSetWithUTF8Fallback):
3085         (WebCore::Document::encoding): Deleted.
3086         (WebCore::Document::characterSetForBindings): Deleted.
3087         * dom/Document.h:
3088         (WebCore::Document::encoding):
3089         (WebCore::Document::textEncoding):
3090         * dom/Document.idl:
3091         * loader/DocumentWriter.cpp:
3092         (WebCore::DocumentWriter::createDecoderIfNeeded):
3093         * loader/FormSubmission.cpp:
3094         (WebCore::encodingFromAcceptCharset):
3095
3096 2015-09-14  Chris Dumez  <cdumez@apple.com>
3097
3098         Drop non-standard [IsIndex] WebKit IDL extended attribute
3099         https://bugs.webkit.org/show_bug.cgi?id=149122
3100         <rdar://problem/22547139>
3101
3102         Reviewed by Darin Adler.
3103
3104         Drop non-standard [IsIndex] WebKit IDL extended attribute. This attribute
3105         causes us to throw an IndexSizeError if the input value is negative. Web
3106         IDL supports no such thing. Instead Web IDL supports:
3107         1. Default behavior: the input value wraps around if it does not fit.
3108         2. [EnforceRange]: A TypeError is thrown if the input value does not fit [1].
3109         3. [Clamp]: The input value will be clamped if it does not fit [2].
3110
3111         Our bindings generator supports all three. We don't need the non-standard
3112         [IsIndex].
3113
3114         We previously used [IsIndex] in places where we're supposed to wrap around
3115         as per Web IDL. Therefore, we threw for negative values but other browsers
3116         don't. For e.g., CharacterData.substringData(offset, -1) is supposed to
3117         return the substring from offset to the end of the string. It does so in
3118         Firefox and Chrome. However, WebKit was throwing an Exception.
3119
3120         This change impacts the CharacterData and the SVGTextContentElement
3121         API. The compatibility risk is low because we were throwing an exception
3122         for negative values and we now wrap the value around instead, as other
3123         browsers do.
3124
3125         No new tests, already covered by existing tests.
3126
3127         [1] https://heycam.github.io/webidl/#EnforceRange
3128         [2] https://heycam.github.io/webidl/#Clamp
3129
3130         * bindings/scripts/CodeGeneratorJS.pm:
3131         (GenerateParametersCheck): Deleted.
3132         * bindings/scripts/IDLAttributes.txt:
3133         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3134         (WebCore::jsTestEventTargetPrototypeFunctionItem):
3135         * bindings/scripts/test/TestEventTarget.idl:
3136         * dom/CharacterData.cpp:
3137         (WebCore::CharacterData::deleteData):
3138         (WebCore::CharacterData::replaceData):
3139         * dom/CharacterData.idl:
3140         * dom/ClientRectList.idl:
3141         * svg/SVGTextContentElement.cpp:
3142         (WebCore::SVGTextContentElement::getSubStringLength):
3143         (WebCore::SVGTextContentElement::selectSubString):
3144         * svg/SVGTextContentElement.idl:
3145
3146 2015-09-14  Chris Dumez  <cdumez@apple.com>
3147
3148         Document.createNodeIterator(null) / Document.createTreeWalker(null) should throw a TypeError
3149         https://bugs.webkit.org/show_bug.cgi?id=149126
3150         <rdar://problem/22564891>
3151
3152         Reviewed by Ryosuke Niwa.
3153
3154         Document.createNodeIterator(null) / Document.createTreeWalker(null)
3155         should throw a TypeError:
3156         https://dom.spec.whatwg.org/#interface-document
3157
3158         This is because the parameter is not nullable and Web IDL says we
3159         should throw a TypeError in this case.
3160
3161         Firefox and Chrome throw an exception in this case. This patch
3162         aligns our behavior with the specification and other major browsers.
3163
3164         No new tests, already covered by existing W3C test.
3165
3166         * dom/Document.cpp:
3167         (WebCore::Document::createNodeIterator):
3168         (WebCore::Document::createTreeWalker):
3169         * dom/Document.h:
3170         * dom/Document.idl:
3171         * dom/NodeIterator.cpp:
3172         (WebCore::NodeIterator::NodeIterator):
3173         * dom/NodeIterator.h:
3174         (WebCore::NodeIterator::create):
3175         * dom/Traversal.cpp:
3176         (WebCore::NodeIteratorBase::NodeIteratorBase):
3177         * dom/Traversal.h:
3178         * dom/TreeWalker.cpp:
3179         (WebCore::TreeWalker::TreeWalker):
3180         * dom/TreeWalker.h:
3181         (WebCore::TreeWalker::create):
3182
3183 2015-09-14  Alex Christensen  <achristensen@webkit.org>
3184
3185         Fix Windows clean build after r189746
3186
3187         * WebCore.vcxproj/copyForwardingHeaders.cmd:
3188         Copy headers from new legacy directory.
3189
3190 2015-09-14  Chris Dumez  <cdumez@apple.com>
3191
3192         window.HTMLDetailsElement should exist
3193         https://bugs.webkit.org/show_bug.cgi?id=149139
3194
3195         Reviewed by Ryosuke Niwa.
3196
3197         window.HTMLDetailsElement should exist:
3198         https://html.spec.whatwg.org/multipage/forms.html#the-details-element
3199
3200         Drop the [NoInterfaceObject] IDL extended attribute in WebKit to
3201         address the problem.
3202
3203         No new tests, already covered by existing tests.
3204
3205         * html/HTMLDetailsElement.idl:
3206
3207 2015-09-14  Alex Christensen  <achristensen@webkit.org>
3208
3209         Fix AppleWin CMake build
3210         https://bugs.webkit.org/show_bug.cgi?id=149137
3211
3212         Reviewed by Brent Fulgham.
3213
3214         * PlatformAppleWin.cmake:
3215         Spell Inband correctly.
3216         * css/makegrammar.pl:
3217         Add quotes so bison can be in a directory with spaces in it.        
3218
3219 2015-09-14  Alex Christensen  <achristensen@webkit.org>
3220
3221         [Win] Unreviewed build fix after r189746
3222
3223         * WebCore.vcxproj/WebCoreIncludeCommon.props:
3224         Include new legacy directory.
3225
3226 2015-09-14  Alex Christensen  <achristensen@webkit.org>
3227
3228         Progress towards CMake on Mac.
3229         https://bugs.webkit.org/show_bug.cgi?id=149123
3230
3231         Reviewed by Chris Dumez.
3232
3233         * CMakeLists.txt:
3234         Added some more files.
3235         * PlatformMac.cmake:
3236         Added more files and listed the strange ObjC bindings.
3237         * contentextensions/DFACombiner.cpp:
3238         * contentextensions/DFACombiner.h:
3239         Added preprocessor protection.
3240         * platform/FileSystem.h:
3241         Include utility.  It's needed to compile the different configurations.
3242         * platform/ScrollAnimator.cpp:
3243         ScrollAnimator is an abstract class on Mac.  Don't compile it.
3244         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
3245         FontAntialiasingStateSaver.h is only used on iOS.
3246         * rendering/RenderThemeMac.mm:
3247         config.h needs to be outside the #if !PLATFORM(IOS) to compile correctly without precompiled headers.
3248
3249 2015-09-14  Brady Eidson  <beidson@apple.com>
3250
3251         Rename current concrete IDB implementation to "Legacy".
3252         https://bugs.webkit.org/show_bug.cgi?id=149118
3253
3254         Reviewed by Alex Christensen.
3255
3256         No new tests (No change in behavior).
3257
3258         This patch makes IDL bindings abstract.
3259         It then renames the current concrete implementations of the bindings from "IDB" to "Legacy".
3260         Finally it moves those files and their support classes to a "legacy" subfolder.
3261
3262         * CMakeLists.txt:
3263         * Modules/indexeddb/DOMWindowIndexedDatabase.cpp:
3264         * Modules/indexeddb/IDBAny.cpp:
3265         * Modules/indexeddb/IDBAny.h:
3266         * Modules/indexeddb/IDBCursor.cpp:
3267         * Modules/indexeddb/IDBCursor.h:
3268         * Modules/indexeddb/IDBCursor.idl:
3269         * Modules/indexeddb/IDBCursorWithValue.cpp:
3270         * Modules/indexeddb/IDBCursorWithValue.h:
3271         * Modules/indexeddb/IDBCursorWithValue.idl:
3272         * Modules/indexeddb/IDBDatabase.cpp:
3273         * Modules/indexeddb/IDBDatabase.h:
3274         * Modules/indexeddb/IDBDatabase.idl:
3275         * Modules/indexeddb/IDBFactory.cpp:
3276         * Modules/indexeddb/IDBFactory.h:
3277         * Modules/indexeddb/IDBFactory.idl:
3278         * Modules/indexeddb/IDBIndex.cpp:
3279         * Modules/indexeddb/IDBIndex.h:
3280         * Modules/indexeddb/IDBIndex.idl:
3281         * Modules/indexeddb/IDBObjectStore.cpp:
3282         * Modules/indexeddb/IDBObjectStore.h:
3283         * Modules/indexeddb/IDBObjectStore.idl:
3284         * Modules/indexeddb/IDBOpenDBRequest.cpp:
3285         * Modules/indexeddb/IDBOpenDBRequest.h:
3286         * Modules/indexeddb/IDBOpenDBRequest.idl:
3287         * Modules/indexeddb/IDBRequest.cpp:
3288         * Modules/indexeddb/IDBRequest.h:
3289         * Modules/indexeddb/IDBRequest.idl:
3290         * Modules/indexeddb/IDBTransaction.cpp:
3291         * Modules/indexeddb/IDBTransaction.h:
3292         * Modules/indexeddb/IDBTransaction.idl:
3293         * Modules/indexeddb/IDBVersionChangeEvent.cpp:
3294         * Modules/indexeddb/IDBVersionChangeEvent.h:
3295         * Modules/indexeddb/legacy/IDBCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCallbacks.h.
3296         * Modules/indexeddb/legacy/IDBCursorBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.cpp.
3297         * Modules/indexeddb/legacy/IDBCursorBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackend.h.
3298         * Modules/indexeddb/legacy/IDBCursorBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.cpp.
3299         * Modules/indexeddb/legacy/IDBCursorBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBCursorBackendOperations.h.
3300         * Modules/indexeddb/legacy/IDBDatabaseBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.cpp.
3301         * Modules/indexeddb/legacy/IDBDatabaseBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseBackend.h.
3302         * Modules/indexeddb/legacy/IDBDatabaseCallbacks.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacks.h.
3303         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp.
3304         * Modules/indexeddb/legacy/IDBDatabaseCallbacksImpl.h: Renamed from Source/WebCore/Modules/indexeddb/IDBDatabaseCallbacksImpl.h.
3305         * Modules/indexeddb/legacy/IDBFactoryBackendInterface.h: Renamed from Source/WebCore/Modules/indexeddb/IDBFactoryBackendInterface.h.
3306         * Modules/indexeddb/legacy/IDBPendingDeleteCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingDeleteCall.h.
3307         * Modules/indexeddb/legacy/IDBPendingOpenCall.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingOpenCall.h.
3308         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.cpp.
3309         * Modules/indexeddb/legacy/IDBPendingTransactionMonitor.h: Renamed from Source/WebCore/Modules/indexeddb/IDBPendingTransactionMonitor.h.
3310         * Modules/indexeddb/legacy/IDBTransactionBackend.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.cpp.
3311         * Modules/indexeddb/legacy/IDBTransactionBackend.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackend.h.
3312         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.cpp.
3313         * Modules/indexeddb/legacy/IDBTransactionBackendOperations.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionBackendOperations.h.
3314         * Modules/indexeddb/legacy/IDBTransactionCoordinator.cpp: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.cpp.
3315         * Modules/indexeddb/legacy/IDBTransactionCoordinator.h: Renamed from Source/WebCore/Modules/indexeddb/IDBTransactionCoordinator.h.
3316         * Modules/indexeddb/legacy/LegacyAny.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBAny.cpp.
3317         * Modules/indexeddb/legacy/LegacyAny.h: Added.
3318         * Modules/indexeddb/legacy/LegacyCursor.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.cpp.
3319         * Modules/indexeddb/legacy/LegacyCursor.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursor.h.
3320         * Modules/indexeddb/legacy/LegacyCursorWithValue.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.cpp.
3321         * Modules/indexeddb/legacy/LegacyCursorWithValue.h: Copied from Source/WebCore/Modules/indexeddb/IDBCursorWithValue.h.
3322         * Modules/indexeddb/legacy/LegacyDatabase.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.cpp.
3323         * Modules/indexeddb/legacy/LegacyDatabase.h: Copied from Source/WebCore/Modules/indexeddb/IDBDatabase.h.
3324         * Modules/indexeddb/legacy/LegacyFactory.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.cpp.
3325         * Modules/indexeddb/legacy/LegacyFactory.h: Copied from Source/WebCore/Modules/indexeddb/IDBFactory.h.
3326         * Modules/indexeddb/legacy/LegacyIndex.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBIndex.cpp.
3327         * Modules/indexeddb/legacy/LegacyIndex.h: Added.
3328         * Modules/indexeddb/legacy/LegacyObjectStore.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp.
3329         * Modules/indexeddb/legacy/LegacyObjectStore.h: Copied from Source/WebCore/Modules/indexeddb/IDBObjectStore.h.
3330         * Modules/indexeddb/legacy/LegacyOpenDBRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.cpp.
3331         * Modules/indexeddb/legacy/LegacyOpenDBRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBOpenDBRequest.h.
3332         * Modules/indexeddb/legacy/LegacyRequest.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.cpp.
3333         * Modules/indexeddb/legacy/LegacyRequest.h: Copied from Source/WebCore/Modules/indexeddb/IDBRequest.h.
3334         * Modules/indexeddb/legacy/LegacyTransaction.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.cpp.
3335         * Modules/indexeddb/legacy/LegacyTransaction.h: Copied from Source/WebCore/Modules/indexeddb/IDBTransaction.h.
3336         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.cpp: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.cpp.
3337         * Modules/indexeddb/legacy/LegacyVersionChangeEvent.h: Copied from Source/WebCore/Modules/indexeddb/IDBVersionChangeEvent.h.
3338         * WebCore.xcodeproj/project.pbxproj:
3339         * WebCore.vcxproj/WebCore.vcxproj:
3340
3341 2015-09-14  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3342
3343         [EFL] Remove create() factory function in EvasGLContext and EvasGLSurface
3344         https://bugs.webkit.org/show_bug.cgi?id=149110
3345
3346         Reviewed by Csaba Osztrogonác.
3347
3348         It is not good implementation we support both create() factory function and public constructor.
3349         In EvasGLContext and EvasGLSurface cases, those have supported both. However create() factory is only
3350         used by EwkView. Thus let's remove the create() function, then EwkView creates EvasGLContext using
3351         std::make_unique<> directly.
3352
3353         * platform/graphics/efl/EvasGLContext.h:
3354         (WebCore::EvasGLContext::create): Deleted.
3355         * platform/graphics/efl/EvasGLSurface.h:
3356         (WebCore::EvasGLSurface::create): Deleted.
3357
3358 2015-09-09  Sergio Villar Senin  <svillar@igalia.com>
3359
3360         min-width/height should default to auto for grid items
3361         https://bugs.webkit.org/show_bug.cgi?id=146021
3362
3363         Reviewed by Darin Adler.
3364
3365         Based on Blink's r194408, r194863 and r194887 by <rego@igalia.com>.
3366
3367         From the spec (http://dev.w3.org/csswg/css-grid/#grid-items):
3368         "The auto value of min-width and min-height behaves on grid
3369         items in the relevant axis analogously to its behavior on flex
3370         items in the main axis."
3371
3372         From now on the default value for min-width and min-height for
3373         grid items is auto, meaning that in general, grid items won't
3374         shrink bellow their content.
3375
3376         The change is not exactly the same as the one in Blink because
3377         this one takes into account vertical writting modes, something
3378         that was not well handled in the original one.
3379
3380         Tests: fast/css-grid-layout/min-width-height-auto-overflow.html
3381                fast/css-grid-layout/min-width-height-auto.html
3382
3383         * rendering/RenderBox.cpp:
3384         (WebCore::RenderBox::computeLogicalWidthInRegion):
3385         (WebCore::RenderBox::computeLogicalHeight):
3386
3387 2015-09-14  Manuel Rego Casasnovas  <rego@igalia.com>
3388
3389         [css-grid] Percentage columns should remove scrollbar's width
3390         https://bugs.webkit.org/show_bug.cgi?id=149116
3391
3392         Reviewed by Sergio Villar Senin.
3393
3394         Currently the calculation of percentage columns was not subtracting the
3395         scrollbar's size.
3396         Fixed RenderGrid::computeUsedBreadthOfSpecifiedLength()
3397         to avoid this problem.
3398
3399         Test: fast/css-grid-layout/grid-percent-track-scrollbar.html
3400
3401         * rendering/RenderGrid.cpp:
3402         (WebCore::RenderGrid::computeUsedBreadthOfSpecifiedLength):
3403
3404 2015-09-13  Chris Dumez  <cdumez@apple.com>
3405
3406         Improve Node pre-insertion validation when the parent is a Document
3407         https://bugs.webkit.org/show_bug.cgi?id=149109
3408         <rdar://problem/22560436>
3409
3410         Reviewed by Ryosuke Niwa.
3411
3412         Improve Node pre-insertion validation when the parent is a Document to
3413         match the specification:
3414         https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity
3415         https://dom.spec.whatwg.org/#concept-node-replace
3416
3417         This affects the following API: Node.insertBefore(), Node.appendChild(),
3418         Node.replaceChild().
3419
3420         WebKit current fails to do the following checks whenever the parent is a
3421         Document from pre-insertion validation:
3422         1. If the inserted Node is a DocumentFragment, we should make sure it
3423           contains only one Element.
3424         -> This is because a Document can have only one child that is an
3425            Element [1].
3426         2.a. If an Element is inserted, we should make sure it is not inserted
3427              before a DocumentType.
3428         2.b. If a DocumentType is inserted, we should make sure it is not
3429              inserted after an Element.
3430         -> This is because the DocType must come before the optional Element
3431            child [1].
3432
3433         Firefox and Chrome already match the specification here. This patch
3434         aligns WebKit's behavior with those browsers and the specification.
3435
3436         [1] https://dom.spec.whatwg.org/#node-trees
3437
3438         No new tests, already covered by existing W3C tests.
3439
3440         * dom/ContainerNode.cpp:
3441         (WebCore::checkAcceptChild):
3442         (WebCore::checkAddChild):
3443         (WebCore::checkReplaceChild):
3444         (WebCore::ContainerNode::insertBefore):
3445         (WebCore::ContainerNode::appendChild):
3446         (WebCore::containsConsideringHostElements): Deleted.
3447         (WebCore::checkAcceptChildGuaranteedNodeTypes): Deleted.
3448         * dom/Document.cpp:
3449         (WebCore::Document::canAcceptChild):
3450         (WebCore::Document::cloneNodeInternal): Deleted.
3451         * dom/Document.h:
3452
3453 2015-09-13  Chris Dumez  <cdumez@apple.com>
3454
3455         Document.adoptNode() should be able to explicitly adopt a DocumentType node
3456         https://bugs.webkit.org/show_bug.cgi?id=149097
3457         <rdar://problem/22549345>
3458
3459         Reviewed by Ryosuke Niwa.
3460
3461         Document.adoptNode() should be able to explicitly adopt a DocumentType
3462         node as per the latest DOM specification:
3463         https://dom.spec.whatwg.org/#dom-document-adoptnode
3464
3465         Chrome and Firefox match the specidicaiton but WebKit was throwing a
3466         NotSupportedError.
3467
3468         No new tests, already covered by existing test.
3469
3470         * dom/Document.cpp:
3471         (WebCore::Document::adoptNode): Deleted.
3472
3473 2015-09-13  Chris Dumez  <cdumez@apple.com>
3474
3475         Document.title does not behave according to specification
3476         https://bugs.webkit.org/show_bug.cgi?id=149098
3477
3478         Reviewed by Ryosuke Niwa.
3479
3480         Update Document.title to behave according to the latest DOM specification:
3481         https://html.spec.whatwg.org/multipage/dom.html#document.title
3482
3483         In particular, the following Web-Exposed changes were made:
3484         1. The title Element should be the first title element in the document
3485            (in tree order) [1]. Previously, WebKit would use the first title
3486            Element *added* to the Document. Document.title returns the text
3487            content of the title Element so this change is web-exposed.
3488         2. If the title Element is replaced after the title has been set by the
3489            JS (via the document.title setter), we should update the value
3490            returned by the document.title getter. Previously, WebKit would set
3491            a flag if the title was explicitly set by JS via document.title
3492            setter and later title element changes would not override the title
3493            set by the JS. This behavior isn't specified and does not match the
3494            behavior of other browsers.
3495
3496         The new behavior is also consistent with the behavior of Firefox and
3497         Chrome.
3498
3499         Some refactoring was made for the sake of clarity now that our
3500         implementation has changed. See details below.
3501
3502         [1] https://html.spec.whatwg.org/multipage/dom.html#the-title-element-2
3503
3504         No new tests, already covered by existing tests.
3505
3506         * dom/Document.cpp:
3507         (WebCore::Document::updateTitleFromTitleElement):
3508         New convenience method that calls updateTitle() with the text of the
3509         document's current title Element. If there is no title Element, it
3510         clears the title.
3511
3512         (WebCore::Document::updateTitleElement):
3513         Method which updates the Document's title Element whenever a title
3514         Element is added or removed from the Document. Once the title Element
3515         is updated, it takes care of calling updateTitleFromTitleElement() to
3516         update the Document's title.
3517
3518         (WebCore::Document::titleElementAdded):
3519         (WebCore::Document::titleElementRemoved):
3520         (WebCore::Document::titleElementTextChanged):
3521         New Document public API called by HTMLTitleElement / SVGTitleElement
3522         whenever a title Element is added / removed from the Document or
3523         whenever the title element's text has changed. These methods will
3524         take care of calling updateTitleElement() / updateTitleFromTitleElement()
3525         as necessary.
3526         Previously, we would only have 2 methods:
3527         - setTitleElement() which would be called whenever a title Element was
3528           added to the document or when its text had changed. The name was
3529           confusing because it would not necessarily set the document's title
3530           Element and it would be used both for title element update and a
3531           simple title update. This method has been split into 2:
3532           titleElementAdded() and titleElementTextChanged().
3533         - removeTitle() which would be called whenever a title Element was
3534           removed. The naming was confusing because it would not necessarily
3535           remove the Document's title Element. This is now called
3536           titleElementRemoved().
3537
3538         * html/HTMLTitleElement.cpp:
3539         (WebCore::HTMLTitleElement::insertedInto):
3540         Call the new titleElementAdded() instead of setTitleElement().
3541
3542         (WebCore::HTMLTitleElement::removedFrom):
3543         Call the new titleElementRemoved() instead of removeTitle().
3544
3545         (WebCore::HTMLTitleElement::childrenChanged):
3546         Call the new titleElementTextChanged() instead of
3547         setTitleElement() / removeTitle() as we don't really want
3548         to remove or add a title Element. We merely want to notify
3549         the document that the title element text has changed in
3550         case it is the current title Element of the Document.
3551
3552         (WebCore::HTMLTitleElement::computedTextWithDirection):
3553         Rename textWithDirection() to computedTextWithDirection() to
3554         make it clear it is not a simple getter and make it private
3555         as it is only used to set the m_title member which caches the
3556         computed text.
3557
3558         * html/HTMLTitleElement.h:
3559         Add new textWithDirection() getter which returns m_title. This
3560         is needed so that Document can query the title of the Element.
3561         Previously, HTMLTitleElement would pass directly m_title to
3562         the Document when calling Document::setTitleElement().
3563
3564         * svg/SVGTitleElement.cpp:
3565         (WebCore::SVGTitleElement::insertedInto):
3566         Call the new titleElementAdded() instead of setTitleElement().
3567
3568         (WebCore::SVGTitleElement::removedFrom):
3569         Call the new titleElementRemoved() instead of removeTitle().
3570
3571         (WebCore::SVGTitleElement::childrenChanged):
3572         Call the new titleElementTextChanged() instead of
3573         setTitleElement().
3574
3575 2015-09-13  Chris Dumez  <cdumez@apple.com>
3576
3577         document.lastModified should use the user's local time zone
3578         https://bugs.webkit.org/show_bug.cgi?id=149092
3579         <rdar://problem/22567705>
3580
3581         Reviewed by Ryosuke Niwa.
3582
3583         document.lastModified should use the user's local time zone:
3584         https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified
3585
3586         Chrome and Firefox comply with the specification but WebKit was using
3587         UTC. This patch aligns WebKit's behavior with the specification and
3588         other browsers.
3589
3590         No new tests, already covered by existing tests.
3591
3592         * dom/Document.cpp:
3593         (WebCore::Document::lastModified):
3594         (WebCore::Document::setCookieURL): Deleted.
3595
3596 2015-09-13  Chris Dumez  <cdumez@apple.com>
3597
3598         Node.baseURI should not return null for detached nodes
3599         https://bugs.webkit.org/show_bug.cgi?id=149104
3600         <rdar://problem/22559535>
3601
3602         Reviewed by Sam Weinig.
3603
3604         Node.baseURI should not return null for detached nodes. It should return
3605         the node document's base URL. The node document is set when the node is
3606         created so it is valid even if the node is detached [1]:
3607         https://dom.spec.whatwg.org/#dom-node-baseuri
3608
3609         WebKit was traversing the ancestors to find the base URL, which only
3610         works if the node is attached. Also, WebKit was taking into account
3611         the xml:base attribute when computing the baseURI.
3612
3613         Both Chrome and Firefox already dropped support for xml:base:
3614         https://code.google.com/p/chromium/issues/detail?id=341854
3615         https://bugzilla.mozilla.org/show_bug.cgi?id=903372
3616
3617         Firefox complies with the specification. Chrome's baseURI still only
3618         works for attached Nodes as their implementation still traverses the
3619         DOM tree, despite dropping support for xml:base.
3620
3621         This patch drops support xml:base when computing Node.baseURI, as
3622         Firefox, Chrome and the latest DOM specification do. It also makes
3623         Node.baseURI work for detached Nodes by returning the base URL of the
3624         node Document. This means we no longer have to traverse the Node's
3625         ancestors in the DOM tree. This is consistent with the behavior of
3626         Firefox and the latest DOM specification.
3627
3628         This patch does not drop the SVGElement.xmlbase attribute yet. However,
3629         we should probably consider making this change as well given that:
3630         - The SVG2 specification dropped it
3631         - Chrome dropped it.
3632         - It no longers impacts Node.baseURI
3633
3634         [1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=20976
3635
3636         No new tests, already covered by existing test.
3637
3638         * dom/Document.cpp:
3639         (WebCore::Document::setContent): Deleted.
3640         * dom/Document.h:
3641         (WebCore::Document::inputCursor): Deleted.
3642         * dom/DocumentType.cpp:
3643         (WebCore::DocumentType::nodeName): Deleted.
3644         * dom/DocumentType.h:
3645         * dom/Element.cpp:
3646         (WebCore::Element::imageSourceURL): Deleted.
3647         (WebCore::Element::rendererIsNeeded): Deleted.
3648         (WebCore::Element::createElementRenderer): Deleted.
3649         (WebCore::Element::insertedInto): Deleted.
3650         * dom/Element.h:
3651         * dom/Node.cpp:
3652         (WebCore::Node::baseURI):
3653         * dom/Node.h:
3654         * svg/SVGElement.idl:
3655
3656 2015-09-13  Chris Dumez  <cdumez@apple.com>
3657
3658         CharacterData API parameters should not be optional
3659         https://bugs.webkit.org/show_bug.cgi?id=149101
3660         <rdar://problem/22546954>
3661
3662         Reviewed by Sam Weinig.
3663
3664         CharacterData API parameters should not be optional as per the DOM
3665         specification:
3666         https://dom.spec.whatwg.org/#characterdata
3667
3668         The parameters are also mandatory in Firefox and Chrome. However,
3669         those parameters are optional in WebKit. When DOMString parameters
3670         were omitted, we would use the "undefined" string instead. When
3671         unsigned long parameters were omitted, we would use 0 instead.
3672         This patch aligns our behavior with the specification and other
3673         major browsers.
3674
3675         No new tests, already covered by existing tests.
3676
3677         * dom/CharacterData.cpp:
3678         (WebCore::CharacterData::appendData):
3679         * dom/CharacterData.h:
3680         * dom/CharacterData.idl:
3681         * dom/Element.cpp:
3682         (WebCore::Element::mergeWithNextTextNode):
3683         * dom/Node.cpp:
3684         (WebCore::Node::normalize):
3685         * xml/parser/XMLDocumentParser.cpp:
3686         (WebCore::XMLDocumentParser::exitText):
3687
3688 2015-09-13  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3689
3690         Remove all uses of PassRefPtr in crypto, storage, and history
3691         https://bugs.webkit.org/show_bug.cgi?id=149091
3692
3693         Reviewed by Andreas Kling.
3694
3695         * crypto/CryptoKeyPair.cpp:
3696         (WebCore::CryptoKeyPair::CryptoKeyPair):
3697         * crypto/CryptoKeyPair.h:
3698         (WebCore::CryptoKeyPair::create):
3699         * crypto/SubtleCrypto.h:
3700         (WebCore::SubtleCrypto::create):
3701         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
3702         (WebCore::CryptoKeyRSA::create):
3703         * crypto/keys/CryptoKeyAES.cpp:
3704         (WebCore::CryptoKeyAES::generate):
3705         * crypto/keys/CryptoKeyAES.h:
3706         * crypto/keys/CryptoKeyHMAC.cpp:
3707         (WebCore::CryptoKeyHMAC::generate):
3708         * crypto/keys/CryptoKeyHMAC.h:
3709         * crypto/keys/CryptoKeyRSA.h:
3710         * crypto/mac/CryptoKeyRSAMac.cpp:
3711         (WebCore::CryptoKeyRSA::create):
3712         * history/BackForwardController.cpp:
3713         (WebCore::BackForwardController::BackForwardController):
3714         * history/BackForwardController.h:
3715         * history/HistoryItem.cpp:
3716         (WebCore::HistoryItem::setStateObject):
3717         (WebCore::HistoryItem::setFormData):
3718         * history/HistoryItem.h:
3719         (WebCore::HistoryItem::stateObject):
3720         * loader/EmptyClients.cpp:
3721         * page/Page.cpp:
3722         (WebCore::Page::Page):
3723         * storage/Storage.cpp:
3724         (WebCore::Storage::create):
3725         (WebCore::Storage::Storage):
3726         * storage/Storage.h:
3727         * storage/StorageArea.h:
3728         * storage/StorageMap.cpp:
3729         (WebCore::StorageMap::copy):
3730         (WebCore::StorageMap::setItem):
3731         (WebCore::StorageMap::setItemIgnoringQuota):
3732         (WebCore::StorageMap::removeItem):
3733         * storage/StorageMap.h:
3734         * storage/StorageNamespace.h:
3735
3736 2015-09-12  Chris Dumez  <cdumez@apple.com>
3737
3738         window.EventTarget should exist
3739         https://bugs.webkit.org/show_bug.cgi?id=149085
3740         <rdar://problem/22546774>
3741
3742         Reviewed by Sam Weinig.
3743
3744         Drop [NoInterfaceObject] for the EventTarget interface to match Chrome,
3745         Firefox and the specification:
3746         https://dom.spec.whatwg.org/#interface-eventtarget
3747
3748         No new tests, already covered by existing tests.
3749
3750         * dom/EventTarget.idl:
3751
3752 2015-09-12  Brian Burg  <bburg@apple.com>
3753
3754         Web Inspector: disambiguate inspected/frontend controllers and pages in backend code
3755         https://bugs.webkit.org/show_bug.cgi?id=149071
3756
3757         Reviewed by Joseph Pecoraro.
3758
3759         Be consistent about prefixing pages, inspector controllers, and window controllers
3760         with either "frontend" or "inspected", as appropriate. This change makes obvious some bugs
3761         in the frontend connection code, which are tracked by https://webkit.org/b/149006.
3762
3763         No new tests, no behavior change.
3764
3765         * WebCore.order:
3766         * inspector/InspectorClient.h:
3767         * inspector/InspectorController.cpp:
3768         (WebCore::InspectorController::inspectedPageDestroyed):
3769         (WebCore::InspectorController::show):
3770         (WebCore::InspectorController::close):
3771         * inspector/InspectorFrontendClientLocal.cpp:
3772         (WebCore::InspectorFrontendClientLocal::InspectorFrontendClientLocal):
3773         (WebCore::InspectorFrontendClientLocal::~InspectorFrontendClientLocal):
3774         (WebCore::InspectorFrontendClientLocal::canAttachWindow):
3775         (WebCore::InspectorFrontendClientLocal::changeAttachedWindowHeight):
3776         (WebCore::InspectorFrontendClientLocal::changeAttachedWindowWidth):
3777         (WebCore::InspectorFrontendClientLocal::openInNewTab):
3778         (WebCore::InspectorFrontendClientLocal::restoreAttachedWindowHeight):
3779         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
3780         (WebCore::InspectorFrontendClientLocal::isUnderTest):
3781         * inspector/InspectorFrontendClientLocal.h:
3782         * inspector/InspectorOverlay.cpp:
3783         (WebCore::InspectorOverlay::freePage):
3784         * loader/EmptyClients.h:
3785
3786 2015-09-12  Chris Dumez  <cdumez@apple.com>
3787
3788         ChildNode.replaceWith() without argument should replace the node with an empty DocumentFragment
3789         https://bugs.webkit.org/show_bug.cgi?id=149073
3790         <rdar://problem/22547801>
3791
3792         Reviewed by Ryosuke Niwa.
3793
3794         ChildNode.replaceWith() without argument should replace the node with 
3795         an empty DocumentFragment, as per the specification:
3796         https://dom.spec.whatwg.org/#dom-childnode-replacewith
3797         https://dom.spec.whatwg.org/#converting-nodes-into-a-node
3798
3799         Previously, WebKit did not do anything in this case. This patch fixes
3800         it.
3801
3802         No new tests, already covered by existing test.
3803
3804         * dom/Node.cpp:
3805         (WebCore::Node::replaceWith):
3806
3807 2015-09-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3808
3809         Remove all uses of PassRefPtr in WebCore/plugins
3810         https://bugs.webkit.org/show_bug.cgi?id=149055
3811
3812         Reviewed by Darin Adler.
3813
3814         * plugins/DOMMimeType.cpp:
3815         (WebCore::DOMMimeType::DOMMimeType):
3816         (WebCore::DOMMimeType::enabledPlugin):
3817         * plugins/DOMMimeType.h:
3818         (WebCore::DOMMimeType::create):
3819         * plugins/DOMMimeTypeArray.cpp:
3820         (WebCore::DOMMimeTypeArray::item):
3821         * plugins/DOMMimeTypeArray.h:
3822         * plugins/DOMPlugin.cpp:
3823         (WebCore::DOMPlugin::item):
3824         * plugins/DOMPlugin.h:
3825         * plugins/DOMPluginArray.cpp:
3826         (WebCore::DOMPluginArray::item):
3827         * plugins/DOMPluginArray.h:
3828         * plugins/PluginViewBase.h:
3829         (WebCore::PluginViewBase::bindingInstance):
3830
3831 2015-09-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
3832
3833         Remove all uses of PassRefPtr in WebCore/accessibility and WebCore/fileapi
3834         https://bugs.webkit.org/show_bug.cgi?id=149059
3835
3836         Reviewed by Darin Adler.
3837
3838         * accessibility/AXObjectCache.cpp:
3839         * accessibility/AccessibilityObject.cpp:
3840         (WebCore::rangeClosestToRange):
3841         (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection):
3842         (WebCore::AccessibilityObject::selectionRange):
3843         (WebCore::AccessibilityObject::selectText):
3844         * accessibility/AccessibilityObject.h:
3845         * accessibility/ios/AXObjectCacheIOS.mm:
3846         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
3847         (-[WebAccessibilityObjectWrapper _convertToDOMRange:]):
3848         (-[WebAccessibilityObjectWrapper textMarkerForPosition:]):
3849         * accessibility/mac/AXObjectCacheMac.mm:
3850         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3851         (-[WebAccessibilityObjectWrapper _textMarkerForIndex:]):
3852         * fileapi/FileList.h:
3853         (WebCore::FileList::append):
3854         * fileapi/WebKitBlobBuilder.cpp:
3855         (WebCore::BlobBuilder::append):
3856         * fileapi/WebKitBlobBuilder.h:
3857
3858 2015-09-11  Said Abou-Hallawa  <sabouhallawa@apple.com>
3859
3860         SVGColor custom text format is different from the CSS color custom text format
3861         https://bugs.webkit.org/show_bug.cgi?id=148879
3862
3863         Reviewed by Daniel Bates.
3864
3865         Implement the serialization of a CSS color value as it is described in
3866         <https://drafts.csswg.org/cssom/#serializing-css-values>. Add the new
3867         function Color::cssText() which is refactored from the existing function
3868         Color::serialized(). Use the new function for serializing the SVGColor
3869         always and also for Color but only when the alpha component is not 1.
3870
3871         Test: svg/css/computed-style-rgb-color.html
3872
3873         * css/CSSPrimitiveValue.cpp:
3874         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Move the code
3875         for serializing the color from this function to Color::cssText().
3876         
3877         * platform/graphics/Color.cpp:
3878         (WebCore::Color::serialized): Call Color::cssText() if the alpha component
3879         is not 1 and delete the repeated code. 
3880         
3881         (WebCore::Color::cssText):
3882         * platform/graphics/Color.h: Add the new function to the header file.
3883         
3884         * svg/SVGColor.cpp:
3885         (WebCore::SVGColor::customCSSText): Call Color::cssText() always instead
3886         of calling Color::serialized() for serializing the SVGColor.
3887
3888 2015-09-11  Nan Wang  <n_wang@apple.com>
3889
3890         AX: ARIA 1.1 @aria-current
3891         https://bugs.webkit.org/show_bug.cgi?id=146012
3892
3893         Reviewed by Chris Fleizach.
3894
3895         Tests: accessibility/aria-current.html
3896                inspector/dom/getAccessibilityPropertiesForNode_ariaCurrent.html
3897
3898         Added support for ARIA 1.1 aria-current.
3899
3900         * accessibility/AccessibilityObject.cpp:
3901         (WebCore::AccessibilityObject::invalidStatus):
3902         (WebCore::AccessibilityObject::ariaCurrentState):
3903         (WebCore::AccessibilityObject::hasTagName):
3904         * accessibility/AccessibilityObject.h:
3905         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3906         (-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
3907         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
3908         * html/HTMLAttributeNames.in:
3909         * inspector/InspectorDOMAgent.cpp:
3910         (WebCore::InspectorDOMAgent::buildObjectForAccessibilityProperties):
3911
3912 2015-09-11  Chris Dumez  <cdumez@apple.com>
3913
3914         DOMTokenList update steps for classList don't follow the spec
3915         https://bugs.webkit.org/show_bug.cgi?id=148589
3916         <rdar://problem/22547443>
3917
3918         Reviewed by Ryosuke Niwa and Darin Adler.
3919
3920         Update our DOMTokenList implementation to behave according to
3921         the latest DOM specification:
3922         https://dom.spec.whatwg.org/#interface-domtokenlist
3923
3924         In particular, the following changes were made:
3925         - The stringifier now returns the result of the ordered set serializer
3926           for tokens. This means that we drop duplicate spaces and extra spaces
3927           [1][2][3].
3928         - DOMSettableTokenList.value now returns the result of the ordered set
3929           serializer for tokens [4] as well.
3930         - When the DOMTokenList's tokens are updated and there is an associated
3931           Element attribute, we set the attribute value to be the the ordered
3932           set serializer for tokens. This is according to the DOMTokenList
3933           update steps in the specification [6]. Chrome does not match the
3934           specification either.
3935
3936         Edge browser behaves according to the specification already. Firefox was
3937         implementing this via [7] but no recent progress. This makes the JS API
3938         nicer to use and interest was shown by jQuery Team.
3939
3940         The following refactoring was done:
3941         - Merge ClassList / RelList into a single AttributeDOMTokenList class
3942           as their code is mostly duplicated and the only thing that changes
3943           is which attribute is associated (class vs rel). AttributeDOMTokenList
3944           now keeps the attribute name as a member so it could be used for any
3945           attribute. AttributeDOMTokenList overrides DOMTokenList's
3946           updateAfterTokenChange() to do update the attribute's value as per
3947           [6].
3948         - We no longer use a SpaceSplitString for the internal representation
3949           as we need to sanitize the tokens (drop duplicates and extra spaces).
3950           DOMTokenList now has an internal Vector<AtomicString> containing the
3951           tokens that is constructed from the algorithm in [2]. As a result,
3952           most of the logic is now in DOMTokenList instead of its subclasses
3953           which means that most methods are no longer virtual. We only have
3954           one virtual function named updateAfterTokenChange() to do the update
3955           steps as AttributeDOMTokenList needs to update the associated
3956           attribute.
3957
3958         This change does not seem to impact Dromaeo.
3959
3960         [1] https://dom.spec.whatwg.org/#concept-ordered-set-serializer
3961         [2] https://dom.spec.whatwg.org/#ordered%20sets
3962         [3] https://dom.spec.whatwg.org/#stringification-behavior
3963         [4] https://dom.spec.whatwg.org/#dom-domsettabletokenlist-value
3964         [5] https://dom.spec.whatwg.org/#dom-domtokenlist-contains (step 2)
3965         [6] https://dom.spec.whatwg.org/#concept-DTL-update
3966         [7] https://bugzilla.mozilla.org/show_bug.cgi?id=869788
3967
3968         No new tests, already covered by existing tests.
3969
3970         * dom/Element.cpp:
3971         (WebCore::Element::classAttributeChanged):
3972         When the class attribute changes, make sure