1893c91a0074e6e9d09a6f0bd38665ccc4db2dd8
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-06-16  Simon Fraser  <simon.fraser@apple.com>
2
3         [iOS] Focus event dispatched in iframe causes parent document to scroll incorrectly
4         https://bugs.webkit.org/show_bug.cgi?id=158629
5         rdar://problem/26521616
6
7         Reviewed by Enrica Casucci.
8
9         When focussing elements in iframes, the page could scroll to an incorrect location.
10         This happened because code in Element::focus() tried to disable scrolling on focus,
11         but did so only for the current frame, so ancestor frames got programmatically scrolled.
12         On iOS we handle the scrolling in the UI process, so never want the web process to
13         do programmatic scrolling.
14
15         Fix by changing the focus and cache restore code to use SelectionRevealMode::DoNotReveal,
16         rather than manually prohibiting frame scrolling.
17
18         Tests: fast/forms/ios/focus-input-in-iframe.html
19                fast/forms/ios/programmatic-focus-input-in-iframe.html
20
21         * dom/Element.cpp:
22         (WebCore::Element::focus):
23         * history/CachedPage.cpp:
24         (WebCore::CachedPage::restore):
25
26 2016-06-16  Zalan Bujtas  <zalan@apple.com>
27
28         [New Block-Inside-Inline Model] Do not attempt to re-run margin collapsing on the block sequence.
29         https://bugs.webkit.org/show_bug.cgi?id=158854
30
31         Reviewed by David Hyatt.
32
33         Test: fast/block/inside-inlines/crash-on-first-line-change.html
34
35         * rendering/RenderBlockLineLayout.cpp:
36         (WebCore::RenderBlockFlow::marginCollapseLinesFromStart):
37
38 2016-06-16  Ting-Wei Lan  <lantw44@gmail.com>
39
40         Include cstdlib before using std::atexit
41         https://bugs.webkit.org/show_bug.cgi?id=158681
42
43         Reviewed by Brent Fulgham.
44
45         * platform/graphics/PlatformDisplay.cpp:
46
47 2016-06-16  Chris Dumez  <cdumez@apple.com>
48
49         Use StringView::toAtomicString() in HTMLImageElement::setBestFitURLAndDPRFromImageCandidate()
50         https://bugs.webkit.org/show_bug.cgi?id=158853
51
52         Reviewed by Brent Fulgham.
53
54         Use StringView::toAtomicString() in HTMLImageElement::setBestFitURLAndDPRFromImageCandidate()
55         as m_bestFitImageURL data member is an AtomicString. This avoids constructing a String and
56         then atomizing it.
57
58         * html/HTMLImageElement.cpp:
59         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
60
61 2016-06-16  Benjamin Poulain  <bpoulain@apple.com>
62
63         :in-range & :out-of-range CSS pseudo-classes shouldn't match inputs without range limitations
64         https://bugs.webkit.org/show_bug.cgi?id=156558
65
66         Reviewed by Simon Fraser.
67
68         The pseudo selectors :in-range and :out-of-range should only
69         apply if:
70         -minimum/maximum are defined for the input type
71         -the input value is/is-not suffering from underflow/overflow.
72
73         Only certain types have a valid minimum and maximum:
74         -number
75         -range
76         -date
77         -month
78         -week
79         -time
80         -datetime-local
81
82         Of those, only one has a default minimum and maximum: range.
83         For all the others, the minimum or maximum is only defined
84         if the min/max attribute is defined and valid.
85
86         This patch addresses these constraints for number and range.
87         The date types range validation is severely broken and is
88         left untouched. It really needs a clean rewrite.
89
90         Tests: fast/css/pseudo-in-range-basics.html
91                fast/css/pseudo-in-range-out-of-range-trivial.html
92                fast/css/pseudo-out-of-range-basics.html
93
94         * html/DateInputType.cpp:
95         (WebCore::DateInputType::createStepRange):
96         * html/DateTimeInputType.cpp:
97         (WebCore::DateTimeInputType::createStepRange):
98         * html/DateTimeLocalInputType.cpp:
99         (WebCore::DateTimeLocalInputType::createStepRange):
100         * html/InputType.cpp:
101         (WebCore::InputType::isInRange):
102         (WebCore::InputType::isOutOfRange):
103         Notice the isEmpty() shortcut.
104         A value can only overflow/underflow if it is not empty.
105
106         * html/MonthInputType.cpp:
107         (WebCore::MonthInputType::createStepRange):
108         * html/NumberInputType.cpp:
109         (WebCore::NumberInputType::createStepRange):
110         * html/RangeInputType.cpp:
111         (WebCore::RangeInputType::createStepRange):
112         * html/StepRange.cpp:
113         (WebCore::StepRange::StepRange):
114         * html/StepRange.h:
115         (WebCore::StepRange::hasRangeLimitations):
116         * html/WeekInputType.cpp:
117         (WebCore::WeekInputType::createStepRange):
118
119 2016-06-16  Anders Carlsson  <andersca@apple.com>
120
121         Fix macOS Sierra build
122         https://bugs.webkit.org/show_bug.cgi?id=158849
123
124         Reviewed by Tim Horton.
125
126         Add WebCore:: qualifiers for IOSurface, to avoid conflicts with the IOSurface Objective-C class.
127         
128         Also, add an asLayerContents() getter that will return an id that's suitable for setting 
129         as the contents of a CALayer.
130
131         * platform/graphics/cocoa/IOSurface.h:
132         * platform/graphics/cocoa/IOSurface.mm:
133
134 2016-06-16  Andreas Kling  <akling@apple.com>
135
136         REGRESSION(r196217): 3% JSBench regression on iPhone 5.
137         <https://webkit.org/b/158848>
138         <rdar://problem/26609622>
139
140         Unreviewed rollout.
141
142         Don't jettison linked code on every top-level navigation as that was hurting JSBench on iPhone 5.
143
144         * loader/FrameLoader.cpp:
145         (WebCore::FrameLoader::commitProvisionalLoad):
146
147 2016-06-16  Adam Bergkvist  <adam.bergkvist@ericsson.com>
148
149         WebRTC: Check type of this in RTCPeerConnection JS built-in functions
150         https://bugs.webkit.org/show_bug.cgi?id=151303
151
152         Reviewed by Youenn Fablet.
153
154         Check type of 'this' in RTCPeerConnection JS built-in functions.
155
156         Test: fast/mediastream/RTCPeerConnection-js-built-ins-check-this.html
157
158         * Modules/mediastream/RTCPeerConnection.js:
159         (createOffer):
160         (createAnswer):
161         (setLocalDescription):
162         (setRemoteDescription):
163         (addIceCandidate):
164         (getStats):
165         Reject if 'this' isn't of type RTCPeerConnection.
166         * Modules/mediastream/RTCPeerConnectionInternals.js:
167         (isRTCPeerConnection):
168         Add helper function to perform type check. Needs further robustifying.
169
170 2016-06-16  Myles C. Maxfield  <mmaxfield@apple.com>
171
172         Sporadic crash in HashTableAddResult following CSSValuePool::createFontFamilyValue
173         https://bugs.webkit.org/show_bug.cgi?id=158297
174
175         Reviewed by Darin Adler.
176
177         In an effort to reduce the flash of unstyled content, we force all elements
178         to have display: none during an external stylesheet load. We do this by
179         ignoring the CSS cascade and forcing all elements to have a placeholder style
180         which hardcodes display: none. (This is necessary to make elements created by
181         script during the stylesheet load not flash.)
182
183         This style is exposed to web content via getComputedStyle(), which means it
184         needs to maintain the invariant that font-families can never be null strings.
185         We enforce this by forcing the font-family to be the standard font name.
186
187         Test: fast/text/placeholder-renderstyle-null-font.html
188
189         * style/StyleTreeResolver.cpp:
190         (WebCore::Style::ensurePlaceholderStyle):
191
192 2016-06-16  Chris Dumez  <cdumez@apple.com>
193
194         Avoid some temporary String allocations for common HTTP headers in ResourceResponse::platformLazyInit()
195         https://bugs.webkit.org/show_bug.cgi?id=158827
196
197         Reviewed by Darin Adler.
198
199         Add a HTTPHeaderMap::set() overload taking in a CFStringRef. The
200         implementation has a fast path which gets the internal characters
201         of the CFStringRef when possible and constructs a StringView for
202         it in order to call findHTTPHeaderName(). As a result, we avoid
203         allocating a temporary String when findHTTPHeaderName() succeeds.
204
205         This new HTTPHeaderMap::set() overload is called from both the
206         CF and Cocoa implementations of ResourceResponse::platformLazyInit().
207
208         I have confirmed locally on both Mac and iOS that the fast path
209         is used ~93% of the time. CFStringGetCStringPtr() returns null in
210         rare cases, causing the regular code path to be used.
211
212         * platform/network/HTTPHeaderMap.cpp:
213         (WebCore::HTTPHeaderMap::set):
214         * platform/network/HTTPHeaderMap.h:
215
216 2016-06-15  Zalan Bujtas  <zalan@apple.com>
217
218         Decouple the percent height and positioned descendants maps.
219         https://bugs.webkit.org/show_bug.cgi?id=158773
220
221         Reviewed by David Hyatt and Chris Dumez.
222
223         We track renderers with percent height across multiple containers using
224         HashMap<const RenderBox*, std::unique_ptr<HashSet<const RenderBlock*>>>.
225         We also use the same data structure to track positioned descendants.
226         However a positioned renderer can have only one containing block so tracking it
227         with a 1:many type is defective.
228         It allows multiple inserts for positioned descendants, which could lead to
229         inconsistent layout state as the rendering logic expects these type of renderers
230         with only one containing block.
231         This patch decouples percent height and positioned tracking by introducing
232         the PositionedDescendantsMap class. This class is responsible for tracking
233         the positioned descendants inbetween layouts.
234
235         No change in functionality.
236
237         Tests: fast/block/positioning/change-containing-block-for-absolute-positioned.html
238                fast/block/positioning/change-containing-block-for-fixed-positioned.html
239
240         * rendering/RenderBlock.cpp:
241         (WebCore::insertIntoTrackedRendererMaps):
242         (WebCore::removeFromTrackedRendererMaps):
243         (WebCore::PositionedDescendantsMap::addDescendant): Add more defensive ASSERT_NOT_REACHED
244         to the double insert branch when webkit.org/b/158772 gets fixed.
245         (WebCore::PositionedDescendantsMap::removeDescendant):
246         (WebCore::PositionedDescendantsMap::removeContainingBlock):
247         (WebCore::PositionedDescendantsMap::positionedRenderers):
248         (WebCore::positionedDescendantsMap):
249         (WebCore::removeBlockFromPercentageDescendantAndContainerMaps):
250         (WebCore::RenderBlock::~RenderBlock):
251         (WebCore::RenderBlock::positionedObjects):
252         (WebCore::RenderBlock::insertPositionedObject):
253         (WebCore::RenderBlock::removePositionedObject):
254         (WebCore::RenderBlock::addPercentHeightDescendant):
255         (WebCore::RenderBlock::removePercentHeightDescendant):
256         (WebCore::RenderBlock::percentHeightDescendants):
257         (WebCore::RenderBlock::checkPositionedObjectsNeedLayout):
258         (WebCore::removeBlockFromDescendantAndContainerMaps): Deleted.
259         * rendering/RenderBlock.h:
260
261 2016-06-15  David Kilzer  <ddkilzer@apple.com>
262
263         Move SoftLinking.h to platform/cococa from platform/mac
264         <https://webkit.org/b/158825>
265
266         Reviewed by Andy Estes.
267
268         * PlatformMac.cmake: Update for new directory.
269         * WebCore.xcodeproj/project.pbxproj: Ditto.
270         * platform/cocoa/SoftLinking.h: Renamed from Source/WebCore/platform/mac/SoftLinking.h.
271
272 2016-06-15  Chris Dumez  <cdumez@apple.com>
273
274         [Cocoa] Clean up / optimize ResourceResponse::platformLazyInit(InitLevel)
275         https://bugs.webkit.org/show_bug.cgi?id=158809
276
277         Reviewed by Darin Adler.
278
279         Clean up / optimize ResourceResponse::platformLazyInit(InitLevel).
280
281         * platform/network/HTTPParsers.cpp:
282         (WebCore::extractReasonPhraseFromHTTPStatusLine):
283         * platform/network/HTTPParsers.h:
284         Have extractReasonPhraseFromHTTPStatusLine() return an AtomicString as the
285         Reason is stored as an AtomicString on ResourceResponse. Have the
286         implementation use StringView::subString()::toAtomicString().
287
288         * platform/network/cocoa/ResourceResponseCocoa.mm:
289         (WebCore::stripLeadingAndTrailingDoubleQuote):
290         Move the stripLeadingAndTrailingDoubleQuote logic from platformLazyInit()
291         to its own function. Have it use StringView::subString()::toAtomicString()
292         to avoid unnecessarily atomizing the textEncodingName that has surrounding
293         double-quotes.
294
295         (WebCore::initializeHTTPHeaders):
296         Move HTTP headers initialization to its own function for clarity.
297
298         (WebCore::extractHTTPStatusText):
299         Move HTTP status Text extraction to its own function for clarity.
300
301         (WebCore::ResourceResponse::platformLazyInit):
302         - The function is streamlined a bit because most of the logic was moved
303           into separate functions.
304         - Drop unnecessary (initLevel >= CommonFieldsOnly) check in the first
305           if case and replace with an assertion. This function is always called
306           with CommonFieldsOnly or above (AllFields).
307         - Drop unnecessary (m_initLevel < AllFields) check in the second if
308           case as this is always true. If not, we would have returned early
309           at the beginning of the function when checking
310           m_initLevel >= initLevel.
311         - Use AutodrainedPool instead of NSAutoreleasePool for convenience and have
312           only 1 pool instead of 2.
313         - Drop unnecessary copyNSURLResponseStatusLine() function and call directly
314           CFHTTPMessageCopyResponseStatusLine() since we already have a
315           CFHTTPMessageRef at the call site.
316
317 2016-06-15  Tim Horton  <timothy_horton@apple.com>
318
319         <attachment> elements jump around a lot around when subtitle text changes slightly
320         https://bugs.webkit.org/show_bug.cgi?id=158818
321         <rdar://problem/24450270>
322
323         Reviewed by Simon Fraser.
324
325         Test: fast/attachment/attachment-subtitle-resize.html
326
327         * rendering/RenderAttachment.cpp:
328         (WebCore::RenderAttachment::layout):
329         * rendering/RenderAttachment.h:
330         * rendering/RenderThemeMac.mm:
331         (WebCore::AttachmentLayout::AttachmentLayout):
332         (WebCore::RenderThemeMac::paintAttachment):
333         In order to avoid changes to the centered subtitle text causing the whole
334         attachment to bounce around a lot, make it so that attachment width can only
335         increase, never decrease, and round the subtitle's width up to the nearest
336         increment of 10px when determining its affect on the whole element's width.
337         Also, center the attachment in its element, instead of left-aligning it,
338         so that the extra width we may have is evenly distributed between the two sides.
339
340 2016-06-15  Ryan Haddad  <ryanhaddad@apple.com>
341
342         Reset bindings test results after r202105
343
344         Unreviewed test gardening.
345
346         * bindings/scripts/test/JS/JSTestObj.cpp:
347
348 2016-06-15  Adam Bergkvist  <adam.bergkvist@ericsson.com>
349
350         WebRTC: (Refactor) Align the structure of RTCPeerConnection.idl with the header file
351         https://bugs.webkit.org/show_bug.cgi?id=158779
352
353         Reviewed by Eric Carlson.
354
355         Restructure RTCPeerConnection.idl to make it easer to read and extend in the future.
356
357         No change in behavior.
358
359         * Modules/mediastream/RTCPeerConnection.idl:
360
361 2016-06-15  Chris Dumez  <cdumez@apple.com>
362
363         Drop some unnecessary header includes
364         https://bugs.webkit.org/show_bug.cgi?id=158788
365
366         Reviewed by Alexey Proskuryakov.
367
368         Drop some unnecessary header includes in headers to speed up build time.
369
370         * Modules/encryptedmedia/MediaKeySession.cpp:
371         * Modules/gamepad/GamepadManager.cpp:
372         * Modules/indexeddb/IDBDatabase.cpp:
373         * Modules/indexeddb/IDBOpenDBRequest.cpp:
374         * Modules/indexeddb/IDBRequest.cpp:
375         * Modules/indexeddb/IDBTransaction.cpp:
376         * Modules/mediasource/MediaSource.cpp:
377         * Modules/mediasource/SourceBuffer.cpp:
378         * Modules/mediasource/SourceBufferList.cpp:
379         * Modules/mediastream/MediaStream.cpp:
380         * Modules/mediastream/MediaStreamTrack.cpp:
381         * Modules/speech/SpeechSynthesis.cpp:
382         * Modules/webaudio/AudioScheduledSourceNode.cpp:
383         * Modules/webaudio/ScriptProcessorNode.cpp:
384         * bindings/scripts/CodeGeneratorJS.pm:
385         (GenerateImplementation):
386         * dom/CharacterData.cpp:
387         * dom/ContainerNode.cpp:
388         * dom/DOMNamedFlowCollection.cpp:
389         * dom/DeviceMotionController.cpp:
390         * dom/DeviceOrientationController.cpp:
391         * dom/Document.cpp:
392         * dom/Document.h:
393         * dom/DocumentEventQueue.cpp:
394         * dom/DocumentOrderedMap.h:
395         * dom/Element.cpp:
396         * dom/Event.cpp:
397         * dom/EventDispatcher.cpp:
398         * dom/EventTarget.cpp:
399         * dom/EventTarget.h:
400         * dom/KeyboardEvent.cpp:
401         * dom/MessageEvent.cpp:
402         * dom/MessagePort.cpp:
403         * dom/ScriptElement.cpp:
404         * dom/ScriptExecutionContext.cpp:
405         * dom/ScriptExecutionContext.h:
406         * dom/SecurityContext.h:
407         * dom/SimulatedClick.cpp:
408         * dom/TextEvent.cpp:
409         * dom/WebKitNamedFlow.cpp:
410         * editing/FrameSelection.cpp:
411         * fileapi/FileReader.cpp:
412         * html/HTMLLinkElement.cpp:
413         * html/HTMLPlugInImageElement.cpp:
414         * html/HTMLStyleElement.cpp:
415         * html/HTMLSummaryElement.cpp:
416         * html/HTMLTrackElement.cpp:
417         * html/HTMLVideoElement.cpp:
418         * html/InputType.cpp:
419         * html/MediaController.cpp:
420         * html/TextFieldInputType.cpp:
421         * html/canvas/WebGLRenderingContextBase.cpp:
422         * html/parser/HTMLScriptRunner.cpp:
423         * html/shadow/MediaControlElementTypes.cpp:
424         * html/shadow/MediaControls.cpp:
425         * html/shadow/MediaControlsApple.cpp:
426         * html/shadow/SliderThumbElement.cpp:
427         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
428         * inspector/InspectorIndexedDBAgent.cpp:
429         * loader/DocumentLoader.cpp:
430         * loader/ImageLoader.cpp:
431         * loader/PolicyChecker.cpp:
432         * mathml/MathMLSelectElement.cpp:
433         * page/DOMWindow.h:
434         * page/EventSource.cpp:
435         * page/FrameView.cpp:
436         * page/Performance.cpp:
437         * page/csp/ContentSecurityPolicy.cpp:
438         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
439         * platform/network/HTTPHeaderMap.h:
440         * platform/network/ResourceHandle.cpp:
441         * rendering/RenderEmbeddedObject.cpp:
442         * rendering/RenderSnapshottedPlugIn.cpp:
443         * svg/SVGSVGElement.cpp:
444         * svg/SVGUseElement.cpp:
445         * svg/animation/SVGSMILElement.cpp:
446         * workers/WorkerGlobalScope.h:
447         * xml/XMLHttpRequest.cpp:
448         * xml/XMLHttpRequestProgressEventThrottle.cpp:
449         * xml/XMLHttpRequestUpload.cpp:
450
451 2016-06-15  Antti Koivisto  <antti@apple.com>
452
453         GoogleMaps transit schedule explorer comes up blank initially
454         https://bugs.webkit.org/show_bug.cgi?id=158803
455         rdar://problem/25818080
456
457         Reviewed by Andreas Kling.
458
459         In case we had something like
460
461         .foo bar { ... }
462
463         and later a new stylesheet was added dynamically that contained
464
465         .foo baz { ... }
466
467         we would fail to add the new rules to the descendant invalidation rule sets for ".foo". This could
468         cause some style invalidations to be missed.
469
470         * css/DocumentRuleSets.cpp:
471         (WebCore::DocumentRuleSets::collectFeatures):
472
473         Reset the ancestorClassRules and ancestorAttributeRulesForHTML rule set caches when new style sheets
474         are added (==collectFeatures is called).
475
476 2016-06-15  Javier Fernandez  <jfernandez@igalia.com>
477
478         [css-sizing] Item borders are missing with 'min-width:-webkit-fill-available' and zero available width
479         https://bugs.webkit.org/show_bug.cgi?id=158258
480
481         Reviewed by Darin Adler.
482
483         The "fill-available" size is defined as the containing block's size less
484         the box's border and padding size. However, when used for min-width we
485         should ensure we don't get negative values as result of logical width
486         computation.
487
488         http://www.w3.org/TR/css-sizing-3/#fill-available-sizing
489
490         This patch ensure fill-available value computed value will be always
491         greater than box's boder and padding width.
492
493         Test: fast/css-intrinsic-dimensions/fill-available-with-zero-width.html
494
495         * rendering/RenderBox.cpp:
496         (WebCore::RenderBox::computeIntrinsicLogicalWidthUsing):
497
498 2016-06-15  Alex Christensen  <achristensen@webkit.org>
499
500         Fix 2d canvas transform after r192900
501         https://bugs.webkit.org/show_bug.cgi?id=158725
502         rdar://problem/26774230
503
504         Reviewed by Dean Jackson.
505
506         Test: fast/canvas/canvas-transform-inverse.html
507
508         * html/canvas/CanvasRenderingContext2D.cpp:
509         (WebCore::CanvasRenderingContext2D::transform):
510         r192900 was intended to have no change in behavior, but I made a typo.
511         We need to apply the inverse of the original transform to the path to be correct.
512         This affects transforms applied to the canvas during the creation of a path.
513
514 2016-06-15  Eric Carlson  <eric.carlson@apple.com>
515
516         [iOS] Make HTMLMediaElement.muted mutable
517         https://bugs.webkit.org/show_bug.cgi?id=158787
518         <rdar://problem/24452567>
519
520         Reviewed by Dean Jackson.
521
522         Tests: media/audio-playback-restriction-removed-muted.html
523                media/audio-playback-restriction-removed-track-enabled.html
524
525         * html/HTMLMediaElement.cpp:
526         (WebCore::HTMLMediaElement::audioTrackEnabledChanged): Remove most behavior restrictions if
527           the track state was changed as a result of a user gesture.
528         (WebCore::HTMLMediaElement::setMuted): Ditto.
529         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Add mask 
530           parameter so caller can choose which restrictions are removed.
531         * html/HTMLMediaElement.h:
532
533         * html/MediaElementSession.cpp:
534         (WebCore::restrictionName): Drive-by fix: remove duplicate label.
535         * html/MediaElementSession.h:
536
537         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
538         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
539         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Set muted on AVPlayer if setMuted
540           was called before the player was created.
541         (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): Drive-by fix: return early if there
542           is no AVPlayer, not if we won't have metadata yet.
543         (WebCore::MediaPlayerPrivateAVFoundationObjC::setMuted): New.
544
545 2016-06-15  Romain Bellessort  <romain.bellessort@crf.canon.fr>
546
547         Enabling Shadow DOM for all platforms
548         https://bugs.webkit.org/show_bug.cgi?id=158738
549
550         Reviewed by Ryosuke Niwa.
551
552         No new tests (no new behavior to be tested).
553
554         Removed Shadow DOM from options (enabled by default)
555         (comprises removal of corresponding preprocessor directives)
556
557         * Configurations/FeatureDefines.xcconfig:
558         * DerivedSources.make:
559         * bindings/generic/RuntimeEnabledFeatures.h:
560         * bindings/js/JSDocumentFragmentCustom.cpp:
561         * bindings/js/JSNodeCustom.cpp:
562         * css/CSSGrammar.y.in:
563         * css/CSSParser.cpp:
564         * css/CSSParserValues.cpp:
565         * css/CSSParserValues.h:
566         * css/CSSSelector.cpp:
567         * css/CSSSelector.h:
568         * css/ElementRuleCollector.cpp:
569         * css/ElementRuleCollector.h:
570         * css/RuleSet.cpp:
571         * css/RuleSet.h:
572         * css/SelectorChecker.cpp:
573         * css/SelectorChecker.h:
574         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
575         * css/StyleResolver.cpp:
576         * cssjit/SelectorCompiler.cpp:
577         * dom/ComposedTreeAncestorIterator.h:
578         * dom/ComposedTreeIterator.cpp:
579         * dom/ComposedTreeIterator.h:
580         * dom/ContainerNode.cpp:
581         * dom/Document.cpp:
582         * dom/Document.h:
583         * dom/Element.cpp:
584         * dom/Element.h:
585         * dom/Element.idl:
586         * dom/Event.idl:
587         * dom/EventPath.cpp:
588         * dom/Node.cpp:
589         * dom/Node.h:
590         * dom/NonDocumentTypeChildNode.idl:
591         * dom/ShadowRoot.cpp:
592         * dom/ShadowRoot.h:
593         * dom/ShadowRoot.idl:
594         * dom/SlotAssignment.cpp:
595         * dom/SlotAssignment.h:
596         * html/HTMLSlotElement.cpp:
597         * html/HTMLSlotElement.h:
598         * html/HTMLSlotElement.idl:
599         * html/HTMLTagNames.in:
600         * page/FocusController.cpp:
601         * style/StyleSharingResolver.cpp:
602         * style/StyleTreeResolver.cpp:
603
604 2016-06-15  Andreas Kling  <akling@apple.com>
605
606         [Cocoa] Add two notify listeners for poking the garbage collector.
607         <https://webkit.org/b/158783>
608
609         Reviewed by Antti Koivisto.
610
611         Add two new notify listeners:
612
613         - com.apple.WebKit.fullGC
614
615             Trigger a full garbage collection in the main WebCore VM immediately.
616
617         - com.apple.WebKit.deleteAllCode
618
619             Throw away all of JSC's linked and unlinked code, and do a full GC.
620
621         These will make it easier to diagnose memory growth issues by having a lever that
622         eliminates many of the large object graphs without going after behavior-changing things
623         like the memory cache.
624
625         * platform/MemoryPressureHandler.cpp:
626         (WebCore::MemoryPressureHandler::platformInitialize):
627         * platform/MemoryPressureHandler.h:
628         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
629         (WebCore::MemoryPressureHandler::platformInitialize):
630
631 2016-06-15  Antti Koivisto  <antti@apple.com>
632
633         Vary:Cookie validation doesn't work in private browsing
634         https://bugs.webkit.org/show_bug.cgi?id=158616
635         <rdar://problem/26755067>
636
637         Reviewed by Andreas Kling.
638
639         There wasn't a way to get cookie based on SessionID from WebCore.
640
641         * platform/CookiesStrategy.h:
642
643             Add a cookie retrival function that takes SessionID instead of NetworkStorageSession.
644
645         * platform/network/CacheValidation.cpp:
646         (WebCore::headerValueForVary):
647
648             Use it.
649
650         (WebCore::verifyVaryingRequestHeaders):
651
652 2016-06-15  Per Arne Vollan  <pvollan@apple.com>
653
654         [Win] The test accessibility/selected-text-range-aria-elements.html is failing.
655         https://bugs.webkit.org/show_bug.cgi?id=158732
656
657         Reviewed by Brent Fulgham.
658
659         Implement support for getting selected text range.
660
661         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
662         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
663
664 2016-06-14  Myles C. Maxfield  <mmaxfield@apple.com>
665
666         Addressing post-review comments after r201971
667         https://bugs.webkit.org/show_bug.cgi?id=158450
668
669         Unreviewed.
670
671         * css/CSSFontFaceSet.cpp:
672         (WebCore::CSSFontFaceSet::add):
673         (WebCore::CSSFontFaceSet::remove):
674
675 2016-06-14  Myles C. Maxfield  <mmaxfield@apple.com>
676
677         Honor bidi unicode codepoints
678         https://bugs.webkit.org/show_bug.cgi?id=149170
679         <rdar://problem/26527378>
680
681         Reviewed by Simon Fraser.
682
683         BidiResolver doesn't have any concept of isolate Unicode code points, so produces
684         unexpected output when they are present. Fix by considering such code points as
685         whitespace in the bidi algorithm. This is a stop-gap measure until we can support
686         the codepoints fully in our Bidi algorithm.
687
688         Test: fast/text/isolate-ignore.html
689
690         * platform/graphics/Font.cpp:
691         (WebCore::createAndFillGlyphPage):
692         * platform/text/BidiResolver.h:
693         (WebCore::Subclass>::createBidiRunsForLine):
694
695 2016-06-14  Antoine Quint  <graouts@apple.com>
696
697         [iOS] Play glyph is pixelated when the page zoom is large
698         https://bugs.webkit.org/show_bug.cgi?id=158770
699         <rdar://problem/26092124>
700
701         Reviewed by Dean Jackson.
702
703         Use the same technique that we use to scale the video controls by using a combination
704         of CSS "zoom" and "transform" properties to have the video play glyph scaled at its
705         native size regardless of page zoom.
706
707         * Modules/mediacontrols/mediaControlsiOS.js:
708         (ControllerIOS.prototype.set pageScaleFactor):
709
710 2016-06-14  Chris Dumez  <cdumez@apple.com>
711
712         Regression(r201534): Compile time greatly regressed
713         https://bugs.webkit.org/show_bug.cgi?id=158765
714         <rdar://problem/26587342>
715
716         Reviewed by Darin Adler.
717
718         Compile time greatly regressed by r201534 due to Document.h now including
719         TextAutoSizing.h. Move the TextAutoSizingTraits back to Document.h to
720         restore pre-r201534 behavior.
721
722         * WebCore.xcodeproj/project.pbxproj:
723         * dom/Document.cpp:
724         (WebCore::TextAutoSizingTraits::constructDeletedValue):
725         (WebCore::TextAutoSizingTraits::isDeletedValue):
726         * dom/Document.h:
727         * rendering/TextAutoSizing.h:
728         (WebCore::TextAutoSizingTraits::constructDeletedValue): Deleted.
729         (WebCore::TextAutoSizingTraits::isDeletedValue): Deleted.
730
731 2016-06-14  Antoine Quint  <graouts@apple.com>
732
733         Inline media controls cut off PiP and fullscreen buttons on cnn.com
734         https://bugs.webkit.org/show_bug.cgi?id=158766
735         <rdar://problem/24175161>
736
737         Reviewed by Dean Jackson.
738
739         The display of the picture-in-picture and fullscreen buttons are dependent on the availability
740         of video tracks through a call to hasVideo(). We need to ensure that the display properties of
741         both those buttons are updated when the number of video tracks has changed since the controls
742         may be populated prior to the availability of video tracks.
743
744         * Modules/mediacontrols/mediaControlsApple.js:
745         (Controller.prototype.updateHasVideo):
746
747 2016-06-14  Joseph Pecoraro  <pecoraro@apple.com>
748
749         Web Inspector: Rename Timeline.setAutoCaptureInstruments to Timeline.setInstruments
750         https://bugs.webkit.org/show_bug.cgi?id=158762
751
752         Reviewed by Timothy Hatcher.
753
754         Test: inspector/timeline/setInstruments-errors.html
755
756         * inspector/InspectorTimelineAgent.cpp:
757         (WebCore::InspectorTimelineAgent::willDestroyFrontendAndBackend):
758         (WebCore::InspectorTimelineAgent::setInstruments):
759         (WebCore::InspectorTimelineAgent::mainFrameStartedLoading):
760         (WebCore::InspectorTimelineAgent::setAutoCaptureInstruments): Deleted.
761         * inspector/InspectorTimelineAgent.h:
762
763 2016-06-14  Dean Jackson  <dino@apple.com>
764
765         decompose4 return value is unchecked, leading to potentially uninitialized data.
766         https://bugs.webkit.org/show_bug.cgi?id=158761
767         <rdar://problem/17526268>
768
769         Reviewed by Simon Fraser.
770
771         WebCore::decompose4 could return early without initializing data.
772         I now initialize it, but I also started checking the return
773         value at all the call sites to make sure everything is sensible.
774
775         Test: transforms/undecomposable.html
776
777         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
778         (WebCore::PerspectiveTransformOperation::blend):
779         * platform/graphics/transforms/RotateTransformOperation.cpp:
780         (WebCore::RotateTransformOperation::blend):
781         * platform/graphics/transforms/TransformationMatrix.cpp:
782         (WebCore::decompose4):
783         (WebCore::TransformationMatrix::blend4):
784         * platform/graphics/transforms/TransformationMatrix.h:
785
786 2016-06-14  Benjamin Poulain  <bpoulain@apple.com>
787
788         Add the unprefixed version of the pseudo element ::placeholder
789         https://bugs.webkit.org/show_bug.cgi?id=158653
790
791         Reviewed by Dean Jackson.
792
793         Test: fast/forms/placeholder-pseudo-element-with-webkit-prefix.html
794
795         The pseudo element ::-webkit-input-placeholder is stupidly popular
796         which forces other engines to support this exact name.
797
798         The pseudo-element spec provides a new standard name we can adopt
799         to drop the prefix: https://drafts.csswg.org/css-pseudo-4/#placeholder-pseudo
800
801         This patch does just that, make ::placeholder the standard name to select
802         the placeholder element in the shadow dom of input elements.
803
804         Unlike pseudo classes, we did not have any support for prefixes and aliasing.
805         I want to keep the absurdly efficient matching we currently use for styling
806         because style updates are more common than stylesheet updates.
807         With that constraint in mind, the value of CSSSelector has to be the unprefixed
808         version for both forms of input.
809
810         This leaves us with the problem of displaying the CSSSelector for CSSOM.
811         To differentiate the legacy form from the standard form, I added
812         a new type of PseudoElement: PseudoElementWebKitCustomLegacyPrefixed.
813         When parsing, PseudoElementWebKitCustomLegacyPrefixed let us replace
814         the original value "-webkit-input-placeholder" by the standard value.
815         When creating the selectorText for CSSOM, PseudoElementWebKitCustomLegacyPrefixed
816         let us replace the standard for by the legacy form.
817
818         * css/CSSParserValues.cpp:
819         (WebCore::CSSParserSelector::parsePseudoElementSelector):
820         * css/CSSSelector.cpp:
821         (WebCore::CSSSelector::pseudoId):
822         (WebCore::CSSSelector::selectorText):
823         * css/CSSSelector.h:
824         (WebCore::CSSSelector::isCustomPseudoElement):
825         (WebCore::CSSSelector::isWebKitCustomPseudoElement):
826         * css/SelectorChecker.cpp:
827         (WebCore::SelectorChecker::matchRecursively):
828         * css/SelectorPseudoElementTypeMap.in:
829         * css/html.css:
830         (::placeholder):
831         (input::placeholder, isindex::placeholder):
832         (textarea::placeholder):
833         (::-webkit-input-placeholder): Deleted.
834         (input::-webkit-input-placeholder, isindex::-webkit-input-placeholder): Deleted.
835         (textarea::-webkit-input-placeholder): Deleted.
836         * features.json:
837         * html/shadow/TextControlInnerElements.cpp:
838         (WebCore::TextControlPlaceholderElement::TextControlPlaceholderElement):
839
840 2016-06-14  Doug Russell  <d_russell@apple.com>
841
842         AX: Form label text should be exposed as static text if it contains only static text
843         https://bugs.webkit.org/show_bug.cgi?id=158634
844
845         Reviewed by Chris Fleizach.
846
847         Use AccessibilityLabel to represent HTMLLabelElement to assistive technology.
848         AccessibilityLabel::containsOnlyStaticText() searches label subtree to evaluate 
849         if all children are static text.
850         AccessibilityLabel::stringValue() consults containsOnlyStaticText() and returns
851         textUnderElement() if true.
852         WebAccessibilityObjectWrapperMac consults containsOnlyStaticText() and substitutes
853         StaticTextRole for LabelRole if true.
854         Cache containsOnlyStaticText() in the common case when updating children.
855
856         Tests: accessibility/mac/label-element-all-text-string-value.html
857                accessibility/mac/label-element-with-link-string-value.html
858
859         * CMakeLists.txt:
860         * WebCore.xcodeproj/project.pbxproj:
861         * accessibility/AXObjectCache.cpp:
862         (WebCore::createFromRenderer):
863         * accessibility/AccessibilityAllInOne.cpp:
864         * accessibility/AccessibilityLabel.cpp: Added.
865         (WebCore::AccessibilityLabel::AccessibilityLabel):
866         (WebCore::AccessibilityLabel::~AccessibilityLabel):
867         (WebCore::AccessibilityLabel::create):
868         (WebCore::AccessibilityLabel::computeAccessibilityIsIgnored):
869         (WebCore::AccessibilityLabel::stringValue):
870         (WebCore::childrenContainOnlyStaticText):
871         (WebCore::AccessibilityLabel::containsOnlyStaticText):
872         (WebCore::AccessibilityLabel::updateChildrenIfNecessary):
873         (WebCore::AccessibilityLabel::clearChildren):
874         (WebCore::AccessibilityLabel::insertChild):
875         * accessibility/AccessibilityLabel.h: Added.
876         * accessibility/AccessibilityObject.h:
877         (WebCore::AccessibilityObject::isLabel):
878         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
879         (-[WebAccessibilityObjectWrapper role]):
880
881 2016-06-14  Commit Queue  <commit-queue@webkit.org>
882
883         Unreviewed, rolling out r202057.
884         https://bugs.webkit.org/show_bug.cgi?id=158749
885
886         This change broke the Windows build. (Requested by ryanhaddad
887         on #webkit).
888
889         Reverted changeset:
890
891         "Honor bidi unicode codepoints"
892         https://bugs.webkit.org/show_bug.cgi?id=149170
893         http://trac.webkit.org/changeset/202057
894
895 2016-06-14  Myles C. Maxfield  <mmaxfield@apple.com>
896
897         Honor bidi unicode codepoints
898         https://bugs.webkit.org/show_bug.cgi?id=149170
899         <rdar://problem/26527378>
900
901         Reviewed by Simon Fraser.
902
903         BidiResolver doesn't have any concept of isolate Unicode code points, so produces
904         unexpected output when they are present. Fix by considering such code points as
905         whitespace in the bidi algorithm. This is a stop-gap measure until we can support
906         the codepoints fully in our Bidi algorithm.
907
908         Test: fast/text/isolate-ignore.html
909
910         * platform/graphics/Font.cpp:
911         (WebCore::createAndFillGlyphPage):
912         * platform/text/BidiResolver.h:
913         (WebCore::Subclass>::createBidiRunsForLine):
914
915 2016-06-14  Commit Queue  <commit-queue@webkit.org>
916
917         Unreviewed, rolling out r200455.
918         https://bugs.webkit.org/show_bug.cgi?id=158740
919
920         hangs twitter/facebook (Requested by mcatanzaro on #webkit).
921
922         Reverted changeset:
923
924         "[GStreamer] Adaptive streaming issues"
925         https://bugs.webkit.org/show_bug.cgi?id=144040
926         http://trac.webkit.org/changeset/200455
927
928 2016-06-14  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
929
930         WebRTC: RTCPeerConnection::addTrack() should throw InvalidAccessError instead of InvalidModificationError.
931         https://bugs.webkit.org/show_bug.cgi?id=158735
932
933         Reviewed by Eric Carlson.
934
935         Throw InvalidAccessError instead of InvalidModificationError when track already exists in connection's
936         set of senders as per specification (https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtrack).
937
938         Updated existing test results: fast/mediastream/RTCPeerConnection-add-removeTrack-expected.txt
939
940         * Modules/mediastream/RTCPeerConnection.cpp:
941         (WebCore::RTCPeerConnection::addTrack):
942
943 2016-06-14  Adam Bergkvist  <adam.bergkvist@ericsson.com>
944
945         WebRTC: Imlement MediaEndpointPeerConnection::addIceCandidate()
946         https://bugs.webkit.org/show_bug.cgi?id=158690
947
948         Reviewed by Eric Carlson.
949
950         Implement MediaEndpointPeerConnection::addIceCandidate() that is the MediaEndpoint
951         implementation of RTCPeerConnection.addIceCandidate() [1].
952
953         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-peerconnection-addicecandidate
954
955         Test: fast/mediastream/RTCPeerConnection-addIceCandidate.html
956
957         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
958         (WebCore::MediaEndpointPeerConnection::addIceCandidate):
959         (WebCore::MediaEndpointPeerConnection::addIceCandidateTask):
960         Implemented.
961         * Modules/mediastream/MediaEndpointPeerConnection.h:
962         * platform/mediastream/MediaEndpoint.h:
963         Use mid instead of mdescIndex to identify the target media description in the backend.
964         * platform/mock/MockMediaEndpoint.cpp:
965         Update mock method signature accordingly.
966         (WebCore::MockMediaEndpoint::addRemoteCandidate):
967         * platform/mock/MockMediaEndpoint.h:
968
969 2016-06-14  Zalan Bujtas  <zalan@apple.com>
970
971         Make RenderBlock::insertInto/RemoveFromTrackedRendererMaps functions static.
972         https://bugs.webkit.org/show_bug.cgi?id=158722
973
974         Reviewed by Simon Fraser.
975
976         These functions manipulate static tracker hashmaps. They don't need to be on RenderBlock.
977         This is also in preparation for decoupling positioned descendant tracking from descendent percentage height handling.
978         (gPositionedDescendantsMap and gPercentHeightDescendantsMap) 
979
980         No change in functionality.
981
982         * rendering/RenderBlock.cpp:
983         (WebCore::insertIntoTrackedRendererMaps):
984         (WebCore::removeFromTrackedRendererMaps):
985         (WebCore::removeBlockFromDescendantAndContainerMaps):
986         (WebCore::RenderBlock::insertPositionedObject):
987         (WebCore::RenderBlock::addPercentHeightDescendant):
988         (WebCore::RenderBlock::insertIntoTrackedRendererMaps): Deleted.
989         (WebCore::RenderBlock::removeFromTrackedRendererMaps): Deleted.
990         * rendering/RenderBlock.h:
991
992 2016-06-14  Adam Bergkvist  <adam.bergkvist@ericsson.com>
993
994         WebRTC: Add media setup test where media is set up in one direction at a time
995         https://bugs.webkit.org/show_bug.cgi?id=158691
996
997         Reviewed by Eric Carlson.
998
999         Add test for setting up media in one direction at a time. This requires a change in sdp.js
1000         to allow an SDP that doesn't contain a stream id or track id (representing
1001         a track being sent). In this test, the first answer doesn't contain any sending media.
1002
1003         Test: fast/mediastream/RTCPeerConnection-media-setup-two-dialogs.html
1004
1005         * Modules/mediastream/sdp.js:
1006
1007 2016-06-14  Chris Dumez  <cdumez@apple.com>
1008
1009         [Cocoa] Avoid extra copy of headers dictionary in ResourceResponse::platformLazyInit()
1010         https://bugs.webkit.org/show_bug.cgi?id=158717
1011
1012         Reviewed by Alex Christensen.
1013
1014         Avoid extra copy of headers dictionary in ResourceResponse::platformLazyInit() by
1015         calling CFHTTPMessageCopyAllHeaderFields() instead of [NSURLResponse allHeaderFields].
1016
1017         CFHTTPMessageCopyAllHeaderFields() creates only 1 copy while
1018         [NSURLResponse allHeaderFields] creates 2 (see <rdar://problem/26778863>).
1019
1020         * platform/network/cocoa/ResourceResponseCocoa.mm:
1021         (WebCore::addToHTTPHeaderMap):
1022         (WebCore::ResourceResponse::platformLazyInit):
1023
1024 2016-06-14  David Kilzer  <ddkilzer@apple.com>
1025
1026         REGRESSION (r151608): Leak of QTMovieLayer or AVPlayerLayer in -[WebVideoFullscreenController setVideoElement:]
1027         <https://webkit.org/b/158729>
1028
1029         Reviewed by Eric Carlson.
1030
1031         * platform/mac/WebVideoFullscreenController.mm:
1032         (-[WebVideoFullscreenController setVideoElement:]): Use
1033         RetainPtr<> to prevent leaks.
1034         * platform/mac/WebVideoFullscreenHUDWindowController.mm:
1035         Drive-by fix to remove unused <wtf/RetainPtr.h> import.
1036
1037 2016-06-14  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1038
1039         The vector of mediastreams should be passed via a reference to RTCPeerConnection::addTrack()
1040         https://bugs.webkit.org/show_bug.cgi?id=158701
1041
1042         Pass vector of mediastreams by reference.
1043
1044         Reviewed by Youenn Fablet.
1045
1046         * Modules/mediastream/RTCPeerConnection.cpp:
1047         (WebCore::RTCPeerConnection::addTrack):
1048         * Modules/mediastream/RTCPeerConnection.h:
1049
1050 2016-06-14  Ryosuke Niwa  <rniwa@webkit.org>
1051
1052         Crash inside firstPositionInNode in checkLoadCompleteForThisFrame
1053         https://bugs.webkit.org/show_bug.cgi?id=158724
1054
1055         Reviewed by Alex Christensen.
1056
1057         Added null checks for document and document element since they could be nullptr here.
1058
1059         * loader/FrameLoader.cpp:
1060         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
1061
1062 2016-06-13  Gavin & Ellie Barraclough  <barraclough@apple.com>
1063
1064         Remove hasStaticPropertyTable (part 3: JSLocation::putDelegate)
1065         https://bugs.webkit.org/show_bug.cgi?id=158431
1066
1067         Unreviewed build fix.
1068
1069         * bindings/js/JSLocationCustom.cpp:
1070         (WebCore::JSLocation::putDelegate):
1071
1072 2016-06-13  Gavin & Ellie Barraclough  <barraclough@apple.com>
1073
1074         Remove hasStaticPropertyTable (part 4: JSHTMLDocument & JSStorage)
1075         https://bugs.webkit.org/show_bug.cgi?id=158431
1076
1077         Reviewed by Chris Dumez.
1078
1079         All uses of hasStaticPropertyTable flag generated by bindings are wrong.
1080
1081         JSHTMLDocument & JSStorage contain a number of static_asserts claiming that
1082         various methods do not support static properties. These asserts were likely
1083         correct at the time they were added, as JSObject::getOwnPropertySlot and
1084         JSObject::deleteProperty did not support getting / deleting static value.
1085         This is no longer the case, and these asserts are now incorrect.
1086
1087         * bindings/js/JSHTMLDocumentCustom.cpp:
1088         (WebCore::JSHTMLDocument::getOwnPropertySlot):
1089         * bindings/js/JSStorageCustom.cpp:
1090         (WebCore::JSStorage::deleteProperty):
1091         (WebCore::JSStorage::deletePropertyByIndex):
1092         (WebCore::JSStorage::putDelegate):
1093             - remove incorrect static_asserts.
1094
1095 2016-06-13  Gavin & Ellie Barraclough  <barraclough@apple.com>
1096
1097         Remove hasStaticPropertyTable (part 3: JSLocation::putDelegate)
1098         https://bugs.webkit.org/show_bug.cgi?id=158431
1099
1100         Reviewed by Geoff Garen.
1101
1102         All uses of hasStaticPropertyTable flag generated by bindings are wrong.
1103
1104         JSLocation::putDelegate checks the static property table redundantly.
1105
1106         In the case of same origin access, if the property is not in the static
1107         table the method will call JSObject::put and return true (indicating the
1108         delegate handled the put). If the property is in the static table, the
1109         method will return false (indicating the the delegate did not handle the
1110         access) - in which case the calling function will call JSObject::put.
1111         Checking for the property in the static table is redundant - same origin
1112         access does not require any special handling, and should just always
1113         return false & let the caller handle the put.
1114
1115         In the case of cross origin access, if the property is not in the static
1116         table we return true (indicating the access was handled, and silently
1117         blocking it). If it is a static property, we check the name, and if the
1118         name is not 'href' we also return true, silently blocking. In the case
1119         that the name is 'href' we'll return false, indicating to the caller
1120         that the access was not handled by the delegate, resulting in it taking
1121         place. The additional check of the static table is redundant, since we
1122         only have special behaviour in the case of 'href'. (Moreover it is
1123         unnecesszarily fragile, since if we made a change such that 'href' was no
1124         longer implemented as a static property with would fail.)
1125
1126         - for same origin, always return false.
1127         - for cross origin, return false for 'href', otherwise return true.
1128
1129         * bindings/js/JSLocationCustom.cpp:
1130         (WebCore::JSLocation::putDelegate):
1131             - restructure & remove static table check.
1132
1133 2016-06-13  Gavin & Ellie Barraclough  <barraclough@apple.com>
1134
1135         Remove hasStaticPropertyTable (part 2: JSPluginElement)
1136         https://bugs.webkit.org/show_bug.cgi?id=158431
1137
1138         Reviewed by Chris Dumez.
1139
1140         All uses of hasStaticPropertyTable flag generated by bindings are wrong.
1141
1142         The check in pluginElementCustomGetOwnPropertySlot was somewhat dubious in the
1143         first place (for types with static properties it would give precedence to both
1144         static and also property storage properties; for types without static properties
1145         it would check neither - an odd asymetry in the case of values in the storage
1146         array, and was depending on an implementation detail that could change).
1147
1148         This is all now redundant anyway. None of these types have static properties.
1149         All properties are now corretcly on the prototype (which is handled appropriately
1150         below). This is just dead code.
1151
1152         * bindings/js/JSPluginElementFunctions.h:
1153         (WebCore::pluginElementCustomGetOwnPropertySlot):
1154             - remove dead code.
1155
1156 2016-06-13  Gavin & Ellie Barraclough  <barraclough@apple.com>
1157
1158         Remove hasStaticPropertyTable (part 1: DOM bindings)
1159         https://bugs.webkit.org/show_bug.cgi?id=158431
1160
1161         Reviewed by Chris Dumez.
1162
1163         All uses of hasStaticPropertyTable flag generated by bindings are wrong.
1164
1165         * bindings/js/JSDOMBinding.h:
1166         (WebCore::getStaticValueSlotEntryWithoutCaching): Deleted.
1167         (WebCore::getStaticValueSlotEntryWithoutCaching<JSDOMObject>): Deleted.
1168             - this method is not used anywhere.
1169
1170 2016-06-13  Adam Bergkvist  <adam.bergkvist@ericsson.com>
1171
1172         WebRTC: Imlement MediaEndpointPeerConnection::replaceTrack()
1173         https://bugs.webkit.org/show_bug.cgi?id=158688
1174
1175         Reviewed by Eric Carlson.
1176
1177         Implement MediaEndpointPeerConnection::replaceTrack() that is the MediaEndpoint implementation
1178         of RTCRtpSender.replaceTrack() [1].
1179
1180         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcrtpsender-replacetrack
1181
1182         Updated fast/mediastream/RTCRtpSender-replaceTrack.html
1183
1184         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
1185         (WebCore::MediaEndpointPeerConnection::replaceTrack):
1186         (WebCore::MediaEndpointPeerConnection::replaceTrackTask):
1187         Implemented.
1188         * Modules/mediastream/MediaEndpointPeerConnection.h:
1189         * Modules/mediastream/PeerConnectionBackend.h:
1190         * Modules/mediastream/RTCPeerConnection.cpp:
1191         (WebCore::RTCPeerConnection::replaceTrack):
1192         * Modules/mediastream/RTCPeerConnection.h:
1193         Move the MediaStreamTrack instance of sending a reference to it. This change is the main
1194         reason many files are touched by this change.
1195         * Modules/mediastream/RTCRtpSender.h:
1196         * Modules/mediastream/RTCRtpSender.idl:
1197         * platform/mediastream/MediaEndpoint.h:
1198         Use mid instead of mdescIndex to identify the media description in the backend.
1199         * platform/mock/MockMediaEndpoint.cpp:
1200         (WebCore::MockMediaEndpoint::replaceSendSource):
1201         * platform/mock/MockMediaEndpoint.h:
1202
1203 2016-06-13  Joseph Pecoraro  <pecoraro@apple.com>
1204
1205         window.onerror should pass the ErrorEvent's 'error' property as the 5th argument to the event handler
1206         https://bugs.webkit.org/show_bug.cgi?id=55092
1207         <rdar://problem/25731279>
1208
1209         Reviewed by Dean Jackson.
1210
1211         This includes the actual Error in window.error / ErrorEvent:
1212         https://html.spec.whatwg.org/multipage/webappapis.html#the-errorevent-interface
1213
1214         This is useful for scripts to be able to get an error stack
1215         from uncaught exceptions, by checking the error itself.
1216
1217         Tests: fast/events/window-onerror17.html
1218                http/tests/security/cross-origin-script-error-event-redirected.html
1219                http/tests/security/cross-origin-script-error-event.html
1220                http/tests/security/script-crossorigin-error-event-information.html
1221                http/tests/security/script-no-crossorigin-error-event-should-be-sanitized.html
1222                userscripts/window-onerror-for-isolated-world-3.html
1223
1224         * CMakeLists.txt:
1225         * WebCore.xcodeproj/project.pbxproj:
1226         * bindings/js/JSBindingsAllInOne.cpp:
1227         Add new custom error event file.
1228
1229         * bindings/js/JSDOMBinding.cpp:
1230         (WebCore::reportException):
1231         Include the JSC::Exception when reporting exceptions, so the error value is available.
1232         
1233         * bindings/js/JSErrorEventCustom.cpp:
1234         (WebCore::JSErrorEvent::error):
1235         Sanitized access to the ErrorEvent's error property to prevent leaking objects
1236         across isolated world boundaries. This is like CustomEvent's data property.
1237
1238         * bindings/js/JSErrorHandler.cpp:
1239         (WebCore::JSErrorHandler::handleEvent):
1240         * bindings/js/JSErrorHandler.h:
1241         Include the error object as the 4th argument to the window.onerror event handler.
1242
1243         * dom/ScriptExecutionContext.cpp:
1244         (WebCore::ScriptExecutionContext::sanitizeScriptError):
1245         (WebCore::ScriptExecutionContext::reportException):
1246         (WebCore::ScriptExecutionContext::dispatchErrorEvent):
1247         * dom/ScriptExecutionContext.h:
1248         Include the error object in the ErrorEvent constructed when dispatching error events.
1249
1250         * dom/ErrorEvent.cpp:
1251         (WebCore::ErrorEvent::ErrorEvent):
1252         (WebCore::ErrorEvent::sanitizedErrorValue):
1253         (WebCore::ErrorEvent::trySerializeError):
1254         * dom/ErrorEvent.h:
1255         * dom/ErrorEvent.idl:
1256         Include an any "error" property on the ErrorEvent, and allow it in initialization.
1257
1258         * bindings/js/WorkerScriptController.cpp:
1259         (WebCore::WorkerScriptController::evaluate):
1260         * workers/WorkerMessagingProxy.cpp:
1261         (WebCore::WorkerMessagingProxy::postExceptionToWorkerObject):
1262         Within the Worker world, the error is included in the event.
1263         When re-dispatching the error on the world object in the world that spawned the
1264         Worker the event does not include an error object. This matches other browsers
1265         right now, but could be improved to have the same cross world serialization
1266         as isolated worlds have with the error data.
1267
1268         * dom/CustomEvent.h:
1269         Remove unimplemented stale method.
1270
1271 2016-06-13  Dean Jackson  <dino@apple.com>
1272
1273         SVG elements don't blend correctly into HTML
1274         https://bugs.webkit.org/show_bug.cgi?id=158718
1275         <rdar://problem/26782004>
1276
1277         Reviewed by Antoine Quint.
1278
1279         We were not creating any transparency layers for the root SVG nodes.
1280         This is ok if the SVG is the root document, because it is the backdrop.
1281         However, if it is inline SVG, it needs to apply the operation in
1282         order to composite into the document.
1283
1284         Test: svg/css/mix-blend-mode-with-inline-svg.html
1285
1286         * rendering/RenderLayer.cpp:
1287         (WebCore::RenderLayer::beginTransparencyLayers):
1288
1289 2016-06-13  Brady Eidson  <beidson@apple.com>
1290
1291         storage/indexeddb/modern/leaks-1.html leaks the database connection handle.
1292         https://bugs.webkit.org/show_bug.cgi?id=158643
1293
1294         Reviewed by Alex Christensen.
1295
1296         Tested by changes to existing test.
1297
1298         * Modules/indexeddb/IDBDatabase.cpp:
1299         (WebCore::IDBDatabase::hasPendingActivity):
1300         
1301         * dom/EventTarget.h:
1302         (WebCore::EventTarget::eventTargetData):
1303         (WebCore::EventTarget::hasEventListeners):
1304
1305
1306 2016-06-13  Enrica Casucci  <enrica@apple.com>
1307
1308         REGRESSION(r201956): Failure to initialize new internal settings produced random test failures in release.
1309         https://bugs.webkit.org/show_bug.cgi?id=158713
1310         rdar://26769957
1311
1312         Reviewed by Simon Fraser.
1313
1314         Failed to initialize the new member variable in both Settings and InternalSettings classes.
1315
1316         * page/Settings.cpp:
1317         (WebCore::Settings::Settings):
1318         * testing/InternalSettings.cpp:
1319         (WebCore::InternalSettings::Backup::Backup):
1320
1321 2016-06-13  Chris Dumez  <cdumez@apple.com>
1322
1323         Drop HipChat hack introduced in r197548
1324         https://bugs.webkit.org/show_bug.cgi?id=158711
1325
1326         Reviewed by Geoffrey Garen.
1327
1328         Drop HipChat hack introduced in r197548. This hack is no longer needed
1329         as the bug was fixed in HipChat since then:
1330         https://support.atlassian.com/servicedesk/customer/portal/32/HCP-7532
1331
1332         I have confirmed locally that the latest version (4.0.12.665) is able
1333         to connect without the hack.
1334
1335         * bindings/js/JSLocationCustom.cpp:
1336         (WebCore::JSLocation::putDelegate): Deleted.
1337         * platform/RuntimeApplicationChecks.h:
1338         * platform/RuntimeApplicationChecks.mm:
1339         (WebCore::MacApplication::isHipChat): Deleted.
1340
1341 2016-06-13  Chris Fleizach  <cfleizach@apple.com>
1342
1343         AX: CrashTracer: com.apple.WebKit.WebContent at WebCore::AccessibilityRenderObject::remoteSVGRootElement const + 227
1344         https://bugs.webkit.org/show_bug.cgi?id=158685
1345
1346         Reviewed by David Kilzer.
1347
1348         Crash reports show a null access at a line that tries to dereference a pointer. 
1349         I still don't have a way to layout test this, as it seems tied to tear down of the main document.
1350
1351         * accessibility/AccessibilityRenderObject.cpp:
1352         (WebCore::AccessibilityRenderObject::remoteSVGRootElement):
1353
1354 2016-06-13  Jeremy Jones  <jeremyj@apple.com>
1355
1356         Use two video layer solution only on mac.
1357         https://bugs.webkit.org/show_bug.cgi?id=158705
1358         rdar://problem/26776360
1359
1360         Reviewed by Jer Noble.
1361
1362         Two video layer solution is only useful on the mac to prevent flicker, so don't do it elsewhere.
1363
1364         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1365         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer):
1366
1367 2016-06-13  Jeremy Jones  <jeremyj@apple.com>
1368
1369         Decrease PiP flicker by not removing window prematurely.
1370         https://bugs.webkit.org/show_bug.cgi?id=158436
1371         <rdar://problem/19052639>
1372
1373         Reviewed by Darin Adler.
1374
1375         UIWindow shouldn't be removed until cleanupFullscreen, so the video layer has a chance
1376         to be reparented in the DOM first.
1377
1378         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
1379         (WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture):
1380
1381 2016-06-13  Alex Christensen  <achristensen@webkit.org>
1382
1383         Add WebSocketProvider stub
1384         https://bugs.webkit.org/show_bug.cgi?id=158702
1385
1386         Reviewed by Brady Eidson.
1387
1388         No new tests.  No change in behavior.
1389
1390         * WebCore.xcodeproj/project.pbxproj:
1391         * dom/DocumentMarkerController.cpp:
1392         * dom/ScriptedAnimationController.cpp:
1393         * html/HTMLMediaElement.cpp:
1394         * html/MediaDocument.cpp:
1395         * html/shadow/MediaControlElements.cpp:
1396         * html/shadow/MediaControls.cpp:
1397         * html/shadow/MediaControls.h:
1398         * html/shadow/MediaControlsApple.cpp:
1399         * inspector/InspectorInstrumentation.cpp:
1400         * inspector/InspectorInstrumentation.h:
1401         * inspector/InspectorOverlay.cpp:
1402         (WebCore::InspectorOverlay::overlayPage):
1403         * loader/EmptyClients.h:
1404         * loader/FrameLoader.cpp:
1405         * loader/FrameLoader.h:
1406         * loader/appcache/ApplicationCacheHost.cpp:
1407         * loader/cache/CachedResource.cpp:
1408         * page/FrameView.cpp:
1409         * page/Page.cpp:
1410         (WebCore::Page::Page):
1411         * page/Page.h:
1412         (WebCore::Page::applicationCacheStorage):
1413         (WebCore::Page::databaseProvider):
1414         (WebCore::Page::socketProvider):
1415         (WebCore::Page::storageNamespaceProvider):
1416         * page/PageConfiguration.cpp:
1417         (WebCore::PageConfiguration::PageConfiguration):
1418         * page/PageConfiguration.h:
1419         * page/ResourceUsageOverlay.cpp:
1420         * page/SocketProvider.h: Added.
1421         (WebCore::SocketProvider::~SocketProvider):
1422         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1423         * rendering/RenderElement.cpp:
1424         * rendering/RenderLayerBacking.cpp:
1425         * style/StyleResolveForDocument.cpp:
1426         * style/StyleTreeResolver.cpp:
1427         * svg/graphics/SVGImage.cpp:
1428         (WebCore::SVGImage::dataChanged):
1429         * testing/MockPageOverlayClient.cpp:
1430
1431 2016-06-13  Brady Eidson  <beidson@apple.com>
1432
1433         Crashes in WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask.
1434         <rdar://problem/26768449> and https://bugs.webkit.org/show_bug.cgi?id=158696
1435
1436         Reviewed by David Kilzer.
1437
1438         No new tests (Covered by all existing tests in Gmalloc/ASAN configs).
1439
1440         * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
1441         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTask):
1442         (WebCore::IDBServer::UniqueIDBDatabase::executeNextDatabaseTaskReply):
1443
1444 2016-06-13  Brady Eidson  <beidson@apple.com>
1445
1446         Modern IDB: IDBOpenDBRequest objects leak.
1447         https://bugs.webkit.org/show_bug.cgi?id=158694
1448
1449         Reviewed by Alex Christensen.
1450
1451         No new tests (Currently have no testing strategy for guaranteeing lifetime of WebCore DOM objects)
1452
1453         * Modules/indexeddb/client/IDBConnectionProxy.cpp:
1454         (WebCore::IDBClient::IDBConnectionProxy::completeOpenDBRequest): At this point we never need the
1455             request again, so remove it from the map.
1456
1457 2016-06-13  Chris Dumez  <cdumez@apple.com>
1458
1459         Make sure HTTPHeaderMap gets a move constructor / assignment operator
1460         https://bugs.webkit.org/show_bug.cgi?id=158695
1461         <rdar://problem/26729511>
1462
1463         Reviewed by Alex Christensen.
1464
1465         Make sure HTTPHeaderMap gets a move constructor / assignment operator.
1466         It was not getting an implicit one because of its user-declared
1467         destructor. This patch drops the user-declared destructor so that
1468         HTTPHeaderMap now gets an implicit move constructor / assignment
1469         operator.
1470
1471         Not having a move constructor / assignment operator is an issue because
1472         we rely on HTTPHeaderMap::isolatedCopy() / WTFMove() since r201623 to
1473         pass HTTPHeaderMap across thread.
1474
1475         * platform/network/HTTPHeaderMap.cpp:
1476         (WebCore::HTTPHeaderMap::~HTTPHeaderMap): Deleted.
1477         * platform/network/HTTPHeaderMap.h:
1478
1479 2016-06-13  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1480
1481         Remove useless parameter from GenerateParametersCheck signature
1482         https://bugs.webkit.org/show_bug.cgi?id=158692
1483
1484         Reviewed by Chris Dumez.
1485
1486         Remove one parameter which is passed to GenerateParametersCheck
1487         but never used in the caller code.
1488
1489         * bindings/scripts/CodeGeneratorJS.pm:
1490         (GenerateImplementation):
1491         (GenerateParametersCheck):
1492         (GenerateConstructorDefinition):
1493
1494 2016-06-13  Nael Ouedraogo  <nael.ouedraogo@crf.canon.fr>
1495
1496         Improve code generator for functions with variadic parameters
1497         https://bugs.webkit.org/show_bug.cgi?id=158529
1498
1499         Reviewed by Darin Adler.
1500
1501         JS bindings code of functions with variadic parameters is improved.
1502
1503         Functions with variadic parameters are skipped for ObjC and GObject code generators.
1504
1505         * bindings/scripts/CodeGeneratorGObject.pm:
1506         (SkipFunction): Skip functions with variadic parameters.
1507         * bindings/scripts/CodeGeneratorJS.pm:
1508         (GenerateParametersCheck):
1509         * bindings/scripts/CodeGeneratorObjC.pm:
1510         (SkipFunction): Skip functions with variadic parameters.
1511         * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
1512         (webkit_dom_test_obj_any): Deleted.
1513         (webkit_dom_test_obj_attach_shadow_root): Deleted.
1514         (webkit_dom_test_obj_get_read_only_long_attr): Deleted.
1515         (webkit_dom_test_obj_get_read_only_string_attr): Deleted.
1516         * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
1517         * bindings/scripts/test/JS/JSTestObj.cpp:
1518         (WebCore::jsTestObjPrototypeFunctionOverloadedMethod12):
1519         (WebCore::jsTestObjPrototypeFunctionVariadicStringMethod):
1520         (WebCore::jsTestObjPrototypeFunctionVariadicDoubleMethod):
1521         (WebCore::jsTestObjPrototypeFunctionVariadicNodeMethod):
1522         * bindings/scripts/test/ObjC/DOMTestObj.h:
1523         * bindings/scripts/test/ObjC/DOMTestObj.mm:
1524
1525 2016-06-12  Zalan Bujtas  <zalan@apple.com>
1526
1527         Cleanup RenderBlock::removePositionedObjects
1528         https://bugs.webkit.org/show_bug.cgi?id=158670
1529
1530         Reviewed by Simon Fraser.
1531
1532         No change in functionality.
1533
1534         * rendering/RenderBlock.cpp:
1535         (WebCore::RenderBlock::insertPositionedObject):
1536         (WebCore::RenderBlock::removePositionedObject):
1537         (WebCore::RenderBlock::removePositionedObjects):
1538         * rendering/RenderBlock.h:
1539
1540 2016-06-12  Zalan Bujtas  <zalan@apple.com>
1541
1542         Remove positioned descendants when RenderBlock is no longer a containing block.
1543         https://bugs.webkit.org/show_bug.cgi?id=158655
1544         <rdar://problem/26510032>
1545
1546         Reviewed by Simon Fraser.
1547
1548         Normally the RenderView is the containing block for fixed positioned renderers.
1549         However when a renderer acquires some transform related properties, it becomes the containing
1550         block for all the fixed positioned renderers in its descendant tree.
1551         When the last transform related property is removed, the renderer is no longer a containing block
1552         and we need to remove all these positioned renderers from the descendant tracker map (gPositionedDescendantsMap).
1553         They will be inserted back into the tracker map during the next layout (either under the RenderView or
1554         under the next transformed renderer in the ancestor chain).
1555
1556         Test: fast/block/fixed-position-reparent-when-transition-is-removed.html
1557
1558         * rendering/RenderBlock.cpp:
1559         (WebCore::RenderBlock::removePositionedObjectsIfNeeded):
1560
1561 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
1562
1563         Addressing post-review comments after r201978.
1564         https://bugs.webkit.org/show_bug.cgi?id=158649
1565         <rdar://problem/13258122>
1566
1567         Unreviewed.
1568
1569         * platform/graphics/FontCache.cpp:
1570         (WebCore::FontCache::alternateFamilyName):
1571         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1572         (WebCore::FontCache::platformAlternateFamilyName):
1573
1574 2016-06-11  Darin Adler  <darin@apple.com>
1575
1576         Tighten code to build set of tag names
1577         https://bugs.webkit.org/show_bug.cgi?id=158662
1578
1579         Reviewed by Alexey Proskuryakov.
1580
1581         * dom/Element.cpp:
1582         (WebCore::canAttachAuthorShadowRoot): Use an array of pointers that the loader
1583         can initialize as part of loading the library, rather than an array that needs
1584         to be initialized with code at runtime.
1585
1586 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
1587
1588         [Win] [EFL] Build fix after r201978.
1589         https://bugs.webkit.org/show_bug.cgi?id=158649
1590         <rdar://problem/13258122>
1591
1592         Unreviewed
1593
1594         * platform/graphics/freetype/FontCacheFreeType.cpp:
1595         (WebCore::FontCache::platformAlternateFamilyName):
1596         * platform/graphics/win/FontCacheWin.cpp:
1597
1598 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
1599
1600         [Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
1601         https://bugs.webkit.org/show_bug.cgi?id=158649
1602         <rdar://problem/13258122>
1603
1604         Reviewed by Darin Adler.
1605
1606         There are many Chinese websites which hardcode Windows font names.
1607         We should map these to fonts which best match them on Cocoa operating
1608         systems. We can do this by using our existing fallback font name
1609         infrastructure.
1610
1611         Tests: fast/text/chinese-font-name-aliases-2.html
1612                fast/text/chinese-font-name-aliases.html
1613
1614         * platform/graphics/FontCache.cpp:
1615         (WebCore::FontCache::alternateFamilyName):
1616         (WebCore::alternateFamilyName): Deleted.
1617         * platform/graphics/FontCache.h:
1618         * platform/graphics/cocoa/FontCacheCoreText.cpp:
1619         (WebCore::FontCache::platformAlternateFamilyName):
1620         * platform/graphics/freetype/FontCacheFreeType.cpp:
1621         (WebCore::FontCache::platformAlternateFamilyName):
1622         * platform/graphics/win/FontCacheWin.cpp:
1623         (WebCore::FontCache::platformAlternateFamilyName):
1624
1625 2016-06-11  Commit Queue  <commit-queue@webkit.org>
1626
1627         Unreviewed, rolling out r201967, r201968, and r201972.
1628         https://bugs.webkit.org/show_bug.cgi?id=158665
1629
1630         Caused flaky failures on IndexedDB tests (Requested by ap on
1631         #webkit).
1632
1633         Reverted changesets:
1634
1635         "Vary:Cookie validation doesn't work in private browsing"
1636         https://bugs.webkit.org/show_bug.cgi?id=158616
1637         http://trac.webkit.org/changeset/201967
1638
1639         "Build fix."
1640         http://trac.webkit.org/changeset/201968
1641
1642         "WinCairo build fix attempt."
1643         http://trac.webkit.org/changeset/201972
1644
1645 2016-06-11  Konstantin Tokarev  <annulen@yandex.ru>
1646
1647         Fixed compilation of LocaleICU with ENABLE(DATE_AND_TIME_INPUT_TYPES)
1648         https://bugs.webkit.org/show_bug.cgi?id=158659
1649
1650         Reviewed by Darin Adler.
1651
1652         No new tests needed.
1653
1654         * platform/text/LocaleICU.cpp:
1655         (WebCore::getFormatForSkeleton):
1656         (WebCore::LocaleICU::monthFormat):
1657         (WebCore::LocaleICU::shortMonthFormat):
1658
1659 2016-06-11  Antti Koivisto  <antti@apple.com>
1660
1661         WinCairo build fix attempt.
1662
1663         * platform/network/NetworkStorageSession.cpp:
1664         * platform/network/NetworkStorageSession.h:
1665         * platform/network/NetworkStorageSessionStub.cpp:
1666         (WebCore::NetworkStorageSession::NetworkStorageSession):
1667         (WebCore::NetworkStorageSession::context):
1668         (WebCore::NetworkStorageSession::createPrivateBrowsingSession):
1669         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1670         (WebCore::NetworkStorageSession::~NetworkStorageSession): Deleted.
1671         (WebCore::defaultSession): Deleted.
1672         (WebCore::NetworkStorageSession::defaultStorageSession): Deleted.
1673
1674 2016-06-11  Myles C. Maxfield  <mmaxfield@apple.com>
1675
1676         Deleting a CSSOM style rule invalidates any previously-added FontFaces
1677         https://bugs.webkit.org/show_bug.cgi?id=158450
1678
1679         Reviewed by Darin Adler.
1680
1681         This patch has two pieces: updating the CSSOM when the FontFace changes, and
1682         updating the FontFace when the CSSOM changes.
1683
1684         1: Updating the CSSOM when the FontFace changes: CSSFontFaces already have a RefPtr
1685         to their StyleRuleFontFace which represents their CSS-connection. When changing a
1686         property of the CSSFontFace, we simply reach into the StyleRule and update it to
1687         match. Our existing infrastructure of invalidation due to the attribute changes
1688         makes sure that all the necessary updates occur.
1689
1690         2. Updating the FontFace when the CSSOM changes: If the CSSOM changes in a trivial
1691         way (for example, a new @font-face is appended to the end of the last <style>
1692         element), we can handle it directly. However, when something more invasive occurs,
1693         we end up clearing the entire CSSFontSelector, and then adding all the style rules
1694         from scratch. This involves three steps:
1695             a) CSSFontSelector::buildStarted() is run, which means "we're about to start
1696                building up all the @font-face rules from scratch." We take this opportunity
1697                to purge as many fonts as possible. This is valuable because, for example,
1698                this function gets run when the page gets put into the page cache, so we
1699                want to destroy as much as possible. Not everything can be purged, however -
1700                only CSS-connected fonts which have never been inspected by script are
1701                purgeable. We don't allow fonts inspected by script to be purged because
1702                purging might result in a font appearing from JavaScript to transition from
1703                a success -> failure state, which we don't allow.
1704             b) Upon style recalc (possibly asynchronously) CSSFontSelector::addFontFaceRule()
1705                is called for each @font-face rule. We actually detect that we're in the
1706                middle of a style rebuild, and defer this step.
1707             c) When we're done adding all the font face rules, we call
1708                CSSFontSelector::buildCompleted(). This is where we compare the newly built-
1709                up list of font faces with what existed previously (as remembered in
1710                CSSFontSelector::buildStarted()) in order to detect font faces which were
1711                deleted from the document. Fonts which were newly added to the document
1712                are handled naturally.
1713                Fonts which have a property modified on them are created as if they were new.
1714                However, instead of simply adding the CSSFontFace, we search for the existing
1715                CSSFontFace (by CSS connection pointer) and tell the existing FontFace to
1716                adopt this new CSSFontFace. This means that the JavaScript object will just
1717                pick up any newly-written values in the CSSOM. It also means that the
1718                "status" attribute of the JavaScript object is reset, but this is expected
1719                and allowed by the spec. (For example, if you change the "src" attribute of
1720                an @font-face block via the CSSOM, all bets are off when you inspect the
1721                FontFace JS object representing that block.)
1722
1723         Test: fast/text/font-face-set-cssom.html
1724
1725         * css/CSSFontFace.cpp:
1726         (WebCore::CSSFontFace::CSSFontFace):
1727         (WebCore::CSSFontFace::setFamilies):
1728         (WebCore::CSSFontFace::setStyle):
1729         (WebCore::CSSFontFace::setWeight):
1730         (WebCore::CSSFontFace::setUnicodeRange):
1731         (WebCore::CSSFontFace::setVariantLigatures):
1732         (WebCore::CSSFontFace::setVariantPosition):
1733         (WebCore::CSSFontFace::setVariantCaps):
1734         (WebCore::CSSFontFace::setVariantNumeric):
1735         (WebCore::CSSFontFace::setVariantAlternates):
1736         (WebCore::CSSFontFace::setVariantEastAsian):
1737         (WebCore::CSSFontFace::setFeatureSettings):
1738         (WebCore::CSSFontFace::initializeWrapper):
1739         (WebCore::CSSFontFace::wrapper):
1740         (WebCore::CSSFontFace::setWrapper):
1741         (WebCore::CSSFontFace::purgeable):
1742         (WebCore::CSSFontFace::updateStyleIfNeeded):
1743         * css/CSSFontFace.h:
1744         * css/CSSFontFaceSet.cpp:
1745         (WebCore::CSSFontFaceSet::remove):
1746         (WebCore::CSSFontFaceSet::containsCSSConnection):
1747         (WebCore::CSSFontFaceSet::purge):
1748         * css/CSSFontFaceSet.h:
1749         * css/CSSFontSelector.cpp:
1750         (WebCore::CSSFontSelector::buildStarted):
1751         (WebCore::CSSFontSelector::buildCompleted):
1752         (WebCore::CSSFontSelector::addFontFaceRule):
1753         * css/CSSFontSelector.h:
1754         * css/FontFace.cpp:
1755         (WebCore::FontFace::family):
1756         (WebCore::FontFace::style):
1757         (WebCore::FontFace::weight):
1758         (WebCore::FontFace::unicodeRange):
1759         (WebCore::FontFace::variant):
1760         (WebCore::FontFace::featureSettings):
1761         (WebCore::FontFace::adopt):
1762         * css/FontFace.h:
1763
1764 2016-06-11  Chris Dumez  <cdumez@apple.com>
1765
1766         WorkerNavigator is missing some attributes
1767         https://bugs.webkit.org/show_bug.cgi?id=158593
1768         <rdar://problem/26731334>
1769
1770         Reviewed by Darin Adler.
1771
1772         Add attributes that are missing on WorkerNavigator:
1773         - appCodeName
1774         - hardwareConcurrency
1775         - language
1776         - product
1777         - productSub
1778         - vendor
1779         - vendorSub
1780
1781         Firefox and Chrome already expose those attributes.
1782
1783         Relevant specification:
1784         https://html.spec.whatwg.org/multipage/workers.html#the-workernavigator-object
1785
1786         This patch also refactors the IDL to match the specification more
1787         closely and promote sharing between Navigator and WorkerNavigator.
1788
1789         No new tests, updated existing test.
1790
1791         * CMakeLists.txt:
1792         * DerivedSources.make:
1793         Add new supplemental IDL files.
1794
1795         * page/Navigator.cpp:
1796         * page/Navigator.h:
1797         Moved language() / hardwareConcurrency() from Navigator to NavigatorBase
1798         so that it can be used by NavigatorWorker as well.
1799
1800         * page/NavigatorBase.h:
1801         * page/NavigatorBase.cpp:
1802         (WebCore::NavigatorBase::language):
1803         The implementation still calls defaultLanguage() but I updated it to be
1804         thread safe on all platforms.
1805
1806         (WebCore::NavigatorBase::hardwareConcurrency):
1807         Use std::call_once() for thread safety.
1808
1809         * page/Navigator.idl:
1810         * page/NavigatorConcurrentHardware.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
1811         * page/NavigatorID.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
1812         * page/NavigatorLanguage.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
1813         * page/NavigatorOnLine.idl: Copied from Source/WebCore/page/WorkerNavigator.idl.
1814         * page/WorkerNavigator.idl:
1815         Move several attributes to their own supplemental interfaces to match
1816         the specification and promote sharing with WorkerNavigator.
1817
1818         * platform/Language.cpp:
1819         (WebCore::userPreferredLanguages):
1820         * platform/Language.h:
1821         Made thread-safe on all platforms.
1822
1823 2016-06-11  Antti Koivisto  <antti@apple.com>
1824
1825         Build fix.
1826
1827         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1828         (WebCore::NetworkStorageSession::switchToNewTestingSession):
1829
1830 2016-06-10  Antti Koivisto  <antti@apple.com>
1831
1832         Vary:Cookie validation doesn't work in private browsing
1833         https://bugs.webkit.org/show_bug.cgi?id=158616
1834         rdar://problem/26755067
1835
1836         Reviewed by Darin Adler.
1837
1838         This wasn't implemented because there was no way to get NetworkStorageSession from
1839         a SessionID on WebCore side.
1840
1841         The patch adds a simple WebCore level weak map that allows getting NetworkStorageSessions
1842         from SessionID. This seemed like the cleanest way to do this without a big refactoring
1843         around the currently WebKit2 level SessionTracker.
1844
1845         * CMakeLists.txt:
1846         * WebCore.xcodeproj/project.pbxproj:
1847         * platform/network/CacheValidation.cpp:
1848         (WebCore::headerValueForVary):
1849
1850             Get NetworkStorageSession from SessionID for cookies
1851
1852         (WebCore::verifyVaryingRequestHeaders):
1853         * platform/network/NetworkStorageSession.cpp: Added.
1854
1855             Add platform independent .cpp for NetworkStorageSession.
1856             Implement a weak map for SessionID -> NetworkStorageSession.
1857
1858         (WebCore::sessionsMap):
1859         (WebCore::NetworkStorageSession::NetworkStorageSession):
1860         (WebCore::NetworkStorageSession::~NetworkStorageSession):
1861         (WebCore::NetworkStorageSession::forSessionID):
1862
1863             Get NetworkStorageSession for sessionID.
1864
1865         * platform/network/NetworkStorageSession.h:
1866         (WebCore::NetworkStorageSession::sessionID):
1867         (WebCore::NetworkStorageSession::credentialStorage):
1868         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
1869         (WebCore::NetworkStorageSession::NetworkStorageSession):
1870
1871             Call to common constructor.
1872
1873         (WebCore::defaultNetworkStorageSession):
1874         * platform/network/soup/NetworkStorageSessionSoup.cpp:
1875         (WebCore::NetworkStorageSession::NetworkStorageSession):
1876
1877             Call to common constructor.
1878
1879         (WebCore::defaultSession):
1880         (WebCore::NetworkStorageSession::~NetworkStorageSession): Deleted.
1881
1882 2016-06-10  Ada Chan  <adachan@apple.com>
1883
1884         Use the video element's video box when getting the inline video rect in WebVideoFullscreenManager
1885         https://bugs.webkit.org/show_bug.cgi?id=158351
1886         <rdar://problem/26567938>
1887
1888         Reviewed by Darin Adler.
1889
1890         * WebCore.xcodeproj/project.pbxproj:
1891         Change the visibility of RenderVideo.h and RenderMedia.h since we'll be importing RenderVideo.h from WebKit2.
1892         * rendering/RenderVideo.h:
1893
1894 2016-06-10  Benjamin Poulain  <bpoulain@apple.com>
1895
1896         Add support for passive event listeners on touch events
1897         https://bugs.webkit.org/show_bug.cgi?id=158601
1898
1899         Reviewed by Simon Fraser.
1900
1901         This patch wires "passive" state of EventTarget to the delivery of touch
1902         events in WebKit2.
1903
1904         Instead of having a NonFastScrollableRegion, we have a pair of regions
1905         in EventTrackingRegions.
1906         The "asynchronousDispatchRegion" tracks the area for which all event
1907         listeners are passive. For those, events should be dispatched asynchronously.
1908         The "synchronousDispatchRegion" tracks the area for which there is at
1909         least one active event listener. Events have to be dispatched synchronously
1910         for correctness.
1911
1912         Tests: fast/events/touch/ios/tap-with-active-listener-on-elements.html
1913                fast/events/touch/ios/tap-with-active-listener-on-window.html
1914                fast/events/touch/ios/tap-with-passive-listener-on-elements.html
1915                fast/events/touch/ios/tap-with-passive-listener-on-window.html
1916
1917         * WebCore.xcodeproj/project.pbxproj:
1918         * dom/Document.cpp:
1919         (WebCore::Document::wheelEventHandlersChanged):
1920         (WebCore::Document::Document): Deleted.
1921         * dom/Document.h:
1922
1923         * dom/EventListenerMap.cpp:
1924         (WebCore::EventListenerMap::containsActive):
1925         If a Target has multiple listener for an event type, we want to know
1926         if any of them is active.
1927
1928         * dom/EventListenerMap.h:
1929         * dom/EventTarget.cpp:
1930         (WebCore::EventTarget::hasActiveEventListeners):
1931         (WebCore::EventTarget::hasActiveTouchEventListeners):
1932         * dom/EventTarget.h:
1933
1934         * page/DebugPageOverlays.cpp:
1935         (WebCore::NonFastScrollableRegionOverlay::updateRegion):
1936         I did not change the debug overlays.
1937         The NonFastScrollable area is the region for which events needs
1938         synchronous dispatch. Everything else should scroll without delay.
1939
1940         * page/FrameView.cpp:
1941         (WebCore::FrameView::scrollableAreaSetChanged):
1942         * page/Page.cpp:
1943         (WebCore::Page::nonFastScrollableRects):
1944         * page/scrolling/AsyncScrollingCoordinator.cpp:
1945         (WebCore::AsyncScrollingCoordinator::setEventTrackingRegionsDirty):
1946         (WebCore::AsyncScrollingCoordinator::willCommitTree):
1947         (WebCore::AsyncScrollingCoordinator::updateEventTrackingRegions):
1948         (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1949         (WebCore::AsyncScrollingCoordinator::frameViewEventTrackingRegionsChanged):
1950         (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText):
1951         (WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty): Deleted.
1952         (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion): Deleted.
1953         (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Deleted.
1954         * page/scrolling/AsyncScrollingCoordinator.h:
1955         (WebCore::AsyncScrollingCoordinator::eventTrackingRegionsDirty):
1956         (WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty): Deleted.
1957
1958         * page/scrolling/ScrollingCoordinator.cpp:
1959         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame):
1960         (WebCore::ScrollingCoordinator::absoluteEventTrackingRegions):
1961         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame): Deleted.
1962         (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegion): Deleted.
1963         I intentionally left the Wheel event with synchronous dispatch.
1964         This use case will need its own set of tests.
1965
1966         * page/scrolling/ScrollingCoordinator.h:
1967         (WebCore::ScrollingCoordinator::frameViewEventTrackingRegionsChanged):
1968         (WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged): Deleted.
1969         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1970         (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
1971         (WebCore::ScrollingStateFrameScrollingNode::setEventTrackingRegions):
1972         (WebCore::ScrollingStateFrameScrollingNode::dumpProperties):
1973         (WebCore::ScrollingStateFrameScrollingNode::setNonFastScrollableRegion): Deleted.
1974         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1975         * page/scrolling/ScrollingTree.cpp:
1976         (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
1977         (WebCore::ScrollingTree::commitNewTreeState):
1978         (WebCore::ScrollingTree::eventTrackingTypeForPoint):
1979         (WebCore::ScrollingTree::isPointInNonFastScrollableRegion): Deleted.
1980         * page/scrolling/ScrollingTree.h:
1981         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1982         (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
1983         * platform/EventTrackingRegions.h: Added.
1984         (WebCore::EventTrackingRegions::isEmpty):
1985         (WebCore::EventTrackingRegions::trackingTypeForPoint):
1986         (WebCore::operator==):
1987
1988 2016-06-10  Enrica Casucci  <enrica@apple.com>
1989
1990         REGRESSION(r198177): Cannot paste an image when the pasteboard format is mime type.
1991         https://bugs.webkit.org/show_bug.cgi?id=158590
1992         rdar://problem/25471371
1993
1994         Reviewed by Darin Adler.
1995
1996         When creating a fragment from an image resource, the resource needs to
1997         be added to the document loader before setting the src attribute to the
1998         image element, otherwise loading is triggered and the loading fails.
1999         In r198177 the order of the operations was changed causing the bug.
2000         This patch adds support to test the scenario where the image in the pasteboard
2001         is available only as mime type (not WebArchive or RTFD), a situation that occurs
2002         more frequently on iOS.
2003
2004         Test: editing/pasteboard/image-in-iframe.html
2005
2006         * editing/ios/EditorIOS.mm:
2007         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
2008         * editing/mac/EditorMac.mm:
2009         (WebCore::Editor::WebContentReader::readWebArchive):
2010         (WebCore::Editor::WebContentReader::readRTFD):
2011         (WebCore::Editor::WebContentReader::readRTF):
2012         (WebCore::Editor::createFragmentForImageResourceAndAddResource):
2013         * page/Settings.cpp:
2014         (WebCore::Settings::setImagesEnabled):
2015         (WebCore::Settings::setPreferMimeTypeForImages):
2016         (WebCore::Settings::setForcePendingWebGLPolicy):
2017         * page/Settings.h:
2018         (WebCore::Settings::areImagesEnabled):
2019         (WebCore::Settings::preferMimeTypeForImages):
2020         (WebCore::Settings::arePluginsEnabled):
2021         * testing/InternalSettings.cpp:
2022         (WebCore::InternalSettings::Backup::restoreTo):
2023         (WebCore::InternalSettings::setLangAttributeAwareFormControlUIEnabled):
2024         (WebCore::InternalSettings::setPreferMimeTypeForImages):
2025         (WebCore::InternalSettings::setImagesEnabled):
2026         * testing/InternalSettings.h:
2027         * testing/InternalSettings.idl:
2028
2029 2016-06-10  Alex Christensen  <achristensen@webkit.org>
2030
2031         Fix WinCairo build after r201943
2032
2033         * platform/network/curl/MultipartHandle.cpp:
2034         (WebCore::MultipartHandle::didReceiveResponse):
2035         * platform/network/curl/ResourceHandleManager.cpp:
2036         (WebCore::handleLocalReceiveResponse):
2037         (WebCore::headerCallback):
2038         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
2039
2040 2016-06-10  Alex Christensen  <achristensen@webkit.org>
2041
2042         handleDataURL is only used by curl
2043         https://bugs.webkit.org/show_bug.cgi?id=158636
2044
2045         Reviewed by Tim Horton.
2046
2047         * CMakeLists.txt:
2048         * platform/network/DataURL.cpp: Removed.
2049         * platform/network/DataURL.h: Removed.
2050         * platform/network/curl/ResourceHandleManager.cpp:
2051         (WebCore::ResourceHandleManager::startScheduledJobs):
2052         (WebCore::handleDataURL):
2053         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
2054
2055 2016-06-10  Alex Christensen  <achristensen@webkit.org>
2056
2057         Reduce ResourceResponse copying
2058         https://bugs.webkit.org/show_bug.cgi?id=158232
2059
2060         Reviewed by Darin Adler.
2061
2062         No new tests.  No change in behavior except removing an unnecessary copy on cocoa platforms.
2063
2064         * loader/ResourceLoader.cpp:
2065         (WebCore::ResourceLoader::didSendData):
2066         (WebCore::ResourceLoader::didReceiveResponse):
2067         * loader/ResourceLoader.h:
2068         * loader/appcache/ApplicationCacheGroup.cpp:
2069         (WebCore::ApplicationCacheGroup::createResourceHandle):
2070         (WebCore::ApplicationCacheGroup::didReceiveResponse):
2071         * loader/appcache/ApplicationCacheGroup.h:
2072         * platform/graphics/PlatformMediaResourceLoader.h:
2073         (WebCore::PlatformMediaResourceClient::~PlatformMediaResourceClient):
2074         (WebCore::PlatformMediaResourceClient::responseReceived):
2075         (WebCore::PlatformMediaResourceClient::redirectReceived):
2076         (WebCore::PlatformMediaResourceClient::shouldCacheResponse):
2077         (WebCore::PlatformMediaResourceClient::dataSent):
2078         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
2079         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2080         (ResourceHandleStreamingClient::willSendRequest):
2081         (ResourceHandleStreamingClient::didReceiveResponse):
2082         * platform/network/BlobResourceHandle.cpp:
2083         (WebCore::BlobResourceHandle::notifyResponseOnSuccess):
2084         (WebCore::BlobResourceHandle::notifyResponseOnError):
2085         (WebCore::BlobResourceHandle::notifyReceiveData):
2086         * platform/network/DataURL.cpp:
2087         (WebCore::handleDataURL):
2088         * platform/network/PingHandle.h:
2089         (WebCore::PingHandle::PingHandle):
2090         * platform/network/ResourceHandleClient.cpp:
2091         (WebCore::ResourceHandleClient::willSendRequestAsync):
2092         (WebCore::ResourceHandleClient::didReceiveResponseAsync):
2093         * platform/network/ResourceHandleClient.h:
2094         (WebCore::ResourceHandleClient::didSendData):
2095         (WebCore::ResourceHandleClient::didReceiveResponse):
2096         (WebCore::ResourceHandleClient::didReceiveData):
2097         * platform/network/ResourceResponseBase.cpp:
2098         (WebCore::ResourceResponseBase::ResourceResponseBase):
2099         (WebCore::ResourceResponseBase::includeCertificateInfo):
2100         (WebCore::ResourceResponseBase::suggestedFilename):
2101         (WebCore::ResourceResponseBase::certificateInfo): Deleted.
2102         * platform/network/ResourceResponseBase.h:
2103         (WebCore::ResourceResponseBase::certificateInfo):
2104         (WebCore::ResourceResponseBase::encode):
2105         (WebCore::ResourceResponseBase::decode):
2106         (WebCore::ResourceResponseBase::containsCertificateInfo): Deleted.
2107         * platform/network/SynchronousLoaderClient.cpp:
2108         (WebCore::SynchronousLoaderClient::canAuthenticateAgainstProtectionSpace):
2109         (WebCore::SynchronousLoaderClient::didReceiveResponse):
2110         (WebCore::SynchronousLoaderClient::didReceiveData):
2111         * platform/network/SynchronousLoaderClient.h:
2112         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
2113         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
2114         * platform/network/cf/SynchronousResourceHandleCFURLConnectionDelegate.cpp:
2115         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveResponse):
2116         (WebCore::SynchronousResourceHandleCFURLConnectionDelegate::didReceiveData):
2117         * platform/network/mac/WebCoreResourceHandleAsDelegate.mm:
2118         (-[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:]):
2119         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
2120         (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
2121         * platform/network/soup/ResourceHandleSoup.cpp:
2122         (WebCore::nextMultipartResponsePartCallback):
2123         (WebCore::sendRequestCallback):
2124
2125 2016-06-09  Ryosuke Niwa  <rniwa@webkit.org>
2126
2127         Add SPI to disable spellchecking on auto-fillable text fields
2128         https://bugs.webkit.org/show_bug.cgi?id=158611
2129
2130         Reviewed by Anders Carlsson.
2131
2132         Added a boolean flag m_isSpellCheckingEnabled to HTMLInputElement. This flag defaults to true, and can be set
2133         to false by WebKit2 C API.
2134
2135         * editing/Editor.cpp:
2136         (WebCore::Editor::isSpellCheckingEnabledFor): Fixed a bug that we were calling isSpellCheckingEnabled on
2137         the div inside an input element's shadow tree instead of the input element itself.
2138         * html/HTMLInputElement.cpp:
2139         (WebCore::HTMLInputElement::HTMLInputElement): Initialize m_spellcheckEnabled to true (it's a bit field).
2140         (WebCore::HTMLInputElement::isSpellCheckingEnabled): Added. Return false if m_spellcheckEnabled is false.
2141         * html/HTMLInputElement.h:
2142         (WebCore::HTMLInputElement::setSpellcheckEnabled): Added.
2143
2144 2016-06-10  Alex Christensen  <achristensen@webkit.org>
2145
2146         Introduce WTF::UniqueRef
2147         https://bugs.webkit.org/show_bug.cgi?id=158596
2148
2149         Reviewed by Brady Eidson.
2150
2151         No new tests.  No change in behavior.
2152
2153         * inspector/InspectorOverlay.cpp:
2154         (WebCore::InspectorOverlay::overlayPage):
2155         * loader/EmptyClients.cpp:
2156         (WebCore::fillWithEmptyClients):
2157         * page/Page.cpp:
2158         (WebCore::Page::Page):
2159         * page/Page.h:
2160         (WebCore::Page::canStartMedia):
2161         (WebCore::Page::editorClient):
2162         (WebCore::Page::plugInClient):
2163         (WebCore::Page::mainFrame):
2164         (WebCore::Page::groupPtr): Deleted.
2165         * page/PageConfiguration.cpp:
2166         (WebCore::PageConfiguration::PageConfiguration):
2167         * page/PageConfiguration.h:
2168         * svg/graphics/SVGImage.cpp:
2169         (WebCore::SVGImage::dataChanged):
2170
2171 2016-06-10  Joseph Pecoraro  <pecoraro@apple.com>
2172
2173         Web Inspector: Cleanup InspectorIndexedDBAgent a bit
2174         https://bugs.webkit.org/show_bug.cgi?id=158598
2175
2176         Reviewed by Darin Adler.
2177
2178         * inspector/InspectorIndexedDBAgent.cpp:
2179
2180 2016-06-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2181
2182         Origin header is not included in CORS requests for preloaded cross-origin resources
2183         https://bugs.webkit.org/show_bug.cgi?id=155761
2184         <rdar://problem/25351850>
2185
2186         Reviewed by Alex Christensen.
2187
2188         Making HTML preloader fully aware of crossorigin attribute value.
2189         Introducing CachedResourceRequest::setAsPotentiallyCrossOrigin as a helper routine to activate CORS mode.
2190         Making HTMLLinkElement and HTMLResourcePreloader use that routine.
2191         Making TokenPreloadScanner store the crossorigin attribute value in preload requests.
2192         Making TokenPreloadScanner store the crossorigin attribute value for link elements.
2193
2194         Test: http/tests/security/cross-origin-css-9.html
2195
2196         * html/HTMLLinkElement.cpp:
2197         (WebCore::HTMLLinkElement::process):
2198         * html/parser/HTMLPreloadScanner.cpp:
2199         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
2200         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2201         * html/parser/HTMLResourcePreloader.cpp:
2202         (WebCore::crossOriginModeAllowsCookies):
2203         (WebCore::PreloadRequest::resourceRequest):
2204         * html/parser/HTMLResourcePreloader.h:
2205         (WebCore::PreloadRequest::setCrossOriginMode):
2206         (WebCore::PreloadRequest::PreloadRequest): Deleted.
2207         (WebCore::PreloadRequest::resourceType): Deleted.
2208         * loader/cache/CachedResourceRequest.cpp:
2209         (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin):
2210         * loader/cache/CachedResourceRequest.h:
2211
2212 2016-06-10  Chris Dumez  <cdumez@apple.com>
2213
2214         ErrorEvent / ProgressEvent should be exposed to workers
2215         https://bugs.webkit.org/show_bug.cgi?id=158606
2216
2217         Reviewed by Brady Eidson.
2218
2219         ErrorEvent / ProgressEvent should be exposed to workers:
2220         - https://html.spec.whatwg.org/multipage/webappapis.html#errorevent
2221         - https://xhr.spec.whatwg.org/#interface-progressevent
2222
2223         Firefox and Chrome both already expose those.
2224
2225         No new tests, rebaselined existing test.
2226
2227         * dom/ErrorEvent.idl:
2228         * dom/ProgressEvent.idl:
2229
2230 2016-06-10  Chris Dumez  <cdumez@apple.com>
2231
2232         MessagePort should be exposed to workers
2233         https://bugs.webkit.org/show_bug.cgi?id=158607
2234
2235         Reviewed by Brady Eidson.
2236
2237         MessagePort should be exposed to workers:
2238         https://html.spec.whatwg.org/multipage/comms.html#messageport
2239
2240         Firefox and Chrome both already expose it.
2241
2242         No new tests, rebaselined existing test.
2243
2244         * dom/MessagePort.idl:
2245
2246 2016-06-10  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2247
2248         Move preflight check code outside of DocumentThreadableLoader
2249         https://bugs.webkit.org/show_bug.cgi?id=158425
2250
2251         Reviewed by Darin Adler.
2252
2253         Moving preflight check code in its own class.
2254         This allows code to be easier to read, use/reuse and update.
2255
2256         Behavior should be the same as before except in the case of a preflight response
2257         being a 3XX redirect response.
2258         Before this patch, the 3XX response was directly passed to the code processing regular responses.
2259         To keep compatibility with existing tests, a didFailRedirectCheck callback is called.
2260         This should be change to a preflight failure.
2261
2262         Covered by existing tests.
2263
2264         * CMakeLists.txt:
2265         * WebCore.xcodeproj/project.pbxproj:
2266         * loader/CrossOriginPreflightChecker.cpp: Added.
2267         (WebCore::CrossOriginPreflightChecker::CrossOriginPreflightChecker):
2268         (WebCore::CrossOriginPreflightChecker::~CrossOriginPreflightChecker):
2269         (WebCore::CrossOriginPreflightChecker::handleLoadingFailure):
2270         (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
2271         (WebCore::CrossOriginPreflightChecker::notifyFinished):
2272         (WebCore::CrossOriginPreflightChecker::startPreflight):
2273         (WebCore::CrossOriginPreflightChecker::doPreflight):
2274         (WebCore::CrossOriginPreflightChecker::redirectReceived):
2275         (WebCore::CrossOriginPreflightChecker::setDefersLoading):
2276         (WebCore::CrossOriginPreflightChecker::isXMLHttpRequest):
2277         * loader/CrossOriginPreflightChecker.h: Added.
2278         * loader/DocumentThreadableLoader.cpp:
2279         (WebCore::DocumentThreadableLoader::create):
2280         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
2281         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequestWithPreflight):
2282         (WebCore::DocumentThreadableLoader::setDefersLoading):
2283         (WebCore::DocumentThreadableLoader::clearResource):
2284         (WebCore::DocumentThreadableLoader::didReceiveResponse):
2285         (WebCore::DocumentThreadableLoader::didReceiveData):
2286         (WebCore::DocumentThreadableLoader::notifyFinished):
2287         (WebCore::DocumentThreadableLoader::didFinishLoading):
2288         (WebCore::DocumentThreadableLoader::didFail):
2289         (WebCore::DocumentThreadableLoader::preflightSuccess):
2290         (WebCore::DocumentThreadableLoader::preflightFailure):
2291         (WebCore::DocumentThreadableLoader::loadRequest):
2292         (WebCore::DocumentThreadableLoader::responseReceived): Deleted.
2293         (WebCore::DocumentThreadableLoader::dataReceived): Deleted.
2294         (WebCore::DocumentThreadableLoader::isAllowedByContentSecurityPolicy): Deleted.
2295         * loader/DocumentThreadableLoader.h:
2296         (WebCore::DocumentThreadableLoader::options):
2297         (WebCore::DocumentThreadableLoader::isLoading):
2298         (WebCore::DocumentThreadableLoader::document):
2299
2300 2016-06-10  Adam Bergkvist  <adam.bergkvist@ericsson.com>
2301
2302         WebRTC: Imlement MediaEndpointPeerConnection::createAnswer()
2303         https://bugs.webkit.org/show_bug.cgi?id=158566
2304
2305         Reviewed by Eric Carlson.
2306
2307         Add the MediaEndpointPeerConnection implementation of RTCPeerConnection.createAnswer [1].
2308         createAnswer() creates a 'reply' to an remote offer set with setRemoteDescription(),
2309         completes the offer/answer dialog and brings the RTCPeerConnection back to the 'stable'
2310         signaling state.
2311
2312         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcpeerconnection-createanswer
2313
2314         Test: fast/mediastream/RTCPeerConnection-inspect-answer.html
2315
2316         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
2317         (WebCore::MediaEndpointPeerConnection::createOfferTask):
2318         Align creation of RTCSessionDescription with createAnswerTask.
2319         (WebCore::MediaEndpointPeerConnection::createAnswer):
2320         (WebCore::MediaEndpointPeerConnection::createAnswerTask):
2321         Add Implementation.
2322         * Modules/mediastream/MediaEndpointPeerConnection.h:
2323
2324 2016-06-08  Sergio Villar Senin  <svillar@igalia.com>
2325
2326         [css-grid] CRASH when getting the computed style of a grid with only absolutely positioned children
2327         https://bugs.webkit.org/show_bug.cgi?id=158537
2328
2329         Reviewed by Darin Adler.
2330
2331         Absolute positioning occurs after layout of the grid and its in-flow contents, and does not
2332         contribute to the sizing of any grid tracks or affect the size/configuration of the grid in
2333         any way. This means that we should treat as empty any grid whose only children are
2334         absolutely positioned items.
2335
2336         Since r201510 empty grids are no longer internally represented by a 1x1 matrix. As we were
2337         not considering grids-with-only-absolutely-positioned-children as empty, we were trying to
2338         access some invalid position in the internal representation of the grid triggering an ASSERT
2339         in debug builds and a crash in release.
2340
2341         Test: fast/css-grid-layout/grid-only-abspos-item-computed-style-crash.html
2342
2343         * css/CSSComputedStyleDeclaration.cpp:
2344         (WebCore::valueForGridTrackList):
2345
2346 2016-06-10  Chris Dumez  <cdumez@apple.com>
2347
2348         DOMException should be exposed to workers
2349         https://bugs.webkit.org/show_bug.cgi?id=158608
2350
2351         Reviewed by Alex Christensen.
2352
2353         DOMException should be exposed to workers:
2354         https://heycam.github.io/webidl/#es-DOMException-call
2355
2356         Both Firefox and Chrome expose DOMException to workers already.
2357
2358         No new tests, rebaselined existing test.
2359
2360         * dom/DOMCoreException.idl:
2361
2362 2016-06-09  Alex Christensen  <achristensen@webkit.org>
2363
2364         Fix CMake build.
2365
2366         * PlatformMac.cmake:
2367
2368 2016-06-09  Alex Christensen  <achristensen@webkit.org>
2369
2370         Fix AppleWin build after r201901.
2371         https://bugs.webkit.org/show_bug.cgi?id=119839
2372
2373         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2374         (PlatformCALayerWin::backingStoreAttached):
2375         (PlatformCALayerWin::userInteractionEnabled):
2376         (PlatformCALayerWin::setUserInteractionEnabled):
2377         (PlatformCALayerWin::geometryFlipped):
2378         * platform/graphics/ca/win/PlatformCALayerWin.h:
2379
2380 2016-06-09  Chris Fleizach  <cfleizach@apple.com>
2381
2382         AX: VoiceOver Unable to View Download Progress or Completion Status for Mail Attachments
2383         https://bugs.webkit.org/show_bug.cgi?id=158581
2384
2385         Reviewed by Darin Adler.
2386
2387         Update attachment element accessibility so that:
2388            1) the action name comes first to match UI
2389            2) on iOS, it has the updates frequently trait
2390
2391         Make sure this test now runs on iOS as well.
2392
2393         Modified tests: accessibility/attachment-element.html
2394
2395         * accessibility/AccessibilityAttachment.cpp:
2396         (WebCore::AccessibilityAttachment::accessibilityText):
2397         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2398         (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]):
2399         (-[WebAccessibilityObjectWrapper accessibilityTraits]):
2400         (-[WebAccessibilityObjectWrapper accessibilityValue]):
2401         (-[WebAccessibilityObjectWrapper accessibilityIsAttachmentElement]):
2402         (-[WebAccessibilityObjectWrapper accessibilityIsComboBox]):
2403
2404 2016-06-09  Alex Christensen  <achristensen@webkit.org>
2405
2406         Clean up WebCore.vcxproj after switching to CMake.
2407
2408         * WebCore.vcxproj/QTMovieWin: Removed.
2409         * WebCore.vcxproj/QTMovieWin/QTMovieWinCairoDebug.props: Removed.
2410         * WebCore.vcxproj/QTMovieWin/QTMovieWinCairoRelease.props: Removed.
2411         * WebCore.vcxproj/QTMovieWin/QTMovieWinCommon.props: Removed.
2412         * WebCore.vcxproj/QTMovieWin/QTMovieWinDebug.props: Removed.
2413         * WebCore.vcxproj/QTMovieWin/QTMovieWinPostBuild.cmd: Removed.
2414         * WebCore.vcxproj/QTMovieWin/QTMovieWinPreBuild.cmd: Removed.
2415         * WebCore.vcxproj/QTMovieWin/QTMovieWinPreLink.cmd: Removed.
2416         * WebCore.vcxproj/QTMovieWin/QTMovieWinProduction.props: Removed.
2417         * WebCore.vcxproj/QTMovieWin/QTMovieWinRelease.props: Removed.
2418         * WebCore.vcxproj/xcopy.excludes: Removed.
2419
2420 2016-06-09  Zalan Bujtas  <zalan@apple.com>
2421
2422         Hairline borders do not show up on 3x displays.
2423         https://bugs.webkit.org/show_bug.cgi?id=158604
2424         <rdar://problem/26511679>
2425
2426         Reviewed by Simon Fraser.
2427
2428         On a 3x display, when we convert a 1/3px hairline border from float
2429         to LayoutUnit and pixel floor the result, we end up with a 0px width border.
2430         It's because float to LayoutUnit is lossy and since the current kFixedPointDenominator % 3 != 0,
2431         flooring LayoutUnit(1/3px) ends up being 0px. (float: 1/3 -> LayoutUnit: (1/3 - 1/kFixedPointDenominator) -> floor: 0)
2432         This patch eliminates the (unnecessary) float -> LayoutUnit - float conversion on border width.   
2433
2434         Test: fast/borders/hidpi-3x-input-hairline-border.html
2435
2436         * rendering/BorderEdge.cpp:
2437         (WebCore::BorderEdge::BorderEdge):
2438         * rendering/BorderEdge.h:
2439
2440 2016-06-09  Commit Queue  <commit-queue@webkit.org>
2441
2442         Unreviewed, rolling out r201887.
2443         https://bugs.webkit.org/show_bug.cgi?id=158610
2444
2445         This change caused LayoutTest crashes under GuardMalloc and
2446         ASan (Requested by ryanhaddad on #webkit).
2447
2448         Reverted changeset:
2449
2450         "Deleting a CSSOM style rule invalidates any previously-added
2451         FontFaces"
2452         https://bugs.webkit.org/show_bug.cgi?id=158450
2453         http://trac.webkit.org/changeset/201887
2454
2455 2016-06-09  Chris Dumez  <cdumez@apple.com>
2456
2457         Address Darin's review comment on r201898.
2458         https://bugs.webkit.org/show_bug.cgi?id=158576
2459
2460         Reviewed by Darin Adler.
2461
2462         * page/Base64Utilities.h:
2463
2464 2016-06-09  Antoine Quint  <graouts@apple.com>
2465
2466         [iOS] -webkit-overflow-scrolling: touch; ignores pointer-events: none;
2467         https://bugs.webkit.org/show_bug.cgi?id=119839
2468         <rdar://problem/9671514>
2469
2470         Reviewed by Simon Fraser.
2471
2472         Propagate a "userInteractionEnabled" flag from the Web process which is used to turn off
2473         user interaction on a UIScrollView created for -webkit-overflow-scrolling: touch.
2474
2475         Test: fast/scrolling/ios/touch-scroll-pointer-events-none.html
2476
2477         * platform/graphics/GraphicsLayer.cpp:
2478         (WebCore::GraphicsLayer::GraphicsLayer):
2479         * platform/graphics/GraphicsLayer.h:
2480         (WebCore::GraphicsLayer::userInteractionEnabled):
2481         (WebCore::GraphicsLayer::setUserInteractionEnabled):
2482         * platform/graphics/ca/GraphicsLayerCA.cpp:
2483         (WebCore::GraphicsLayerCA::setUserInteractionEnabled):
2484         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
2485         (WebCore::GraphicsLayerCA::updateUserInteractionEnabled):
2486         * platform/graphics/ca/GraphicsLayerCA.h:
2487         * platform/graphics/ca/PlatformCALayer.h:
2488         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
2489         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
2490         (PlatformCALayerCocoa::userInteractionEnabled):
2491         (PlatformCALayerCocoa::setUserInteractionEnabled):
2492         * rendering/RenderLayerBacking.cpp:
2493         (WebCore::RenderLayerBacking::updateAfterDescendants):
2494
2495 2016-06-09  Chris Dumez  <cdumez@apple.com>
2496
2497         WorkerNavigator property should exist on WorkerGlobalScope
2498         https://bugs.webkit.org/show_bug.cgi?id=158574
2499         <rdar://problem/26725108>
2500
2501         Reviewed by Darin Adler.
2502
2503         WorkerNavigator property should exist on WorkerGlobalScope:
2504         https://html.spec.whatwg.org/multipage/workers.html#the-workernavigator-object
2505
2506         Fixing this gets the number of failures on http://w3c-test.org/workers/interfaces.worker
2507         from 34 to 23.
2508
2509         No new tests, rebaselined existing test.
2510
2511         * page/WorkerNavigator.idl:
2512
2513 2016-06-09  Chris Dumez  <cdumez@apple.com>
2514
2515         atob() / btoa() API should be exposed to workers
2516         https://bugs.webkit.org/show_bug.cgi?id=158576
2517         <rdar://problem/26729340>
2518
2519         Reviewed by Sam Weinig.
2520
2521         Expose atob() / btoa() API to workers as per:
2522         https://html.spec.whatwg.org/multipage/webappapis.html#windoworworkerglobalscope
2523
2524         This aligns our behavior with Firefox and Chrome as well.
2525
2526         Test: fast/workers/atob-btoa.html
2527
2528         * CMakeLists.txt:
2529         * DerivedSources.cpp:
2530         * DerivedSources.make:
2531         * PlatformMac.cmake:
2532         * WebCore.xcodeproj/project.pbxproj:
2533         * page/Base64Utilities.cpp: Added.
2534         (WebCore::Base64Utilities::btoa):
2535         (WebCore::Base64Utilities::atob):
2536         * page/Base64Utilities.h: Added.
2537         * page/DOMWindow.cpp:
2538         (WebCore::DOMWindow::find): Deleted.
2539         (WebCore::DOMWindow::offscreenBuffering): Deleted.
2540         (WebCore::DOMWindow::outerHeight): Deleted.
2541         (WebCore::DOMWindow::outerWidth): Deleted.
2542         * page/DOMWindow.h:
2543         * page/DOMWindow.idl:
2544         * page/WindowBase64.idl: Removed.
2545         * page/WindowOrWorkerGlobalScope.idl: Renamed from Source/WebCore/page/WindowTimers.idl.
2546         * workers/WorkerGlobalScope.h:
2547         * workers/WorkerGlobalScope.idl:
2548
2549 2016-06-09  John Wilander  <wilander@apple.com>
2550
2551         Restrict HTTP/0.9 responses to default ports and cancel HTTP/0.9 resource loads if the document was loaded with another HTTP protocol
2552         https://bugs.webkit.org/show_bug.cgi?id=158589
2553         <rdar://problem/25757454>
2554
2555         Reviewed by Brent Fulgham.
2556
2557         No new tests. Our layout test environment does not allow for headerless responses
2558         nor does it allow you to set an explicit HTTP/0.9 status header in PHP. I have
2559         manually tested this change with a Python socket setup doing both headerless and
2560         HTTP/0.9 header tests for positive and negative cases.
2561
2562         * loader/DocumentLoader.cpp:
2563         (WebCore::DocumentLoader::responseReceived):
2564             Cancel loads if the request was made to a non-default port.
2565         * loader/ResourceLoader.cpp:
2566         (WebCore::ResourceLoader::didReceiveResponse):
2567             Cancel loads if the request was made to a non-default port or if the document
2568             was loaded with another protocol. Cancelation is handled as a fail so as to
2569             fire the onerror event and allow sites to handle it gracefully.
2570
2571 2016-06-09  Alex Christensen  <achristensen@webkit.org>
2572
2573         Clean up EditorClient lifetime
2574         https://bugs.webkit.org/show_bug.cgi?id=158588
2575
2576         Reviewed by Anders Carlsson.
2577
2578         No new tests.  This patch does two things, all of which do not change behavior:
2579         1. Use a std::unique_ptr<EditorClient> owned by the Page instead of allocating
2580         with new in WebKit/WebKit2 and deleting in WebEditorClient::pageDestroyed.
2581         2. Give the Page a PageConfiguration&& instead of a PageConfiguration& in its constructor.
2582
2583         * inspector/InspectorOverlay.cpp:
2584         (WebCore::InspectorOverlay::overlayPage):
2585         * loader/EmptyClients.cpp:
2586         (WebCore::fillWithEmptyClients):
2587         * loader/EmptyClients.h:
2588         (WebCore::EmptyEditorClient::EmptyEditorClient):
2589         (WebCore::EmptyEditorClient::~EmptyEditorClient):
2590         * page/EditorClient.h:
2591         (WebCore::EditorClient::~EditorClient):
2592         * page/Page.cpp:
2593         (WebCore::Page::Page):
2594         (WebCore::Page::~Page):
2595         (WebCore::Page::setViewMode):
2596         (WebCore::Page::clearUndoRedoOperations):
2597         (WebCore::Page::inLowQualityImageInterpolationMode):
2598         (WebCore::Page::invalidateStylesForAllLinks):
2599         (WebCore::Page::invalidateStylesForLink):
2600         (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
2601         (WebCore::Page::setDebugger):
2602         (WebCore::Page::setIsVisibleInternal):
2603         (WebCore::Page::setAllowsMediaDocumentInlinePlayback):
2604         * page/Page.h:
2605         (WebCore::Page::canStartMedia):
2606         (WebCore::Page::editorClient):
2607         (WebCore::Page::plugInClient):
2608         (WebCore::Page::mainFrame):
2609         (WebCore::Page::group):
2610         * page/PageConfiguration.cpp:
2611         * page/PageConfiguration.h:
2612         * page/mac/PageMac.mm:
2613         (WebCore::Page::addSchedulePair):
2614         (WebCore::Page::removeSchedulePair):
2615         * svg/graphics/SVGImage.cpp:
2616         (WebCore::SVGImage::dataChanged):
2617
2618 2016-06-09  Joseph Pecoraro  <pecoraro@apple.com>
2619
2620         REGRESSION: Web Inspector: IndexedDB does not show ObjectStore data
2621         https://bugs.webkit.org/show_bug.cgi?id=158592
2622         <rdar://problem/26730696>
2623
2624         Reviewed by Timothy Hatcher.
2625
2626         * inspector/InspectorIndexedDBAgent.cpp:
2627         (WebCore::DataLoader::execute):
2628         Ensure the IDBTransaction is active when attempting to open a cursor.
2629
2630         (WebCore::OpenCursorCallback::handleEvent):
2631         End, when the cursor result is empty, like we do for script results.
2632
2633 2016-06-09  Antoine Quint  <graouts@apple.com>
2634
2635         Changing canvas height immediately after page load does not relayout canvas
2636         https://bugs.webkit.org/show_bug.cgi?id=156097
2637
2638         Reviewed by Zalan Bujtas.
2639
2640         Promote the logic use to identify whether we should perform a layout after a change of
2641         intrinsic size from RenderImage to RenderReplaced such that RenderCanvas may use it
2642         in canvasSizeChanged() and correctly update its layout in the case where the width
2643         or height attribute is updated and there are no explicit sizing performed with CSS.
2644         Additionally, this will also account for the object-fix property to only perform
2645         a layout if necessary.
2646
2647         Test: fast/canvas/canvas-css-size-after-height-change-with-display-flex.html
2648
2649         * rendering/RenderHTMLCanvas.cpp:
2650         (WebCore::RenderHTMLCanvas::canvasSizeChanged):
2651         * rendering/RenderImage.cpp:
2652         (WebCore::RenderImage::repaintOrMarkForLayout):
2653         * rendering/RenderReplaced.cpp:
2654         (WebCore::RenderReplaced::setNeedsLayoutIfNeededAfterIntrinsicSizeChange):
2655         * rendering/RenderReplaced.h:
2656
2657 2016-06-09  Myles C. Maxfield  <mmaxfield@apple.com>
2658
2659         Deleting a CSSOM style rule invalidates any previously-added FontFaces
2660         https://bugs.webkit.org/show_bug.cgi?id=158450
2661
2662         Reviewed by Darin Adler.
2663
2664         This patch has two pieces: updating the CSSOM when the FontFace changes, and
2665         updating the FontFace when the CSSOM changes.
2666
2667         1: Updating the CSSOM when the FontFace changes: CSSFontFaces already have a RefPtr
2668         to their StyleRuleFontFace which represents their CSS-connection. When changing a
2669         property of the CSSFontFace, we simply reach into the StyleRule and update it to
2670         match. Our existing infrastructure of invalidation due to the attribute changes
2671         makes sure that all the necessary updates occur.
2672
2673         2. Updating the FontFace when the CSSOM changes: If the CSSOM changes in a trivial
2674         way (for example, a new @font-face is appended to the end of the last <style>
2675         element), we can handle it directly. However, when something more invasive occurs,
2676         we end up clearing the entire CSSFontSelector, and then adding all the style rules
2677         from scratch. This involves three steps:
2678             a) CSSFontSelector::buildStarted() is run, which means "we're about to start
2679                building up all the @font-face rules from scratch." We take this opportunity
2680                to purge as many fonts as possible. This is valuable because, for example,
2681                this function gets run when the page gets put into the page cache, so we
2682                want to destroy as much as possible. Not everything can be purged, however -
2683                only CSS-connected fonts which have never been inspected by script are
2684                purgeable. We don't allow fonts inspected by script to be purged because
2685                purging might result in a font appearing from JavaScript to transition from
2686                a success -> failure state, which we don't allow.
2687             b) Upon style recalc (possibly asynchronously) CSSFontSelector::addFontFaceRule()
2688                is called for each @font-face rule. We actually detect that we're in the
2689                middle of a style rebuild, and defer this step.
2690             c) When we're done adding all the font face rules, we call
2691                CSSFontSelector::buildCompleted(). This is where we compare the newly built-
2692                up list of font faces with what existed previously (as remembered in
2693                CSSFontSelector::buildStarted()) in order to detect font faces which were
2694                deleted from the document. Fonts which were newly added to the document
2695                are handled naturally.
2696                Fonts which have a property modified on them are created as if they were new.
2697                However, instead of simply adding the CSSFontFace, we search for the existing
2698                CSSFontFace (by CSS connection pointer) and tell the existing FontFace to
2699                adopt this new CSSFontFace. This means that the JavaScript object will just
2700                pick up any newly-written values in the CSSOM. It also means that the
2701                "status" attribute of the JavaScript object is reset, but this is expected
2702                and allowed by the spec. (For example, if you change the "src" attribute of
2703                an @font-face block via the CSSOM, all bets are off when you inspect the
2704                FontFace JS object representing that block.)
2705
2706         Test: fast/text/font-face-set-cssom.html
2707
2708         * css/CSSFontFace.cpp:
2709         (WebCore::CSSFontFace::CSSFontFace):
2710         (WebCore::CSSFontFace::setFamilies):
2711         (WebCore::CSSFontFace::setStyle):
2712         (WebCore::CSSFontFace::setWeight):
2713         (WebCore::CSSFontFace::setUnicodeRange):
2714         (WebCore::CSSFontFace::setVariantLigatures):
2715         (WebCore::CSSFontFace::setVariantPosition):
2716         (WebCore::CSSFontFace::setVariantCaps):
2717         (WebCore::CSSFontFace::setVariantNumeric):
2718         (WebCore::CSSFontFace::setVariantAlternates):
2719         (WebCore::CSSFontFace::setVariantEastAsian):
2720         (WebCore::CSSFontFace::setFeatureSettings):
2721         (WebCore::CSSFontFace::initializeWrapper):
2722         (WebCore::CSSFontFace::wrapper):
2723         (WebCore::CSSFontFace::setWrapper):
2724         (WebCore::CSSFontFace::purgeable):
2725         (WebCore::CSSFontFace::updateStyleIfNeeded):
2726         * css/CSSFontFace.h:
2727         * css/CSSFontFaceSet.cpp:
2728         (WebCore::CSSFontFaceSet::remove):
2729         (WebCore::CSSFontFaceSet::containsCSSConnection):
2730         (WebCore::CSSFontFaceSet::purge):
2731         * css/CSSFontFaceSet.h:
2732         * css/CSSFontSelector.cpp:
2733         (WebCore::CSSFontSelector::buildStarted):
2734         (WebCore::CSSFontSelector::buildCompleted):
2735         (WebCore::CSSFontSelector::addFontFaceRule):
2736         * css/CSSFontSelector.h:
2737         * css/FontFace.cpp:
2738         (WebCore::FontFace::family):
2739         (WebCore::FontFace::style):
2740         (WebCore::FontFace::weight):
2741         (WebCore::FontFace::unicodeRange):
2742         (WebCore::FontFace::variant):
2743         (WebCore::FontFace::featureSettings):
2744         (WebCore::FontFace::adopt):
2745         * css/FontFace.h:
2746
2747 2016-06-09  Andy Estes  <aestes@apple.com>
2748
2749         Define printing{Minimum,Maximum}ShrinkFactor in only one place
2750         https://bugs.webkit.org/show_bug.cgi?id=158580
2751
2752         Reviewed by Tim Horton.
2753
2754         * page/PrintContext.cpp: Removed printingMinimumShrinkFactor and printingMaximumShrinkFactor.
2755         (WebCore::PrintContext::begin): Used minimumShrinkFactor() and maximumShrinkFactor() instead
2756         of printingMinimumShrinkFactor and printingMaximumShrinkFactor.
2757         (WebCore::PrintContext::computeAutomaticScaleFactor): Ditto.
2758         * page/PrintContext.h:
2759         (WebCore::PrintContext::minimumShrinkFactor): Added to return the same value as
2760         printingMinimumShrinkFactor.
2761         (WebCore::PrintContext::maximumShrinkFactor): Added to return the same value as
2762         printingMaximumShrinkFactor.
2763
2764 2016-06-09  Eric Carlson  <eric.carlson@apple.com>
2765
2766         Don't show the caption menu if a video has only forced tracks
2767         https://bugs.webkit.org/show_bug.cgi?id=158573
2768         <rdar://problem/24632384>
2769
2770         Reviewed by Jer Noble.
2771
2772         Test: media/controls/forced-tracks-only.html
2773
2774         * Modules/mediacontrols/mediaControlsApple.js:
2775         (Controller.prototype.updateCaptionButton): Don't show the button of there are no user-selectable
2776           text or audio tracks.
2777
2778         * page/CaptionUserPreferencesMediaAF.cpp:
2779         (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Return an empty Vector if
2780           there are no user-selectable tracks.
2781
2782 2016-06-09  Jer Noble  <jer.noble@apple.com>
2783
2784         Pass through play state and toggle state to the WebPlaybackControlsManager
2785         https://bugs.webkit.org/show_bug.cgi?id=158578
2786         <rdar://problem/25045616>
2787
2788         Reviewed by Beth Dakin.
2789
2790         Pass through the isPlaying portion of setRate() and allow toggling when a model is present.
2791
2792         * platform/mac/WebPlaybackControlsManager.h:
2793         * platform/mac/WebPlaybackControlsManager.mm:
2794         * platform/mac/WebPlaybackSessionInterfaceMac.mm:
2795         (WebCore::WebPlaybackSessionInterfaceMac::setRate):
2796         (WebCore::WebPlaybackSessionInterfaceMac::setPlayBackControlsManager):
2797
2798 2016-06-09  Frederic Wang  <fred.wang@free.fr>
2799
2800         RenderMathOperator: Move calculation of preferred width into MathOperator
2801         https://bugs.webkit.org/show_bug.cgi?id=157071
2802
2803         Reviewed by Brent Fulgham.
2804
2805         No new tests, behavior is not change.
2806
2807         * rendering/mathml/MathOperator.cpp:
2808         (WebCore::MathOperator::setOperator): Introduce a style parameter and call reset.
2809         (WebCore::MathOperator::reset): New helper function to reset the operator.
2810         For now we only set the width of the base glyph and the preferred max width.
2811         (WebCore::MathOperator::calculateDisplayStyleLargeOperator): Calculate the m_maxPreferredWidth.
2812         (WebCore::MathOperator::calculateStretchyData): Change the signature of the function and directly set m_maxPreferredWidth.
2813         * rendering/mathml/MathOperator.h: Add m_maxPreferredWidth member and update some declarations.
2814         (WebCore::MathOperator::width): New helper function.
2815         (WebCore::MathOperator::maxPreferredWidth): New helper function.
2816         * rendering/mathml/RenderMathMLOperator.cpp:
2817         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): This function performs wrong
2818         operations that will be fixed in bug 152244 when we update the tests.
2819         For now, let's just use maxPreferredWidth() for non-horizontal operators.
2820         (WebCore::RenderMathMLOperator::updateStyle): Use the new signature of the functions.
2821
2822 2016-06-09  Alex Christensen  <achristensen@webkit.org>
2823
2824         Clean up WebSocket code
2825         https://bugs.webkit.org/show_bug.cgi?id=158551
2826
2827         Reviewed by Darin Adler.
2828
2829         No new tests.  There is no change in behavior.
2830         There seems to be no reason why SocketStreamHandle should be an AuthenticationClient.
2831
2832         * Modules/websockets/ThreadableWebSocketChannel.h:
2833         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
2834         (WebCore::ThreadableWebSocketChannelClientWrapper::setSendRequestResult):
2835         (WebCore::ThreadableWebSocketChannelClientWrapper::bufferedAmount):
2836         (WebCore::ThreadableWebSocketChannelClientWrapper::setBufferedAmount):
2837         (WebCore::ThreadableWebSocketChannelClientWrapper::didReceiveBinaryData):
2838         (WebCore::ThreadableWebSocketChannelClientWrapper::didUpdateBufferedAmount):
2839         (WebCore::ThreadableWebSocketChannelClientWrapper::didStartClosingHandshake):
2840         (WebCore::ThreadableWebSocketChannelClientWrapper::didClose):
2841         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
2842         * Modules/websockets/WebSocket.cpp:
2843         (WebCore::joinStrings):
2844         (WebCore::saturateAdd):
2845         (WebCore::WebSocket::send):
2846         (WebCore::WebSocket::readyState):
2847         (WebCore::WebSocket::bufferedAmount):
2848         (WebCore::WebSocket::didReceiveBinaryData):
2849         (WebCore::WebSocket::didReceiveMessageError):
2850         (WebCore::WebSocket::didUpdateBufferedAmount):
2851         (WebCore::WebSocket::didStartClosingHandshake):
2852         (WebCore::WebSocket::didClose):
2853         * Modules/websockets/WebSocket.h:
2854         * Modules/websockets/WebSocketChannel.cpp:
2855         (WebCore::WebSocketChannel::WebSocketChannel):
2856         (WebCore::WebSocketChannel::~WebSocketChannel):
2857         (WebCore::WebSocketChannel::send):
2858         (WebCore::WebSocketChannel::bufferedAmount):
2859         (WebCore::WebSocketChannel::resume):
2860         (WebCore::WebSocketChannel::willOpenSocketStream):
2861         (WebCore::WebSocketChannel::didOpenSocketStream):
2862         (WebCore::WebSocketChannel::didCloseSocketStream):
2863         (WebCore::WebSocketChannel::didReceiveSocketStreamData):
2864         (WebCore::WebSocketChannel::didUpdateBufferedAmount):
2865         (WebCore::WebSocketChannel::didFailSocketStream):
2866         (WebCore::WebSocketChannel::didStartLoading):
2867         (WebCore::WebSocketChannel::appendToBuffer):
2868         (WebCore::WebSocketChannel::processBuffer):
2869         (WebCore::WebSocketChannel::resumeTimerFired):
2870         (WebCore::WebSocketChannel::startClosingHandshake):
2871         (WebCore::WebSocketChannel::didReceiveAuthenticationChallenge): Deleted.
2872         (WebCore::WebSocketChannel::didCancelAuthenticationChallenge): Deleted.
2873         * Modules/websockets/WebSocketChannel.h:
2874         * Modules/websockets/WebSocketChannelClient.h:
2875         (WebCore::WebSocketChannelClient::~WebSocketChannelClient):
2876         (WebCore::WebSocketChannelClient::didConnect):
2877         (WebCore::WebSocketChannelClient::didReceiveMessage):
2878         (WebCore::WebSocketChannelClient::didReceiveBinaryData):
2879         (WebCore::WebSocketChannelClient::didReceiveMessageError):
2880         (WebCore::WebSocketChannelClient::didUpdateBufferedAmount):
2881         (WebCore::WebSocketChannelClient::didStartClosingHandshake):
2882         (WebCore::WebSocketChannelClient::didClose):
2883         (WebCore::WebSocketChannelClient::WebSocketChannelClient):
2884         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2885         (WebCore::WorkerThreadableWebSocketChannel::send):
2886         (WebCore::WorkerThreadableWebSocketChannel::bufferedAmount):
2887         (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
2888         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
2889         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
2890         (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
2891         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
2892         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
2893         (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
2894         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
2895         * platform/network/BlobData.cpp:
2896         (WebCore::BlobData::appendData):
2897         (WebCore::BlobData::appendFile):
2898         * platform/network/BlobData.h:
2899         (WebCore::BlobDataItem::BlobDataItem):
2900         * platform/network/BlobRegistry.h:
2901         * platform/network/BlobRegistryImpl.cpp:
2902         (WebCore::BlobRegistryImpl::appendStorageItems):
2903         (WebCore::BlobRegistryImpl::registerFileBlobURL):
2904         (WebCore::BlobRegistryImpl::registerBlobURL):
2905         (WebCore::BlobRegistryImpl::registerBlobURLOptionallyFileBacked):
2906         (WebCore::BlobRegistryImpl::registerBlobURLForSlice):
2907         * platform/network/BlobRegistryImpl.h:
2908         * platform/network/SocketStreamHandleBase.cpp:
2909         (WebCore::SocketStreamHandleBase::send):
2910         (WebCore::SocketStreamHandleBase::disconnect):
2911         (WebCore::SocketStreamHandleBase::sendPendingData):
2912         * platform/network/SocketStreamHandleBase.h:
2913         * platform/network/SocketStreamHandleClient.h:
2914         (WebCore::SocketStreamHandleClient::~SocketStreamHandleClient):
2915         (WebCore::SocketStreamHandleClient::willOpenSocketStream):
2916         (WebCore::SocketStreamHandleClient::didOpenSocketStream):
2917         (WebCore::SocketStreamHandleClient::didCloseSocketStream):
2918         (WebCore::SocketStreamHandleClient::didReceiveSocketStreamData):
2919         (WebCore::SocketStreamHandleClient::didUpdateBufferedAmount):
2920         (WebCore::SocketStreamHandleClient::didFailSocketStream):
2921         (WebCore::SocketStreamHandleClient::didReceiveAuthenticationChallenge): Deleted.
2922         (WebCore::SocketStreamHandleClient::didCancelAuthenticationChallenge): Deleted.
2923         * platform/network/cf/SocketStreamHandle.h:
2924         (WebCore::SocketStreamHandle::create):
2925         (WebCore::SocketStreamHandle::refAuthenticationClient): Deleted.
2926         (WebCore::SocketStreamHandle::derefAuthenticationClient): Deleted.
2927         * platform/network/cf/SocketStreamHandleCFNet.cpp:
2928         (WebCore::SocketStreamHandle::SocketStreamHandle):
2929         (WebCore::SocketStreamHandle::addCONNECTCredentials):
2930         (WebCore::SocketStreamHandle::copyCFStreamDescription):
2931         (WebCore::SocketStreamHandle::readStreamCallback):
2932         (WebCore::SocketStreamHandle::writeStreamCallback):
2933         (WebCore::SocketStreamHandle::reportErrorToClient):
2934         (WebCore::SocketStreamHandle::~SocketStreamHandle):
2935         (WebCore::SocketStreamHandle::platformClose):
2936         (WebCore::SocketStreamHandle::port):
2937         (WebCore::SocketStreamHandle::receivedCredential): Deleted.
2938         (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
2939         (WebCore::SocketStreamHandle::receivedCancellation): Deleted.
2940         (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
2941         (WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
2942         * platform/network/curl/ResourceHandleCurl.cpp:
2943         * platform/network/curl/SocketStreamHandle.h:
2944         (WebCore::SocketStreamHandle::SocketData::SocketData):
2945         * platform/network/curl/SocketStreamHandleCurl.cpp:
2946         (WebCore::SocketStreamHandle::platformClose):
2947         (WebCore::SocketStreamHandle::readData):
2948         (WebCore::SocketStreamHandle::didReceiveData):
2949         (WebCore::SocketStreamHandle::didOpenSocket):
2950         (WebCore::SocketStreamHandle::createCopy):
2951         (WebCore::SocketStreamHandle::didReceiveAuthenticationChallenge): Deleted.
2952         (WebCore::SocketStreamHandle::receivedCredential): Deleted.
2953         (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
2954         (WebCore::SocketStreamHandle::receivedCancellation): Deleted.
2955         (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
2956         (WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
2957         * platform/network/soup/SocketStreamHandle.h:
2958         (WebCore::SocketStreamHandle::create):
2959         * platform/network/soup/SocketStreamHandleSoup.cpp:
2960         (WebCore::getHandleFromId):
2961         (WebCore::deactivateHandle):
2962         (WebCore::activateHandle):
2963         (WebCore::SocketStreamHandle::SocketStreamHandle):
2964         (WebCore::SocketStreamHandle::~SocketStreamHandle):
2965         (WebCore::SocketStreamHandle::connected):
2966         (WebCore::SocketStreamHandle::readBytes):
2967         (WebCore::SocketStreamHandle::platformSend):
2968         (WebCore::SocketStreamHandle::platformClose):
2969         (WebCore::SocketStreamHandle::beginWaitingForSocketWritability):
2970         (WebCore::SocketStreamHandle::didReceiveAuthenticationChallenge): Deleted.
2971         (WebCore::SocketStreamHandle::receivedCredential): Deleted.
2972         (WebCore::SocketStreamHandle::receivedRequestToContinueWithoutCredential): Deleted.
2973         (WebCore::SocketStreamHandle::receivedCancellation): Deleted.
2974         (WebCore::SocketStreamHandle::receivedRequestToPerformDefaultHandling): Deleted.
2975         (WebCore::SocketStreamHandle::receivedChallengeRejection): Deleted.
2976
2977 2016-06-09  Commit Queue  <commit-queue@webkit.org>
2978
2979         Unreviewed, rolling out r201815.
2980         https://bugs.webkit.org/show_bug.cgi?id=158570
2981
2982         This broke the cmake build. (Requested by lforschler on
2983         #webkit).
2984
2985         Reverted changeset:
2986
2987         "Teach cmake about libWebKitSystemInterfaceOSX10.12"
2988         http://trac.webkit.org/changeset/201815
2989
2990 2016-06-09  Chris Dumez  <cdumez@apple.com>
2991
2992         WorkerGlobalScope attributes / operations should be on the prototype
2993         https://bugs.webkit.org/show_bug.cgi?id=158568
2994         <rdar://problem/26720079>
2995
2996         Reviewed by Geoffrey Garen.
2997
2998         WorkerGlobalScope attributes / operations should be on the prototype
2999         because WorkerGlobalScope is not marked as [Global] / [PrimaryGlobal]:
3000         - https://html.spec.whatwg.org/multipage/workers.html#the-workerglobalscope-common-interface
3001         - http://heycam.github.io/webidl/#es-attributes
3002         - http://heycam.github.io/webidl/#es-operations
3003
3004         DedicatedWorkerGlobalScope is the interface that is marked as [Global]
3005         and whose attributes / operations should be on the instance.
3006
3007         This brings the number of failures on http://w3c-test.org/workers/interfaces.worker
3008         from 65 to 34. It also aligns our behavior with Firefox and Chrome.
3009
3010         Test: fast/workers/WorkerGlobalScope-properties-prototype.html
3011
3012         * bindings/scripts/CodeGeneratorJS.pm:
3013         (InterfaceRequiresAttributesOnInstance):
3014         (OperationShouldBeOnInstance):
3015
3016 2016-06-09  Tim Horton  <timothy_horton@apple.com>
3017
3018         Writing-mode-dependent properties don't apply if their value is a variable
3019         https://bugs.webkit.org/show_bug.cgi?id=158449
3020         <rdar://problem/26662478>
3021
3022         Reviewed by Simon Fraser.
3023
3024         Test: fast/css/variables/direction-dependent-variable-properties.html
3025
3026         * css/CSSParser.cpp:
3027         (WebCore::CSSParser::parseVariableDependentValue):
3028         * css/CSSParser.h:
3029         * css/StyleResolver.cpp:
3030         (WebCore::StyleResolver::resolvedVariableValue):
3031         CSSVariableDependentValue stores the unresolved (direction-dependent) property ID,
3032         because the property that it resolves to cannot be determined until style resolution time.
3033         Plumb the requisite direction and writing mode information into parseVariableDependentValue
3034         at style resolution time so that the property can be resolved to the correct
3035         non-direction-dependent property for each use of the value.
3036
3037 2016-06-09  Ryan Haddad  <ryanhaddad@apple.com>
3038
3039         Attempt to fix the iOS build.
3040
3041         Unreviewed build fix.
3042
3043         * platform/network/mac/ResourceErrorMac.mm:
3044         (WebCore::ResourceError::ResourceError):
3045
3046 2016-06-09  Simon Fraser  <simon.fraser@apple.com>
3047
3048         border-radius with different width and height rendered wrong
3049         https://bugs.webkit.org/show_bug.cgi?id=158300
3050         <rdar://problem/26672922>
3051
3052         Reviewed by Zalan Bujtas.
3053
3054         Borders with border-radius close to 100% 100% got oddly clipped. This happened because
3055         of the clipping we do to achieve the diagonal corner joins; RenderBoxModelObject::clipBorderSidePolygon()
3056         created trapezoids for each side, but only extended them to the center of the inner border rect.
3057         This clipped out parts of these borders.
3058
3059         Fix by computing the trapezoids by intersecting the corner diagonal line with a line that passes
3060         through the adjacent corners of the inner rect, whose intersection is always going to be inside the
3061         rounded border. Also fix the quads used to do the antialiased/non-antialiased clipping,
3062         by adding a point rather than moving a corner point to ensure we don't mistakenly clip out any
3063         parts of the border.
3064         
3065         Finally, improve the rendering of non-renderable cases by actually doing the diagonal
3066         corner joins rather than just giving up.
3067
3068         Tests: fast/borders/border-non-renderable-radius-inner-clip.html
3069                fast/borders/border-radius-inner-clip-vertical.html
3070                fast/borders/border-radius-inner-clip.html
3071
3072         * rendering/RenderBoxModelObject.cpp:
3073         (WebCore::calculateAdjustedInnerBorder): Moved up.
3074         (WebCore::RenderBoxModelObject::paintOneBorderSide):
3075         (WebCore::RenderBoxModelObject::clipBorderSidePolygon):
3076         (WebCore::findInnerVertex): Deleted.
3077         (WebCore::calculateSideRectIncludingInner): Deleted.
3078         (WebCore::RenderBoxModelObject::clipBorderSideForComplexInnerPath): Deleted.
3079         * rendering/RenderBoxModelObject.h:
3080
3081 2016-06-09  Xabier Rodriguez Calvar  <calvaris@igalia.com>
3082
3083         Unreviewed, fixing compilation issue with WebRTC
3084
3085         The code dependencies of the SDP processor were not right.
3086
3087         * PlatformGTK.cmake:
3088
3089 2016-06-09  Frederic Wang  <fwang@igalia.com>
3090
3091         Introduce MathOperator::Type
3092         https://bugs.webkit.org/show_bug.cgi?id=156950
3093
3094         Reviewed by Sergio Villar Senin.
3095
3096         No new tests, behavior is not change.
3097
3098         An enum Type is introduced in MathOperator in order to indicate
3099         which kind of stretching is requested. In follow-up work, this will
3100         allow to just call setOperator and stretchTo without having to
3101         explicitly call calculateDisplayStyleLargeOperator or calculateStretchyData.
3102
3103         * rendering/mathml/MathOperator.cpp:
3104         (WebCore::MathOperator::setOperator): Use Type instead of a boolean.
3105         (WebCore::MathOperator::setGlyphAssembly): Add an assert to ensure that the function is correctly used.
3106         (WebCore::MathOperator::calculateDisplayStyleLargeOperator): Ditto, this makes the assert more accurate.
3107         (WebCore::MathOperator::calculateStretchyData): Ditto and replace m_isVertical with a local isVertical variable.
3108         (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
3109         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
3110         (WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
3111         (WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
3112         * rendering/mathml/MathOperator.h: Add the Type enum.
3113         (WebCore::MathOperator::stretchSize): Use Type instead of a boolean and add an
3114         assert to ensure that the function is correctly used.
3115         * rendering/mathml/RenderMathMLOperator.cpp:
3116         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Call setOperator with the correct value.
3117         (WebCore::RenderMathMLOperator::updateStyle): Ditto.
3118
3119 2016-06-09  Commit Queue  <commit-queue@webkit.org>
3120
3121         Unreviewed, rolling out r201810.
3122         https://bugs.webkit.org/show_bug.cgi?id=158563
3123
3124         breaks build without ENABLE_WEB_ANIMATION (Requested by
3125         mcatanzaro on #webkit).
3126
3127         Reverted changeset:
3128
3129         "[web-animations] Add Animatable, AnimationEffect,
3130         KeyframeEffect and Animation interface"
3131         https://bugs.webkit.org/show_bug.cgi?id=156096
3132         http://trac.webkit.org/changeset/201810
3133
3134 2016-06-09  Ryosuke Niwa  <rniwa@webkit.org>
3135
3136         slotchange event should be fired at the end of microtask
3137         https://bugs.webkit.org/show_bug.cgi?id=157374
3138         <rdar://problem/26154024>
3139
3140         Reviewed by Antti Koivisto.
3141
3142         Dispatch slotchange event at the end of every microtask after delivering records to mutation observers
3143         as specified in: https://dom.spec.whatwg.org/#notify-mutation-observers
3144
3145         Test: fast/shadow-dom/slotchange-event.html
3146
3147         * dom/Document.cpp:
3148         (WebCore::Document::enqueueSlotchangeEvent): Deleted.
3149         * dom/Document.h:
3150         * dom/MutationObserver.cpp:
3151         (WebCore::signalSlotList): Added.
3152         (WebCore::MutationObserverMicrotask::run): mutationObserverCompoundMicrotaskQueuedFlag is now unset in
3153         notifyMutationObservers to better match the concept to "notify mutation observers".
3154         (WebCore::MutationObserver::enqueueSlotChangeEvent): Added.
3155         (WebCore::MutationObserver::notifyMutationObservers): Renamed from deliverAllMutations. Added the code
3156         to dispatch slotchange events as spec'ed, and also added comments for each step.
3157         * dom/MutationObserver.h:
3158         * html/HTMLSlotElement.cpp:
3159         (WebCore::HTMLSlotElement::enqueueSlotChangeEvent): Use MutationObserver::enqueueSlotChangeEvent. Don't
3160         create an event here since that is only needed when dispatching the event, and to keep track of whether
3161         we've already scheduled an event or not. Use a boolean flag instead for the latter. 
3162         (WebCore::HTMLSlotElement::dispatchSlotChangeEvent): Added. Creates and dispatches an event.
3163         (WebCore::HTMLSlotElement::dispatchEvent): Deleted.
3164         * html/HTMLSlotElement.h:
3165         (WebCore::HTMLSlotElement::didRemoveFromSignalSlotList): Added.
3166
3167 2016-06-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3168
3169         Introduce ResourceErrorBase::type
3170         https://bugs.webkit.org/show_bug.cgi?id=158299
3171
3172         Reviewed by Alex Christensen.
3173
3174         Introducing an enum type for ResourceErrorBase.
3175         In most cases, the type is set at construction time.
3176         By default, constructor with no parameters will set type to Null.
3177         Constructor with parameters will set type to General.
3178
3179         Removed boolean state error fields.
3180
3181         Introduced a type setter. It should only be used to  make the type
3182         more precise (when type is Null or General).
3183
3184         Updating related calling code.
3185
3186         No change of behavior.
3187
3188         * loader/DocumentLoader.cpp:
3189         (WebCore::DocumentLoader::stopLoadingForPolicyChange):
3190         * loader/DocumentThreadableLoader.cpp:
3191         (WebCore::DocumentThreadableLoader::cancel):
3192         * loader/EmptyClients.h:
3193         * loader/FrameLoader.cpp:
3194         (WebCore::FrameLoader::cancelledError):
3195         (WebCore::FrameLoader::blockedError):
3196         * loader/WorkerThreadableLoader.cpp:
3197         (WebCore::WorkerThreadableLoader::MainThreadBridge::cancel):
3198         * platform/network/ResourceErrorBase.cpp:
3199         (WebCore::ResourceErrorBase::isolatedCopy):
3200         (WebCore::ResourceErrorBase::setType):
3201         (WebCore::ResourceErrorBase::compare):
3202         * platform/network/ResourceErrorBase.h:
3203         (WebCore::ResourceErrorBase::isNull):
3204         (WebCore::ResourceErrorBase::isCancellation):
3205         (WebCore::ResourceErrorBase::isTimeout):
3206         (WebCore::ResourceErrorBase::type):
3207         (WebCore::ResourceErrorBase::ResourceErrorBase):
3208         (WebCore::ResourceErrorBase::domain):
3209         * platform/network/cf/ResourceError.h:
3210         (WebCore::ResourceError::ResourceError):
3211         * platform/network/cf/ResourceErrorCF.cpp:
3212         (WebCore::ResourceError::ResourceError):
3213         (WebCore::ResourceError::cfError):
3214         * platform/network/curl/ResourceError.h:
3215         (WebCore::ResourceError::ResourceError):
3216         * platform/network/mac/ResourceErrorMac.mm:
3217         (WebCore::m_platformError):
3218         (WebCore::ResourceError::nsError):
3219         (WebCore::ResourceError::ResourceError):
3220         (WebCore::ResourceError::platformLazyInit):
3221         * platform/network/soup/ResourceError.h:
3222         (WebCore::ResourceError::ResourceError):
3223         * platform/network/soup/ResourceErrorSoup.cpp:
3224         (WebCore::ResourceError::timeoutError):
3225
3226 2016-06-08  Frederic Wang  <fwang@igalia.com>
3227
3228         Move selection and drawing of stretchy operators into a separate MathOperator class
3229         https://bugs.webkit.org/show_bug.cgi?id=156921
3230
3231         Reviewed by Martin Robinson.
3232
3233         No new tests, behavior is not changed.
3234
3235         * CMakeLists.txt: Add the MathOperator files.
3236         * WebCore.xcodeproj/project.pbxproj: Ditto.
3237         * rendering/mathml/MathOperator.cpp: Added.
3238         (WebCore::boundsForGlyph): Moved from RenderMathMLOperator.
3239         (WebCore::heightForGlyph): Moved from RenderMathMLOperator.
3240         (WebCore::advanceWidthForGlyph): Moved from RenderMathMLOperator.
3241         (WebCore::MathOperator::MathOperator):
3242         (WebCore::MathOperator::setOperator):
3243         (WebCore::MathOperator::getBaseGlyph): Moved from RenderMathMLOperator.
3244         (WebCore::MathOperator::setSizeVariant): Moved from RenderMathMLOperator.
3245         (WebCore::MathOperator::setGlyphAssembly): Moved from RenderMathMLOperator.
3246         (WebCore::MathOperator::calculateDisplayStyleLargeOperator): Moved from RenderMathMLOperator with additional style parameter.
3247         (WebCore::MathOperator::calculateGlyphAssemblyFallBack): Ditto.
3248         (WebCore::MathOperator::calculateStretchyData): Ditto.
3249         (WebCore::MathOperator::paintGlyph): Ditto.
3250         (WebCore::MathOperator::fillWithVerticalExtensionGlyph): Ditto.
3251         (WebCore::MathOperator::fillWithHorizontalExtensionGlyph): Ditto.
3252         (WebCore::MathOperator::paintVerticalGlyphAssembly): Ditto.
3253         (WebCore::MathOperator::paintHorizontalGlyphAssembly): Ditto.
3254         * rendering/mathml/MathOperator.h: Added.
3255         (WebCore::MathOperator::italicCorrection):
3256         (WebCore::MathOperator::isStretched):
3257         (WebCore::MathOperator::unstretch):
3258         (WebCore::MathOperator::GlyphAssemblyData::GlyphAssemblyData): Moved from RenderMathMLOperator.
3259         (WebCore::MathOperator::stretchSize):
3260         * rendering/mathml/RenderMathMLOperator.cpp:
3261         (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): Updated to use MathOperator members.
3262         For now we call setOperator to transmit information to m_mathOperator.
3263         (WebCore::RenderMathMLOperator::updateStyle): Updated to use MathOperator members.
3264         For now we set some m_mathOperator members to transmit it some information.
3265         (WebCore::RenderMathMLOperator::firstLineBaseline): Updated to use MathOperator members.
3266         (WebCore::RenderMathMLOperator::computeLogicalHeight): Ditto.
3267         (WebCore::RenderMathMLOperator::paint): Ditto.
3268         For now we set some m_mathOperator members to transmit it some information.
3269         (WebCore::RenderMathMLOperator::paintChildren): Updated to use MathOperator members.
3270         (WebCore::RenderMathMLOperator::trailingSpaceError): Ditto.
3271         (WebCore::RenderMathMLOperator::getBaseGlyph): Deleted.
3272         (WebCore::RenderMathMLOperator::setSizeVariant): Deleted.
3273         (WebCore::RenderMathMLOperator::setGlyphAssembly): Deleted.
3274         (WebCore::RenderMathMLOperator::calculateGlyphAssemblyFallBack): Deleted.
3275         (WebCore::RenderMathMLOperator::calculateDisplayStyleLargeOperator): Deleted.
3276         (WebCore::RenderMathMLOperator::calculateStretchyData): Deleted.
3277         (WebCore::RenderMathMLOperator::paintGlyph): Deleted.
3278         (WebCore::RenderMathMLOperator::fillWithVerticalExtensionGlyph): Deleted.
3279         (WebCore::RenderMathMLOperator::fillWithHorizontalExtensionGlyph): Deleted.
3280         (WebCore::RenderMathMLOperator::paintVerticalGlyphAssembly): Deleted.
3281         (WebCore::RenderMathMLOperator::paintHorizontalGlyphAssembly): Deleted.
3282         * rendering/mathml/RenderMathMLOperator.h:
3283         (WebCore::RenderMathMLOperator::italicCorrection): Updated to use MathOperator members.
3284         (WebCore::RenderMathMLOperator::GlyphAssemblyData::GlyphAssemblyData): Deleted.
3285
3286 2016-06-08  Chris Dumez  <cdumez@apple.com>
3287
3288         DedicatedWorkerGlobalScope prototype chain is incorrect
3289         https://bugs.webkit.org/show_bug.cgi?id=158544
3290
3291         Reviewed by Brady Eidson.
3292
3293         There were several issues with the prototype chain of DedicatedWorkerGlobalScope:
3294         1. Object.getPrototypeOf(DedicatedWorkerGlobalScope.prototype) was not
3295            WorkerGlobalScope.prototype.
3296         2. WorkerGlobalScope.prototype was a DedicatedWorkerGlobalScopePrototype
3297            object and was equal to DedicatedWorkerGlobalScope.prototype.
3298         3. Object.getPrototypeOf(WorkerGlobalScope.prototype) was not EventTarget.prototype.
3299
3300         Those issues were identified by the following W3C web-platform-test:
3301         http://w3c-test.org/workers/interfaces.worker
3302
3303         This patch fixes the issue so that the prototype chain is now as per the
3304         specification.
3305
3306         Test: fast/workers/DedicatedWorkerGlobalScope-prototype-chain.html
3307
3308         * bindings/js/WorkerScriptController.cpp:
3309         (WebCore::WorkerScriptController::initScript):
3310         - Stop creating the WorkerGlobalScopePrototype and let JSWorkerGlobalScope
3311           create it.
3312         - Set DedicatedWorkerGlobalScopePrototype's prototype to JSWorkerGlobalScope's
3313           prototype after creating the JSDedicatedWorkerGlobalScope object.
3314
3315         * bindings/scripts/CodeGeneratorJS.pm:
3316         (ShouldUseGlobalObjectPrototype):
3317         (GenerateHeader):
3318         (GenerateImplementation):
3319         (GenerateConstructorHelperMethods):
3320         - Do not use globalObject.getPrototypeDirect() as 'prototype' property for
3321           WorkerGlobalScope. The globalObject is a DedicatedWorkerGlobalScope, not
3322           a WorkerGlobalScope.
3323         - Generate the code to create / get a prototype object for WorkerGlobalScope.
3324
3325
3326 2016-06-08  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3327
3328         WebRTC: Imlement MediaEndpointPeerConnection::setRemoteDescription()
3329         https://bugs.webkit.org/show_bug.cgi?id=158467
3330
3331         Reviewed by Eric Carlson.
3332
3333         Implement MediaEndpointPeerConnection::setRemoteDescription() which verifies a
3334         remote offer or answer, configures the WebRTC backend and dispatches the 'track' events
3335         that represent the incoming media [1].
3336
3337         This change also updates the RTCTrackEvent [2] with a streams and a transceiver attribute.
3338
3339         [1] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#dom-rtcpeerconnection-setremotedescription
3340         [2] https://w3c.github.io/webrtc-pc/archives/20160513/webrtc.html#rtctrackevent
3341
3342         Tests: fast/mediastream/RTCPeerConnection-setRemoteDescription-offer.html
3343                fast/mediastream/RTCTrackEvent-constructor.html
3344
3345         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3346         (WebCore::createSourceMap):
3347         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
3348         (WebCore::MediaEndpointPeerConnection::setRemoteDescription):
3349         (WebCore::MediaEndpointPeerConnection::setRemoteDescriptionTask):
3350         Implemented.
3351         (WebCore::MediaEndpointPeerConnection::remoteDescription):
3352         (WebCore::MediaEndpointPeerConnection::currentRemoteDescription):
3353         (WebCore::MediaEndpointPeerConnection::pendingRemoteDescription):
3354         (WebCore::MediaEndpointPeerConnection::remoteDescriptionTypeValidForState):
3355         (WebCore::MediaEndpointPeerConnection::internalRemoteDescription):
3356         * Modules/mediastream/MediaEndpointPeerConnection.h:
3357         * Modules/mediastream/PeerConnectionBackend.h:
3358         * Modules/mediastream/RTCPeerConnection.cpp:
3359         (WebCore::RTCPeerConnection::addTransceiver):
3360         * Modules/mediastream/RTCPeerConnection.h:
3361         * Modules/mediastream/RTCRtpReceiver.h:
3362         (WebCore::RTCRtpReceiver::isDispatched):
3363         (WebCore::RTCRtpReceiver::setDispatched):
3364         * Modules/mediastream/RTCTrackEvent.cpp:
3365         (WebCore::RTCTrackEvent::create):
3366         (WebCore::RTCTrackEvent::RTCTrackEvent):
3367         * Modules/mediastream/RTCTrackEvent.h:
3368         (WebCore::RTCTrackEvent::streams):
3369         (WebCore::RTCTrackEvent::transceiver):
3370         * Modules/mediastream/RTCTrackEvent.idl:
3371         Add streams and transceiver attributes.
3372         * bindings/js/JSDictionary.cpp:
3373         (WebCore::JSDictionary::convertValue):
3374         * bindings/js/JSDictionary.h:
3375         * platform/mediastream/MediaEndpoint.h:
3376         * platform/mock/MockMediaEndpoint.cpp:
3377         (WebCore::MockMediaEndpoint::filterPayloads):
3378         (WebCore::MockMediaEndpoint::updateSendConfiguration):
3379         * platform/mock/MockMediaEndpoint.h:
3380
3381 2016-06-08  John Wilander  <wilander@apple.com>
3382
3383         Perform IDNA encoding on parameters for setHostAndPort and setHost
3384         https://bugs.webkit.org/show_bug.cgi?id=158371
3385         <rdar://problem/16869342>
3386
3387         Reviewed by Brent Fulgham.
3388
3389         Tests: fast/dom/set-document-location-host-to-unaccepted-values.html
3390                fast/dom/set-document-location-hostname-to-unaccepted-values.html
3391                http/tests/dom/set-document-location-host-to-accepted-values.html
3392                http/tests/dom/set-document-location-hostname-to-accepted-values.html
3393
3394         * platform/URL.cpp:
3395         (WebCore::containsOnlyASCII):
3396             Moved up to enable usage in URL::setHost and URL::setHostAndPort.
3397         (WebCore::appendEncodedHostname):
3398             Moved up to enable usage in URL::setHost and URL::setHostAndPort.
3399         (WebCore::URL::setHost):
3400             Now disallows the colon character, does IDNA encoding, and uses StringBuilder.
3401         (WebCore::URL::setHostAndPort):
3402             Now disallows multiple colons, disallows non-numeric ports, disallows the empty
3403             string, does IDNA encoding, and uses StringBuilder.
3404
3405 2016-06-08  Alex Christensen  <achristensen@webkit.org>
3406
3407         Fix WinCairo build.
3408
3409         * platform/network/curl/MultipartHandle.cpp:
3410         (WebCore::MultipartHandle::didReceiveResponse):
3411
3412 2016-06-08  Alex Christensen  <achristensen@webkit.org>
3413
3414         Fix WinCairo build.
3415
3416         * platform/network/curl/MultipartHandle.cpp:
3417         (WebCore::MultipartHandle::didReceiveResponse):
3418
3419 2016-06-08  Jer Noble  <jer.noble@apple.com>
3420
3421         With audio user gesture restriction in place, video.src = 'file', video.play() succeeds where it should fail.
3422         https://bugs.webkit.org/show_bug.cgi?id=158546
3423
3424         Reviewed by Eric Carlson.
3425
3426         Test: media/video-playback-restriction-play-before-load.html
3427
3428         Don't check that the media element isPlaying(); that will only return true if playback has begun.
3429         Instead, check !paused(), as that will be true as soon as the play() method returns.
3430
3431         * html/HTMLMediaElement.cpp:
3432         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
3433         (WebCore::HTMLMediaElement::updateShouldPlay):
3434         * rendering/RenderLayer.h:
3435
3436 2016-06-08  Alex Christensen  <achristensen@webkit.org>
3437
3438         Modernize WebSocket code
3439         https://bugs.webkit.org/show_bug.cgi?id=158539
3440
3441         Reviewed by Brady Eidson.
3442
3443         No new tests, no change in behavior.
3444
3445         * Modules/websockets/ThreadableWebSocketChannel.cpp:
3446         (WebCore::ThreadableWebSocketChannel::create):
3447         * Modules/websockets/ThreadableWebSocketChannel.h:
3448         (WebCore::ThreadableWebSocketChannel::ThreadableWebSocketChannel):
3449         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp:
3450         (WebCore::ThreadableWebSocketChannelClientWrapper::ThreadableWebSocketChannelClientWrapper):
3451         (WebCore::ThreadableWebSocketChannelClientWrapper::create):
3452         (WebCore::ThreadableWebSocketChannelClientWrapper::processPendingTasks):
3453         * Modules/websockets/ThreadableWebSocketChannelClientWrapper.h:
3454         * Modules/websockets/WebSocket.cpp:
3455         (WebCore::WebSocket::connect):
3456         * Modules/websockets/WebSocketChannel.cpp:
3457         (WebCore::WebSocketChannel::WebSocketChannel):
3458         * Modules/websockets/WebSocketChannel.h:
3459         (WebCore::WebSocketChannel::create):
3460         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
3461         (WebCore::WorkerThreadableWebSocketChannel::WorkerThreadableWebSocketChannel):
3462         (WebCore::WorkerThreadableWebSocketChannel::subprotocol):
3463         (WebCore::WorkerThreadableWebSocketChannel::extensions):
3464         (WebCore::WorkerThreadableWebSocketChannel::resume):
3465         (WebCore::WorkerThreadableWebSocketChannel::Peer::Peer):
3466         (WebCore::WorkerThreadableWebSocketChannel::Peer::send):
3467         (WebCore::WorkerThreadableWebSocketChannel::Peer::bufferedAmount):
3468         (WebCore::WorkerThreadableWebSocketChannel::Peer::didConnect):
3469         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessage):
3470         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveBinaryData):
3471         (WebCore::WorkerThreadableWebSocketChannel::Peer::didUpdateBufferedAmount):
3472         (WebCore::WorkerThreadableWebSocketChannel::Peer::didStartClosingHandshake):
3473         (WebCore::WorkerThreadableWebSocketChannel::Peer::didClose):
3474         (WebCore::WorkerThreadableWebSocketChannel::Peer::didReceiveMessageError):
3475         (WebCore::WorkerThreadableWebSocketChannel::Bridge::Bridge):
3476         (WebCore::WorkerThreadableWebSocketChannel::Bridge::~Bridge):
3477         (WebCore::WorkerThreadableWebSocketChannel::Bridge::mainThreadInitialize):
3478         (WebCore::WorkerThreadableWebSocketChannel::Bridge::initialize):
3479         (WebCore::WorkerThreadableWebSocketChannel::Bridge::connect):
3480         (WebCore::WorkerThreadableWebSocketChannel::Bridge::send):
3481         (WebCore::WorkerThreadableWebSocketChannel::Bridge::bufferedAmount):
3482         (WebCore::WorkerThreadableWebSocketChannel::Bridge::close):
3483         (WebCore::WorkerThreadableWebSocketChannel::Bridge::setMethodNotCompleted):
3484         (WebCore::WorkerThreadableWebSocketChannel::Bridge::waitForMethodCompletion):
3485         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
3486         (WebCore::WorkerThreadableWebSocketChannel::create):
3487         (WebCore::WorkerThreadableWebSocketChannel::Bridge::create):
3488
3489 2016-06-08  Chris Dumez  <cdumez@apple.com>
3490
3491         First parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should be mandatory
3492         https://bugs.webkit.org/show_bug.cgi?id=158540
3493
3494         Reviewed by Geoffrey Garen.
3495
3496         First parameter to MessagePort / DedicatedWorkerGlobalScope.postMessage() should be mandatory:
3497         - https://html.spec.whatwg.org/multipage/comms.html#messageport
3498         - https://html.spec.whatwg.org/multipage/workers.html#dedicated-workers-and-the-dedicatedworkerglobalscope-interface
3499
3500         Previously, WebKit send a bogus MessageEvent whose data attribute is undefined. This would
3501         cause a testharness error when running the following W3C test:
3502         - http://w3c-test.org/workers/interfaces.worker
3503
3504         Firefox and Chrome already correctly throw in this case. Our Window.postMessage() API is also
3505         already throwing in this case.
3506
3507         Test: fast/workers/postMessage-missing-parameter.html
3508
3509         * bindings/js/JSMessagePortCustom.h:
3510         (WebCore::handlePostMessage):
3511
3512 2016-06-08  Gavin Barraclough  <barraclough@apple.com>
3513
3514         Remove removeDirect
3515         https://bugs.webkit.org/show_bug.cgi?id=158516
3516
3517         Reviewed by Ryosuke Niwa.
3518
3519         removeDirect is typically used as a subroutine of deleteProperty, but is also available to
3520         call directly. Having this functionality factored out to a separate routine is a bad idea
3521         on a couple of fronts:
3522
3523         - for the main use within deleteProperty there is redundancy (presence of the property
3524           was being checked twice) and inconsistency (the two functions returned different results
3525           in the case of a nonexistent property; the result from removeDirect was never observed).
3526
3527         - all uses of removeDirect are in practical terms incorrect. removeDirect had the
3528           advantage of ignoring the configurable (DontDelete) attributes, but this is achievable
3529           using the DeletePropertyMode setting - and the disadvantage of failing delete static
3530           table properties. Last uses were one that was removed in bug #158295 (where failure to
3531           delete static properties was a problem), and as addressed in this patch removeDirect is
3532           being used to implement runtime enabled features. This only works because we currently
3533           force reification of all properties on the DOM prototype objects, so in effect there are
3534           no static properties. In order to make the code robust such that runtime enabled
3535           features would still work even if we were not reifying static properties (a change we
3536           may want to make) we should be calling deleteProperty in this case too.
3537
3538         * bindings/scripts/CodeGeneratorJS.pm:
3539         (GenerateImplementation):
3540             - changed to call deleteProperty instead of removeDirect.
3541         * bindings/scripts/test/JS/JSTestObj.cpp:
3542         (WebCore::JSTestObjPrototype::finishCreation):
3543             - updated bindings test results.
3544
3545 2016-06-08  Nan Wang  <n_wang@apple.com>
3546
3547         For keyboard users, activating a fragment URL should transfer focus and caret to the destination
3548         https://bugs.webkit.org/show_bug.cgi?id=116046
3549
3550         Reviewed by Ryosuke Niwa.
3551
3552         Added a sequential focus navigation starting node to document. When TAB or SHIFT-TAB is pressed
3553         and there is no focused element, we start searching for next focus candidates at the sequential
3554         focus navigation node.
3555         Spec: https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point
3556
3557         Test: fast/events/sequential-focus-navigation-starting-point.html
3558
3559         * dom/Document.cpp:
3560         (WebCore::Document::removedLastRef):
3561         (WebCore::Document::destroyRenderTree):
3562         (WebCore::Document::styleResolverChanged):
3563         (WebCore::isNodeInSubtree):
3564         (WebCore::Document::removeFocusedNodeOfSubtree):
3565         (WebCore::Document::hoveredElementDidDetach):
3566         (WebCore::Document::setFocusedElement):
3567         (WebCore::shouldResetFocusNavigationStartingNode):
3568         (WebCore::Document::setFocusNavigationStartingNode):
3569         (WebCore::Document::focusNavigationStartingNode):
3570         (WebCore::Document::setCSSTarget):
3571         (WebCore::Document::nodeChildrenWillBeRemoved):
3572         (WebCore::Document::nodeWillBeRemoved):
3573         (WebCore::fallbackFocusNavigationStartingNodeAfterRemoval):
3574         (WebCore::Document::removeFocusNavigationNodeOfSubtree):
3575         (WebCore::Document::textInserted):
3576         * dom/Document.h:
3577         (WebCore::Document::userActionElements):
3578         * page/EventHandler.cpp:
3579         (WebCore::EventHandler::handleMousePressEvent):
3580         * page/FocusController.cpp:
3581         (WebCore::FocusController::advanceFocusInDocumentOrder):
3582         * page/FrameView.cpp:
3583         (WebCore::FrameView::scrollToAnchor):
3584
3585 2016-06-08  Eric Carlson  <eric.carlson@apple.com>
3586
3587         HTMLMediaElement.prototype.canPlayType accounting for 250-750ms first loading theverge.com
3588         https://bugs.webkit.org/show_bug.cgi?id=158335
3589         <rdar://problem/26615416>
3590
3591         Reviewed by Brent Fulgham.
3592
3593         * WebCore.xcodeproj/project.pbxproj: Add AVFoundationMIMETypeCache.
3594
3595         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.h: Added.
3596         * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm: Added.
3597         (WebCore::AVFoundationMIMETypeCache::AVFoundationMIMETypeCache):
3598         (WebCore::AVFoundationMIMETypeCache::loadTypes):
3599         (WebCore::AVFoundationMIMETypeCache::types):
3600         (WebCore::AVFoundationMIMETypeCache::singleton):
3601
3602         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3603         (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Start MIME type loading.
3604         (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): Use AVFoundationMIMETypeCache.
3605         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Ditto.
3606         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Ditto.
3607         (WebCore::avfMIMETypes): Deleted.
3608
3609         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
3610         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::registerMediaEngine): Start MIME type loading.
3611         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isAvailable): Use AVFoundationMIMETypeCache.
3612         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::getSupportedTypes): Ditto.
3613         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType): Ditto.
3614         (WebCore::mimeTypeCache): Deleted.
3615
3616 2016-06-07  Ryosuke Niwa  <rniwa@webkit.org>
3617
3618         REGRESSION (r201667): ASSERTION FAILED: !m_anchorNode || !editingIgnoresContent(*m_anchorNode)
3619         https://bugs.webkit.org/show_bug.cgi?id=158373
3620         <rdar://problem/26690795>
3621
3622         Reviewed by Brent Fulgham.
3623
3624         The bug was caused by VisibleSelection::toNormalizedRange calling parentAnchoredEquivalent on an orphaned Position.
3625         Fixed it by checking that condition and exiting early since we can't create a Range with a detached node anyway.
3626
3627         Also renamed isNonOrphanedCaretOrRange to isNoneOrOrphaned after negating the semantics for clarity.
3628
3629         Test: editing/selection/selection-in-iframe-removed-crash.html
3630
3631         * editing/EditorCommand.cpp:
3632         (WebCore::valueFormatBlock):
3633         * editing/FrameSelection.cpp:
3634         (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
3635         * editing/InsertLineBreakCommand.cpp:
3636         (WebCore::InsertLineBreakCommand::doApply):
3637         * editing/InsertListCommand.cpp:
3638         (WebCore::InsertListCommand::doApply):
3639         * editing/InsertParagraphSeparatorCommand.cpp:
3640         (WebCore::InsertParagraphSeparatorCommand::doApply):
3641         * editing/InsertTextCommand.cpp:
3642         (WebCore::InsertTextCommand::doApply):
3643         * editing/RemoveFormatCommand.cpp:
3644         (WebCore::RemoveFormatCommand::doApply):
3645         * editing/ReplaceSelectionCommand.cpp:
3646         (WebCore::ReplaceSelectionCommand::doApply):
3647         * editing/SetSelectionCommand.cpp:
3648         (WebCore::SetSelectionCommand::doApply):
3649         (WebCore::SetSelectionCommand::doUnapply):
3650         * editing/TypingCommand.cpp:
3651         (WebCore::TypingCommand::doApply):
3652         * editing/VisibleSelection.cpp:
3653         (WebCore::VisibleSelection::firstRange): Also added a check for isNoneOrOrphaned since this function can hit the same
3654         assertion when the selection end points are orphaned.
3655         (WebCore::VisibleSelection::toNormalizedRange): Fixed the bug.
3656         * editing/VisibleSelection.h:
3657         (WebCore::VisibleSelection::isNoneOrOrphaned): Renamed from isNonOrphanedCaretOrRange and negated the semantics.
3658
3659 2016-06-08  Dean Jackson  <dino@apple.com>
3660
3661         Multiple selectors break keyframes animation
3662         https://bugs.webkit.org/show_bug.cgi?id=158199
3663         <rdar://problem/26652591>
3664
3665         Reviewed by Simon Fraser.
3666
3667         If we came across a duplicate key entry in a keyframe, we
3668         were replacing the existing entry, instead of merging.
3669
3670         Test: animations/duplicate-keys.html
3671
3672         * css/CSSKeyframeRule.h:
3673         (WebCore::StyleKeyframe::setKey): Add a way to set the key of a rule
3674         as a number, rather than going through a string and the CSS parser.
3675         * css/StyleResolver.cpp:
3676         (WebCore::StyleResolver::keyframeStylesForAnimation): Check if the rule
3677         has duplicates, and if it does, merge all the common entries.
3678         * rendering/style/KeyframeList.cpp:
3679         (WebCore::KeyframeList::insert): Now that we've removed duplicates at
3680         the processing time, we should never come across a duplicate while
3681         building this list.
3682
3683 2016-06-08  Ryan Haddad  <ryanhaddad@apple.com>
3684
3685         Rebaseline bindings tests after r201808
3686
3687         Unreviewed test gardening.
3688
3689         * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
3690         (WebCore::JSTestGlobalObject::finishCreation):
3691         * bindings/scripts/test/JS/JSTestGlobalObject.h:
3692
3693 2016-06-08  Lucas Forschler  <lforschler@apple.com>
3694
3695         Teach cmake about libWebKitSystemInterfaceOSX10.12
3696         
3697         Rubber-stamped by Matt Hanson and Alex Christensen.
3698         
3699         * PlatformMac.cmake:
3700
3701 2016-06-08  Rawinder Singh  <rawinder.singh-webkit@cisra.canon.com.au>
3702
3703         [web-animations] Add Animatable, AnimationEffect, KeyframeEffect and Animation interface
3704         https://bugs.webkit.org/show_bug.cgi?id=156096
3705
3706         Reviewed by Dean Jackson.
3707
3708         Adds:
3709         - Animatable interface and implementation of getAnimations in Element
3710         - Interface and implementation for Document getAnimations method.
3711         - AnimationEffect interface and class stub.
3712         - KeyframeEffect interface and constructor implementation.
3713         - 'Animation' interface, constructor and query methods for effect and timeline.
3714         - Remove runtime condition on Web animation interfaces (compile time flag is specified).
3715
3716         Test: webanimations/Document.html
3717
3718         * CMakeLists.txt:
3719         * DerivedSources.make:
3720         * PlatformGTK.cmake:
3721         * WebCore.xcodeproj/project.pbxproj:
3722         * animation/Animatable.idl: Copied from Source/WebCore/animation/DocumentAnimation.idl.
3723         * animation/AnimationEffect.cpp: Copied from Source/WebCore/animation/AnimationTimeline.cpp.
3724         (WebCore::AnimationEffect::AnimationEffect):
3725         (WebCore::AnimationEffect::~AnimationEffect):
3726         (WebCore::AnimationEffect::setAnimation):
3727         (WebCore::AnimationEffect::isCurrent):
3728         (WebCore::AnimationEffect::isInEffect):
3729         * animation/AnimationEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
3730         * animation/AnimationEffect.idl: Copied from Source/WebCore/animation/AnimationTimeline.idl.
3731         * animation/AnimationTimeline.cpp:
3732         (WebCore::AnimationTimeline::destroy):
3733         (WebCore::AnimationTimeline::attachAnimation):
3734         (WebCore::AnimationTimeline::detachAnimation):
3735         * animation/AnimationTimeline.h:
3736         * animation/AnimationTimeline.idl:
3737         * animation/DocumentAnimation.cpp:
3738         (WebCore::DocumentAnimation::timeline):
3739         (WebCore::DocumentAnimation::getAnimations):
3740         (WebCore::DocumentAnimation::addAnimation):
3741         (WebCore::DocumentAnimation::removeAnimation):
3742         * animation/DocumentAnimation.h:
3743         (WebCore::DocumentAnimation::getAnimations):
3744         * animation/DocumentAnimation.idl:
3745         * animation/DocumentTimeline.cpp:
3746         (WebCore::DocumentTimeline::create):
3747         (WebCore::DocumentTimeline::DocumentTimeline):
3748         (WebCore::DocumentTimeline::attach):
3749         (WebCore::DocumentTimeline::detach):
3750         * animation/DocumentTimeline.h:
3751         * animation/DocumentTimeline.idl:
3752         * animation/KeyframeEffect.cpp: Copied from Source/WebCore/animation/DocumentTimeline.cpp.
3753         (WebCore::KeyframeEffect::create):
3754         (WebCore::KeyframeEffect::KeyframeEffect):
3755         (WebCore::KeyframeEffect::~KeyframeEffect):
3756         * animation/KeyframeEffect.h: Copied from Source/WebCore/animation/DocumentTimeline.h.
3757         * animation/KeyframeEffect.idl: Copied from Source/WebCore/animation/AnimationTimeline.idl.
3758         * animation/WebAnimation.cpp: Copied from Source/WebCore/animation/DocumentAnimation.cpp.
3759         (WebCore::WebAnimation::create):
3760         (WebCore::WebAnimation::WebAnimation):
3761         (WebCore::WebAnimation::~WebAnimation):
3762         * animation/WebAnimation.h: Copied from Source/WebCore/animation/DocumentAnimation.h.
3763         * animation/WebAnimation.idl: Copied from Source/WebCore/animation/DocumentTimeline.idl.
3764         * bindings/scripts/CodeGeneratorGObject.pm:
3765         * dom/Element.cpp:
3766         (WebCore::Element::getAnimations):
3767         * dom/Element.h:
3768         * dom/Element.idl:
3769
3770 2016-06-08  Chris Dumez  <cdumez@apple.com>
3771
3772         self.hasOwnProperty() does not work inside Web workers
3773         https://bugs.webkit.org/show_bug.cgi?id=158446
3774         <rdar://problem/26638397>
3775
3776         Reviewed by Geoffrey Garen.
3777
3778         W3C tests for workers were severely broken on WebKit because
3779         self.hasOwnProperty() did not work inside workers. The reason is that
3780         hasOwnProperty() (and other methods like toString()) call toThis() in
3781         StrictMode on thisValue. However, in the case of 'self' in workers,
3782         self was a DedicatedWorkerGlobalScope, which is a JSGlobalObject.
3783         JSGlobalObject::toThis() returns jsUndefined() when called in strict
3784         mode. As a result, we would end up with exceptions such as "undefined
3785         is not an object" when calling self.hasOwnProperty() in workers.
3786
3787         To address the problem, this patch introduces a JSProxy whose proxy
3788         type is PureForwardingProxyType and whose target is the
3789         WorkerGlobalScope. This JSProxy is what we expose to the JavaScript,
3790         instead of the JSWorkerGlobalScope itself. As a result, toThis() now
3791         behaves as expected and self.hasOwnProperty() works inside workers.
3792
3793         This patch greatly improves our pass rate on several W3C tests:
3794         http://w3c-test.org/workers/interfaces.worker: 20 passes -> 50 passes (out of 128)
3795         http://w3c-test.org/IndexedDB/interfaces.worker 0 passes -> 145 passes (out of 156)
3796
3797         Tests: fast/workers/self-hasOwnProperty.html
3798                fast/workers/self-toString.html
3799
3800         * bindings/js/JSWorkerGlobalScopeBase.cpp:
3801         (WebCore::JSWorkerGlobalScopeBase::finishCreation):
3802         (WebCore::JSWorkerGlobalScopeBase::visitChildren):
3803         (WebCore::toJS):
3804         * bindings/js/JSWorkerGlobalScopeBase.h:
3805         (WebCore::JSWorkerGlobalScopeBase::proxy):
3806         * bindings/js/WorkerScriptController.cpp:
3807         (WebCore::WorkerScriptController::initScript):
3808         * bindings/scripts/CodeGeneratorJS.pm:
3809         (GenerateHeader):
3810         (GenerateImplementation):
3811
3812 2016-06-08  Antti Koivisto  <antti@apple.com>
3813
3814         WebKit memory cache doesn't respect Vary header
3815         https://bugs.webkit.org/show_bug.cgi?id=71509
3816         <rdar://problem/26651033>
3817
3818         Reviewed by Sam Weinig.
3819
3820         Implement Vary header support in WebCore memory cache.
3821
3822         The patch moves Vary header code from WebKit2 Network Cache to WebCore and uses it to
3823         verify the headers for CachedResources.
3824
3825         * loader/cache/CachedResource.cpp:
3826         (WebCore::CachedResource::failBeforeStarting):
3827         (WebCore::addAdditionalRequestHeadersToRequest):
3828
3829             Factor into standalone function so we can use it from varyHeaderValuesMatch.
3830
3831         (WebCore::CachedResource::addAdditionalRequestHeaders):
3832         (WebCore::CachedResource::load):
3833         (WebCore::CachedResource::setResponse):
3834
3835             Collect the Vary header values when we receive a response.
3836
3837         (WebCore::CachedResource::responseReceived):
3838         (WebCore::CachedResource::redirectChainAllowsReuse):
3839         (WebCore::CachedResource::varyHeaderValuesMatch):
3840
3841             Test for Vary match.
3842
3843         (WebCore::CachedResource::overheadSize):
3844         * loader/cache/CachedResource.h:
3845         (WebCore::CachedResource::isCacheValidator):
3846         (WebCore::CachedResource::resourceToRevalidate):
3847         * loader/cache/CachedResourceLoader.cpp:
3848         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
3849
3850             Reload on Vary mismatch.
3851
3852         * platform/network/CacheValidation.cpp:
3853         (WebCore::parseCacheControlDirectives):
3854         (WebCore::headerValueForVary):
3855         (WebCore::collectVaryingRequestHeaders):
3856         (WebCore::verifyVaryingRequestHeaders):
3857
3858             Vary header collection and validation code moves here.
3859
3860         * platform/network/CacheValidation.h:
3861
3862 2016-06-08  Commit Queue  <commit-queue@webkit.org>
3863
3864         Unreviewed, rolling out r201800.
3865         https://bugs.webkit.org/show_bug.cgi?id=158518
3866
3867         Missing WebKit2 pieces (Requested by anttik on #webkit).
3868
3869         Reverted changeset:
3870
3871         "WebKit memory cache doesn't respect Vary header"
3872         https://bugs.webkit.org/show_bug.cgi?id=71509
3873         http://trac.webkit.org/changeset/201800
3874
3875 2016-06-06  Antti Koivisto  <antti@apple.com>
3876
3877         WebKit memory cache doesn't respect Vary header
3878         https://bugs.webkit.org/show_bug.cgi?id=71509
3879         <rdar://problem/26651033>
3880
3881         Reviewed by Sam Weinig.
3882
3883         Implement Vary header support in WebCore memory cache.
3884
3885         The patch moves Vary header code from WebKit2 Network Cache to WebCore and uses it to
3886         verify the headers for CachedResources.
3887
3888         * loader/cache/CachedResource.cpp:
3889         (WebCore::CachedResource::failBeforeStarting):
3890         (WebCore::addAdditionalRequestHeadersToRequest):
3891
3892             Factor into standalone function so we can use it from varyHeaderValuesMatch.
3893
3894         (WebCore::CachedResource::addAdditionalRequestHeaders):
3895         (WebCore::CachedResource::load):
3896         (WebCore::CachedResource::setResponse):
3897
3898             Collect the Vary header values when we receive a response.
3899
3900         (WebCore::CachedResource::responseReceived):
3901         (WebCore::CachedResource::redirectChainAllowsReuse):
3902         (WebCore::CachedResource::varyHeaderValuesMatch):
3903
3904             Test for Vary match.
3905
3906         (WebCore::CachedResource::overheadSize):
3907         * loader/cache/CachedResource.h:
3908         (WebCore::CachedResource::isCacheValidator):
3909         (WebCore::CachedResource::resourceToRevalidate):
3910         * loader/cache/CachedResourceLoader.cpp:
3911         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
3912
3913             Reload on Vary mismatch.
3914
3915         * platform/network/CacheValidation.cpp:
3916         (WebCore::parseCacheControlDirectives):
3917         (WebCore::headerValueForVary):
3918         (WebCore::collectVaryingRequestHeaders):
3919         (WebCore::verifyVaryingRequestHeaders):
3920
3921             Vary header collection and validation code moves here.
3922
3923         * platform/network/CacheValidation.h:
3924
3925 2016-06-08  Myles C. Maxfield  <mmaxfield@apple.com>
3926
3927         Extend CSSFontSelector's lifetime to be longer than the Document's lifetime
3928         https://bugs.webkit.org/show_bug.cgi?id=154101
3929
3930         Reviewed by Darin Adler.
3931
3932         Rather than destroying the Document's CSSFontSelector, instead, the object should
3933         live for the lifetime of the document, and it should instead be asked to clear its
3934         contents.
3935
3936         This is important for the CSS Font Loading API, where the identity of objects the
3937         CSSFontSelector references needs to persist throughout the lifetime of the
3938         Document. This patch represents the first step to implementing this correctly.
3939         The second step is for the CSSFontSelector to perform a diff instead of a
3940         wholesale clear of its contents. Once this is done, font loading objects can
3941         survive through a call to Document::clearStyleResolver().
3942
3943         This patch gives the CSSFontSelector two states: building underway and building not
3944         underway. The state is building underway in between calls to clearStyleResolver()
3945         and when the style resolver gets built back up. Otherwise, the state is building
3946         not underway. Because of this new design, creation of all FontFace objects can be
3947         postponed until a state transition from building underway to building not underway.
3948         A subsequent patch will perform the diff at this point. An ASSERT() makes sure that
3949         we never service a font lookup request while Building.
3950
3951         No new tests because there is no behavior change.
3952
3953         * css/CSSFontFaceSet.cpp:
3954         (WebCore::CSSFontFaceSet::clear):
3955         * css/CSSFontSelector.cpp:
3956         (WebCore::CSSFontSelector::buildStarted):
3957         (WebCore::CSSFontSelector::buildCompleted):
3958         (WebCore::CSSFontSelector::addFontFaceRule):
3959         (WebCore::CSSFontSelector::fontRangesForFamily):
3960         (WebCore::CSSFontSelector::CSSFontSelector): Deleted.
3961         (WebCore::CSSFontSelector::clearDocument): Deleted.
3962         * css/CSSFontSelector.h:
3963         * css/StyleResolver.cpp:
3964         (WebCore::StyleResolver::appendAuthorStyleSheets):
3965         * dom/Document.cpp:
3966         (WebCore::Document::Document):
3967         (WebCore::Document::~Document):
3968         (WebCore::Document::clearStyleResolver):
3969         (WebCore::Document::fontSelector): Deleted.
3970         * dom/Document.h:
3971         (WebCore::Document::fontSelector):
3972
3973 2016-06-08  Adam Bergkvist  <adam.bergkvist@ericsson.com>
3974
3975         WebRTC: Imlement MediaEndpointPeerConnection::setLocalDescription()
3976         https://bugs.webkit.org/show_bug.cgi?id=158190
3977
3978         Reviewed by Eric Carlson.
3979
3980         Add implementation for MediaEndpointPeerConnection::setLocalDescription. This function
3981         parses the input SDP, configures the media backend and updates the
3982         RTCPeerConnection state.
3983
3984         This change adds MediaEndpointSessionDescription which is an object representation
3985         of an RTCSessionDescription (which contains an SDP string).
3986
3987         Test: fast/mediastream/RTCPeerConnection-setLocalDescription-offer.html
3988
3989         * CMakeLists.txt:
3990         Add MediaEndpointSessionDescription.
3991         * Modules/mediastream/MediaEndpointPeerConnection.cpp:
3992         (WebCore::hasUnassociatedTransceivers):
3993         (WebCore::MediaEndpointPeerConnection::createOfferTask):
3994         (WebCore::MediaEndpointPeerConnection::setLocalDescription):
3995         (WebCore::MediaEndpointPeerConnection::setLocalDescriptionTask):
3996         Add implementation.
3997         (WebCore::MediaEndpointPeerConnection::localDescription):
3998         (WebCore::MediaEndpointPeerConnection::currentLocalDescription):
3999         (WebCore::MediaEndpointPeerConnection::pendingLocalDescription):
4000         (WebCore::MediaEndpointPeerConnection::localDescriptionTypeValidForState):
4001         (WebCore::MediaEndpointPeerConnection::internalLocalDescription):
4002         (WebCore::MediaEndpointPeerConnection::createRTCSessionDescription):
4003         * Modules/mediastream/MediaEndpointPeerConnection.h:
4004         * Modules/mediastream/MediaEndpointSessionDescription.cpp: Added.
4005         (WebCore::MediaEndpointSessionDescription::create):
4006         (WebCore::MediaEndpointSessionDescription::toRTCSessionDescription):
4007         (WebCore::MediaEndpointSessionDescription::typeString):
4008         (WebCore::MediaEndpointSessionDescription::isLaterThan):
4009         * Modules/mediastream/MediaEndpointSessionDescription.h: Added.
4010         (WebCore::MediaEndpointSessionDescription::~MediaEndpointSessionDescription):
4011         (WebCore::MediaEndpointSessionDescription::type):
4012         (WebCore::MediaEndpointSessionDescription::configuration):
4013         (WebCore::MediaEndpointSessionDescription::MediaEndpointSessionDescription):
4014         * WebCore.xcodeproj/project.pbxproj:
4015         Add MediaEndpointSessionDescription.
4016
4017 2016-06-07  Carlos Garcia Campos  <cgarcia@igalia.com>
4018
4019         [GLIB] Implement hardLinkOrCopyFile() in FileSystemGlib
4020         https://bugs.webkit.org/show_bug.cgi?id=158473
4021
4022         Reviewed by Michael Catanzaro.
4023
4024         It was added in r199230 to be used by IndexedDB blob support, but never implemented for GLib.
4025
4026         * platform/glib/FileSystemGlib.cpp:
4027         (WebCore::hardLinkOrCopyFile):