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