Move RenderObject::shouldRespectImageOrientation to RenderElement.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2016-09-15  Zalan Bujtas  <zalan@apple.com>
2
3         Move RenderObject::shouldRespectImageOrientation to RenderElement.
4         https://bugs.webkit.org/show_bug.cgi?id=162028
5
6         Reviewed by Antti Koivisto.
7
8         Tighten the type for imageSizeForRenderer/canRender so that RenderObject::shouldRespectImageOrientation could
9         be moved to RenderElement.
10
11         No change in functionality.
12
13         * loader/cache/CachedImage.cpp:
14         (WebCore::CachedImage::imageSizeForRenderer):
15         * loader/cache/CachedImage.h:
16         * rendering/RenderElement.cpp:
17         (WebCore::RenderElement::shouldRespectImageOrientation):
18         * rendering/RenderElement.h:
19         * rendering/RenderObject.cpp:
20         (WebCore::RenderObject::shouldRespectImageOrientation): Deleted.
21         * rendering/RenderObject.h:
22         * rendering/style/StyleCachedImage.cpp:
23         (WebCore::StyleCachedImage::canRender):
24         * rendering/style/StyleCachedImage.h:
25         * rendering/style/StyleImage.h:
26         (WebCore::StyleImage::canRender):
27
28 2016-09-15  Anders Carlsson  <andersca@apple.com>
29
30         Fix build.
31
32         * platform/spi/cocoa/PassKitSPI.h:
33
34 2016-09-15  Alex Christensen  <achristensen@webkit.org>
35
36         Use character class table in URLParser
37         https://bugs.webkit.org/show_bug.cgi?id=161997
38
39         Reviewed by Chris Dumez.
40
41         No change in behavior except a performance improvement.
42         
43         Before this change, URLParser took 1.514x as long to run my URL Parsing benchmark as URL::parse
44         with a standard deviation of the ration of the runtimes of 0.063 after 8 runs with each parser.
45         After this change, URLParser took 1.328x as long with a standard deviation of 0.037.
46         This isn't the cleanest data, but it's enough to convince me that this is a significant improvement.
47
48         * platform/URLParser.cpp:
49         (WebCore::isC0Control):
50         (WebCore::isC0ControlOrSpace):
51         (WebCore::isTabOrNewline):
52         (WebCore::isInSimpleEncodeSet):
53         (WebCore::isInDefaultEncodeSet):
54         (WebCore::isInUserInfoEncodeSet):
55         (WebCore::isInvalidDomainCharacter):
56         (WebCore::isSlashQuestionOrHash):
57         (WebCore::shouldPercentEncodeQueryByte):
58         (WebCore::shouldCopyFileURL):
59         (WebCore::isSingleDotPathSegment):
60         (WebCore::URLParser::parse):
61
62 2016-09-15  Keith Miller  <keith_miller@apple.com>
63
64         Pragma out undefined-var-template warnings in JSC for JSObjects that are templatized
65         https://bugs.webkit.org/show_bug.cgi?id=161985
66
67         Reviewed by Alex Christensen.
68
69         Delete unneeded using, which broke the build on newer versions of clang.
70
71         * bridge/objc/WebScriptObject.mm:
72
73 2016-09-15  Alex Christensen  <achristensen@webkit.org>
74
75         URLParser: Check for invalid characters in the host
76         https://bugs.webkit.org/show_bug.cgi?id=162023
77
78         Reviewed by Tim Horton.
79
80         Covered by new API tests.
81
82         * platform/URLParser.cpp:
83         (WebCore::URLParser::failure):
84         (WebCore::URLParser::parseHost):
85
86 2016-09-15  Antti Koivisto  <antti@apple.com>
87
88         Remove some extra spaces.
89
90         * rendering/TextDecorationPainter.cpp:
91         (WebCore::collectStylesForRenderer):
92
93 2016-09-15  Alex Christensen  <achristensen@webkit.org>
94
95         Use efficient iterators in URLParser
96         https://bugs.webkit.org/show_bug.cgi?id=162007
97
98         Reviewed by Tim Horton.
99
100         URLParser used to use StringView::CodePoints::Iterator, which needs to check if
101         the StringView is 8-bit or 16-bit every time it does anything.
102         I wrote a new CodePointIterator template which already knows whether it is iterating
103         8-bit or 16-bit characters, so it does not need to do the checks each time it gets a
104         code point or advances to the next code point.
105
106         No change in behavior except a performance increase.
107         Covered by existing tests.
108
109         * platform/URLParser.cpp:
110         (WebCore::CodePointIterator::CodePointIterator):
111         (WebCore::CodePointIterator::operator==):
112         (WebCore::CodePointIterator::operator!=):
113         (WebCore::CodePointIterator::operator=):
114         (WebCore::CodePointIterator::atEnd):
115         (WebCore::CodePointIterator<LChar>::operator):
116         (WebCore::CodePointIterator<UChar>::operator):
117         (WebCore::isWindowsDriveLetter):
118         (WebCore::shouldCopyFileURL):
119         (WebCore::isPercentEncodedDot):
120         (WebCore::isSingleDotPathSegment):
121         (WebCore::isDoubleDotPathSegment):
122         (WebCore::consumeSingleDotPathSegment):
123         (WebCore::consumeDoubleDotPathSegment):
124         (WebCore::URLParser::failure):
125         (WebCore::URLParser::parse):
126         (WebCore::URLParser::parseAuthority):
127         (WebCore::parseIPv4Number):
128         (WebCore::parseIPv4Host):
129         (WebCore::parseIPv6Host):
130         (WebCore::URLParser::parsePort):
131         (WebCore::URLParser::parseHost):
132         * platform/URLParser.h:
133
134 2016-09-14  Antti Koivisto  <antti@apple.com>
135
136         Move text decoration style computation from RenderObject to TextDecorationPainter
137         https://bugs.webkit.org/show_bug.cgi?id=162004
138
139         Reviewed by Zalan Bujtas.
140
141         It is mostly an implementation detail of TextDecorationPainter.
142
143         * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
144         (AXAttributeStringSetStyle):
145         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
146         (AXAttributeStringSetStyle):
147         * rendering/RenderObject.cpp:
148         (WebCore::decorationColor): Deleted.
149         (WebCore::RenderObject::getTextDecorationColorsAndStyles): Deleted.
150         * rendering/RenderObject.h:
151         * rendering/TextDecorationPainter.cpp:
152         (WebCore::TextDecorationPainter::TextDecorationPainter):
153         (WebCore::TextDecorationPainter::paintTextDecoration):
154         (WebCore::decorationColor):
155         * rendering/TextDecorationPainter.h:
156
157 2016-09-15  Dave Hyatt  <hyatt@apple.com>
158
159         [CSS Parser] Make stylesheets parse using the new parser if the setting is enabled
160         https://bugs.webkit.org/show_bug.cgi?id=162018
161
162         Reviewed by Zalan Bujtas.
163
164         * css/parser/CSSParser.cpp:
165         (WebCore::CSSParserContext::CSSParserContext):
166         (WebCore::CSSParser::parseSheet):
167         * css/parser/CSSParserMode.h:
168
169 2016-09-15  Fujii Hironori  <Hironori.Fujii@sony.com>
170
171         [CMake] Refactor GENERATE_BINDINGS
172         https://bugs.webkit.org/show_bug.cgi?id=161854
173
174         Reviewed by Gyuyoung Kim.
175
176         * CMakeLists.txt: Changed the arguments of GENERATE_BINDINGS to
177         new style.  Removed add_custom_command of preprocess-idls.pl which
178         is moved to GENERATE_BINDINGS.  Moved IDL_ATTRIBUTES_FILE into
179         GENERATE_BINDINGS.
180
181 2016-09-14  Anders Carlsson  <andersca@apple.com>
182
183         Add CSS -webkit-appearance property for Apple Pay buttons
184         https://bugs.webkit.org/show_bug.cgi?id=161986
185         rdar://problem/27459216
186
187         Reviewed by Dean Jackson.
188
189         Add a new -webkit-appearance property, "-apple-pay-button".
190         Also, add two properties, "-apple-pay-button-type" and "-apple-pay-button-style".
191
192         * WebCore.xcodeproj/project.pbxproj:
193         Add RenderThemeCocoa.h and RenderThemeCocoa.mm.
194
195         * css/CSSComputedStyleDeclaration.cpp:
196         (WebCore::ComputedStyleExtractor::propertyValue):
197         Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.
198
199         * css/CSSPrimitiveValueMappings.h:
200         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
201         (WebCore::CSSPrimitiveValue::operator ApplePayButtonStyle):
202         (WebCore::CSSPrimitiveValue::operator ApplePayButtonType):
203         Add ApplePayButtonStyle and ApplePayButtonType conversion routines.
204
205         * css/CSSPropertyNames.in:
206         Add -apple-pay-button-style and -apple-pay-button-type.
207
208         * css/CSSValueKeywords.in:
209         Add CSS values.
210
211         * css/parser/CSSParser.cpp:
212         (WebCore::isValidKeywordPropertyAndValue):
213         Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.
214
215         * css/parser/CSSParserFastPaths.cpp:
216         (WebCore::CSSParserFastPaths::isKeywordPropertyID):
217         Handle CSSPropertyApplePayButtonStyle and CSSPropertyApplePayButtonType.
218
219         (WebCore::isAppleLegacyCSSPropertyKeyword):
220         New function that returns whether the CSS property should be rewritten to -webkit-.
221         We want to rewrite -apple- but not -apple-pay-.
222
223         (WebCore::cssPropertyID):
224         Use the newly added isAppleLegacyCSSPropertyKeyword.
225
226         (WebCore::isAppleLegacyCSSValueKeyword):
227         Check for "-apple-pay-" in addition to "-apple-system-".
228
229         * platform/ThemeTypes.h:
230         Add ApplePayButtonPart.
231
232         * platform/spi/cocoa/PassKitSPI.h:
233         Add PKDrawApplePayButton declaration.
234
235         * rendering/RenderTheme.cpp:
236         (WebCore::RenderTheme::adjustStyle):
237         Handle ApplePayButtonPart.
238
239         (WebCore::RenderTheme::paint):
240         Handle ApplePayButtonPart.
241
242         * rendering/RenderTheme.h:
243         (WebCore::RenderTheme::adjustApplePayButtonStyle):
244         (WebCore::RenderTheme::paintApplePayButton):
245         Add new functions.
246
247         * rendering/RenderThemeCocoa.h: Added.
248         * rendering/RenderThemeCocoa.mm: Added.
249         (WebCore::RenderThemeCocoa::adjustApplePayButtonStyle):
250         Adjust the minimum width and minimum height accordingly.
251
252         (WebCore::toPKPaymentButtonStyle):
253         (WebCore::toPKPaymentButtonType):
254         Helper functions that convert our WebCore types to PK types.
255
256         (WebCore::RenderThemeCocoa::paintApplePayButton):
257         Call PKDrawApplePayButton.
258
259         * rendering/RenderThemeIOS.h:
260         * rendering/RenderThemeMac.h:
261         Inherit from RenderThemeCocoa.
262
263         * rendering/style/RenderStyle.h:
264         (WebCore::RenderStyle::applePayButtonStyle):
265         (WebCore::RenderStyle::applePayButtonType):
266         (WebCore::RenderStyle::setApplePayButtonStyle):
267         (WebCore::RenderStyle::setApplePayButtonType):
268         (WebCore::RenderStyle::initialApplePayButtonStyle):
269         (WebCore::RenderStyle::initialApplePayButtonType):
270         * rendering/style/RenderStyleConstants.h:
271         * rendering/style/StyleRareInheritedData.cpp:
272         (WebCore::StyleRareInheritedData::StyleRareInheritedData):
273         (WebCore::StyleRareInheritedData::operator==):
274         * rendering/style/StyleRareInheritedData.h:
275         Add new style members for the button style and button type properties.
276
277 2016-09-15  Sergio Villar Senin  <svillar@igalia.com>
278
279         [css-grid] Implement fit-content track size
280         https://bugs.webkit.org/show_bug.cgi?id=161379
281
282         Reviewed by Manuel Rego Casasnovas.
283
284         This implements the new <fit-content> track size which is defined as follows: "Represents
285         the formula min(max-content, max(auto, argument)), which is calculated similar to auto
286         (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is
287         greater than the auto minimum."
288
289         From the parsing POV fit-content was implemented as a new type of function which only takes
290         one argument. That forced us to refactor some code because minmax() was the only allowed
291         function for <track-size>s so far.
292
293         The implementation key is a new attribute in GridTrack called growthLimitCap which is
294         precisely the single attribute of fit-content(). Some parts of the track sizing algorithm
295         were adapted to this change like for example the sorting of tracks by growth potential (we
296         need to consider the caps).
297
298         Tests: fast/css-grid-layout/fit-content-columns.html
299         fast/css-grid-layout/fit-content-rows.html
300
301         * css/CSSComputedStyleDeclaration.cpp:
302         (WebCore::specifiedValueForGridTrackSize): Added support for fit-content sizes.
303         * css/StyleBuilderConverter.h:
304         (WebCore::StyleBuilderConverter::createGridTrackSize): Added support for fit-content sizes.
305         * css/parser/CSSParser.cpp:
306         (WebCore::isGridTrackFixedSized): Added support for fit-content sizes.
307         (WebCore::CSSParser::parseGridTrackSize): Added support for parsing fit-content() functions.
308         * css/parser/CSSPropertyParser.cpp: Added support for parsing fit-content() functions so
309         it'll be available once we switch to the new parser.
310         * rendering/RenderGrid.cpp:
311         (WebCore::GridTrack::baseSize): Just return a LayoutUnit, the return value optimization will
312         keep it fast in any case.
313         (WebCore::GridTrack::growthLimit): Ditto.
314         (WebCore::GridTrack::setGrowthLimit): Added an ASSERT to check that the growth limit is
315         never higher than the cap.
316         (WebCore::GridTrack::infiniteGrowthPotential):
317         (WebCore::GridTrack::plannedSize): Just return a LayoutUnit, the return value optimization will
318         keep it fast in any case.
319         (WebCore::GridTrack::tempSize): Just return a LayoutUnit, the return value optimization will
320         keep it fast in any case.
321         (WebCore::GridTrack::setTempSize): Added as we no longer return a reference in tempSize().
322         (WebCore::GridTrack::growTempSize): New utility function which increases the tempSize.
323         (WebCore::GridTrack::setInfinitelyGrowable):
324         (WebCore::GridTrack::setGrowthLimitCap): Added.
325         (WebCore::GridTrack::growthLimitCap): Ditto.
326         (WebCore::GridTrack::growthLimitIsInfinite): Made private.
327         (WebCore::RenderGrid::GridSizingData::freeSpace): Renamed from freeSpaceForDirection.
328         (WebCore::RenderGrid::GridSizingData::availableSpace): We now cache the available space as
329         it is used to compute relative (percentage) sizes.
330         (WebCore::RenderGrid::GridSizingData::setAvailableSpace): Ditto.
331         (WebCore::RenderGrid::GridSizingData::setFreeSpace): Renamed from setFreeSpaceForDirection.
332         (WebCore::RenderGrid::computeTrackSizesForDirection): Receives the available space instead
333         of the free space.
334         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Properly initialize free and available
335         spaces.
336         (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
337         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Use available space to initialize the
338         track sizes. Also use sizingOperation to decide whether or not sizes are indefinite. Last
339         but not least, added support for fit-content tracks.
340         (WebCore::RenderGrid::computeUsedBreadthOfMinLength): Pass a GridTrackSize instead of a GridLength.
341         (WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Ditto.
342         (WebCore::RenderGrid::gridTrackSize): Added support for fit-content.
343         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Ditto.
344         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Ditto.
345         (WebCore::trackSizeForTrackSizeComputationPhase):
346         (WebCore::sortByGridTrackGrowthPotential): Reworked the function so it properly sorts tracks
347         with growth limit caps to support fit-content().
348         (WebCore::clampGrowthShareIfNeeded): Clamps the given growthShare passed as argument to the
349         track growth limit cap.
350         (WebCore::RenderGrid::distributeSpaceToTracks): Use the new setTempSize() method. Also sort
351         the selected tracks to grow over growth limits in order to respect the track caps eventually
352         set by fit-content (otherwise those tracks could indefinitely grow over the specified value).
353         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Use the new defined functions.
354         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Use freeSpace().
355         (WebCore::RenderGrid::populateGridPositionsForDirection): Ditto.
356         (WebCore::GridTrack::infinitelyGrowable): Deleted.
357         (WebCore::RenderGrid::GridSizingData::freeSpaceForDirection): Deleted.
358         (WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection): Deleted.
359         (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Deleted.
360         * rendering/RenderGrid.h: Changed the signature of some methods. Moved
361         TrackSizeComputationPhase out of the RenderGrid class.
362         * rendering/style/GridTrackSize.h:
363         (WebCore::GridTrackSize::GridTrackSize): Added some extra documentation. Added a new
364         attribute to the constructor to support fit-content GridTrackSizes.
365         (WebCore::GridTrackSize::fitContentTrackBreadth): New method which returns the growth limit
366         cap set by fit-content().
367         (WebCore::GridTrackSize::minTrackBreadth):
368         (WebCore::GridTrackSize::isFitContent): Added.
369         (WebCore::GridTrackSize::length): Deleted.
370         (WebCore::GridTrackSize::isPercentage): Deleted.
371
372 2016-09-15  Sergio Villar Senin  <svillar@igalia.com>
373
374         [css-grid] Fix a dangling reference
375         https://bugs.webkit.org/show_bug.cgi?id=161739
376
377         Reviewed by Alexey Proskuryakov.
378
379         The code was trying to get a reference to a private attribute of a temporary object returned
380         by gridTrackSize().
381
382         * rendering/RenderGrid.cpp:
383         (WebCore::RenderGrid::assumedRowsSizeForOrthogonalChild):
384
385 2016-09-15  Sergio Villar Senin  <svillar@igalia.com>
386
387         Unreviewed, rolling out r205966.
388
389         Triggered some assertions
390
391         Reverted changeset:
392
393         "[css-grid] Implement fit-content track size"
394         https://bugs.webkit.org/show_bug.cgi?id=161379
395         http://trac.webkit.org/changeset/205966
396
397 2016-09-15  Zalan Bujtas  <zalan@apple.com>
398
399         Cleanup RenderLayer::shouldBeNormalFlowOnly
400         https://bugs.webkit.org/show_bug.cgi?id=161981
401
402         Reviewed by Simon Fraser.
403
404         This patch changes the logic of figuring about if a particular layer is normal flow only by simply checking
405         if the layer creates a stacking context. If it does, we assume that it can't be a normal flow layer anymore.
406         This patch slightly changes behaviour by making layers with isolation and reflection to be non normal flow layers anymore.    
407
408         Covered by existing testcases.
409
410         * rendering/RenderLayer.cpp:
411         (WebCore::RenderLayer::calculateClipRects):
412
413 2016-09-07  Sergio Villar Senin  <svillar@igalia.com>
414
415         [css-grid] Implement fit-content track size
416         https://bugs.webkit.org/show_bug.cgi?id=161379
417
418         Reviewed by Manuel Rego Casasnovas.
419
420         This implements the new <fit-content> track size which is defined as follows: "Represents
421         the formula min(max-content, max(auto, argument)), which is calculated similar to auto
422         (i.e. minmax(auto, max-content)), except that the track size is clamped at argument if it is
423         greater than the auto minimum."
424
425         From the parsing POV fit-content was implemented as a new type of function which only takes
426         one argument. That forced us to refactor some code because minmax() was the only allowed
427         function for <track-size>s so far.
428
429         The implementation key is a new attribute in GridTrack called growthLimitCap which is
430         precisely the single attribute of fit-content(). Some parts of the track sizing algorithm
431         were adapted to this change like for example the sorting of tracks by growth potential (we
432         need to consider the caps).
433
434         Tests: fast/css-grid-layout/fit-content-columns.html
435         fast/css-grid-layout/fit-content-rows.html
436
437         * css/CSSComputedStyleDeclaration.cpp:
438         (WebCore::specifiedValueForGridTrackSize): Added support for fit-content sizes.
439         * css/StyleBuilderConverter.h:
440         (WebCore::StyleBuilderConverter::createGridTrackSize): Added support for fit-content sizes.
441         * css/parser/CSSParser.cpp:
442         (WebCore::isGridTrackFixedSized): Added support for fit-content sizes.
443         (WebCore::CSSParser::parseGridTrackSize): Added support for parsing fit-content() functions.
444         * css/parser/CSSPropertyParser.cpp: Added support for parsing fit-content() functions so
445         it'll be available once we switch to the new parser.
446         * rendering/RenderGrid.cpp:
447         (WebCore::GridTrack::baseSize): Just return a LayoutUnit, the return value optimization will
448         keep it fast in any case.
449         (WebCore::GridTrack::growthLimit): Ditto.
450         (WebCore::GridTrack::setGrowthLimit): Added an ASSERT to check that the growth limit is
451         never higher than the cap.
452         (WebCore::GridTrack::infiniteGrowthPotential):
453         (WebCore::GridTrack::plannedSize): Just return a LayoutUnit, the return value optimization will
454         keep it fast in any case.
455         (WebCore::GridTrack::tempSize): Just return a LayoutUnit, the return value optimization will
456         keep it fast in any case.
457         (WebCore::GridTrack::setTempSize): Added as we no longer return a reference in tempSize().
458         (WebCore::GridTrack::growTempSize): New utility function which increases the tempSize.
459         (WebCore::GridTrack::setInfinitelyGrowable):
460         (WebCore::GridTrack::setGrowthLimitCap): Added.
461         (WebCore::GridTrack::growthLimitCap): Ditto.
462         (WebCore::GridTrack::growthLimitIsInfinite): Made private.
463         (WebCore::RenderGrid::GridSizingData::freeSpace): Renamed from freeSpaceForDirection.
464         (WebCore::RenderGrid::GridSizingData::availableSpace): We now cache the available space as
465         it is used to compute relative (percentage) sizes.
466         (WebCore::RenderGrid::GridSizingData::setAvailableSpace): Ditto.
467         (WebCore::RenderGrid::GridSizingData::setFreeSpace): Renamed from setFreeSpaceForDirection.
468         (WebCore::RenderGrid::computeTrackSizesForDirection): Receives the available space instead
469         of the free space.
470         (WebCore::RenderGrid::computeIntrinsicLogicalWidths): Properly initialize free and available
471         spaces.
472         (WebCore::RenderGrid::computeIntrinsicLogicalHeight): Ditto.
473         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks): Use available space to initialize the
474         track sizes. Also use sizingOperation to decide whether or not sizes are indefinite. Last
475         but not least, added support for fit-content tracks.
476         (WebCore::RenderGrid::computeUsedBreadthOfMinLength): Pass a GridTrackSize instead of a GridLength.
477         (WebCore::RenderGrid::computeUsedBreadthOfMaxLength): Ditto.
478         (WebCore::RenderGrid::gridTrackSize): Added support for fit-content.
479         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions): Ditto.
480         (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems): Ditto.
481         (WebCore::trackSizeForTrackSizeComputationPhase):
482         (WebCore::sortByGridTrackGrowthPotential): Reworked the function so it properly sorts tracks
483         with growth limit caps to support fit-content().
484         (WebCore::clampGrowthShareIfNeeded): Clamps the given growthShare passed as argument to the
485         track growth limit cap.
486         (WebCore::RenderGrid::distributeSpaceToTracks): Use the new setTempSize() method. Also sort
487         the selected tracks to grow over growth limits in order to respect the track caps eventually
488         set by fit-content (otherwise those tracks could indefinitely grow over the specified value).
489         (WebCore::RenderGrid::tracksAreWiderThanMinTrackBreadth): Use the new defined functions.
490         (WebCore::RenderGrid::applyStretchAlignmentToTracksIfNeeded): Use freeSpace().
491         (WebCore::RenderGrid::populateGridPositionsForDirection): Ditto.
492         (WebCore::GridTrack::infinitelyGrowable): Deleted.
493         (WebCore::RenderGrid::GridSizingData::freeSpaceForDirection): Deleted.
494         (WebCore::RenderGrid::GridSizingData::setFreeSpaceForDirection): Deleted.
495         (WebCore::RenderGrid::trackSizeForTrackSizeComputationPhase): Deleted.
496         * rendering/RenderGrid.h: Changed the signature of some methods. Moved
497         TrackSizeComputationPhase out of the RenderGrid class.
498         * rendering/style/GridTrackSize.h:
499         (WebCore::GridTrackSize::GridTrackSize): Added some extra documentation. Added a new
500         attribute to the constructor to support fit-content GridTrackSizes.
501         (WebCore::GridTrackSize::fitContentTrackBreadth): New method which returns the growth limit
502         cap set by fit-content().
503         (WebCore::GridTrackSize::minTrackBreadth):
504         (WebCore::GridTrackSize::isFitContent): Added.
505         (WebCore::GridTrackSize::length): Deleted.
506         (WebCore::GridTrackSize::isPercentage): Deleted.
507
508 2016-09-15  Alejandro G. Castro  <alex@igalia.com>
509
510         Fix build warnings in the mediastream code
511         https://bugs.webkit.org/show_bug.cgi?id=161957
512
513         Reviewed by Philippe Normand.
514
515         * platform/mediastream/MediaConstraints.cpp:
516         (WebCore::MediaConstraint::create): Added assertion and mock return.
517         * platform/mediastream/RealtimeMediaSourceSupportedConstraints.cpp:
518         (WebCore::RealtimeMediaSourceSupportedConstraints::nameForConstraint):
519         Added assertion and mock return.
520         (WebCore::RealtimeMediaSourceSupportedConstraints::supportsConstraint):
521         Added assertion and mock return.
522
523 2016-09-15  Youenn Fablet  <youenn@apple.com>
524
525         Rebase binding tests after r205953
526         https://bugs.webkit.org/show_bug.cgi?id=162012
527
528         Unreviewed.
529
530         * bindings/scripts/test/JS/JSTestNode.cpp:
531         (WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
532         (WebCore::jsTestNodePrototypeFunctionTestWorkerPromisePromise):
533         * bindings/scripts/test/JS/JSTestObj.cpp:
534         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
535         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
536         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
537         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
538         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
539         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
540         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
541         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
542         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
543         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
544         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
545         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
546         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
547         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
548         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
549         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
550
551 2016-09-15  Alejandro G. Castro  <alex@igalia.com>
552
553         [WebRTC][OpenWebRTC] crash in maybeHandleChangeMutedState
554         https://bugs.webkit.org/show_bug.cgi?id=161619
555
556         Added OpenWebRTC support to the RealtimeMediaSource mock class.
557
558         Reviewed by Eric Carlson.
559
560         Fixed tests.
561
562         * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
563         (WebCore::RealtimeMediaSourceOwr::RealtimeMediaSourceOwr): Allowed
564         inheritance of the class, required to use it when creating the
565         mock class. Added a new constructor to create the class with null
566         mediastream.
567         * platform/mock/MockRealtimeMediaSource.cpp:
568         (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource): Use
569         the new BaseRealtimeMediaSourceClass in the constructor.
570         * platform/mock/MockRealtimeMediaSource.h: Added a new
571         BaseRealtimeMediaSourceClass defined using the
572         RealtimeMediaSourceOwr class for OpenWebRTC platform.
573
574 2016-09-15  Sergio Villar Senin  <svillar@igalia.com>
575
576         [css-grid] Fix intrinsic size computation with flexible sized tracks
577         https://bugs.webkit.org/show_bug.cgi?id=161903
578
579         Reviewed by Manuel Rego Casasnovas.
580
581         This is fixing a regression added in r192154. When computing the min content size of a grid
582         container (min preferred logical width) we should not take into account the fr tracks. As
583         stated in the early versions of the spec that size is the sum of the tracks' base sizes
584         before running the maximize tracks step.
585
586         That regression was causing sizing issues in grids with fr tracks both when under
587         min|max-content constrains and also when used as grid items (in nested grids).
588
589         * rendering/RenderGrid.cpp:
590         (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
591
592 2016-09-13  Sergio Villar Senin  <svillar@igalia.com>
593
594         [css-grid] Too many gaps with trailing collapsing tracks
595         https://bugs.webkit.org/show_bug.cgi?id=161905
596
597         Reviewed by Darin Adler.
598
599         The total number and size of gaps were incorrectly computed whenever there were trailing
600         collapsed tracks (with collapsed gaps). The problem was that we were trying to optimize too
601         much the amount of hash table queries required to know the gaps between two lines. We were
602         considering that a gap always exist between 2 consecutive tracks if the first one is not
603         empty. That's generally true (for both NOTEMPTY|NOTEMPTY and NOTEMPTY|EMPTY+|NOTEMPTY
604         sequences) but not for all the cases (NOTEMPTY|EMPTY+).
605
606         * rendering/RenderGrid.cpp:
607         (WebCore::RenderGrid::guttersSize):
608
609 2016-09-15  Youenn Fablet  <youenn@apple.com>
610
611         callPromiseFunction should be made usable for custom binding code
612         https://bugs.webkit.org/show_bug.cgi?id=161961
613
614         Reviewed by Darin Adler.
615
616         Covered by updated test.
617
618         * bindings/js/JSDOMBinding.h:
619         (WebCore::castThisValue): Utility function to cast this value to a specific type.
620         * bindings/js/JSDOMPromise.h:
621         (WebCore::callPromiseFunction): Updated to take real promise function as a template parameter
622         for improved efficiency. Added workerMode template parameter.
623         (WebCore::bindingPromiseFunctionAdapter): Function signature adaptor.
624         * bindings/js/JSMediaDevicesCustom.cpp:
625         (WebCore::JSMediaDevicesGetUserMediaPromiseFunction):
626         (WebCore::JSMediaDevices::getUserMedia): Making use of callPromiseFunction to properly handle exceptions.
627         * bindings/scripts/CodeGeneratorJS.pm:
628         (GenerateImplementation): Updated to use template parameter.
629         * bindings/scripts/test/JS/JSTestNode.cpp:
630         (WebCore::jsTestNodePrototypeFunctionTestWorkerPromise):
631         (WebCore::jsTestNodePrototypeFunctionTestWorkerPromisePromise):
632         * bindings/scripts/test/JS/JSTestObj.cpp:
633         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunction):
634         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument):
635         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithException):
636         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument):
637         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1):
638         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2):
639         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunction):
640         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithException):
641         * bindings/scripts/test/TestNode.idl: Adding Worker promise binding test.
642
643 2016-09-14  Jiewen Tan  <jiewen_tan@apple.com>
644
645         WebCrypto algorithms should be exposed via KeyAlgorithm dictionary
646         https://bugs.webkit.org/show_bug.cgi?id=128748
647         <rdar://problem/27359438>
648
649         Reviewed by Brent Fulgham and Chris Dumez.
650
651         Replace custom CryptoAlgorithmBuilder/buildAlgorithmDescription with KeyAlgorithm dictionary which is
652         defined by the spec: https://www.w3.org/TR/WebCryptoAPI/#key-algorithm-dictionary. Moreover, mark
653         CryptoKey.usages as CachedAttribute.
654
655         Tests: crypto/subtle/crypto-key-algorithm-gc.html
656                crypto/subtle/crypto-key-usages-gc.html
657
658         * PlatformEfl.cmake:
659         * PlatformGTK.cmake:
660         * PlatformMac.cmake:
661         Remove CryptoAlgorithmDescriptionBuilder.cpp.
662         * WebCore.xcodeproj/project.pbxproj:
663         * bindings/js/JSCryptoAlgorithmBuilder.cpp:
664         (WebCore::JSCryptoAlgorithmBuilder::add):
665         (WebCore::JSCryptoAlgorithmBuilder::createEmptyClone): Deleted.
666         * bindings/js/JSCryptoAlgorithmBuilder.h:
667         * bindings/js/JSCryptoKeyCustom.cpp:
668         (WebCore::JSCryptoKey::algorithm):
669         Get rid of dependency on CryptoAlgorithmDescriptionBuilder.
670         * crypto/CryptoAlgorithmDescriptionBuilder.cpp: Removed.
671         * crypto/CryptoAlgorithmDescriptionBuilder.h: Removed.
672         Replace it with KeyAlgorithm.
673         * crypto/CryptoKey.cpp:
674         (WebCore::CryptoKey::CryptoKey):
675         (WebCore::CryptoKey::buildAlgorithmDescription): Deleted.
676         * crypto/CryptoKey.h:
677         (WebCore::KeyAlgorithm::KeyAlgorithm):
678         (WebCore::KeyAlgorithm::~KeyAlgorithm):
679         (WebCore::CryptoKey::algorithmIdentifier):
680         * crypto/CryptoKey.idl:
681         Add KeyAlgorithm dictionary which is returned via CryptoKey.buildAlgorithm() method,
682         and rename m_algorithm to m_algorithmIdentifier to distingush it with newly
683         added KeyAlgorithm dictionary.
684         * crypto/gnutls/CryptoKeyRSAGnuTLS.cpp:
685         (WebCore::buildAlgorithm):
686         (WebCore::CryptoKeyRSA::buildAlgorithmDescription): Deleted.
687         * crypto/keys/CryptoKeyAES.cpp:
688         (WebCore::CryptoKeyAES::buildAlgorithm):
689         (WebCore::CryptoKeyAES::buildAlgorithmDescription): Deleted.
690         * crypto/keys/CryptoKeyAES.h:
691         (WebCore::AesKeyAlgorithm::AesKeyAlgorithm):
692         (WebCore::AesKeyAlgorithm::~AesKeyAlgorithm):
693         * crypto/keys/CryptoKeyHMAC.cpp:
694         (WebCore::CryptoKeyHMAC::buildAlgorithm):
695         (WebCore::CryptoKeyHMAC::buildAlgorithmDescription): Deleted.
696         * crypto/keys/CryptoKeyHMAC.h:
697         (WebCore::HmacKeyAlgorithm::HmacKeyAlgorithm):
698         (WebCore::HmacKeyAlgorithm::~HmacKeyAlgorithm):
699         * crypto/keys/CryptoKeyRSA.h:
700         (WebCore::RsaKeyAlgorithm::RsaKeyAlgorithm):
701         (WebCore::RsaKeyAlgorithm::~RsaKeyAlgorithm):
702         (WebCore::RsaHashedKeyAlgorithm::RsaHashedKeyAlgorithm):
703         (WebCore::RsaHashedKeyAlgorithm::~RsaHashedKeyAlgorithm):
704         * crypto/mac/CryptoKeyRSAMac.cpp:
705         (WebCore::CryptoKeyRSA::buildAlgorithm):
706         (WebCore::CryptoKeyRSA::buildAlgorithmDescription): Deleted.
707
708 2016-09-14  Chris Dumez  <cdumez@apple.com>
709
710         REGRESSION (r205670): ASSERTION FAILED: methodTable(vm)->toThis(this, exec, NotStrictMode) == this
711         https://bugs.webkit.org/show_bug.cgi?id=161982
712
713         Reviewed by Saam Barati.
714
715         We no longer need a custom [[SetPrototypeOf]] anymore as JSProxy::setPrototypeOf()
716         no longer forwards the call to its target.
717
718         No new layout tests because the behavior only changes in the context of the JSC
719         tests (which were updated in this patch).
720
721         * bindings/js/JSDOMWindowCustom.cpp:
722         (WebCore::JSDOMWindow::setPrototype): Deleted.
723         * page/DOMWindow.idl:
724
725 2016-09-14  Wenson Hsieh  <wenson_hsieh@apple.com>
726
727         Media controls behave strangely when changing media sources
728         https://bugs.webkit.org/show_bug.cgi?id=161914
729         <rdar://problem/28227805>
730
731         Reviewed by Tim Horton.
732
733         Addresses media controls flickering while changing the source of a media element. To accomplish this, we make
734         the following changes to the media controls main content heuristic:
735
736         - Prevent elements that are not mostly within the mainframe rect (or elements with empty rects) from showing
737           media controls. Many websites that rely on same document navigation will move videos offscreen when navigating
738           to a section of their site that does not play media. Without this check, we would not know to hide a video
739           element on certain popular websites that use this technique, since the video has been interacted with in the
740           past.
741
742         - Rather than check whether a media element currently has video/audio sources, check whether it has ever had
743           audio. Many websites will use the same media element across different videos and change only the source, and
744           we should not prevent a media element from having media controls on grounds of having no audio or video in
745           this case.
746
747         - Rather than add user gesture and playback behavior restrictions before dispatching an ended event, add only
748           the gesture restriction immediately, and add the playback restriction after waiting for a grace period only if
749           the user has not interacted with the video since ending, and the video is not currently playing or about to
750           play. This gives the user a chance to interact with the controls when a video ends, but also allows the page
751           to load or begin playing a new video with the same media element without thrashing media control state.
752
753         Adds 3 new API tests.
754
755         * html/HTMLMediaElement.cpp:
756         (WebCore::HTMLMediaElement::HTMLMediaElement):
757         (WebCore::HTMLMediaElement::~HTMLMediaElement):
758         (WebCore::HTMLMediaElement::mediaPlayerActiveSourceBuffersChanged):
759         (WebCore::HTMLMediaElement::seekWithTolerance):
760         (WebCore::HTMLMediaElement::beginScrubbing):
761         (WebCore::HTMLMediaElement::addBehaviorRestrictionsOnEndIfNecessary):
762         (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged):
763         (WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired):
764         * html/HTMLMediaElement.h:
765         (WebCore::HTMLMediaElement::hasEverHadAudio):
766         (WebCore::HTMLMediaElement::hasEverHadVideo):
767         * html/MediaElementSession.cpp:
768         (WebCore::MediaElementSession::canShowControlsManager):
769         (WebCore::isElementRectMostlyInMainFrame):
770         * platform/graphics/MediaPlayer.h:
771         (WebCore::MediaPlayerClient::mediaPlayerActiveSourceBuffersChanged):
772         * platform/graphics/MediaPlayerPrivate.h:
773         (WebCore::MediaPlayerPrivateInterface::notifyActiveSourceBuffersChanged):
774         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
775         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
776         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::notifyActiveSourceBuffersChanged):
777         * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
778         (WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
779         (WebCore::MediaSourcePrivateAVFObjC::sourceBufferPrivateDidChangeActiveState):
780
781 2016-09-14  Eric Carlson  <eric.carlson@apple.com>
782
783         [MediaStream] Minor cleanup
784         https://bugs.webkit.org/show_bug.cgi?id=161976
785
786         Reviewed by Youenn Fablet and Dean Jackson.
787
788         No new tests, no behavior change.
789
790         * CMakeLists.txt:
791         * DerivedSources.make:
792         * Modules/mediastream/CaptureDeviceInfo.h: Removed.
793         * Modules/mediastream/CaptureDeviceManager.cpp: Removed.
794         * Modules/mediastream/CaptureDeviceManager.h: Removed.
795         * Modules/mediastream/MediaDevicesRequest.cpp:
796         (WebCore::MediaDevicesRequest::didCompletePermissionCheck):
797         (WebCore::MediaDevicesRequest::didCompleteTrackSourceInfoRequest): Deleted.
798         (WebCore::MediaDevicesRequest::requestOrigin): Deleted.
799         * Modules/mediastream/MediaDevicesRequest.h:
800         * Modules/mediastream/MediaStreamTrackSourcesCallback.h: Removed.
801         * Modules/mediastream/MediaStreamTrackSourcesCallback.idl: Removed.
802         * Modules/mediastream/SourceInfo.cpp: Removed.
803         * Modules/mediastream/SourceInfo.h: Removed.
804         * Modules/mediastream/SourceInfo.idl: Removed.
805         * WebCore.xcodeproj/project.pbxproj:
806         * platform/mediastream/CaptureDevice.h: Copied from Source/WebCore/Modules/mediastream/CaptureDeviceInfo.h.
807         (WebCore::CaptureDevice::CaptureDevice):
808         (WebCore::CaptureDevice::persistentId):
809         (WebCore::CaptureDevice::label):
810         (WebCore::CaptureDevice::groupId):
811         (WebCore::CaptureDevice::kind):
812         (WebCore::CaptureSessionInfo::~CaptureSessionInfo): Deleted.
813         (WebCore::CaptureSessionInfo::supportsVideoSize): Deleted.
814         (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions): Deleted.
815         * platform/mediastream/CaptureDeviceManager.cpp: Copied from Source/WebCore/Modules/mediastream/CaptureDeviceManager.cpp.
816         (CaptureDeviceManager::getSourcesInfo):
817         * platform/mediastream/CaptureDeviceManager.h: Copied from Source/WebCore/Modules/mediastream/CaptureDeviceManager.h.
818         (WebCore::CaptureSessionInfo::~CaptureSessionInfo):
819         (WebCore::CaptureSessionInfo::supportsVideoSize):
820         (WebCore::CaptureSessionInfo::bestSessionPresetForVideoDimensions):
821         * platform/mediastream/MediaStreamTrackSourcesRequestClient.h: Removed.
822         * platform/mediastream/RealtimeMediaSourceCenter.h:
823         * platform/mediastream/mac/AVCaptureDeviceManager.h:
824         * platform/mediastream/mac/AVCaptureDeviceManager.mm:
825         (WebCore::AVCaptureDeviceManager::getSourcesInfo):
826         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
827         (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamDevices):
828         (WebCore::RealtimeMediaSourceCenterMac::getMediaStreamTrackSources): Deleted.
829         (WebCore::RealtimeMediaSourceCenterMac::sourceWithUID): Deleted.
830         * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
831         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
832         (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamDevices):
833         (WebCore::RealtimeMediaSourceCenterOwr::getMediaStreamTrackSources): Deleted.
834         (WebCore::RealtimeMediaSourceCenterOwr::sourceWithUID): Deleted.
835         * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.h:
836         * platform/mock/MockRealtimeMediaSource.cpp:
837         (WebCore::MockRealtimeMediaSource::audioDeviceInfo):
838         (WebCore::MockRealtimeMediaSource::videoDeviceInfo):
839         (WebCore::MockRealtimeMediaSource::trackSourceWithUID): Deleted.
840         * platform/mock/MockRealtimeMediaSource.h:
841         * platform/mock/MockRealtimeMediaSourceCenter.cpp:
842         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamDevices):
843         (WebCore::MockRealtimeMediaSourceCenter::getMediaStreamTrackSources): Deleted.
844         (WebCore::MockRealtimeMediaSourceCenter::sourceWithUID): Deleted.
845         * platform/mock/MockRealtimeMediaSourceCenter.h:
846
847 2016-09-14  Antti Koivisto  <antti@apple.com>
848
849         Move more code out from RenderObject
850         https://bugs.webkit.org/show_bug.cgi?id=161980
851
852         Reviewed by Zalan Bujtas.
853
854         Move some functions that are only needed for RenderElement there.
855         Move collapsing anonymous table rows to RenderTableRow.
856
857         * rendering/RenderElement.cpp:
858         (WebCore::RenderElement::hasOutlineAnnotation):
859         (WebCore::RenderElement::hasSelfPaintingLayer):
860         (WebCore::RenderElement::checkForRepaintDuringLayout):
861         * rendering/RenderElement.h:
862         (WebCore::RenderElement::hasOutline):
863         (WebCore::RenderElement::hasHiddenBackface): Deleted.
864         * rendering/RenderLayerCompositor.cpp:
865         (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
866         * rendering/RenderObject.cpp:
867         (WebCore::RenderObject::pixelSnappedAbsoluteClippedOverflowRect):
868         (WebCore::RenderObject::destroyAndCleanupAnonymousWrappers):
869         (WebCore::RenderObject::hasSelfPaintingLayer): Deleted.
870         (WebCore::RenderObject::checkForRepaintDuringLayout): Deleted.
871         (WebCore::RenderObject::hasOutlineAnnotation): Deleted.
872         (WebCore::RenderObject::hasEntirelyFixedBackground): Deleted.
873         (WebCore::collapseAnonymousTableRowsIfNeeded): Deleted.
874         * rendering/RenderObject.h:
875         (WebCore::RenderObject::hasLayer):
876         (WebCore::RenderObject::canBeSelectionLeaf):
877         (WebCore::RenderObject::hasOutline): Deleted.
878         (WebCore::RenderObject::hasSelectedChildren): Deleted.
879         * rendering/RenderTableRow.cpp:
880         (WebCore::RenderTableRow::destroyAndCollapseAnonymousSiblingRows):
881         * rendering/RenderTableRow.h:
882         * rendering/RenderView.cpp:
883         (WebCore::RenderView::rootBackgroundIsEntirelyFixed):
884
885 2016-09-14  Daniel Bates  <dabates@apple.com>
886
887         Switch CSSParser to use CSSParserFastPaths::isKeywordPropertyID()
888         https://bugs.webkit.org/show_bug.cgi?id=161983
889
890         Reviewed by David Hyatt.
891
892         Towards switching to the new CSS parser keyword properties validation logic,
893         switch over the old CSS parser logic for determining a keyword property to
894         use the analogous logic in the new CSS parser.
895
896         A side benefit of this change is that it is a step towards unifying CSS- and
897         SVG CSS- keyword properties. The new CSS parser does not make a distinction
898         between these kinds of properties and will allow us to have a shared code path
899         for validating a keyword property.
900
901         No functionality was changed. So, no new tests.
902
903         * css/parser/CSSParser.cpp: Include header CSSParserFastPaths.h.
904         (WebCore::isValidKeywordPropertyAndValue): Validate SVG CSS keyword properties. This
905         logic was moved from CSSParser::parseSVGValue(). In subsequent patches we will switch
906         the old CSS parser from this function to CSSParserFastPaths::isValidKeywordPropertyAndValue().
907         (WebCore::parseKeywordValue): Modified to call CSSParserFastPaths::isKeywordPropertyID().
908         (WebCore::CSSParser::parseValue): Ditto.
909         (WebCore::isKeywordPropertyID): Deleted. Incorporated its functionality into
910         CSSParserFastPaths::isKeywordPropertyID().
911         * css/parser/CSSParserFastPaths.cpp:
912         (WebCore::CSSParserFastPaths::isKeywordPropertyID): Incorporates the functionality
913         of WebCore::isKeywordPropertyID().
914         * css/parser/SVGCSSParser.cpp:
915         (WebCore::CSSParser::parseSVGValue): Move properties that can be processed as
916         keyword properties from here to WebCore::isValidKeywordPropertyAndValue().
917
918 2016-09-13  Dean Jackson  <dino@apple.com>
919
920         Rename parseColorParameters and clean up conditional
921         https://bugs.webkit.org/show_bug.cgi?id=161941
922         <rdar://problem/28292750>
923
924         Reviewed by Dan Bates.
925
926         In preparation for adding color() support, rename the existing
927         parseColorParameters to parseRGBParameters.
928
929         Also clean up the logic in the parseColorFromValue function.
930
931         * css/parser/CSSParser.cpp:
932         (WebCore::CSSParser::parseRGBParameters):
933         (WebCore::CSSParser::parseColorFromValue):
934         (WebCore::CSSParser::parseColorParameters): Deleted.
935         * css/parser/CSSParser.h:
936
937 2016-09-14  Chris Dumez  <cdumez@apple.com>
938
939         Add support hr.color IDL attribute
940         https://bugs.webkit.org/show_bug.cgi?id=161977
941
942         Reviewed by Darin Adler.
943
944         Add support hr.color IDL attribute as per:
945         - https://html.spec.whatwg.org/#HTMLHRElement-partial
946
947         Even though this is a legacy attribute, it is still part of the HTML specification
948         and it is still supported by Firefox and Chrome.
949
950         Also note that even though WebKit does not currently support the 'color' IDL
951         attribute on <hr>, it does support the 'color' content attribute on <hr>.
952         Therefore, we only need to reflect the 'color' content attribute.
953
954         No new tests, rebaselined existing test.
955
956         * html/HTMLHRElement.idl:
957
958 2016-09-14  Alex Christensen  <achristensen@webkit.org>
959
960         URLParser: Add fast path for hosts containing no non-ASCII or percent characters
961         https://bugs.webkit.org/show_bug.cgi?id=161970
962
963         Reviewed by Daniel Bates.
964
965         Covered by existing tests.
966
967         * platform/URLParser.cpp:
968         (WebCore::URLParser::parse):
969         (WebCore::URLParser::parseHost):
970         * platform/URLParser.h:
971         When parsing the host of a URL, if it contains non-ASCII characters or percent-encoded values,
972         we need to do additional encoding.  Many URLs, including all already-parsed URLs, do not have
973         such characters in their host, and therefore do not need the additional encoding.  Skipping
974         the additional encoding significantly speeds up my URL parsing benchmark.
975
976 2016-09-14  Zalan Bujtas  <zalan@apple.com>
977
978         ShowRenderTree should take position offset into account when printing inflow positioned renderers.
979         https://bugs.webkit.org/show_bug.cgi?id=161978
980
981         Reviewed by Simon Fraser.
982
983         Adjust (x, y) with the inflow positioned renderer's offset.  
984
985         Not testable.
986
987         * rendering/RenderObject.cpp:
988         (WebCore::RenderObject::showRenderObject):
989
990 2016-09-14  Alex Christensen  <achristensen@webkit.org>
991
992         URLParser: Add fast path for utf8 encoding queries
993         https://bugs.webkit.org/show_bug.cgi?id=161968
994
995         Reviewed by Daniel Bates.
996
997         No change in behavior.  Covered by existing tests.
998
999         * platform/URLParser.cpp:
1000         (WebCore::utf8PercentEncodeQuery):
1001         (WebCore::URLParser::parse):
1002         If the text encoding is UTF-8 (which is quite common), then we can encode the query
1003         as we iterate its code points. This reduces memory allocation and significantly speeds
1004         up my URL parsing benchmark.
1005
1006 2016-09-14  Chris Dumez  <cdumez@apple.com>
1007
1008         Regression(r152725): generate-bindings.pl --write-dependencies does not work
1009         https://bugs.webkit.org/show_bug.cgi?id=161897
1010
1011         Reviewed by Darin Adler.
1012
1013         r152725 inadvertently dropped the code generating the JS*.dep files when
1014         --write-dependencies is passed to the bindings generator. As a result,
1015         our dependency tracking was broken. This patch restores the code that
1016         was dropped in r152725.
1017
1018         * bindings/scripts/CodeGeneratorJS.pm:
1019         (new):
1020         (GenerateHeader):
1021
1022 2016-09-14  Chris Dumez  <cdumez@apple.com>
1023
1024         input.type cannot be set to "file" after being set to another type
1025         https://bugs.webkit.org/show_bug.cgi?id=161943
1026
1027         Reviewed by Daniel Bates.
1028
1029         input.type cannot be set to "file" after being set to another type.
1030         This behavior does not match the HTML specification or the behavior
1031         of Firefox and Chrome. This patch drops this restriction and aligns
1032         our behavior with other browsers.
1033
1034         Test: fast/dom/HTMLInputElement/input-type-change-to-file.html
1035
1036         * html/FileInputType.cpp:
1037         (WebCore::FileInputType::canChangeFromAnotherType): Deleted.
1038         * html/FileInputType.h:
1039         * html/HTMLInputElement.cpp:
1040         (WebCore::HTMLInputElement::updateType):
1041         * html/InputType.cpp:
1042         (WebCore::InputType::canChangeFromAnotherType): Deleted.
1043         * html/InputType.h:
1044
1045 2016-09-14  Carlos Garnacho <carlosg@gnome.org>
1046
1047         [GTK][Wayland] Implement clipboard support
1048         https://bugs.webkit.org/show_bug.cgi?id=146574
1049
1050         Reviewed by Carlos Garcia Campos.
1051
1052         Implement PlatformPasteboard in the GTK+ platform, and move Pasteboard
1053         to using PasteboardStrategy so clipboard management is left to the
1054         UIProcess.
1055
1056         DataObjectGtk is still used in the Pasteboard GTK implementation, it's
1057         now just never backed by a GtkClipboard, this object is instead
1058         serialized through PasteboardStrategy, so the UIProcess side can mirror
1059         the content in a GtkClipboard-backed DataObjectGtk, which is then
1060         exposed to the windowing through PlatformPasteboard/PasteboardHelper.
1061
1062         When requesting clipboard content, it works similarly, the UIProcess
1063         side first updates its DataObjectGtk, which is then mirrored by the
1064         WebProcess through the PasteboardStrategy requests.
1065
1066         * PlatformGTK.cmake: Added PlatformPasteboardGtk.cpp
1067         * editing/gtk/EditorGtk.cpp:
1068         (WebCore::Editor::writeSelectionToPasteboard): Eliminate usage of
1069         PasteboardWebContent callback argument. This is done differently as
1070         we have to signal back the WebProcess.
1071         * platform/Pasteboard.h: Cleaned up of direct GTK+ dependency.
1072         * platform/PasteboardStrategy.h: Added plumbing towards the pasteboard
1073         proxy.
1074         * platform/PlatformPasteboard.h:
1075         * platform/gtk/DataObjectGtk.cpp:
1076         (WebCore::DataObjectGtk::clearAllExceptFilenames): Clear the "smart
1077         paste" flag if set, now that this is DataObjectGtk data.
1078         * platform/gtk/DataObjectGtk.h:
1079         (WebCore::DataObjectGtk::canSmartReplace):
1080         (WebCore::DataObjectGtk::setCanSmartReplace): Added functions, in order
1081         to flag whether a DataObjectGtk has the "smart paste" feature enabled
1082         or not.
1083         * platform/gtk/PasteboardGtk.cpp:
1084         (WebCore::Pasteboard::createForCopyAndPaste):
1085         (WebCore::Pasteboard::createForGlobalSelection):
1086         (WebCore::Pasteboard::Pasteboard):
1087         (WebCore::Pasteboard::writeToClipboard):
1088         (WebCore::Pasteboard::readFromClipboard):
1089         (WebCore::Pasteboard::writePlainText):
1090         (WebCore::Pasteboard::write):
1091         (WebCore::Pasteboard::writePasteboard):
1092         (WebCore::Pasteboard::clear):
1093         (WebCore::Pasteboard::canSmartReplace):
1094         (WebCore::Pasteboard::read):
1095         (WebCore::Pasteboard::hasData):
1096         (WebCore::Pasteboard::types):
1097         (WebCore::Pasteboard::readString):
1098         (WebCore::Pasteboard::readFilenames): Made to use the
1099         PasteboardStrategy instead of PasteboardHelper/GTK+ API.
1100         * platform/gtk/PasteboardHelper.cpp:
1101         (WebCore::PasteboardHelper::~PasteboardHelper):
1102         (WebCore::ClipboardSetData::ClipboardSetData):
1103         (WebCore::clearClipboardContentsCallback):
1104         (WebCore::PasteboardHelper::writeClipboardContents): Remove the GClosure
1105         to notify whether the global selection has been replaced. Use std:function
1106         instead. Remove SmartPasteInclusion argument, now figured out through
1107         DataObjectGtk canSmartPaste() member.
1108         * platform/gtk/PasteboardHelper.h:
1109         * platform/gtk/PlatformPasteboardGtk.cpp: Added.
1110         (WebCore::PlatformPasteboard::PlatformPasteboard):
1111         (WebCore::PlatformPasteboard::writeToClipboard):
1112         (WebCore::PlatformPasteboard::readFromClipboard): Implemented
1113         PlatformPasteboard using PasteboardHelper/GTK+ API.
1114
1115 2016-09-13  Dave Hyatt  <hyatt@apple.com>
1116
1117         [CSS Parser] Enable the new sizes parser by default
1118         https://bugs.webkit.org/show_bug.cgi?id=161931
1119
1120         Reviewed by Zalan Bujtas.
1121
1122         Added new tests in fast/dom/HTMLImageElement/sizes.
1123
1124         * CMakeLists.txt:
1125         * WebCore.xcodeproj/project.pbxproj:
1126         * css/CSSGrammar.y.in:
1127         Remove the old code that parsed source size lists.
1128
1129         * css/MediaQueryEvaluator.cpp:
1130         (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
1131         * css/MediaQueryEvaluator.h:
1132         Change to take a const Document&, since the Document is not modified.
1133
1134         * css/SourceSizeList.cpp: Removed.
1135         * css/SourceSizeList.h: Removed.
1136         * css/parser/CSSParser.cpp:
1137         (WebCore::CSSParser::parseSizesAttribute): Deleted.
1138         (WebCore::CSSParser::SourceSize::SourceSize): Deleted.
1139         (WebCore::CSSParser::sourceSize): Deleted.
1140         * css/parser/CSSParser.h:
1141         Remove the old sizes processing code.
1142
1143         * css/parser/MediaQueryParser.cpp:
1144         (WebCore::MediaQueryParser::skipUntilComma):
1145         (WebCore::MediaQueryParser::parseInternal):
1146         Fix a bug I introduced when modifying this code from Blink. The Nones should have been Nots.
1147
1148         * css/parser/SizesAttributeParser.cpp:
1149         (WebCore::SizesAttributeParser::computeLength):
1150         (WebCore::SizesAttributeParser::SizesAttributeParser):
1151         (WebCore::SizesAttributeParser::calculateLengthInPixels):
1152         (WebCore::SizesAttributeParser::mediaConditionMatches):
1153         (WebCore::SizesAttributeParser::effectiveSizeDefaultValue):
1154         * css/parser/SizesAttributeParser.h:
1155         * css/parser/SizesCalcParser.cpp:
1156         (WebCore::SizesCalcParser::SizesCalcParser):
1157         (WebCore::SizesCalcParser::appendLength):
1158         * css/parser/SizesCalcParser.h:
1159         Make the sizes parsers take a Document, since having separate style and view arguments made
1160         no sense, given that the style used is always the view's.
1161
1162         * html/HTMLImageElement.cpp:
1163         (WebCore::HTMLImageElement::bestFitSourceFromPictureElement):
1164         (WebCore::HTMLImageElement::selectImageSource):
1165         * html/parser/HTMLPreloadScanner.cpp:
1166         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
1167         Switch image elements and the preload scanner over to the new code.
1168
1169 2016-09-13  Chris Dumez  <cdumez@apple.com>
1170
1171         Unreviewed, rolling out r205887.
1172
1173         Broke the Windows build
1174
1175         Reverted changeset:
1176
1177         "Merge Element::ScrollToOptions and
1178         DOMWindow::ScrollToOptions"
1179         https://bugs.webkit.org/show_bug.cgi?id=161932
1180         http://trac.webkit.org/changeset/205887
1181
1182 2016-09-13  Dean Jackson  <dino@apple.com>
1183
1184         Remove a .rej file.
1185
1186         * animation/DocumentTimeline.h.rej: Removed.
1187
1188 2016-09-13  Alex Christensen  <achristensen@webkit.org>
1189
1190         Implement URLSearchParams
1191         https://bugs.webkit.org/show_bug.cgi?id=161920
1192
1193         Reviewed by Chris Dumez.
1194
1195         Covered by newly passing web platform tests.
1196
1197         * CMakeLists.txt:
1198         * DerivedSources.make:
1199         * WebCore.xcodeproj/project.pbxproj:
1200         * html/DOMURL.cpp:
1201         (WebCore::DOMURL::setQuery):
1202         (WebCore::DOMURL::searchParams):
1203         * html/DOMURL.h:
1204         * html/URLSearchParams.cpp: Added.
1205         (WebCore::URLSearchParams::URLSearchParams):
1206         (WebCore::URLSearchParams::get):
1207         (WebCore::URLSearchParams::has):
1208         (WebCore::URLSearchParams::set):
1209         (WebCore::URLSearchParams::append):
1210         (WebCore::URLSearchParams::getAll):
1211         (WebCore::URLSearchParams::remove):
1212         (WebCore::URLSearchParams::toString):
1213         (WebCore::URLSearchParams::updateURL):
1214         (WebCore::URLSearchParams::Iterator::Iterator):
1215         * html/URLSearchParams.h: Added.
1216         (WebCore::URLSearchParams::create):
1217         (WebCore::URLSearchParams::createIterator):
1218         * html/URLSearchParams.idl: Added.
1219         * html/URLUtils.idl:
1220         * platform/URLParser.cpp:
1221         (WebCore::percentDecode):
1222         (WebCore::URLParser::parseHost):
1223         (WebCore::formURLDecode):
1224         (WebCore::serializeURLEncodedForm):
1225         (WebCore::URLParser::serialize):
1226         * platform/URLParser.h:
1227
1228 2016-09-12  Dean Jackson  <dino@apple.com>
1229
1230         Replace RGBA32 with Color in member variables
1231         https://bugs.webkit.org/show_bug.cgi?id=161856
1232         <rdar://problem/28254324>
1233
1234         Reviewed by Simon Fraser.
1235
1236         In preparation for the Color class to become more than
1237         just a 4-byte RGBA value, I went through a few places
1238         that were using the RGBA32 type directly, and replaced
1239         them with Color. This will make some objects a little
1240         bigger e.g. BorderValue and its friends.
1241
1242         I mostly looked at the places that were using RGBA32 as
1243         a member variable. There is still a lot of RGBA32 use
1244         around the project, in particular the CSS parser.
1245
1246         There should be no behaviour change.
1247
1248         * html/canvas/CanvasRenderingContext2D.cpp: Shadows now use Color.
1249         (WebCore::CanvasRenderingContext2D::setShadow):
1250         (WebCore::CanvasRenderingContext2D::shouldDrawShadows):
1251         (WebCore::CanvasRenderingContext2D::didDraw):
1252         * html/canvas/CanvasRenderingContext2D.h:
1253         * html/canvas/CanvasStyle.cpp: Canvas style uses Color for fills and strokes.
1254         (WebCore::CanvasStyle::CanvasStyle):
1255         (WebCore::CanvasStyle::isEquivalentColor):
1256         (WebCore::CanvasStyle::isEquivalentRGBA):
1257         (WebCore::CanvasStyle::applyStrokeColor):
1258         (WebCore::CanvasStyle::applyFillColor):
1259         * html/canvas/CanvasStyle.h:
1260         (WebCore::CanvasStyle::CMYKAValues::CMYKAValues):
1261         (WebCore::CanvasStyle::color):
1262
1263         * html/track/TextTrackCueGeneric.h: Foreground, background and
1264         highlight colors.
1265         * platform/graphics/InbandTextTrackPrivateClient.h:
1266         (WebCore::GenericCueData::setForegroundColor):
1267         (WebCore::GenericCueData::setBackgroundColor):
1268         (WebCore::GenericCueData::setHighlightColor):
1269
1270         * page/PageOverlay.cpp: Background color.
1271         (WebCore::PageOverlay::setBackgroundColor):
1272         * page/PageOverlay.h:
1273
1274         * platform/graphics/mac/ColorMac.h: Random function that returned RGBA32.
1275         * platform/graphics/mac/ColorMac.mm:
1276         (WebCore::oldAquaFocusRingColor):
1277
1278         * rendering/RenderTableCell.cpp: Update the size of CollapsedBorderValue.
1279
1280         * rendering/RenderTheme.h: Use a NeverDestroyed Color rather than a static RGBA32.
1281
1282         * rendering/style/BorderValue.h: Use a Color.
1283         (WebCore::BorderValue::BorderValue):
1284         (WebCore::BorderValue::isTransparent):
1285         (WebCore::BorderValue::operator==):
1286         (WebCore::BorderValue::setColor):
1287         (WebCore::BorderValue::color):
1288         * rendering/style/CollapsedBorderValue.h:
1289         (WebCore::CollapsedBorderValue::CollapsedBorderValue):
1290         (WebCore::CollapsedBorderValue::color):
1291         * rendering/style/OutlineValue.h:
1292         (WebCore::OutlineValue::operator==):
1293
1294         * rendering/style/RenderStyle.cpp: Update to match new BorderValue.
1295
1296 2016-09-13  Jer Noble  <jer.noble@apple.com>
1297
1298         [media-source] MediaSource.addSourceBuffer(null) should throw an exception
1299         https://bugs.webkit.org/show_bug.cgi?id=161884
1300
1301         Reviewed by Eric Carlson.
1302
1303         Fixes test: imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer.html
1304
1305         * Modules/mediasource/MediaSource.idl: The addSourceBuffer() parameter is not optional
1306             and not nullable.
1307
1308 2016-09-13  Daniel Bates  <dabates@apple.com>
1309
1310         Remove Chrome app-specific CSS property -webkit-app-region
1311         https://bugs.webkit.org/show_bug.cgi?id=161935
1312
1313         Reviewed by Simon Fraser.
1314
1315         * css/parser/CSSParserFastPaths.cpp:
1316
1317 2016-09-13  Daniel Bates  <dabates@apple.com>
1318
1319         Treat some CSS properties as keyword properties
1320         https://bugs.webkit.org/show_bug.cgi?id=161934
1321
1322         Reviewed by Simon Fraser.
1323
1324         Move validation of the following CSS keyword properties from CSSParser::parseValue() to
1325         WebCore::isValidKeywordPropertyAndValue():
1326
1327         CSSPropertyColumnProgression
1328         CSSPropertyFontStretch
1329         CSSPropertyTextAlign
1330         CSSPropertyUnicodeBidi
1331         CSSPropertyWebkitColumnAxis
1332         CSSPropertyWebkitCursorVisibility
1333         CSSPropertyWebkitTextDecorationStyle
1334         CSSPropertyWebkitTextOrientation
1335         CSSPropertyWebkitTextZoom
1336         CSSPropertyWebkitTouchCallout
1337
1338         Among other benefits, this will make it more straightforward to migrate from CSSParser::is{KeywordPropertyID, ValidKeywordPropertyAndValue}()
1339         to CSSParserFastPaths::is{KeywordPropertyID, ValidKeywordPropertyAndValue}(), respectively.
1340
1341         * css/parser/CSSParser.cpp:
1342         (WebCore::isValidKeywordPropertyAndValue):
1343         (WebCore::isKeywordPropertyID):
1344         (WebCore::CSSParser::parseValue):
1345
1346 2016-09-13  Chris Dumez  <cdumez@apple.com>
1347
1348         Merge Element::ScrollToOptions and DOMWindow::ScrollToOptions
1349         https://bugs.webkit.org/show_bug.cgi?id=161932
1350
1351         Reviewed by Simon Fraser.
1352
1353         Merge Element::ScrollToOptions and DOMWindow::ScrollToOptions.
1354         Ideally we would merge them on IDL side as well but this is for
1355         another patch.
1356
1357         * WebCore.xcodeproj/project.pbxproj:
1358         * bindings/scripts/CodeGeneratorJS.pm:
1359         (GenerateDictionaryImplementationContent):
1360         * bindings/scripts/test/JS/JSTestObj.cpp:
1361         (WebCore::convertDictionary<TestObj::Dictionary>):
1362         (WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
1363         (WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
1364         (WebCore::convertDictionary<AlternateDictionaryName>):
1365         * dom/Element.h:
1366         * dom/Element.idl:
1367         * dom/ScrollToOptions.h: Added.
1368         * html/HTMLBodyElement.cpp:
1369         (WebCore::HTMLBodyElement::scrollTo):
1370         * page/DOMWindow.h:
1371         * page/DOMWindow.idl:
1372
1373 2016-09-13  Myles C. Maxfield  <mmaxfield@apple.com>
1374
1375         [Cocoa] Unify font's ascent, descent, and x-height between macOS and iOS
1376         https://bugs.webkit.org/show_bug.cgi?id=161877
1377
1378         Reviewed by Simon Fraser.
1379
1380         macOS and iOS have slightly different handling of ascent, descent, and x-height.
1381         This patch migrates them to have the same handling of them.
1382
1383         There are slight behavior changes here because our previous code converted between
1384         floats and doubles in unnecessary places, and does not handle rounding in
1385         consistent ways. The differences are all miniscule, but nevertheless lead to test
1386         results needing to be updated.
1387
1388         Coincidentally, by performing this unification, there are no longer any places
1389         on macOS Sierra which are using the CGFontRef member of PlatformFontData. This
1390         patch removes the member on that operating system for memory savings as well as
1391         clarity.
1392
1393         Covered by existing tests.
1394
1395         * platform/graphics/FontPlatformData.cpp:
1396         * platform/graphics/FontPlatformData.h:
1397         * platform/graphics/cocoa/FontCocoa.mm:
1398         (WebCore::Font::platformInit):
1399         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1400         (WebCore::FontPlatformData::FontPlatformData):
1401         (WebCore::FontPlatformData::platformIsEqual):
1402         (WebCore::FontPlatformData::ctFont):
1403
1404 2016-09-13  Brent Fulgham  <bfulgham@apple.com>
1405
1406         [Win] Unreviewed build fix.
1407
1408         Based on a suggestion by Simon Fraser, I have corrected the
1409         headers to avoid including <d2d1.h> directly, relying instead
1410         on forward declarations.
1411
1412         * platform/graphics/FloatPoint.h:
1413         * platform/graphics/FloatRect.h:
1414         * platform/graphics/FloatSize.h:
1415         * platform/graphics/IntPoint.h:
1416         * platform/graphics/IntRect.h:
1417         * platform/graphics/IntSize.h:
1418         * platform/graphics/transforms/AffineTransform.h:
1419         * platform/graphics/transforms/TransformationMatrix.h:
1420
1421 2016-09-13  Said Abou-Hallawa  <sabouhallawa@apple.com>
1422
1423         Get rid of the m_premultiplyAlpha flag of the ImageFrame class
1424         https://bugs.webkit.org/show_bug.cgi?id=159721
1425
1426         Reviewed by Simon Fraser.
1427
1428         This flag was only needed when calling ImageBackingStore::create() in 
1429         ImageFrame::setSize(). Instead we can pass ImageDecoder::m_premultiplyAlpha 
1430         to ImageFrame::setSize(), which is renamed ImageFrame::initializeBackingStore().
1431         The passed premultiplyAlpha can then be passed to ImageBackingStore::create().
1432
1433         * platform/image-decoders/ImageDecoder.cpp:
1434         (WebCore::ImageFrame::ImageFrame):
1435         (WebCore::ImageFrame::operator=):
1436         (WebCore::ImageFrame::initializeBackingStore):
1437         (WebCore::ImageFrame::copyBitmapData): Deleted.
1438         (WebCore::ImageFrame::setSize): Deleted.
1439         * platform/image-decoders/ImageDecoder.h:
1440         (WebCore::ImageFrame::disposalMethod):
1441         (WebCore::ImageFrame::setDisposalMethod):
1442         (WebCore::ImageDecoder::premultiplyAlpha):
1443         (WebCore::ImageFrame::premultiplyAlpha): Deleted.
1444         (WebCore::ImageFrame::setPremultiplyAlpha): Deleted.
1445         * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1446         (WebCore::BMPImageDecoder::frameBufferAtIndex):
1447         * platform/image-decoders/bmp/BMPImageReader.cpp:
1448         (WebCore::BMPImageReader::decodeBMP):
1449         * platform/image-decoders/gif/GIFImageDecoder.cpp:
1450         (WebCore::GIFImageDecoder::decode):
1451         (WebCore::GIFImageDecoder::initFrameBuffer):
1452         * platform/image-decoders/ico/ICOImageDecoder.cpp:
1453         (WebCore::ICOImageDecoder::frameCount):
1454         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1455         (WebCore::JPEGImageDecoder::frameBufferAtIndex):
1456         (WebCore::JPEGImageDecoder::outputScanlines):
1457         * platform/image-decoders/png/PNGImageDecoder.cpp:
1458         (WebCore::PNGImageDecoder::frameBufferAtIndex):
1459         (WebCore::PNGImageDecoder::rowAvailable):
1460         (WebCore::PNGImageDecoder::readChunks):
1461         (WebCore::PNGImageDecoder::initFrameBuffer):
1462         (WebCore::setPixelRGB): Deleted.
1463         (WebCore::setPixelRGBA): Deleted.
1464         (WebCore::setPixelPremultipliedRGBA): Deleted.
1465         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
1466         (WebCore::WEBPImageDecoder::frameBufferAtIndex):
1467         (WebCore::WEBPImageDecoder::decode):
1468
1469 2016-09-12  Brent Fulgham  <bfulgham@apple.com>
1470
1471         [Win][Direct2D] Provide Direct2D-based geometry and transform cast operations
1472         https://bugs.webkit.org/show_bug.cgi?id=161818
1473
1474         Reviewed by Dean Jackson.
1475
1476         Tested by new TestWebKitAPI tests.
1477
1478         Add new casting operators to and from various Direct2D data types.
1479
1480         * PlatformWin.cmake:
1481         * platform/graphics/FloatPoint.h:
1482         (WebCore::FloatPoint::FloatPoint):
1483         * platform/graphics/FloatRect.h:
1484         * platform/graphics/FloatSize.h:
1485         (WebCore::FloatSize::FloatSize):
1486         * platform/graphics/IntPoint.h:
1487         * platform/graphics/IntRect.h:
1488         * platform/graphics/IntSize.h:
1489         * platform/graphics/transforms/AffineTransform.h:
1490         * platform/graphics/transforms/TransformationMatrix.h:
1491         * platform/graphics/win/FloatPointDirect2D.cpp:
1492         * platform/graphics/win/FloatRectDirect2D.cpp:
1493         * platform/graphics/win/FloatSizeDirect2D.cpp:
1494         * platform/graphics/win/IntPointWin.cpp:
1495         (WebCore::IntPoint::IntPoint):
1496         (WebCore::IntPoint::operator D2D1_POINT_2F):
1497         (WebCore::IntPoint::operator D2D1_POINT_2U):
1498         * platform/graphics/win/IntRectWin.cpp:
1499         (WebCore::IntRect::IntRect):
1500         (WebCore::IntRect::operator D2D1_RECT_F):
1501         (WebCore::IntRect::operator D2D1_RECT_U):
1502         * platform/graphics/win/IntSizeWin.cpp:
1503         (WebCore::IntSize::IntSize):
1504         (WebCore::IntSize::operator D2D1_SIZE_U):
1505         (WebCore::IntSize::operator D2D1_SIZE_F):
1506         * platform/graphics/win/TransformationMatrixDirect2D.cpp: Added.
1507         (WebCore::TransformationMatrix::TransformationMatrix):
1508         (WebCore::TransformationMatrix::operator D2D1_MATRIX_3X2_F):
1509         (WebCore::AffineTransform::AffineTransform):
1510         (WebCore::AffineTransform::operator D2D1_MATRIX_3X2_F):
1511
1512 2016-09-13  Tim Horton  <timothy_horton@apple.com>
1513
1514         Undoing a candidate insertion results in the replaced text being selected
1515         https://bugs.webkit.org/show_bug.cgi?id=161894
1516         <rdar://problem/28225774>
1517
1518         Reviewed by Simon Fraser.
1519
1520         Test: editing/mac/spelling/accept-candidate-undo-does-not-select.html
1521
1522         * WebCore.xcodeproj/project.pbxproj:
1523         * editing/ReplaceRangeWithTextCommand.cpp: Added.
1524         (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
1525         (WebCore::ReplaceRangeWithTextCommand::doApply):
1526         * editing/ReplaceRangeWithTextCommand.h: Added.
1527         (WebCore::ReplaceRangeWithTextCommand::create):
1528         Add a editor command that replaces a range with the given text.
1529
1530         * editing/Editor.cpp:
1531         (WebCore::Editor::rangeForTextCheckingResult):
1532         (WebCore::Editor::handleAcceptedCandidate):
1533         (WebCore::Editor::selectTextCheckingResult): Deleted.
1534         * editing/Editor.h:
1535         Make use of the new editor command to do candidate insertion as a single
1536         composite operation, so that it is undone as a unit. Otherwise, undo ends up
1537         undoing the insertion, but not the selection, and we are left with the old
1538         text, selected, which is undesirable.
1539
1540 2016-09-13  Dave Hyatt  <hyatt@apple.com>
1541
1542         [CSS Parser] Add CSS Variable Parsing support
1543         https://bugs.webkit.org/show_bug.cgi?id=161916
1544
1545         Reviewed by Dean Jackson.
1546
1547         This patch not only adds the parser for CSS variables (from Blink), but it also brings in
1548         all of the data structures used to store variables and custom property declarations. We
1549         will be abandoning our old data structures eventually in favor of these new ones. They
1550         are not significantly different other than operating on the CSSParserTokenRanges rather
1551         than the soon-to-be-removed parser value lists.
1552
1553         * CMakeLists.txt:
1554         * WebCore.xcodeproj/project.pbxproj:
1555         * css/CSSCustomIdentValue.cpp: Added.
1556         (WebCore::CSSCustomIdentValue::CSSCustomIdentValue):
1557         (WebCore::CSSCustomIdentValue::customCSSText):
1558         * css/CSSCustomIdentValue.h: Added.
1559         (WebCore::CSSCustomIdentValue::create):
1560         (WebCore::CSSCustomIdentValue::value):
1561         (WebCore::CSSCustomIdentValue::isKnownPropertyID):
1562         (WebCore::CSSCustomIdentValue::valueAsPropertyID):
1563         (WebCore::CSSCustomIdentValue::equals):
1564         * css/CSSCustomPropertyDeclaration.cpp: Added.
1565         (WebCore::CSSCustomPropertyDeclaration::customCSSText):
1566         * css/CSSCustomPropertyDeclaration.h: Added.
1567         (WebCore::CSSCustomPropertyDeclaration::create):
1568         (WebCore::CSSCustomPropertyDeclaration::name):
1569         (WebCore::CSSCustomPropertyDeclaration::value):
1570         (WebCore::CSSCustomPropertyDeclaration::id):
1571         (WebCore::CSSCustomPropertyDeclaration::equals):
1572         (WebCore::CSSCustomPropertyDeclaration::CSSCustomPropertyDeclaration):
1573         * css/CSSCustomPropertyValue.h:
1574         * css/CSSValue.cpp:
1575         (WebCore::CSSValue::cssText):
1576         (WebCore::CSSValue::destroy):
1577         * css/CSSValue.h:
1578         (WebCore::CSSValue::isCustomPropertyDeclaration):
1579         (WebCore::CSSValue::isCustomIdentValue):
1580         (WebCore::CSSValue::isVariableReferenceValue):
1581         * css/CSSValueKeywords.in:
1582         * css/CSSVariableData.cpp: Added.
1583         (WebCore::CSSVariableData::updateTokens):
1584         (WebCore::CSSVariableData::operator==):
1585         (WebCore::CSSVariableData::consumeAndUpdateTokens):
1586         (WebCore::CSSVariableData::CSSVariableData):
1587         * css/CSSVariableData.h: Added.
1588         (WebCore::CSSVariableData::create):
1589         (WebCore::CSSVariableData::createResolved):
1590         (WebCore::CSSVariableData::tokenRange):
1591         (WebCore::CSSVariableData::tokens):
1592         (WebCore::CSSVariableData::needsVariableResolution):
1593         (WebCore::CSSVariableData::CSSVariableData):
1594         * css/CSSVariableDependentValue.h:
1595         * css/CSSVariableReferenceValue.cpp: Added.
1596         (WebCore::CSSVariableReferenceValue::customCSSText):
1597         * css/CSSVariableReferenceValue.h: Added.
1598         (WebCore::CSSVariableReferenceValue::create):
1599         (WebCore::CSSVariableReferenceValue::variableDataValue):
1600         (WebCore::CSSVariableReferenceValue::equals):
1601         (WebCore::CSSVariableReferenceValue::CSSVariableReferenceValue):
1602         * css/CSSVariableValue.h:
1603         * css/parser/CSSParserImpl.cpp:
1604         (WebCore::filterProperties):
1605         (WebCore::CSSParserImpl::consumeDeclaration):
1606         (WebCore::CSSParserImpl::consumeVariableValue):
1607         * css/parser/CSSVariableParser.cpp: Added.
1608         (WebCore::CSSVariableParser::isValidVariableName):
1609         (WebCore::classifyBlock):
1610         (WebCore::isValidVariableReference):
1611         (WebCore::classifyVariableRange):
1612         (WebCore::CSSVariableParser::containsValidVariableReferences):
1613         (WebCore::CSSVariableParser::parseDeclarationValue):
1614         * css/parser/CSSVariableParser.h: Added.
1615
1616 2016-09-13  Daniel Bates  <dabates@apple.com>
1617
1618         Remove CSS keyword properties from CSSParser::parseValue(CSSPropertyID, bool)
1619         https://bugs.webkit.org/show_bug.cgi?id=161918
1620
1621         Reviewed by Simon Fraser.
1622
1623         CSSParser::parseValue(CSSPropertyID, bool) calls ASSERT_NOT_REACHED() when processing a CSS property
1624         that is known to accept only keyword values as a means to guide a person to add such a CSS property
1625         to the switch block in WebCore::isValidKeywordPropertyAndValue(). In theory this sounds good, but
1626         in practice it does not work out and the list of such properties is stale. We should remove the
1627         case statements for such properties and the maintenance burden they required, which was manual and
1628         error prone. We should think about a better way to enforce that all CSS properties are parsed/validated.
1629
1630         The approach of calling ASSERT_NOT_REACHED is not beneficial to catching coding mistakes because
1631         CSSParser::parseValue() has a default case statement to parse/validate SVG CSS properties and hence
1632         does not allow the C++ compiler to validate that the switch block covers all CSSPropertyIDs.
1633
1634         * css/parser/CSSParser.cpp:
1635         (WebCore::CSSParser::parseValue):
1636
1637 2016-09-13  Daniel Bates  <dabates@apple.com>
1638
1639         Organize CSS keyword properties in WebCore::isKeywordPropertyID()
1640         https://bugs.webkit.org/show_bug.cgi?id=161917
1641
1642         Reviewed by Simon Fraser.
1643
1644         Group and sort compile-time feature keywords and move them to the end of the switch block
1645         to avoid the distraction of preprocessor statements scattered throughout the list. Sort
1646         all the other keyword properties to make it straightforward to find a property by name.
1647
1648         * css/parser/CSSParser.cpp:
1649         (WebCore::isKeywordPropertyID):
1650
1651 2016-09-13  Nan Wang  <n_wang@apple.com>
1652
1653         AX: Crash at AccessibilityRenderObject::computeAccessibilityIsIgnored const  + 552
1654         https://bugs.webkit.org/show_bug.cgi?id=161276
1655
1656         Reviewed by Chris Fleizach.
1657
1658         Sometimes when calling JavaScript removeChild or setAttribute on a node, it seems like
1659         the renderer is deallocated during the process of computeAccessibilityIsIgnored. It's 
1660         causing a crash when we are accessing the renderer after that. Since RenderObject is not ref
1661         counted and we cannot hold onto it for the duration of the function, fixed it by adding
1662         more nil checks.
1663
1664         Despite my best efforts, I couldn't make a layout test that destroys the renderer within
1665         the computeAccessibilityIsIgnored function. 
1666
1667         * accessibility/AccessibilityRenderObject.cpp:
1668         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
1669
1670 2016-09-12  Jer Noble  <jer.noble@apple.com>
1671
1672         Media-source backed elements block load event; cause web-platform-test flakiness
1673         https://bugs.webkit.org/show_bug.cgi?id=161881
1674
1675         Reviewed by Eric Carlson.
1676
1677         Test: media/media-source/media-source-delaying-load-event.html
1678
1679         The MSE specification has added an explicit step to their "attaching to media element"
1680         algorithm which tells the media element to stop delaying the load event. And indeed,
1681         the HTMLMediaElement blocks the load event when a MediaSource is attached but its data
1682         is never loaded.
1683
1684         * Modules/mediasource/MediaSource.cpp:
1685         (WebCore::MediaSource::setPrivateAndOpen):
1686         * html/HTMLMediaElement.h:
1687
1688 2016-09-12  Zalan Bujtas  <zalan@apple.com>
1689
1690         Input type object and the associated render can go out of sync.
1691         https://bugs.webkit.org/show_bug.cgi?id=161871
1692         <rdar://problem/28178094>
1693
1694         Reviewed by Antti Koivisto.
1695
1696         Bail out when we've got a mismatched renderer.
1697
1698         Test: fast/forms/assert-on-input-type-change.html
1699
1700         * html/ImageInputType.cpp:
1701         (WebCore::ImageInputType::altAttributeChanged):
1702
1703 2016-09-13  Carlos Garcia Campos  <cgarcia@igalia.com>
1704
1705         [GTK] Get rid of DataObjectGtk::forClipboard and cleanup pasteboard code
1706         https://bugs.webkit.org/show_bug.cgi?id=161907
1707
1708         Reviewed by Michael Catanzaro.
1709
1710         We don't really need to keep a DataObjectGtk for every clipboard, we could simply pass the DataObjectGtk to read
1711         and write methods of PasteboardHelper.
1712
1713         * editing/gtk/EditorGtk.cpp:
1714         (WebCore::createFragmentFromPasteboardData): Update for DataObjectGtk API changes.
1715         * platform/Pasteboard.h:
1716         * platform/gtk/DataObjectGtk.cpp: Remove forClipboard() static method.
1717         * platform/gtk/DataObjectGtk.h: Ditto.
1718         * platform/gtk/PasteboardGtk.cpp:
1719         (WebCore::Pasteboard::Pasteboard): Always create a new DataObjectGtk.
1720         (WebCore::Pasteboard::dataObject): Return a const reference instead of a pointer.
1721         (WebCore::Pasteboard::writePlainText): Pass the DataObjectGtk to PasteboardHelper.
1722         (WebCore::Pasteboard::write): Ditto.
1723         (WebCore::Pasteboard::writePasteboard): Ditto.
1724         (WebCore::Pasteboard::clear): Ditto.
1725         (WebCore::Pasteboard::read): Ditto.
1726         (WebCore::Pasteboard::hasData): Ditto.
1727         (WebCore::Pasteboard::types): Ditto.
1728         (WebCore::Pasteboard::readString): Ditto.
1729         (WebCore::Pasteboard::readFilenames): Ditto.
1730         * platform/gtk/PasteboardHelper.cpp:
1731         (WebCore::PasteboardHelper::getClipboardContents): Update the given DataObjectGtk.
1732         (WebCore::PasteboardHelper::fillSelectionData): Use a const reference to DataObjectGtk instead of a pointer.
1733         (WebCore::PasteboardHelper::targetListForDataObject): Ditto.
1734         (WebCore::PasteboardHelper::fillDataObjectFromDropData): Use a reference to DataObjectGtk instead of a pointer.
1735         (WebCore::ClipboardSetData::ClipboardSetData): Helper struct to pass DataObjectGtk and callback to clipboard callbacks.
1736         (WebCore::ClipboardSetData::~ClipboardSetData):
1737         (WebCore::getClipboardContentsCallback): Get the DataObjectGtk from ClipboardSetData struct passed as user data.
1738         (WebCore::clearClipboardContentsCallback): Get the DataObjectGtk and callback from ClipboardSetData struct
1739         passed as user data.
1740         (WebCore::PasteboardHelper::writeClipboardContents): Write the given DataObjectGtk.
1741         * platform/gtk/PasteboardHelper.h:
1742
1743 2016-09-13  Chris Dumez  <cdumez@apple.com>
1744
1745         Drop support for <isindex>
1746         https://bugs.webkit.org/show_bug.cgi?id=7139
1747
1748         Reviewed by Ryosuke Niwa.
1749
1750         Drop support for <isindex> and <input name=isindex>. Those are no longer
1751         in the HTML specification and Chrome / Edge have already dropped their
1752         support. Firefox is also planning on dropping this.
1753
1754         Test: imported/w3c/web-platform-tests/html/semantics/forms/historical.html
1755
1756         * css/StyleResolver.cpp:
1757         (WebCore::elementTypeHasAppearanceFromUAStyle):
1758         * css/html.css:
1759         (input, textarea, keygen, select, button, meter, progress):
1760         (input, textarea, keygen, select, button):
1761         (#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS):
1762         (input::placeholder):
1763         (input:focus, textarea:focus, keygen:focus, select:focus):
1764         * dom/Element.cpp:
1765         (WebCore::Element::ieForbidsInsertHTML):
1766         * html/HTMLInputElement.cpp:
1767         (WebCore::HTMLInputElement::HTMLInputElement):
1768         * html/HTMLTagNames.in:
1769         * html/parser/HTMLStackItem.h:
1770         (WebCore::isSpecialNode):
1771         * html/parser/HTMLTreeBuilder.cpp:
1772         (WebCore::HTMLTreeBuilder::processStartTagForInBody):
1773         (WebCore::HTMLTreeBuilder::processCloseWhenNestedTag): Deleted.
1774         (WebCore::createCaseMap): Deleted.
1775         * html/parser/HTMLTreeBuilder.h:
1776         * platform/network/FormData.cpp:
1777         (WebCore::FormData::appendKeyValuePairItems):
1778
1779 2016-09-12  Per Arne Vollan  <pvollan@apple.com>
1780
1781         [Win] Warning fix.
1782         https://bugs.webkit.org/show_bug.cgi?id=161858
1783
1784         Reviewed by Brent Fulgham.
1785
1786         Use exported constants from CoreText.dll, instead of creating copies.
1787
1788         * PlatformAppleWin.cmake:
1789         * platform/spi/win/CoreTextSPIWin.cpp: Removed.
1790         * platform/spi/win/CoreTextSPIWin.h:
1791
1792 2016-09-12  Youenn Fablet  <youenn@apple.com>
1793
1794         ScriptElement should use FetchOptions::mode according its crossOrigin attribute
1795         https://bugs.webkit.org/show_bug.cgi?id=161686
1796
1797         Reviewed by Darin Adler.
1798
1799         Setting ScriptElement fetch mode according its crossOrigin attribute.
1800         Removing LoadableClassicScriptchecking of CORS since this is now done at ResourceLoader/CachedResource level.
1801
1802         Updating CachedResourceLoader to ensure that a resource that matches an on-going resource load but with different fetch mode/origin,
1803         always gets its loading started if the resource state is not Cached.
1804
1805         Tests: fast/dom/script-crossorigin-loads-fail-origin.html
1806                http/tests/security/cross-origin-cached-images-parallel.html
1807                http/tests/security/cross-origin-cached-images.html
1808                http/tests/security/cross-origin-cached-scripts-parallel.html
1809                http/tests/security/cross-origin-cached-scripts.html
1810                http/tests/security/script-crossorigin-loads-correctly-credentials.html
1811                http/tests/security/script-with-dataurl.html
1812
1813         * dom/LoadableClassicScript.cpp:
1814         (WebCore::LoadableClassicScript::create):
1815         (WebCore::LoadableClassicScript::notifyFinished): Checking CORS failures using the resource state.
1816         (WebCore::LoadableClassicScript::~LoadableClassicScript): Deleted.
1817         (WebCore::LoadableClassicScript::isLoaded): Deleted.
1818         * dom/LoadableClassicScript.h:
1819         * dom/ScriptElement.cpp:
1820         (WebCore::ScriptElement::requestClassicScript):
1821         (WebCore::ScriptElement::requestScriptWithCache): Using CachedResourceRequest::setAsPotentiallyCrossOrigin to set fetch mode according crossOrigin attribute.
1822         * dom/ScriptElement.h:
1823         * loader/cache/CachedImage.cpp:
1824         (WebCore::CachedImage::setBodyDataFrom):
1825         * loader/cache/CachedResourceLoader.cpp:
1826         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Adding support for script resources.
1827         (WebCore::CachedResourceLoader::requestResource): Ensuring that 'updated' resources gets actually loaded.
1828         * loader/cache/CachedScript.cpp:
1829         (WebCore::CachedScript::setBodyDataFrom): Implementing specific data copy from another CachedScript.
1830         * loader/cache/CachedScript.h:
1831
1832 2016-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1833
1834         [GTK] Scrollbar  too large
1835         https://bugs.webkit.org/show_bug.cgi?id=161735
1836
1837         Reviewed by Michael Catanzaro.
1838
1839         We were not calculating the total scrollbar size correctly when the theme defines a minimum width/height. In
1840         that case we need to take the extra size into account (border, margin, padding), but not adding the minimum
1841         size. We were also adjusting the thumb position when rendering in indicator mode, but we really need to adjust
1842         the whole rectangle. This worked in Adwaita because it uses a transparent track when in indicator mode. We are
1843         also now taking into account the text direction when doing this adjustment for the indicator mode.
1844
1845         * platform/gtk/ScrollbarThemeGtk.cpp:
1846         (WebCore::ScrollbarThemeGtk::paint):
1847         (WebCore::ScrollbarThemeGtk::scrollbarThickness):
1848
1849 2016-09-12  Carlos Garcia Campos  <cgarcia@igalia.com>
1850
1851         [GTK] Crash of WebProcess on the last WebView disconnect (take two)
1852         https://bugs.webkit.org/show_bug.cgi?id=161842
1853
1854         Reviewed by Michael Catanzaro.
1855
1856         The problem is that when PlatformDisplayX11 is destroyed, the sharing GL context is deleted and its destructor
1857         makes a downcast of PlatformDisplay to get the native X11 display. We could simply keep a pointer to the native
1858         X11 display in GLContextGLX, got at construction time from the PlatformDisplay, and ensure the sharing GL
1859         context is deleted before the native X11 display is closed.
1860
1861         * platform/graphics/PlatformDisplay.h: Make m_sharingGLContext protected.
1862         * platform/graphics/glx/GLContextGLX.cpp:
1863         (WebCore::GLContextGLX::GLContextGLX): Initialize m_x11Display.
1864         (WebCore::GLContextGLX::~GLContextGLX): Use m_x11Display and remove confusing comment about possible crash with
1865         nviedia closed drivers.
1866         (WebCore::GLContextGLX::defaultFrameBufferSize): Use m_x11Display.
1867         (WebCore::GLContextGLX::makeContextCurrent): Ditto.
1868         (WebCore::GLContextGLX::swapBuffers): Ditto.
1869         (WebCore::GLContextGLX::swapInterval): Ditto.
1870         (WebCore::GLContextGLX::cairoDevice): Ditto.
1871         * platform/graphics/glx/GLContextGLX.h:
1872         * platform/graphics/x11/PlatformDisplayX11.cpp:
1873         (WebCore::PlatformDisplayX11::~PlatformDisplayX11): Delete the sharing GL context before closing the display.
1874
1875 2016-09-12  Chris Dumez  <cdumez@apple.com>
1876
1877         Fix post-landing review comments after r205787
1878         https://bugs.webkit.org/show_bug.cgi?id=161885
1879
1880         Reviewed by Darin Adler.
1881
1882         Leverage new StringBuilder::append(CFStringRef) overload.
1883
1884         * html/parser/HTMLParserIdioms.cpp:
1885         (WebCore::parseHTTPRefreshInternal):
1886         * page/CaptionUserPreferencesMediaAF.cpp:
1887         (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
1888         (WebCore::buildDisplayStringForTrackBase):
1889         * platform/network/mac/CookieJarMac.mm:
1890         (WebCore::cookiesForSession):
1891         * rendering/RenderThemeIOS.mm:
1892         (WebCore::RenderThemeIOS::mediaControlsStyleSheet):
1893         (WebCore::RenderThemeIOS::mediaControlsScript):
1894         * rendering/RenderThemeMac.mm:
1895         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
1896         (WebCore::RenderThemeMac::mediaControlsScript):
1897
1898 2016-09-12  Alex Christensen  <achristensen@webkit.org>
1899
1900         URLParser: Correctly ignore spaces before relative URLs with no scheme
1901         https://bugs.webkit.org/show_bug.cgi?id=161889
1902
1903         Reviewed by Daniel Bates.
1904
1905         Covered by new API tests.
1906
1907         * platform/URLParser.cpp:
1908         (WebCore::URLParser::parse):
1909
1910 2016-09-12  Nan Wang  <n_wang@apple.com>
1911
1912         AX: Crash at WebCore::Range::compareBoundaryPoints(WebCore::Range::CompareHow, WebCore::Range const&, int&) const + 23
1913         https://bugs.webkit.org/show_bug.cgi?id=161878
1914
1915         Reviewed by Chris Fleizach.
1916
1917         In function characterOffsetsInOrder(const CharacterOffset&, const CharacterOffset&), we are creating two
1918         ranges based on the nodes that are associated to the passed in CharacterOffsets. When the first node is a doctype
1919         node, the first range will be a nullptr, and dereferencing it leads to a crash. Fixed this by adding a 
1920         NULL check.
1921
1922         Test: accessibility/mac/doctype-node-in-text-marker-crash.html
1923
1924         * accessibility/AXObjectCache.cpp:
1925         (WebCore::characterOffsetsInOrder):
1926         (WebCore::resetNodeAndOffsetForReplacedNode):
1927
1928 2016-09-12  Said Abou-Hallawa  <sabouhallawa@apple.com>
1929
1930         Move the pixel data of ImageFrame to a separate class named ImageBackingStore
1931         https://bugs.webkit.org/show_bug.cgi?id=159679
1932
1933         Reviewed by Simon Fraser.
1934
1935         Move the pixel data manipulation part in ImageFrame into a separate class
1936         and allocate it on demand.
1937
1938         * PlatformEfl.cmake:
1939         * PlatformGTK.cmake:
1940         * PlatformWinCairo.cmake:
1941         * WebCore.xcodeproj/project.pbxproj:
1942         Add ImageBackingStoreCairo.cpp and remove ImageDecoderCairo.cpp from the
1943         WebKit projects.
1944
1945         * platform/graphics/Color.cpp:
1946         (WebCore::premultipliedChannel): channel = channel * alpha / 255.
1947         (WebCore::unpremultipliedChannel): channel = channel * 255 / alpha.
1948         (WebCore::makePremultipliedRGBA): Un-premultiplied channels to premultiplied RGBA32.
1949         (WebCore::makeUnPremultipliedRGBA): Premultiplied channels to un-premultiplied RGBA32.
1950         (WebCore::colorFromPremultipliedARGB): Use makeUnPremultipliedRGBA.
1951         (WebCore::premultipliedARGBFromColor): Use makePremultipliedRGBA.
1952         * platform/graphics/Color.h:
1953         (WebCore::fastMultiplyBy255): x * 255 = x * 256 - x = x << 8 - x.
1954
1955         * platform/graphics/ImageBackingStore.h: Added.
1956         (WebCore::ImageBackingStore::create): Creates a new ImageBackingStore.
1957         (WebCore::ImageBackingStore::setSize): Changes the pixels size.
1958         (WebCore::ImageBackingStore::setFrameRect): This will always just be the entire buffer except for GIF and PNG frames.
1959         (WebCore::ImageBackingStore::size): Returns the pixels size.
1960         (WebCore::ImageBackingStore::frameRect): Returns the pixels frame rectangle.
1961         (WebCore::ImageBackingStore::clear): Clears the entire image.
1962         (WebCore::ImageBackingStore::clearRect): Clears a rectangle in the image.
1963         (WebCore::ImageBackingStore::repeatFirstRow): Repeats the first row in a rectangle in the image.
1964         (WebCore::ImageBackingStore::pixelAt): Returns a pointer to a pixel data.
1965         (WebCore::ImageBackingStore::setPixel): Sets the color of a pixel in the image.
1966         (WebCore::ImageBackingStore::blendPixel): Blend a color with a pixel in the image.
1967         (WebCore::ImageBackingStore::inBounds): Checks if a rectangle is in the bounds of the image.
1968         (WebCore::ImageBackingStore::isOverSize): Checks whether a size could not be allocated for an image.
1969         (WebCore::ImageBackingStore::ImageBackingStore):
1970
1971         * platform/graphics/cg/NativeImageCG.cpp:
1972         (WebCore::nativeImageHasAlpha): Implement this function. See comments in https://bugs.webkit.org/show_bug.cgi?id=158684.
1973
1974         * platform/image-decoders/ImageDecoder.cpp:
1975         (WebCore::ImageFrame::operator=): copyBitmapData() now copies the frameRect of the ImageBackingStore.
1976         (WebCore::ImageFrame::clearPixelData): The pixels data and the pointer to these pixels are now included in the ImageBackingStore.
1977         (WebCore::ImageFrame::zeroFillPixelData): Clearing the image pixels are now in ImageBackingStore::clear().
1978         (WebCore::ImageFrame::zeroFillFrameRect): Clearing the image pixels are now in ImageBackingStore::clearRect().
1979         (WebCore::ImageFrame::copyBitmapData): We either need to create a new ImageBackingStore or nullify the current one.
1980         (WebCore::ImageFrame::setSize): ImageFrame::setSize() is supposed to be called once and to create the ImageBackingStore.
1981         (WebCore::ImageFrame::setOriginalFrameRect): Delegate this call to ImageBackingStore::setFrameRect().
1982         (WebCore::ImageDecoder::frameBytesAtIndex): ImageFrame::PixelData can be replaced by RGBA32.
1983
1984         * platform/image-decoders/ImageDecoder.h:
1985         (WebCore::ImageFrame::copyRowNTimes): The implementation was moved to ImageBackingStore::repeatFirstRow().
1986         (WebCore::ImageFrame::size): Gets the size of an image from its ImageBackingStore.
1987         (WebCore::ImageFrame::asNewNativeImage): Gets a NtaiveImagePtr from the ImageBackingStore.
1988         (WebCore::ImageFrame::backingStore): Returns a raw pointer to the ImageBackingStore.
1989         (WebCore::ImageFrame::hasBackingStore): Returns whether the ImageFrame has an ImageBackingStore.
1990         (WebCore::ImageFrame::originalFrameRect): Returns the frameRect of the image from its ImageBackingStore.
1991         (WebCore::ImageFrame::pixelAt): Delegates the call to the ImageBackingStore.
1992         (WebCore::ImageFrame::setPixel): Delegates the call to the ImageBackingStore.
1993         (WebCore::ImageFrame::blendPixel): Delegates the call to the ImageBackingStore.
1994         
1995         (WebCore::ImageDecoder::setSize): setSize() now takes an IntSize.
1996         (WebCore::ImageFrame::setOriginalFrameRect): Deleted. Moved to ImageDecoder.cpp.
1997         (WebCore::ImageFrame::setRGBA): Deleted. Renamed to ImageFrame::setPixel().
1998         (WebCore::ImageFrame::getAddr): Deleted. Renamed to ImageFrame::pixelAt().
1999         (WebCore::ImageFrame::hasPixelData): Deleted. Renamed to ImageFrame::hasBackingStore().
2000         (WebCore::ImageFrame::fixPointUnsignedMultiply): Deleted.
2001         (WebCore::ImageFrame::divide255): Deleted. Replaced by fastDivideBy255() from Color.h.
2002         (WebCore::ImageFrame::overRGBA): Deleted. Renamed to ImageFrame::blendPixel().
2003         (WebCore::ImageFrame::width): Deleted.
2004         (WebCore::ImageFrame::height): Deleted.
2005         (WebCore::ImageDecoder::isOverSize): Deleted. Moved to ImageBackingStore::isOverSize().
2006
2007         * platform/image-decoders/bmp/BMPImageReader.cpp:
2008         (WebCore::BMPImageReader::decodeBMP):
2009         (WebCore::BMPImageReader::processInfoHeader):
2010         (WebCore::BMPImageReader::processNonRLEData):
2011         * platform/image-decoders/bmp/BMPImageReader.h:
2012         (WebCore::BMPImageReader::setI):
2013         (WebCore::BMPImageReader::setPixel):
2014         (WebCore::BMPImageReader::fillRGBA):
2015         (WebCore::BMPImageReader::setRGBA): Deleted.
2016         * platform/image-decoders/cairo/ImageBackingStoreCairo.cpp: Added.
2017         (WebCore::ImageBackingStore::image):
2018         * platform/image-decoders/cairo/ImageDecoderCairo.cpp: Removed.
2019         * platform/image-decoders/gif/GIFImageDecoder.cpp:
2020         (WebCore::GIFImageDecoder::setSize):
2021         (WebCore::GIFImageDecoder::haveDecodedRow):
2022         (WebCore::GIFImageDecoder::initFrameBuffer):
2023         * platform/image-decoders/gif/GIFImageDecoder.h:
2024         * platform/image-decoders/gif/GIFImageReader.cpp:
2025         (GIFImageReader::parse):
2026         * platform/image-decoders/ico/ICOImageDecoder.cpp:
2027         (WebCore::ICOImageDecoder::setSize):
2028         (WebCore::ICOImageDecoder::processDirectoryEntries):
2029         * platform/image-decoders/ico/ICOImageDecoder.h:
2030         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
2031         (WebCore::JPEGImageReader::decode):
2032         (WebCore::JPEGImageDecoder::setSize):
2033         (WebCore::setPixel):
2034         (WebCore::JPEGImageDecoder::outputScanlines):
2035         * platform/image-decoders/jpeg/JPEGImageDecoder.h:
2036         * platform/image-decoders/png/PNGImageDecoder.cpp:
2037         (WebCore::PNGImageDecoder::setSize):
2038         (WebCore::PNGImageDecoder::headerAvailable):
2039         (WebCore::setPixelRGB):
2040         (WebCore::setPixelRGBA):
2041         (WebCore::setPixelPremultipliedRGBA):
2042         (WebCore::PNGImageDecoder::rowAvailable):
2043         (WebCore::PNGImageDecoder::initFrameBuffer):
2044         (WebCore::PNGImageDecoder::frameComplete):
2045         * platform/image-decoders/png/PNGImageDecoder.h:
2046         * platform/image-decoders/webp/WEBPImageDecoder.cpp:
2047         (WebCore::WEBPImageDecoder::decode):
2048         - Send an IntSize to ImageFrame::setSize() and ImageDecoder::setSize().
2049         - Replace ImageFrame::PixelData by RGBA32.
2050         - No need to call ImageFrame::setOriginalFrameRect() if this sets the
2051           frameRect to the entire image rectangle since this is done by default
2052           in ImageBackingStore::setSize().
2053         - ImageBackingStore::image() now replaces ImageFrame::asNewNativeImage().
2054         - ImageFrame::setPixel() now replaces ImageFrame::setRGBA().
2055         - ImageFrame::blendPixel() now replaces ImageFrame::overRGBA().
2056         - ImageFrame::pixelAt() now replaces ImageFrame::getAddr().
2057
2058 2016-09-12  Joseph Pecoraro  <pecoraro@apple.com>
2059
2060         HTMLButtonElement.prototype.click should be HTMLElement.prototype.click
2061         https://bugs.webkit.org/show_bug.cgi?id=161874
2062
2063         Reviewed by Chris Dumez.
2064
2065         Test: fast/dom/HTMLButtonElement/click.html
2066
2067         * html/HTMLButtonElement.idl:
2068         Remove the unnecessary 'click' definition. It already exists in HTMLElement.
2069         If this was needed for ObjC code generation on DOMHTMLButtonElement, then
2070         the extra definition is no longer needed now that ObjC bindings have moved.
2071
2072 2016-09-12  Alex Christensen  <achristensen@webkit.org>
2073
2074         URLParser: Fix relative URLs containing only fragments
2075         https://bugs.webkit.org/show_bug.cgi?id=161882
2076
2077         Reviewed by Brady Eidson.
2078
2079         Covered by new API tests.
2080
2081         * platform/URLParser.cpp:
2082         (WebCore::URLParser::parse):
2083
2084 2016-09-12  Alex Christensen  <achristensen@webkit.org>
2085
2086         URLParser: Correctly handle relative URLs that are just a scheme and a colon
2087         https://bugs.webkit.org/show_bug.cgi?id=161876
2088
2089         Reviewed by Brady Eidson.
2090
2091         Covered by new API tests.
2092
2093         * platform/URLParser.cpp:
2094         (WebCore::URLParser::parse):
2095
2096 2016-09-12  Dean Jackson  <dino@apple.com>
2097
2098         Remove OptionalColor
2099         https://bugs.webkit.org/show_bug.cgi?id=161853
2100         <rdar://problem/28252385>
2101
2102         Reviewed by Alex Christensen.
2103
2104         OptionalColor isn't used. The concept will be implemented
2105         in a different manner.
2106
2107         * platform/graphics/Color.h:
2108
2109 2016-09-12  Simon Fraser  <simon.fraser@apple.com>
2110
2111         Add Intersection Observer to the features.json file.
2112
2113         * features.json:
2114
2115 2016-09-12  Myles C. Maxfield  <mmaxfield@apple.com>
2116
2117         [Cocoa] Reduce uses of CGFonts in favor of CTFonts
2118         https://bugs.webkit.org/show_bug.cgi?id=161809
2119
2120         Reviewed by Daniel Bates.
2121
2122         Eventually, we want to remove the cgFont() member of PlatformFontData for both memory
2123         savings and conceptual clarity. Because there is no performance loss from moving from
2124         CGFontGetGlyphsForUnichars() to CTFontGetGlyphsForCharacters(), making this switch
2125         gets us closer to reducing the uses of cgFont().
2126
2127         No new tests because there is no behavior change.
2128
2129         * platform/graphics/Font.cpp:
2130         (WebCore::createAndFillGlyphPage):
2131         * platform/graphics/GlyphPage.h:
2132         (WebCore::GlyphData::GlyphData):
2133         * platform/graphics/mac/GlyphPageMac.cpp:
2134         (WebCore::shouldFillWithVerticalGlyphs):
2135         (WebCore::GlyphPage::fill):
2136         (WebCore::shouldUseCoreText): Deleted.
2137
2138 2016-09-12  Alex Christensen  <achristensen@webkit.org>
2139
2140         Remove trailing control characters and spaces before parsing a URL
2141         https://bugs.webkit.org/show_bug.cgi?id=161870
2142
2143         Reviewed by Tim Horton.
2144
2145         Covered by new API tests.
2146
2147         * platform/URLParser.cpp:
2148         (WebCore::bufferView):
2149         (WebCore::URLParser::parse):
2150
2151 2016-09-12  Chris Dumez  <cdumez@apple.com>
2152
2153         window.performance object resets script-applied properties
2154         https://bugs.webkit.org/show_bug.cgi?id=137407
2155
2156         Reviewed by Darin Adler.
2157
2158         Make sure the window.performance wrapper stays alive for as long as the
2159         associated frame, similarly to what we do for window.screen.
2160
2161         Test: fast/performance/performance-object-gc.html
2162
2163         * page/Performance.idl:
2164
2165 2016-09-12  Saam Barati  <sbarati@apple.com>
2166
2167         Add WebKit support for an option in Safari's debug menu similar to "Get Bytecode Profile" but for the Sampling Profiler's data
2168         https://bugs.webkit.org/show_bug.cgi?id=161785
2169
2170         Reviewed by Tim Horton.
2171
2172         * ForwardingHeaders/runtime/SamplingProfiler.h: Added.
2173
2174 2016-09-12  Dave Hyatt  <hyatt@apple.com>
2175
2176         [CSS Parser] Add support for the parsing of the HTML sizes attribute
2177         https://bugs.webkit.org/show_bug.cgi?id=161868
2178
2179         Reviewed by Dean Jackson.
2180
2181         This patch adds the parsers for the sizes attribute. This code is heavily modified
2182         from Blink, and it really only makes use of the tokenization/parsing code. What is done
2183         with the results involves the same original code that we used over in SourceSizeList.cpp.
2184
2185         * CMakeLists.txt:
2186         * WebCore.xcodeproj/project.pbxproj:
2187         * css/parser/SizesAttributeParser.cpp: Added.
2188         (WebCore::SizesAttributeParser::computeLength):
2189         (WebCore::SizesAttributeParser::SizesAttributeParser):
2190         (WebCore::SizesAttributeParser::length):
2191         (WebCore::SizesAttributeParser::calculateLengthInPixels):
2192         (WebCore::SizesAttributeParser::mediaConditionMatches):
2193         (WebCore::SizesAttributeParser::parse):
2194         (WebCore::SizesAttributeParser::effectiveSize):
2195         (WebCore::SizesAttributeParser::effectiveSizeDefaultValue):
2196         * css/parser/SizesAttributeParser.h: Added.
2197         * css/parser/SizesCalcParser.cpp: Added.
2198         (WebCore::SizesCalcParser::SizesCalcParser):
2199         (WebCore::SizesCalcParser::result):
2200         (WebCore::operatorPriority):
2201         (WebCore::SizesCalcParser::handleOperator):
2202         (WebCore::SizesCalcParser::appendNumber):
2203         (WebCore::SizesCalcParser::appendLength):
2204         (WebCore::SizesCalcParser::appendOperator):
2205         (WebCore::SizesCalcParser::calcToReversePolishNotation):
2206         (WebCore::operateOnStack):
2207         (WebCore::SizesCalcParser::calculate):
2208         * css/parser/SizesCalcParser.h: Added.
2209         (WebCore::SizesCalcValue::SizesCalcValue):
2210         (WebCore::SizesCalcParser::isValid):
2211
2212 2016-09-12  Jer Noble  <jer.noble@apple.com>
2213
2214         Fix failing mediasource-play.html and mediasource-config-change-mp4-v-bitrate.html tests
2215         https://bugs.webkit.org/show_bug.cgi?id=161819
2216
2217         Reviewed by Eric Carlson.
2218
2219         Fixes tests: imported/w3c/web-platform-tests/media-source/mediasource-play.html
2220                      imported/w3c/web-platform-tests/media-source/mediasource-sourcebuffer-mode.html
2221
2222         The newest revision of the web-platform-test suite for Media Source tests new behavior
2223         added to the MSE specification. Specifically, setting a MediaSource's duration will no
2224         longer implicitly truncate the source's active SourceBuffer objects.
2225
2226         * Modules/mediasource/MediaSource.cpp:
2227         (WebCore::MediaSource::setDuration): Return exception if issued by setDurationInternal.
2228         (WebCore::MediaSource::setDurationInternal): Bring "duration change" algorithm up to spec.
2229         * Modules/mediasource/MediaSource.h:
2230         * Modules/mediasource/SampleMap.h:
2231         (WebCore::PresentationOrderSampleMap::begin): Add const accessor.
2232         (WebCore::PresentationOrderSampleMap::end): Ditto.
2233         (WebCore::PresentationOrderSampleMap::rbegin): Ditto.
2234         (WebCore::PresentationOrderSampleMap::rend): DItto.
2235         (WebCore::DecodeOrderSampleMap::begin): Ditto.
2236         (WebCore::DecodeOrderSampleMap::end): Ditto.
2237         (WebCore::DecodeOrderSampleMap::rbegin): Ditto.
2238         (WebCore::DecodeOrderSampleMap::rend): Ditto.
2239         * Modules/mediasource/SourceBuffer.cpp:
2240         (WebCore::SourceBuffer::highestPresentationTimestamp): Added convenience method.
2241         (WebCore::SourceBuffer::removeCodedFrames): Drive-by fix; use .values() rather than
2242             pulling the value out of each HashMap iterator.
2243         * Modules/mediasource/SourceBuffer.h:
2244
2245 2016-09-12  Chris Dumez  <cdumez@apple.com>
2246
2247         Switch remaining users of Document::inPageCache() to pageCacheState()
2248         https://bugs.webkit.org/show_bug.cgi?id=161865
2249
2250         Reviewed by Darin Adler.
2251
2252         Switch remaining users of Document::inPageCache() to pageCacheState() as
2253         the former one is confusing (given that it returns true while the
2254         pagehide event is being fired).
2255
2256         * dom/Document.cpp:
2257         (WebCore::Document::scheduleStyleRecalc):
2258         (WebCore::Document::fontsNeedUpdate):
2259         (WebCore::Document::removeFocusedNodeOfSubtree):
2260         (WebCore::Document::setFocusedElement):
2261         (WebCore::Document::takeDOMWindowFrom):
2262         (WebCore::Document::topDocument):
2263         (WebCore::Document::webkitWillEnterFullScreenForElement):
2264         (WebCore::Document::webkitDidEnterFullScreenForElement):
2265         (WebCore::Document::webkitWillExitFullScreenForElement):
2266         (WebCore::Document::webkitDidExitFullScreenForElement):
2267         * dom/Document.h:
2268         (WebCore::Document::needsStyleRecalc):
2269         (WebCore::Document::inPageCache): Deleted.
2270         * history/CachedFrame.cpp:
2271         (WebCore::CachedFrame::CachedFrame):
2272         (WebCore::CachedFrame::clear):
2273         (WebCore::CachedFrame::destroy):
2274         * html/HTMLMediaElement.cpp:
2275         (WebCore::mediaElementIsAllowedToAutoplay):
2276         * html/HTMLPlugInImageElement.cpp:
2277         (WebCore::HTMLPlugInImageElement::createElementRenderer):
2278         * loader/DocumentLoader.cpp:
2279         (WebCore::DocumentLoader::addSubresourceLoader):
2280         * loader/HistoryController.cpp:
2281         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
2282         * page/DOMWindow.cpp:
2283         (WebCore::DOMWindow::decrementScrollEventListenersCount):
2284         * page/FrameView.cpp:
2285         (WebCore::FrameView::layout):
2286         * page/animation/AnimationBase.cpp:
2287         (WebCore::AnimationBase::setNeedsStyleRecalc):
2288         * page/animation/AnimationController.cpp:
2289         (WebCore::AnimationControllerPrivate::updateAnimations):
2290         (WebCore::AnimationControllerPrivate::addElementChangeToDispatch):
2291         (WebCore::AnimationController::cancelAnimations):
2292         (WebCore::AnimationController::updateAnimations):
2293         * page/animation/ImplicitAnimation.cpp:
2294         (WebCore::ImplicitAnimation::sendTransitionEvent):
2295         * page/animation/KeyframeAnimation.cpp:
2296         (WebCore::KeyframeAnimation::sendAnimationEvent):
2297         * page/scrolling/AsyncScrollingCoordinator.cpp:
2298         (WebCore::AsyncScrollingCoordinator::requestScrollPositionUpdate):
2299         * rendering/RenderElement.cpp:
2300         (WebCore::shouldRepaintForImageAnimation):
2301         (WebCore::RenderElement::newImageAnimationFrameAvailable):
2302         * rendering/RenderImage.cpp:
2303         (WebCore::RenderImage::imageChanged):
2304         * rendering/RenderLayerCompositor.cpp:
2305         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2306         (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking):
2307         (WebCore::RenderLayerCompositor::didAddScrollingLayer):
2308         * rendering/RenderObject.cpp:
2309         (WebCore::printRenderTreeForLiveDocuments):
2310         (WebCore::printLayerTreeForLiveDocuments):
2311         * rendering/RenderView.cpp:
2312         (WebCore::RenderView::lazyRepaintTimerFired):
2313         * rendering/SimpleLineLayout.cpp:
2314         (WebCore::SimpleLineLayout::collectNonEmptyLeafRenderBlockFlowsForCurrentPage):
2315
2316 2016-09-12  Keith Rollin  <krollin@apple.com>
2317
2318         Enhance Network logging
2319         https://bugs.webkit.org/show_bug.cgi?id=161771
2320
2321         Reviewed by Antti Koivisto.
2322
2323         Modify current logging statements to follow a consistent pattern in
2324         order to enhance readability and parsing.
2325
2326         No new tests -- there are no tests for logging.
2327
2328         * loader/FrameLoader.cpp:
2329         (WebCore::FrameLoader::prepareForLoadStart):
2330         (WebCore::FrameLoader::checkLoadCompleteForThisFrame):
2331
2332 2016-09-12  Brady Eidson  <beidson@apple.com>
2333
2334         Crash in com.apple.WebCore: WebCore::NavigatorGamepad::gamepadFromPlatformGamepad.
2335         <rdar://problem/28018073> and https://bugs.webkit.org/show_bug.cgi?id=161694
2336
2337         Reviewed by Alex Christensen.
2338
2339         No new tests (Caught by existing tests in some configurations).
2340
2341         * Modules/gamepad/GamepadManager.cpp:
2342         (WebCore::GamepadManager::platformGamepadInputActivity): Null check.
2343
2344 2016-09-12  Alex Christensen  <achristensen@webkit.org>
2345
2346         Fix more URLParser quirks
2347         https://bugs.webkit.org/show_bug.cgi?id=161834
2348
2349         Reviewed by Brady Eidson.
2350
2351         Added new API tests.
2352
2353         * platform/URLParser.cpp:
2354         (WebCore::URLParser::parse):
2355         Skip some tabs and newlines.  The spec says to remove them before processing the String,
2356         but to reduce allocations I am skipping them whenever we increment an iterator.
2357         Fix a few other quirks to be more web platform conformant.
2358
2359 2016-09-09  Alex Christensen  <achristensen@webkit.org>
2360
2361         Optimize URLParser performance
2362         https://bugs.webkit.org/show_bug.cgi?id=161837
2363
2364         Reviewed by Brady Eidson.
2365
2366         No change in behavior.  Existing behavior covered by API tests and added a new API test.
2367
2368         * platform/URLParser.cpp:
2369         (WebCore::isDefaultPort):
2370         Use switch statements instead of HashMap lookups.
2371         (WebCore::isSpecialScheme):
2372         Use switch statements instead of repeated String comparisons.
2373         (WebCore::URLParser::parsePort):
2374         Reduce String allocation.
2375
2376 2016-09-12  Simon Fraser  <simon.fraser@apple.com>
2377
2378         Make -webkit-transition-* and -webkit-animation-* properties be pure aliases of the unprefixed ones
2379         https://bugs.webkit.org/show_bug.cgi?id=160478
2380
2381         Reviewed by Dean Jackson.
2382         
2383         Remove the custom -webkit prefixed transition and animation properties, and just make
2384         them aliases of the unprefixed ones, as we do for transforms.
2385         
2386         -webkit-animation-trigger remains as the only prefixed-only animation property.
2387         
2388         This is mostly code deletion.
2389
2390         Test: fast/css/longhand-overrides-shorthand-prefixing.html
2391
2392         * css/CSSComputedStyleDeclaration.cpp:
2393         (WebCore::ComputedStyleExtractor::propertyValue):
2394         * css/CSSProperty.h:
2395         (WebCore::prefixingVariantForPropertyId): Deleted.
2396         * css/CSSPropertyNames.in:
2397         * css/CSSToStyleMap.cpp:
2398         (WebCore::CSSToStyleMap::mapAnimationDelay):
2399         (WebCore::CSSToStyleMap::mapAnimationDirection):
2400         (WebCore::CSSToStyleMap::mapAnimationDuration):
2401         (WebCore::CSSToStyleMap::mapAnimationFillMode):
2402         (WebCore::CSSToStyleMap::mapAnimationIterationCount):
2403         (WebCore::CSSToStyleMap::mapAnimationName):
2404         (WebCore::CSSToStyleMap::mapAnimationPlayState):
2405         (WebCore::CSSToStyleMap::mapAnimationProperty):
2406         (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
2407         * css/PropertySetCSSStyleDeclaration.cpp:
2408         (WebCore::PropertySetCSSStyleDeclaration::getPropertyCSSValueInternal):
2409         (WebCore::PropertySetCSSStyleDeclaration::getPropertyValueInternal):
2410         * css/StyleProperties.cpp:
2411         (WebCore::StyleProperties::getPropertyValue):
2412         (WebCore::MutableStyleProperties::removeShorthandProperty):
2413         (WebCore::StyleProperties::asText):
2414         * css/StylePropertyShorthand.cpp:
2415         (WebCore::animationShorthandForParsing):
2416         * css/StylePropertyShorthand.h:
2417         * css/StyleResolver.cpp:
2418         (WebCore::StyleResolver::styleForKeyframe):
2419         * css/parser/CSSParser.cpp:
2420         (WebCore::CSSParser::parseValue):
2421         (WebCore::CSSParser::parseAnimationShorthand):
2422         (WebCore::CSSParser::parseTransitionShorthand):
2423         (WebCore::CSSParser::parseAnimationProperty):
2424         (WebCore::CSSParser::addPropertyWithPrefixingVariant): Deleted.
2425         * css/parser/CSSParser.h:
2426         * html/shadow/MediaControlElements.cpp:
2427         (WebCore::MediaControlPanelElement::makeOpaque):
2428         (WebCore::MediaControlPanelElement::makeTransparent):
2429
2430 2016-09-12  Per Arne Vollan  <pvollan@apple.com>
2431
2432         Unreviewed build fix after r205090.
2433
2434         * platform/cf/MediaAccessibilitySoftLink.cpp:
2435
2436 2016-09-12  Javier Fernandez  <jfernandez@igalia.com>
2437
2438         [css-align] Initial values are parsed as invalid for some Alignment properties
2439         https://bugs.webkit.org/show_bug.cgi?id=161303
2440
2441         Reviewed by Darin Adler.
2442
2443         Due to the implementation of the new CSS Box Alignment specification,
2444         some properties have now new values allowed, which are not valid
2445         according to the Flexible Box Layout specification.
2446
2447         In r205102 we have get back the keywordID parsing, originally implemented for
2448         the Flexbible Box Layout specification. Even though the new valued would be
2449         parsed as invalid when they are set, the 'initial' values will be assigned
2450         in any case.
2451
2452         This patch verifies that the 'initial' values depend on whether the Grid
2453         Layout is enabled or not and verifying such values are parsed as valid.
2454
2455         Additionally, it gets back as well they keywordID parsing for the Content
2456         Alignment properties (align-content and justify-content). This required to
2457         touch a bit the StyleBuilderConverter logic, since we will have to deal with
2458         either the complex CSSContentDistributionValue complex or the  simpler
2459         CSSPrimitiveValue.
2460
2461         Test: fast/css/ensure-flexbox-compatibility-with-initial-values.html
2462
2463         * css/StyleBuilderConverter.h:
2464         (WebCore::StyleBuilderConverter::convertContentAlignmentData): Handling a primitive value if Grid Layout is not enabled.
2465         * css/parser/CSSParser.cpp:
2466         (WebCore::isValidKeywordPropertyAndValue): Simpler parsing of alignment properties if Grid Layout is not enabled.
2467         (WebCore::isKeywordPropertyID): Alignment properties are defined as keyword if Grid Layout is no enabled.
2468         (WebCore::CSSParser::parseValue): Assert Grid Layout is enabled when using the complex parsing.
2469         * rendering/style/RenderStyle.cpp:
2470         (WebCore::RenderStyle::isCSSGridLayoutEnabled): Checking out the Grid Layout runtime flags.
2471         * rendering/style/RenderStyle.h:
2472         (WebCore::RenderStyle::initialDefaultAlignment): Initial value will depend on whether Grid Layout is enabled or not.
2473         (WebCore::RenderStyle::initialContentAlignment): Initial value will depend on whether Grid Layout is enabled or not.
2474
2475 2016-09-12  Chris Dumez  <cdumez@apple.com>
2476
2477         ol.start may return incorrect value for reversed lists when not explicitly set
2478         https://bugs.webkit.org/show_bug.cgi?id=161713
2479
2480         Reviewed by Ryosuke Niwa.
2481
2482         Fix style nit after r205689.
2483
2484         * html/HTMLOListElement.cpp:
2485         (WebCore::HTMLOListElement::itemCount):
2486         (WebCore::HTMLOListElement::itemCountAfterLayout):
2487         * html/HTMLOListElement.h:
2488
2489 2016-09-12  Chris Dumez  <cdumez@apple.com>
2490
2491         Start using Document::pageCacheState() instead of Document::inPageCache()
2492         https://bugs.webkit.org/show_bug.cgi?id=161851
2493
2494         Reviewed by Ryosuke Niwa.
2495
2496         Start using Document::pageCacheState() instead of Document::inPageCache()
2497         as the latter one is confusing (given that it is true when firing the
2498         pagehide event, when the document is about to enter page cache).
2499
2500         * loader/FrameLoader.cpp:
2501         (WebCore::FrameLoader::closeURL):
2502         (WebCore::FrameLoader::clear):
2503         (WebCore::FrameLoader::dispatchUnloadEvents):
2504         * loader/cache/CachedResource.cpp:
2505         (WebCore::CachedResource::load):
2506         * page/Page.cpp:
2507         (WebCore::incrementFrame): Deleted.
2508         * page/Page.h:
2509
2510 2016-09-11  Chris Dumez  <cdumez@apple.com>
2511
2512         HTMLTrackElement.kind's invalid value default should be the metadata state
2513         https://bugs.webkit.org/show_bug.cgi?id=161840
2514
2515         Reviewed by Eric Carlson.
2516
2517         HTMLTrackElement.kind's invalid value default should be the metadata state,
2518         not the subtitles state:
2519         - https://html.spec.whatwg.org/#attr-track-kind
2520
2521         Chrome agrees with the specification.
2522
2523         No new tests, rebaselined existing tests.
2524
2525         * html/track/TextTrack.cpp:
2526         (WebCore::TextTrack::setKindKeywordIgnoringASCIICase):
2527
2528 2016-09-11  Dave Hyatt  <hyatt@apple.com>
2529
2530         [CSS Parser] Add the main parser implementation
2531         https://bugs.webkit.org/show_bug.cgi?id=161813
2532
2533         Reviewed by Dean Jackson.
2534
2535         This patch adds the main CSSParserImpl that handles stylesheet and rule parsing. All parsing starts with this
2536         class (it will eventually be invoked from the CSSParser). This patch also adds @supports parsing.
2537
2538         * WebCore.xcodeproj/project.pbxproj:
2539         * css/CSSKeyframeRule.cpp:
2540         (WebCore::StyleKeyframe::StyleKeyframe):
2541         * css/CSSKeyframeRule.h:
2542         * css/StyleRule.cpp:
2543         (WebCore::StyleRuleBase::destroy):
2544         (WebCore::StyleRuleBase::copy):
2545         (WebCore::StyleRuleBase::createCSSOMWrapper):
2546         (WebCore::StyleRuleCharset::StyleRuleCharset):
2547         (WebCore::StyleRuleCharset::~StyleRuleCharset):
2548         (WebCore::StyleRuleNamespace::StyleRuleNamespace):
2549         (WebCore::StyleRuleNamespace::~StyleRuleNamespace):
2550         * css/StyleRule.h:
2551         (WebCore::StyleRuleBase::isNamespaceRule):
2552         (isType):
2553         (WebCore::StyleRuleBase::isKeyframesRule): Deleted.
2554         * css/StyleSheetContents.cpp:
2555         (WebCore::traverseSubresourcesInRules):
2556         * css/parser/CSSParserImpl.cpp: Added.
2557         (WebCore::CSSParserImpl::CSSParserImpl):
2558         (WebCore::CSSParserImpl::parseValue):
2559         (WebCore::CSSParserImpl::parseVariableValue):
2560         (WebCore::filterProperties):
2561         (WebCore::createStyleProperties):
2562         (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
2563         (WebCore::CSSParserImpl::parseDeclarationList):
2564         (WebCore::CSSParserImpl::parseRule):
2565         (WebCore::CSSParserImpl::parseStyleSheet):
2566         (WebCore::CSSParserImpl::parsePageSelector):
2567         (WebCore::CSSParserImpl::parseCustomPropertySet):
2568         (WebCore::CSSParserImpl::parseKeyframeKeyList):
2569         (WebCore::CSSParserImpl::supportsDeclaration):
2570         (WebCore::CSSParserImpl::parseDeclarationListForInspector):
2571         (WebCore::CSSParserImpl::parseStyleSheetForInspector):
2572         (WebCore::computeNewAllowedRules):
2573         (WebCore::CSSParserImpl::consumeRuleList):
2574         (WebCore::CSSParserImpl::consumeAtRule):
2575         (WebCore::CSSParserImpl::consumeQualifiedRule):
2576         (WebCore::consumeStringOrURI):
2577         (WebCore::CSSParserImpl::consumeCharsetRule):
2578         (WebCore::CSSParserImpl::consumeImportRule):
2579         (WebCore::CSSParserImpl::consumeNamespaceRule):
2580         (WebCore::CSSParserImpl::consumeMediaRule):
2581         (WebCore::CSSParserImpl::consumeSupportsRule):
2582         (WebCore::CSSParserImpl::consumeViewportRule):
2583         (WebCore::CSSParserImpl::consumeFontFaceRule):
2584         (WebCore::CSSParserImpl::consumeKeyframesRule):
2585         (WebCore::CSSParserImpl::consumePageRule):
2586         (WebCore::CSSParserImpl::consumeKeyframeStyleRule):
2587         (WebCore::observeSelectors):
2588         (WebCore::CSSParserImpl::consumeStyleRule):
2589         (WebCore::CSSParserImpl::consumeDeclarationList):
2590         (WebCore::CSSParserImpl::consumeDeclaration):
2591         (WebCore::CSSParserImpl::consumeVariableValue):
2592         (WebCore::CSSParserImpl::consumeDeclarationValue):
2593         (WebCore::CSSParserImpl::consumeKeyframeKeyList):
2594         * css/parser/CSSParserImpl.h: Added.
2595         * css/parser/CSSParserValues.cpp:
2596         (WebCore::CSSParserSelector::parsePagePseudoSelector):
2597         * css/parser/CSSParserValues.h:
2598         * css/parser/CSSPropertyParser.cpp:
2599         (WebCore::CSSPropertyParser::parseValue):
2600         * css/parser/CSSSupportsParser.cpp: Added.
2601         (WebCore::CSSSupportsParser::supportsCondition):
2602         (WebCore::CSSSupportsParser::consumeCondition):
2603         (WebCore::CSSSupportsParser::consumeNegation):
2604         (WebCore::CSSSupportsParser::consumeConditionInParenthesis):
2605         * css/parser/CSSSupportsParser.h: Added.
2606         (WebCore::CSSSupportsParser::CSSSupportsParser):
2607
2608 2016-09-11  Tim Horton  <timothy_horton@apple.com>
2609
2610         Candidates that don't end in spaces shouldn't have spaces arbitrarily appended to them
2611         https://bugs.webkit.org/show_bug.cgi?id=161846
2612         <rdar://problem/28245097>
2613
2614         Reviewed by Beth Dakin.
2615
2616         Tests: editing/mac/spelling/accept-candidate-without-adding-space.html,
2617                editing/mac/spelling/accept-candidate-allows-autocorrect-on-next-word.html
2618
2619         * editing/Editor.cpp:
2620         (WebCore::Editor::handleAcceptedCandidate):
2621         Stop appending a space just because the candidate doesn't end in a space.
2622         There are languages where that doesn't make sense, and the platform
2623         guarantees that candidates will always have spaces if they need them.
2624
2625         Also, adjust the way we compute the AcceptedCandidate document marker range.
2626         There were two problems with the existing code: it expanded outward from
2627         the post-insertion cursor in *both* directions, instead of just backwards,
2628         and it used the length of the replaced text, not the length of the newly
2629         inserted text (more of the confusion mentioned in r205765).
2630
2631 2016-09-10  Chris Dumez  <cdumez@apple.com>
2632
2633         parseHTMLInteger() should take a StringView in parameter
2634         https://bugs.webkit.org/show_bug.cgi?id=161669
2635
2636         Reviewed by Ryosuke Niwa.
2637
2638         parseHTMLInteger() should take a StringView in parameter instead of a
2639         const String&.
2640
2641         * css/parser/CSSParser.cpp:
2642         (WebCore::CSSParser::parseFontFaceSrcLocal):
2643         * css/parser/CSSParserValues.h:
2644         (WebCore::CSSParserString::toStringView):
2645         Add toStringView() to avoid unnecessarily constructing a String for
2646         calling StringBuilder::append().
2647
2648         * html/parser/HTMLParserIdioms.cpp:
2649         (WebCore::parseHTMLInteger):
2650         (WebCore::parseHTMLNonNegativeInteger):
2651         (WebCore::parseHTTPRefreshInternal):
2652         * html/parser/HTMLParserIdioms.h:
2653         (WebCore::limitToOnlyHTMLNonNegativeNumbersGreaterThanZero):
2654         (WebCore::limitToOnlyHTMLNonNegative):
2655         Take a StringView in parameter instead of a const String&.
2656
2657         * platform/sql/SQLiteStatement.cpp:
2658         (WebCore::SQLiteStatement::isColumnDeclaredAsBlob):
2659         Avoid unnecessarily constructing a String to call equalLettersIgnoringASCIICase()
2660         by leveraging the StringView constructor taking a 'const char*' in parameter.
2661
2662         * rendering/RenderBlock.cpp:
2663         (WebCore::RenderBlock::constructTextRun):
2664         * rendering/RenderBlock.h:
2665         Add constructTextRun() overload taking an AtomicString. It was otherwise ambiguous
2666         because both a String or a StringView could be constructed from an AtomicString.
2667
2668         * page/CaptionUserPreferencesMediaAF.cpp:
2669         (WebCore::CaptionUserPreferencesMediaAF::captionsDefaultFontCSS):
2670         (WebCore::buildDisplayStringForTrackBase):
2671         * rendering/RenderThemeMac.mm:
2672         (WebCore::RenderThemeMac::mediaControlsStyleSheet):
2673         (WebCore::RenderThemeMac::mediaControlsScript):
2674         Explicitly construct a String from NSString / CFStringRef types as such calls are
2675         now ambiguous.
2676
2677 2016-09-10  Chris Dumez  <cdumez@apple.com>
2678
2679         It is possible for Document::m_frame pointer to become stale
2680         https://bugs.webkit.org/show_bug.cgi?id=161812
2681         <rdar://problem/27745023>
2682
2683         Reviewed by Ryosuke Niwa.
2684
2685         Document::m_frame is supposed to get cleared by Document::prepareForDestruction().
2686         The Frame destructor calls Frame::setView(nullptr) which is supposed to call the
2687         prepareForDestruction() on the Frame's associated document. However,
2688         Frame::setView(nullptr) was calling prepareForDestruction() only if
2689         Document::inPageCache() returned true. This is because, we allow Documents to
2690         stay alive in the PageCache even though they don't have a frame.
2691
2692         The issue is that Document::m_inPageCache flag was set to true right before
2693         firing the pagehide event, so technically before really entering PageCache.
2694         Therefore, we can run into problems if a Frame gets destroyed by a pagehide
2695         EventHandler because ~Frame() will not call Document::prepareForDestruction()
2696         due to Document::m_inPageCache being true. After the frame is destroyed,
2697         Document::m_frame becomes stale and any action on the document will likely
2698         lead to crashes (such as the one in the layout test and the radar which
2699         happens when trying to unregister event listeners from the document).
2700
2701         The solution adopted in this patch is to replace the m_inPageCache boolean
2702         with a m_pageCacheState enumeration that has 3 states:
2703         - NotInPageCache
2704         - AboutToEnterPageCache
2705         - InPageCache
2706
2707         Frame::setView() / Frame::setDocument() were then updated to call
2708         Document::prepareForDestruction() on the associated document whenever
2709         the document's pageCacheState is not InPageCache. This means that we
2710         will now call Document::prepareForDestruction() when the document is
2711         being detached from its frame while firing the pagehide event.
2712
2713         Note that I tried to keep this patch minimal. Therefore, I kept
2714         the Document::inPageCache() getter for now. I plan to switch all its
2715         calls sites to the new Document::pageCacheState() getter in a follow-up
2716         patch so that we can finally drop the confusing Document::inPageCache().
2717
2718         Test: fast/history/pagehide-remove-iframe-crash.html
2719
2720         * dom/Document.cpp:
2721         (WebCore::Document::Document):
2722         (WebCore::Document::~Document):
2723         (WebCore::Document::createRenderTree):
2724         (WebCore::Document::destroyRenderTree):
2725         (WebCore::Document::setFocusedElement):
2726         (WebCore::Document::setPageCacheState):
2727         (WebCore::Document::topDocument):
2728         * dom/Document.h:
2729         (WebCore::Document::pageCacheState):
2730         (WebCore::Document::inPageCache):
2731         * history/CachedFrame.cpp:
2732         (WebCore::CachedFrame::destroy):
2733         * history/PageCache.cpp:
2734         (WebCore::setPageCacheState):
2735         (WebCore::PageCache::addIfCacheable):
2736         * loader/FrameLoader.cpp:
2737         (WebCore::FrameLoader::stopAllLoaders):
2738         (WebCore::FrameLoader::open):
2739         * loader/HistoryController.cpp:
2740         (WebCore::HistoryController::invalidateCurrentItemCachedPage):
2741         * page/Frame.cpp:
2742         (WebCore::Frame::setView):
2743
2744 2016-09-10  Wenson Hsieh  <wenson_hsieh@apple.com>
2745
2746         Apple.com keynote does not display media controls
2747         https://bugs.webkit.org/show_bug.cgi?id=161833
2748         <rdar://problem/28230123>
2749
2750         Reviewed by Tim Horton.
2751
2752         Tweaks the main content check so that we can distinguish between main content for the purposes of determining
2753         autoplay policy vs. main content for the purposes of showing media controls. Namely, we make the latter less
2754         restrictive than the former in terms of the maximum aspect ratio a video can have to be considered the right
2755         size for main content.
2756
2757         New unit test in TestWebKitAPI.
2758
2759         * html/HTMLMediaElement.cpp:
2760         (WebCore::mediaElementSessionInfoForSession):
2761         * html/MediaElementSession.cpp:
2762         (WebCore::MediaElementSession::canShowControlsManager):
2763         (WebCore::MediaElementSession::isLargeEnoughForMainContent):
2764         (WebCore::MediaElementSession::wantsToObserveViewportVisibilityForMediaControls):
2765         (WebCore::isMainContentForPurposesOfAutoplay):
2766         (WebCore::isElementLargeEnoughForMainContent):
2767         (WebCore::MediaElementSession::updateIsMainContent):
2768         (WebCore::isMainContent): Deleted.
2769         * html/MediaElementSession.h:
2770
2771 2016-09-09  Alex Christensen  <achristensen@webkit.org>
2772
2773         URLParser: Keep track of cannot-be-a-base-url according to spec
2774         https://bugs.webkit.org/show_bug.cgi?id=161830
2775
2776         Reviewed by Tim Horton.
2777
2778         Covered by new API tests.
2779
2780         * platform/URL.cpp:
2781         (WebCore::URL::invalidate):
2782         * platform/URL.h:
2783         Add a boolean required by the spec.
2784         This will not add to sizeof(URL) because we already have some bit fields.
2785         * platform/URLParser.cpp:
2786         (WebCore::URLParser::parse):
2787         (WebCore::URLParser::allValuesEqual):
2788
2789 2016-09-09  Commit Queue  <commit-queue@webkit.org>
2790
2791         Unreviewed, rolling out r205771.
2792         https://bugs.webkit.org/show_bug.cgi?id=161823
2793
2794         Broke Windows build (Requested by litherum on #webkit).
2795
2796         Reverted changeset:
2797
2798         "Remove unused member of GlyphBuffer"
2799         https://bugs.webkit.org/show_bug.cgi?id=161814
2800         http://trac.webkit.org/changeset/205771
2801
2802 2016-09-09  Alex Christensen  <achristensen@webkit.org>
2803
2804         URLParser should convert ASCII hosts to lowercase
2805         https://bugs.webkit.org/show_bug.cgi?id=161820
2806
2807         Reviewed by Geoffrey Garen.
2808
2809         Covered by new API tests.
2810
2811         * platform/URLParser.cpp:
2812         (WebCore::domainToASCII):
2813         The fast path for domains that are already ASCII and do not need punycode encoding
2814         should convert the domain to lowercase.
2815         This matches behavior in URL::parse if isCanonicalHostnameLowercaseForScheme is true,
2816         and RFC 5890.
2817
2818 2016-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
2819
2820         Remove unused member of GlyphBuffer
2821         https://bugs.webkit.org/show_bug.cgi?id=161814
2822
2823         Reviewed by Simon Fraser.
2824
2825         This m_offsets member never actually affected anything. It just made
2826         FontCascade::drawGlyphBuffer() slower.
2827
2828         No new tests because there is no behavior change.
2829
2830         * platform/graphics/FontCascade.cpp:
2831         (WebCore::FontCascade::drawGlyphBuffer):
2832         * platform/graphics/GlyphBuffer.h:
2833         (WebCore::GlyphBuffer::clear):
2834         (WebCore::GlyphBuffer::advanceAt):
2835         (WebCore::GlyphBuffer::add):
2836         (WebCore::GlyphBuffer::shrink):
2837         (WebCore::GlyphBuffer::swap):
2838         (WebCore::GlyphBuffer::offsetAt): Deleted.
2839         * platform/graphics/win/UniscribeController.cpp:
2840         (WebCore::UniscribeController::shapeAndPlaceItem):
2841
2842 2016-09-09  Tim Horton  <timothy_horton@apple.com>
2843
2844         Text replacement candidates don't always overwrite the entire original string
2845         https://bugs.webkit.org/show_bug.cgi?id=161779
2846         <rdar://problem/28033492>
2847
2848         Reviewed by Simon Fraser.
2849
2850         New test: editing/mac/spelling/accept-candidate-replacing-multiple-words.html.
2851
2852         * editing/Editor.cpp:
2853         (WebCore::Editor::contextRangeForCandidateRequest):
2854         Factor contextRangeForCandidateRequest out of the WebKits, into Editor.
2855         This just expands to paragraph boundaries from the cursor.
2856
2857         (WebCore::Editor::selectTextCheckingResult):
2858         Add selectTextCheckingResult, which, given a TextCheckingResult,
2859         selects the range represented by the result's location and length, which
2860         indicate the portion of the context string that the result refers to.
2861         In the case of accepting a candidate, we want to select that range
2862         so that our insertion will overwrite it.
2863
2864         (WebCore::Editor::handleAcceptedCandidate):
2865         Make use of selectTextCheckingResult instead of just assuming that we want
2866         to replace the word to the left of the insertion point.
2867
2868         (WebCore::Editor::stringForCandidateRequest): Deleted.
2869         * editing/Editor.h:
2870
2871         * testing/Internals.cpp:
2872         (WebCore::Internals::handleAcceptedCandidate):
2873         * testing/Internals.h:
2874         * testing/Internals.idl:
2875         Internals' handleAcceptedCandidate assumed (wrongly) that the length
2876         of a TextCheckerResult was the length of the candidate, when really it is
2877         the length of the text that the candidate would replace. Adjust this,
2878         and expose the replacement range to JavaScript, so we can test this.
2879
2880 2016-09-09  Brady Eidson  <beidson@apple.com>
2881
2882         Soft-link GameController.framework.
2883         <rdar://problem/28219953> and https://bugs.webkit.org/show_bug.cgi?id=161802
2884
2885         Reviewed by Brian Burg.
2886
2887         No new tests (No change in behavior).
2888
2889         * Configurations/WebCore.xcconfig:
2890         * WebCore.xcodeproj/project.pbxproj:
2891         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
2892         (WebCore::GameControllerGamepadProvider::startMonitoringGamepads):
2893
2894 2016-09-09  Jiewen Tan  <jiewen_tan@apple.com>
2895
2896         Rename Key to CryptoKey
2897         https://bugs.webkit.org/show_bug.cgi?id=161665
2898         <rdar://problem/28083391>
2899
2900         Reviewed by Brent Fulgham.
2901
2902         A link to the spec: https://www.w3.org/TR/WebCryptoAPI/#cryptokey-interface
2903
2904         * crypto/CryptoKey.idl:
2905         Remove some unnecessary IDL attributes and reorder KeyType enum to match the spec.
2906         * crypto/CryptoKeyType.h:
2907
2908 2016-09-09  Alex Christensen  <achristensen@webkit.org>
2909
2910         URLParser: Fix and optimize parsing file URLs ending with a host but no slash
2911         https://bugs.webkit.org/show_bug.cgi?id=161815
2912
2913         Reviewed by Geoffrey Garen.
2914
2915         Covered by new API tests.
2916
2917         * platform/URLParser.cpp:
2918         (WebCore::bufferView):
2919         (WebCore::URLParser::copyURLPartsUntil):
2920         (WebCore::URLParser::parse):
2921
2922 2016-09-09  Alex Christensen  <achristensen@webkit.org>
2923
2924         URLParser: Handle \ in path according to spec
2925         https://bugs.webkit.org/show_bug.cgi?id=161805
2926
2927         Reviewed by Andy Estes.
2928
2929         Covered by new API tests.
2930
2931         * platform/URLParser.cpp:
2932         (WebCore::URLParser::parse):
2933
2934 2016-09-09  Youenn Fablet  <youenn@apple.com>
2935
2936         TextTrackLoader should use FetchOptions::mode according its crossOrigin attribute
2937         https://bugs.webkit.org/show_bug.cgi?id=161792
2938
2939         Reviewed by Eric Carlson.
2940
2941         Covered by existing and updated tests.
2942
2943         Updating text track loader to use fetch mode according crossOrigin value.
2944
2945         Removed the check done in the case the crossOrigin value is not set.
2946         Previously cross-origin loads were forbidden, now this is authorized.
2947         This change allows aligning with the spec.
2948         Also, this check could be bypassed in the case of a same-origin URL redirecting to a cross-origin one.
2949
2950         * loader/TextTrackLoader.cpp:
2951         (WebCore::TextTrackLoader::notifyFinished): Checking resource error in lieu of doing CORS checks on its own.
2952         (WebCore::TextTrackLoader::load): Using CachedResourceRequest::setAsPotentiallyCrossOrigin
2953         * loader/TextTrackLoader.h:
2954         * loader/cache/CachedResource.cpp:
2955         (WebCore::CachedResource::loadFrom): Setting loading and status values as would be done when load is finished.
2956         (WebCore::CachedResource::setBodyDataFrom): Default implementation is to copy the shared buffer.
2957         * loader/cache/CachedResource.h:
2958         * loader/cache/CachedResourceLoader.cpp:
2959         (WebCore::CachedResourceLoader::updateCachedResourceWithCurrentRequest): Enabling resource update when mode or origin is different for TextTrack resources.
2960
2961 2016-09-09  Alex Christensen  <achristensen@webkit.org>
2962
2963         URLParser should parse URLs with non-special schemes
2964         https://bugs.webkit.org/show_bug.cgi?id=161786
2965
2966         Reviewed by Andy Estes.
2967
2968         Covered by new API tests.
2969
2970         * platform/URLParser.cpp:
2971         (WebCore::URLParser::parse):
2972         There's no reason for a SchemeEndCheckForSlashes state now that we can copy iterators.
2973         It's not in the spec and not needed.
2974         Also, move things around a little so parsing special or non-special schemes
2975         followed by one or two slashes works correctly.
2976
2977 2016-09-09  Chris Dumez  <cdumez@apple.com>
2978
2979         Regression(r186020): Null dereference in getStartDate()
2980         https://bugs.webkit.org/show_bug.cgi?id=161733
2981
2982         Reviewed by Eric Carlson.
2983
2984         Update HTMLMediaElement::getStartDate() to return NaN if m_player is null,
2985         instead of crashing.
2986
2987         Test: fast/media/getStartDate-NaN.html
2988
2989         * bindings/js/IDBBindingUtilities.cpp:
2990         (WebCore::toJS):
2991         Add a FIXME comment as this code is using jsDateOrNull() but should
2992         probably be using jsDate() as per:
2993         - http://w3c.github.io/IndexedDB/#request-convert-a-key-to-a-value
2994
2995         * bindings/js/JSDOMBinding.cpp:
2996         (WebCore::jsDate):
2997         (WebCore::jsDateOrNull):
2998         * bindings/js/JSDOMBinding.h:
2999         - Rename jsDateOrNaN() to jsDate() as this is the default behavior. Also,
3000           return new Date(NaN) instead of NaN if the implementation returns NaN.
3001           The IDL says we should return a Date, not a number.
3002         - Update jsDateOrNull() to only return jsNull() if the native value is
3003           NaN, instead of doing so for every value that is not finite. Our
3004           convention is to use NaN as special value to represent null in JS.
3005
3006         * bindings/scripts/CodeGeneratorJS.pm:
3007         (NativeToJSValue):
3008         When converting a native value (double) into a Date, rely on the fact
3009         that the type is nullable when deciding if we should call jsDate() or
3010         jsDateOrNull() to convert. This way, we no longe need a WebKit specific
3011         [TreatReturnedDateAs=Null|NaN] IDL extended attribute.
3012
3013         * bindings/scripts/IDLAttributes.txt:
3014         * html/HTMLInputElement.idl:
3015         Mark valueAsDate attribute as nullable, as per the specification:
3016         - https://html.spec.whatwg.org/#htmlinputelement
3017
3018         * html/HTMLMediaElement.cpp:
3019         (WebCore::HTMLMediaElement::getStartDate):
3020         Return NaN if m_player is null instead of crashing. The reason I decided
3021         to return NaN is because the specification [1] says to return a new Date
3022         object representing the current timeline offset. The spec of timeline
3023         offset [2] says that the initial timeline offset value is NaN.
3024         [1] https://html.spec.whatwg.org/#dom-media-getstartdate
3025         [2] https://html.spec.whatwg.org/#timeline-offset
3026
3027         * bindings/scripts/IDLAttributes.txt:
3028         * html/HTMLMediaElement.idl:
3029         Drop [TreatReturnedDateAs] attribute as it is no longer supported.
3030
3031 2016-09-09  Youenn Fablet  <youenn@apple.com>
3032
3033         ASSERTION FAILED: promise.inherits(JSPromise::info())
3034         https://bugs.webkit.org/show_bug.cgi?id=161632
3035         <rdar://problem/28184743>
3036
3037         Reviewed by Mark Lam.
3038
3039         Test: fetch/fetch-worker-crash.html
3040
3041         * bindings/js/JSDOMPromise.h:
3042         (WebCore::callPromiseFunction): Returning early if created promise is null.
3043         Passing directly a DeferredWrapper to the generated code.
3044         * bindings/scripts/CodeGeneratorJS.pm: Updated to take a DeferredWrapper.
3045         (GenerateImplementation):
3046         (GenerateReturnParameters):
3047         * bindings/scripts/test/JS/JSTestObj.cpp: Rebasing expectations.
3048         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionPromise):
3049         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgumentPromise):
3050         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithExceptionPromise):
3051         (WebCore::jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgumentPromise):
3052         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction1Promise):
3053         (WebCore::jsTestObjPrototypeFunctionTestPromiseOverloadedFunction2Promise):
3054         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionPromise):
3055         (WebCore::jsTestObjConstructorFunctionTestStaticPromiseFunctionWithExceptionPromise):
3056
3057 2016-09-09  Myles C. Maxfield  <mmaxfield@apple.com>
3058
3059         [Cocoa] Improve performance of glyph advance metrics gathering
3060         https://bugs.webkit.org/show_bug.cgi?id=161119
3061
3062         Reviewed by Simon Fraser.
3063
3064         Most of the glyphs in a GlyphPage are never read from. Therefore, we can get a performance boost
3065         by not populating as many items in the GlyphPage. Because of the performance characteristics of
3066         CTFontGetGlyphsForCharacters(), a better size for a GlyphPage is 16 items. This, coupled with
3067         using CTFontGetUnsummedAdvancesForGlyphsAndStyle(), causes between a 0.01%-0.5% speedup on PLT.
3068
3069         No new tests because there is no behavior change.
3070
3071         * platform/graphics/Font.cpp:
3072         (WebCore::Font::initCharWidths):
3073         (WebCore::Font::platformGlyphInit):
3074         (WebCore::createAndFillGlyphPage):
3075         * platform/graphics/Font.h:
3076         (WebCore::Font::widthForGlyph):
3077         * platform/graphics/GlyphMetricsMap.h:
3078         * platform/graphics/GlyphPage.h:
3079         * platform/graphics/cocoa/FontCocoa.mm:
3080         * platform/spi/cocoa/CoreTextSPI.h:
3081         (WebCore::Font::platformWidthForGlyph):
3082         (WebCore::canUseFastGlyphAdvanceGetter): Deleted.
3083
3084 2016-09-09  Antti Koivisto  <antti@apple.com>
3085
3086         v3: WebContent crash due to RELEASE_ASSERT in WebCore: WebCore::StyleResolver::styleForElement
3087         https://bugs.webkit.org/show_bug.cgi?id=161689
3088
3089         Reviewed by Andreas Kling.
3090
3091         These crashes happen because synchronously triggered resource loads generate callbacks that may end up
3092         deleting the resource loader.
3093
3094         Stop triggering resource loads from StyleResolver. Instead trigger them when applying style to render tree.
3095
3096         * css/StyleResolver.cpp:
3097         (WebCore::StyleResolver::~StyleResolver):
3098
3099             Replace the RELEASE_ASSERT against deletion during resource loads by a general isDeleted assert.
3100
3101         (WebCore::StyleResolver::styleForElement):
3102         (WebCore::StyleResolver::styleForKeyframe):
3103         (WebCore::StyleResolver::pseudoStyleForElement):
3104         (WebCore::StyleResolver::styleForPage):
3105         (WebCore::StyleResolver::applyMatchedProperties):
3106         (WebCore::StyleResolver::loadPendingResources): Deleted.
3107         * css/StyleResolver.h:
3108         * page/animation/KeyframeAnimation.cpp:
3109         (WebCore::KeyframeAnimation::KeyframeAnimation):
3110         (WebCore::KeyframeAnimation::resolveKeyframeStyles):
3111
3112             Ensure resource load for all animation frames.
3113
3114         * page/animation/KeyframeAnimation.h:
3115         * rendering/RenderElement.cpp:
3116         (WebCore::RenderElement::createFor):
3117         (WebCore::RenderElement::initializeStyle):
3118
3119             Load resources when renderer initializes a style.
3120
3121         (WebCore::RenderElement::setStyle):
3122         (WebCore::RenderElement::getUncachedPseudoStyle):
3123
3124             Load resources for pseudo styles.
3125
3126         * rendering/RenderImage.cpp:
3127         (WebCore::RenderImage::RenderImage):
3128         (WebCore::RenderImage::styleWillChange):
3129
3130             Shuffle image resource initialization out from constructor so initializeStyle gets called before.
3131
3132         * rendering/RenderImage.h:
3133         * rendering/style/StyleCachedImage.cpp:
3134         (WebCore::StyleCachedImage::StyleCachedImage):
3135
3136             Track pending status with a bit instead of implicitly by the existence of CachedResource.
3137             This is useful for asserts.
3138
3139         (WebCore::StyleCachedImage::load):
3140         (WebCore::StyleCachedImage::isPending):
3141         (WebCore::StyleCachedImage::addClient):
3142         (WebCore::StyleCachedImage::removeClient):
3143         (WebCore::StyleCachedImage::image):
3144         * rendering/style/StyleCachedImage.h:
3145
3146 2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
3147
3148         ScriptRunner should be driven by PendingScript rather than ScriptElement
3149         https://bugs.webkit.org/show_bug.cgi?id=161726
3150
3151         Reviewed by Ryosuke Niwa.
3152
3153         Tests: js/dom/document-write-in-error-event.html
3154                js/dom/document-write-in-load-event.html
3155
3156         ScriptRunner is driven by ScriptElement::notifyFinished. While ScriptRunner is driven by this,
3157         HTMLScriptRunner does not use it. Instead, HTMLScriptRunner uses PendingScriptClient. As a result,
3158         ScriptElement::notifyFinished is used only when the script is annotated with "defer" or "async"
3159         while all the external script will load the LoadableScript. It is confusing.
3160         This patch removes ScriptElement::notifyFinished and use PendingScript's observability
3161         in ScriptRunner instead.
3162
3163         This patch also fixes the behavior about ignore-destructive-writes counter[1]. When dispatching
3164         the load and error events, this ignore-destructive-writes counter should not be incremeneted by
3165         this execution. The added tests ensure this behavior.
3166
3167         [1]: https://html.spec.whatwg.org/multipage/scripting.html#execute-the-script-block
3168
3169         * dom/ScriptElement.cpp: Drop LoadableScriptClient interface.
3170         (WebCore::ScriptElement::prepareScript): Do not use addClient. ScriptRunner use PendingScript::{setClient,clearClient} instead.
3171         (WebCore::ScriptElement::executeScriptForScriptRunner): IgnoreDestructiveWriteCountIncrementer will be done in ScriptElement::executeScript.
3172         So no need to do it here, that's duplicated.
3173         (WebCore::ScriptElement::~ScriptElement): Deleted. ScriptElement does not use addClient/removeClient.
3174         (WebCore::ScriptElement::stopLoadRequest): Deleted.
3175         (WebCore::ScriptElement::executeScriptForHTMLScriptRunner): Deleted. executeScriptForHTMLScriptRunner and executeScriptForScriptRunner are
3176         merged into executeScriptForRunner.
3177         (WebCore::ScriptElement::notifyFinished): Deleted.
3178         * dom/ScriptElement.h:
3179         (WebCore::ScriptElement::~ScriptElement):
3180         (WebCore::ScriptElement::willExecuteInOrder): Used in ScriptRunner to determine whether the script is async or defer.
3181         (WebCore::ScriptElement::willExecuteWhenDocumentFinishedParsing): Deleted.
3182         * dom/ScriptRunner.cpp:
3183         (WebCore::ScriptRunner::~ScriptRunner): HashSet's iterator will return `const PendingScript&`.
3184         Another option is using HashSet<RefPtr<PendingScript>>. Here, we use a little bit weired const_cast.
3185         (WebCore::ScriptRunner::queueScriptForExecution): Use PendingScript::setClient to wait loading.
3186         (WebCore::ScriptRunner::notifyFinished): Notify the script ready here.
3187         (WebCore::ScriptRunner::timerFired): Use executeScriptForScriptRunner.
3188         (WebCore::ScriptRunner::notifyScriptReady): Deleted.
3189         * dom/ScriptRunner.h:
3190         * html/parser/HTMLScriptRunner.cpp:
3191         (WebCore::HTMLScriptRunner::executePendingScriptAndDispatchEvent): Use executeScriptForScriptRunner.
3192
3193 2016-09-08  Yusuke Suzuki  <utatane.tea@gmail.com>
3194
3195         [WTF] HashTable's rehash is not compatible to Ref<T> and ASan
3196         https://bugs.webkit.org/show_bug.cgi?id=161763
3197
3198         Reviewed by Mark Lam.
3199
3200         Include wtf/text/StringHash.h to avoid linking errors in EFL port.
3201
3202         * loader/ResourceLoadStatistics.h:
3203
3204 2016-09-08  Chris Dumez  <cdumez@apple.com>
3205
3206         HTMLObjectElement.hspace / vspace attributes should be unsigned
3207         https://bugs.webkit.org/show_bug.cgi?id=161766
3208
3209         Reviewed by Ryosuke Niwa.
3210
3211         HTMLObjectElement.hspace / vspace attributes should be unsigned:
3212         - https://html.spec.whatwg.org/#HTMLObjectElement-partial
3213
3214         Firefox agrees with the specification but those were signed in WebKit.
3215
3216         No new tests, rebaselined existing test.
3217
3218         * html/HTMLObjectElement.idl:
3219
3220 2016-09-08  Chris Dumez  <cdumez@apple.com>
3221
3222         HTMLObjectElement.codebase attribute should reflect as a URL
3223         https://bugs.webkit.org/show_bug.cgi?id=161768
3224
3225         Reviewed by Alex Christensen.
3226
3227         HTMLObjectElement.codebase attribute should reflect as a URL:
3228         - https://html.spec.whatwg.org/#dom-applet-codebase
3229
3230         Chrome and Firefox agree with the specification.
3231
3232         No new test, rebaselined existing test.
3233
3234         * html/HTMLObjectElement.idl:
3235
3236 2016-09-08  Chris Dumez  <cdumez@apple.com>
3237
3238         ol.start may return incorrect value for reversed lists when not explicitly set
3239         https://bugs.webkit.org/show_bug.cgi?id=161713
3240
3241         Reviewed by Zalan Bujtas.
3242
3243         ol.start may return incorrect value for reversed lists when not explicitly set.
3244         This is because we're supposed to return the number of rendered <li> child
3245         elements, which relies on layout. However, we did not make sure the layout is
3246         up-to-date before counting the number of li child elements. This patch fixes
3247         the issue.
3248
3249         No new tests, rebaselined existing tests.
3250
3251         * html/HTMLOListElement.h:
3252
3253 2016-09-08  Chris Dumez  <cdumez@apple.com>
3254
3255         Add support for HTMLIframeElement.allowFullscreen attribute
3256         https://bugs.webkit.org/show_bug.cgi?id=161757
3257
3258         Reviewed by Sam Weinig.
3259
3260         Add support for HTMLIframeElement.allowFullscreen attribute:
3261         - https://html.spec.whatwg.org/#dom-iframe-allowfullscreen
3262
3263         Firefox and Chrome already support it, unprefixed.
3264
3265         Note that the HTMLIframeElement.allowFullscreen attribute reflects the
3266         allowfullscreen content attribute which we already support.
3267
3268         Test: fullscreen/full-screen-iframe-allowFullscreen.html
3269
3270         * html/HTMLIFrameElement.idl:
3271
3272 2016-09-08  Chris Dumez  <cdumez@apple.com>
3273
3274         frame.longDesc / iframe.longDesc should reflect as a URL
3275         https://bugs.webkit.org/show_bug.cgi?id=161764
3276
3277         Reviewed by Alex Christensen.
3278
3279         frame.longDesc / iframe.longDesc should reflect as a URL:
3280         - https://html.spec.whatwg.org/#dom-iframe-longdesc
3281         - https://html.spec.whatwg.org/#dom-frame-longdesc
3282
3283         They already do in Chrome and Firefox.
3284
3285         No new tests, rebaselined existing tests.
3286
3287         * html/HTMLFrameElement.idl:
3288         * html/HTMLIFrameElement.idl:
3289
3290 2016-09-08  Alex Christensen  <achristensen@webkit.org>
3291
3292         URLParser: Handle \ in paths of special URLs according to spec
3293         https://bugs.webkit.org/show_bug.cgi?id=161781
3294
3295         Reviewed by Tim Horton.
3296
3297         Covered by new API tests.
3298
3299         * platform/URLParser.cpp:
3300         (WebCore::bufferView):
3301         (WebCore::URLParser::copyURLPartsUntil):
3302         (WebCore::URLParser::parse):
3303         * platform/URLParser.h:
3304
3305 2016-09-08  Said Abou-Hallawa  <sabouhallawa@apple.com>
3306
3307         Move the BitmapImage platform dependent code to a new file named NativeImage[CG|Cairo].cpp
3308         https://bugs.webkit.org/show_bug.cgi?id=158684
3309
3310         Reviewed by Simon Fraser.
3311
3312         This is a refactoring patch. It moves the BitmapImage platform dependent
3313         code from BitmapImage to NativeImage[CG|Cairo].cpp. The new APIs are
3314         responsible of drawing a NativeImagePtr and answering some metadata queries.
3315
3316         No new tests -- Code refactoring, no behavior change.
3317
3318         * PlatformAppleWin.cmake:
3319         * PlatformEfl.cmake:
3320         * PlatformGTK.cmake:
3321         * PlatformMac.cmake:
3322         * PlatformWinCairo.cmake:
3323         * WebCore.xcodeproj/project.pbxproj:
3324         * loader/cache/MemoryCache.h:
3325         * loader/icon/IconDatabaseBase.h:
3326         * page/mac/TextIndicatorWindow.mm:
3327         (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]):
3328         (createContentCrossfadeAnimation):
3329         * platform/graphics/BitmapImage.cpp:
3330         (WebCore::BitmapImage::BitmapImage):
3331         (WebCore::BitmapImage::destroyDecodedData):
3332         (WebCore::BitmapImage::destroyDecodedDataIfNecessary):
3333         (WebCore::BitmapImage::dataChanged):
3334         (WebCore::BitmapImage::ensureFrameAtIndexIsCached):
3335         (WebCore::BitmapImage::frameImageAtIndex):
3336         (WebCore::BitmapImage::nativeImage):
3337         (WebCore::BitmapImage::nativeImageForCurrentFrame):
3338         (WebCore::BitmapImage::nativeImageOfSize):
3339         (WebCore::BitmapImage::framesNativeImages):
3340         (WebCore::BitmapImage::frameIsCompleteAtIndex):
3341         (WebCore::BitmapImage::frameDurationAtIndex):
3342         (WebCore::BitmapImage::frameHasAlphaAtIndex):
3343         (WebCore::BitmapImage::frameOrientationAtIndex):
3344         (WebCore::BitmapImage::singlePixelSolidColor):
3345         (WebCore::BitmapImage::draw):
3346         (WebCore::BitmapImage::drawPattern):
3347         (WebCore::BitmapImage::canAnimate):
3348         (WebCore::BitmapImage::clearTimer):
3349         (WebCore::BitmapImage::startTimer):
3350         (WebCore::BitmapImage::stopAnimation):
3351         (WebCore::BitmapImage::resetAnimation):
3352         (WebCore::BitmapImage::hasSingleSecurityOrigin): Deleted.
3353         (WebCore::BitmapImage::filenameExtension): Deleted.
3354         (WebCore::BitmapImage::ensureFrameIsCached): Deleted.
3355         * platform/graphics/BitmapImage.h:
3356         (WebCore::FrameData::FrameData):
3357         m_hasAlpha can be initialized with false because it is accessed only in
3358         BitmapImage::frameHasAlphaAtIndex() and it is guarded by m_haveMetadata.
3359         Both m_haveMetadata and m_hasAlpha are set in BitmapImage constructor
3360         and in BitmapImage::cacheFrame().
3361         
3362         (WebCore::FrameData::~FrameData):
3363         (WebCore::FrameData::clear):
3364         * platform/graphics/Icon.h:
3365         * platform/graphics/Image.h:
3366         (WebCore::Image::nativeImage):
3367         (WebCore::Image::nativeImageOfSize):
3368         (WebCore::Image::framesNativeImages):
3369         (WebCore::Image::orientationForCurrentFrame): Deleted.
3370         (WebCore::Image::getCGImageRef): Deleted.
3371         (WebCore::Image::getFirstCGImageRefOfSize): Deleted.
3372         (WebCore::Image::getCGImageArray): Deleted.
3373         * platform/graphics/ImageSource.cpp:
3374         (WebCore::ImageSource::calculateMaximumSubsamplingLevel):
3375         (WebCore::ImageSource::size):
3376         (WebCore::ImageSource::sizeRespectingOrientation):
3377         * platform/graphics/ImageSource.h:
3378         * platform/graphics/MediaPlayer.h:
3379         * platform/graphics/NativeImage.h: Added.
3380         * platform/graphics/NativeImagePtr.h: Removed.
3381         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
3382         (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage):
3383         * platform/graphics/cairo/BitmapImageCairo.cpp: Removed.
3384         * platform/graphics/cairo/NativeImageCairo.cpp: Added.
3385         (WebCore::nativeImageSize):
3386         (WebCore::nativeImageHasAlpha):
3387         (WebCore::nativeImageSinglePixelSolidColor):
3388         (WebCore::subsamplingScale):
3389         (WebCore::drawNativeImage):
3390         (WebCore::clearNativeImageSubImages):
3391         * platform/graphics/cg/BitmapImageCG.cpp: Removed.
3392         * platform/graphics/cg/ImageDecoderCG.cpp:
3393         (WebCore::ImageDecoder::size):
3394         * platform/graphics/cg/ImageDecoderCG.h:
3395         * platform/graphics/cg/NativeImageCG.cpp: Added.
3396         (WebCore::nativeImageSize):
3397         (WebCore::nativeImageHasAlpha):
3398         (WebCore::nativeImageSinglePixelSolidColor):
3399         (WebCore::subsamplingScale):
3400         (WebCore::drawNativeImage):
3401         (WebCore::clearNativeImageSubImages):
3402         * platform/graphics/cg/PatternCG.cpp:
3403         (WebCore::Pattern::createPlatformPattern):
3404         * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
3405         (TextTrackRepresentationCocoa::update):
3406         * platform/graphics/mac/ImageMac.mm:
3407         (WebCore::BitmapImage::getTIFFRepresentation):
3408         * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
3409         (WebCore::MockRealtimeVideoSourceMac::updatePlatformLayer):
3410         (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer):
3411         * platform/win/DragImageCGWin.cpp:
3412         (WebCore::createDragImageFromImage):
3413
3414 2016-09-08  Alex Christensen  <achristensen@webkit.org>
3415
3416         URLParser: Parsing empty URLs with a base URL should return the base URL
3417         https://bugs.webkit.org/show_bug.cgi?id=161777
3418
3419         Reviewed by Tim Horton.