4ede1f53031a232adb17b70435ad4d956737738e
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2018-08-02  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Move queue processing logic from CustomElementReactionStack to CustomElementReactionQueue
4         https://bugs.webkit.org/show_bug.cgi?id=188277
5
6         Reviewed by Wenson Hsieh.
7
8         Moved ensureCurrentQueue, processBackupQueue, ElementQueue, ensureBackupQueue, and backupElementQueue
9         from CustomElementReactionStack to CustomElementReactionQueue to simplify CustomElementReactionStack.
10
11         No new tests since there is no behavior change.
12
13         * dom/CustomElementReactionQueue.cpp:
14         (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
15         (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
16         (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
17         (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
18         (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
19         (WebCore::CustomElementReactionQueue::ElementQueue::add): Moved from CustomElementReactionStack.
20         (WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): Ditto.
21         (WebCore::CustomElementReactionQueue::ensureCurrentQueue): Ditto.
22         (WebCore::CustomElementReactionQueue::ensureBackupQueue): Ditto.
23         (WebCore::CustomElementReactionQueue::processBackupQueue): Ditto.
24         (WebCore::CustomElementReactionQueue::backupElementQueue): Ditto.
25         * dom/CustomElementReactionQueue.h:
26         (WebCore::CustomElementReactionStack::hasCurrentProcessingStack): Deleted. It was never called.
27
28 2018-08-02  Timothy Hatcher  <timothy@apple.com>
29
30         Text selection color is hard to see in dark mode web views.
31         https://bugs.webkit.org/show_bug.cgi?id=188260
32         rdar://problem/42721294
33
34         Reviewed by Simon Fraser.
35
36         Stop using blendWithWhite() to transform the AppKit selection color in dark mode.
37         Using an alpha of 80% gives good contrast, and still works good for selections over images.
38
39         * platform/graphics/Color.cpp:
40         (WebCore::Color::blendWithWhite const): Mark new colors as semantic if the original is.
41         (WebCore::Color::colorWithAlpha const): Ditto.
42         * rendering/RenderElement.cpp:
43         (WebCore::RenderElement::selectionBackgroundColor const): Use transformSelectionBackgroundColor.
44         * rendering/RenderTheme.cpp:
45         (WebCore::RenderTheme::activeSelectionBackgroundColor const): Use transformSelectionBackgroundColor.
46         (WebCore::RenderTheme::inactiveSelectionBackgroundColor const): Ditto.
47         (WebCore::RenderTheme::transformSelectionBackgroundColor const): Added. Just blend with white.
48         * rendering/RenderTheme.h:
49         * rendering/RenderThemeMac.h:
50         * rendering/RenderThemeMac.mm:
51         (WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Added. Use an alpha with the color
52         in dark mode, otherwise fallback to RenderTheme.
53         (WebCore::RenderThemeMac::systemColor const): Use activeListBoxSelectionBackgroundColor()
54         and activeSelectionBackgroundColor() instead of caching the colors again. Update hardcoded color.
55
56 2018-08-02  Zalan Bujtas  <zalan@apple.com>
57
58         [LFC][Floating] Use displayBox.rectWithMargin().bottom instead of displayBox.bottom() to where applicable.
59         https://bugs.webkit.org/show_bug.cgi?id=188274
60
61         Reviewed by Antti Koivisto.
62
63         Float placement uses the margin box.
64
65         * layout/FloatingContext.cpp:
66         (WebCore::Layout::FloatingPair::bottom const):
67         (WebCore::Layout::Iterator::operator++):
68         (WebCore::Layout::Iterator::set):
69
70 2018-08-02  Zalan Bujtas  <zalan@apple.com>
71
72         [LFC][Floating] Right aligned float's horizontal candidate position is miscomputed.
73         https://bugs.webkit.org/show_bug.cgi?id=188273
74
75         Reviewed by Antti Koivisto.
76
77         rightAlignedBoxLeft is already shifted with the size of the margin box.
78
79         * layout/FloatingContext.cpp:
80         (WebCore::Layout::FloatingContext::alignWithFloatings const):
81
82 2018-08-02  Zalan Bujtas  <zalan@apple.com>
83
84         [LFC] Display:Box::rectWithMargin()'s width and height don't include margin left/top.
85         https://bugs.webkit.org/show_bug.cgi?id=188272
86
87         Reviewed by Antti Koivisto.
88
89         * layout/displaytree/DisplayBox.h:
90         (WebCore::Display::Box::rectWithMargin const):
91
92 2018-08-02  Zalan Bujtas  <zalan@apple.com>
93
94         [LFC][Floating] Containing block of a float could push the candidate position beyond the current float.
95         https://bugs.webkit.org/show_bug.cgi?id=188264
96
97         Reviewed by Antti Koivisto.
98
99         <div id=first style="float: left; width: 100px; height: 10px;"></div>
100         <div id=second style="float: left; width: 10px; height: 10px;"></div>
101         <div style="width: 50px; height: 50px;>
102             <div id=third style="float: left; width: 10px; height: 10px;"></div>
103         </div>
104         In the example above by the time the "third" float comes in, we are already at 110px horizontally. However the containing block of the "third" float forces
105         the candidate position at 0px. In such cases intersecting won't work since the candidate position is beyond the last(second) float (horizontally).
106         We could either keep going back to the previous floats on this vertical position and eventually intersect with "first" or just compare the horizontal
107         positions and ensure that the left/right float is not going to be placed to the left/right of the last float on the current vertical position.
108
109         * layout/FloatingContext.cpp:
110         (WebCore::Layout::FloatingPair::intersects const):
111
112 2018-08-01  Ryosuke Niwa  <rniwa@webkit.org>
113
114         Implement customElements.upgrade()
115         https://bugs.webkit.org/show_bug.cgi?id=183397
116
117         Reviewed by Frédéric Wang.
118
119         Added the support to upgrade custom elements directly. Ordinarily, custom elements get upgraded as they are
120         inserted / connected into a document but some script libraries and authors want to be able to upgrade them before that.
121         Also see https://github.com/w3c/webcomponents/issues/710
122
123         Implemented the method as specified at:
124         https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-upgrade
125
126             When invoked, the upgrade(root) method must run these steps:
127             1. Let candidates be a list of all of root's shadow-including inclusive descendant elements,
128                in shadow-including tree order.
129             2. For each candidate of candidates, try to upgrade candidate.
130
131         Tests: imported/w3c/web-platform-tests/custom-elements/custom-element-registry/upgrade.html
132
133         * dom/CustomElementReactionQueue.cpp:
134         (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Removed the assertion that the upgraded element
135         is connected since the whole point of this API is to upgrade a disconnected element.
136         * dom/CustomElementRegistry.cpp:
137         (WebCore::upgradeElementsInShadowIncludingdescendants): Added.
138         (WebCore::CustomElementRegistry::upgrade): Added.
139         * dom/CustomElementRegistry.h: Forward declare DeferredPromise instead of unnecessarily including JSDOMPromiseDeferred.h.
140         * dom/CustomElementRegistry.idl:
141         * dom/Element.cpp:
142         (WebCore::Element::insertedIntoAncestor): Moved the assertion here.
143
144 2018-08-02  Simon Fraser  <simon.fraser@apple.com>
145
146         Convert calc-related enums to 8-bit enum classes
147         https://bugs.webkit.org/show_bug.cgi?id=188215
148
149         Reviewed by Zalan Bujtas.
150
151         This shrinks CSSCalcOperation from 48 to 32 bytes.
152
153         * css/CSSCalculationValue.cpp:
154         (WebCore::unitCategory):
155         (WebCore::determineCategory):
156         (WebCore::resolvedTypeForMinOrMax):
157         (WebCore::isIntegerResult):
158         (WebCore::CSSCalcExpressionNodeParser::parseValue):
159         (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
160         (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
161         (WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
162         (WebCore::createBlendHalf):
163         (WebCore::createCSS):
164         * css/CSSCalculationValue.h:
165         * css/CSSPrimitiveValue.cpp:
166         (WebCore::CSSPrimitiveValue::primitiveType const):
167         * css/StyleBuilderConverter.h:
168         (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
169         * css/parser/CSSPropertyParserHelpers.cpp:
170         (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumberRaw):
171         (WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw):
172         (WebCore::CSSPropertyParserHelpers::consumeInteger):
173         (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
174         (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
175         (WebCore::CSSPropertyParserHelpers::consumeNumber):
176         (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
177         (WebCore::CSSPropertyParserHelpers::consumeLength):
178         (WebCore::CSSPropertyParserHelpers::consumePercent):
179         (WebCore::CSSPropertyParserHelpers::canConsumeCalcValue):
180         (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
181         (WebCore::CSSPropertyParserHelpers::consumeAngle):
182         (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
183         (WebCore::CSSPropertyParserHelpers::consumeTime):
184         * platform/CalculationValue.cpp:
185         (WebCore::CalcExpressionNumber::operator== const):
186         (WebCore::CalcExpressionOperation::evaluate const):
187         (WebCore::CalcExpressionOperation::operator== const):
188         (WebCore::CalcExpressionOperation::dump const):
189         (WebCore::CalcExpressionLength::operator== const):
190         (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
191         (WebCore::CalcExpressionBlendLength::operator== const):
192         (WebCore::operator<<):
193         * platform/CalculationValue.h:
194         (WebCore::CalcExpressionNumber::CalcExpressionNumber):
195         (WebCore::toCalcExpressionNumber):
196         (WebCore::CalcExpressionLength::CalcExpressionLength):
197         (WebCore::toCalcExpressionLength):
198         (WebCore::CalcExpressionOperation::CalcExpressionOperation):
199         (WebCore::toCalcExpressionOperation):
200         (WebCore::toCalcExpressionBlendLength):
201         * platform/Length.cpp:
202         (WebCore::convertTo100PercentMinusLength):
203
204 2018-08-02  Charlie Turner  <cturner@igalia.com>
205
206         Handle zero-sized ISOMP4 boxes appropriately
207         https://bugs.webkit.org/show_bug.cgi?id=188256
208
209         Reviewed by Jer Noble.
210
211         According to ISO/IEC 14496-12:2012(E), when the Box classes' size
212         field is zero, the implied size of the box extends to the end of
213         the file. If this detail is not taken into account, CENC
214         sanitization can incorrectly report an invalid box size, since 0
215         != the number of bytes in this box, specifically, the data layout
216         of Box is as follows,
217
218         aligned(8) class Box (unsigned int(32) boxtype,
219               optional unsigned int(8)[16] extended_type) {
220            unsigned int(32) size;
221            unsigned int(32) type = boxtype;
222            if (size==1) {
223              unsigned int(64) largesize;
224            } else if (size==0) { // This is the case now handled.
225              // box extends to end of file
226            }
227            if (boxtype==‘uuid’) {
228              unsigned int(8)[16] usertype = extended_type;
229            }
230         }
231
232         Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html
233
234         * platform/graphics/iso/ISOBox.cpp:
235         (WebCore::ISOBox::peekBox): Check if the parsed size is zero, and
236         if it is, the size is calculated as the total number of bytes in
237         the incoming DataView.
238         (WebCore::ISOBox::parse): Ditto.
239
240 2018-08-01  Dan Bernstein  <mitz@apple.com>
241
242         Optionally expose Attr::style to JavaScript
243         https://bugs.webkit.org/show_bug.cgi?id=188226
244         <rdar://problem/42818113>
245
246         Reviewed by Darin Adler.
247
248         Test: TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm
249
250         * dom/Attr.cpp: Update comment.
251         * dom/Attr.idl: Define the style attribute, enabled at runtime by the AttrStyle feature.
252
253         * page/RuntimeEnabledFeatures.h:
254         (WebCore::RuntimeEnabledFeatures::setAttrStyleEnabled): Added this accessor.
255         (WebCore::RuntimeEnabledFeatures::attrStyleEnabled const): Ditto.
256
257 2018-08-02  David Fenton  <david_fenton@apple.com>
258
259         Unreviewed, rolling out r234489.
260
261         Caused 50+ crashes and 60+ API failures on iOS
262
263         Reverted changeset:
264
265         "[WTF] Rename String::format to String::deprecatedFormat"
266         https://bugs.webkit.org/show_bug.cgi?id=188191
267         https://trac.webkit.org/changeset/234489
268
269 2018-08-02  Zalan Bujtas  <zalan@apple.com>
270
271         [LFC][Floating] Do not pass formatting root to FloatingContext
272         https://bugs.webkit.org/show_bug.cgi?id=188257
273
274         Reviewed by Antti Koivisto.
275
276         If we ever need it, we can get it from FloatingState.
277
278         * layout/FloatingContext.cpp:
279         (WebCore::Layout::FloatingContext::FloatingContext):
280         * layout/FloatingContext.h:
281         * layout/blockformatting/BlockFormattingContext.cpp:
282         (WebCore::Layout::BlockFormattingContext::layout const):
283
284 2018-08-01  Zalan Bujtas  <zalan@apple.com>
285
286         [LFC][Floating] Convert all coordinates relative to the formatting context root.
287         https://bugs.webkit.org/show_bug.cgi?id=188249
288
289         Reviewed by Antti Koivisto.
290
291         The idea here is that all the float related computation should be happening in the same coordinate system.
292         FloatItem holds the transformed Display::Box for both the layout box and its containing block. 
293
294         * layout/FloatingContext.cpp:
295         (WebCore::Layout::begin):
296         (WebCore::Layout::end):
297         (WebCore::Layout::FloatingContext::computePosition const):
298         (WebCore::Layout::FloatingContext::floatingPosition const):
299         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
300         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
301         (WebCore::Layout::FloatingContext::alignWithFloatings const):
302         (WebCore::Layout::FloatingContext::toContainingBlock const):
303         (WebCore::Layout::FloatingPair::FloatingPair):
304         (WebCore::Layout::FloatingPair::left const):
305         (WebCore::Layout::FloatingPair::right const):
306         (WebCore::Layout::Iterator::Iterator):
307         (WebCore::Layout::previousFloatingIndex):
308         (WebCore::Layout::Iterator::operator++):
309         (WebCore::Layout::Iterator::set):
310         * layout/FloatingContext.h:
311         * layout/FloatingState.cpp:
312         (WebCore::Layout::FloatingState::FloatItem::FloatItem):
313         (WebCore::Layout::FloatingState::remove):
314         (WebCore::Layout::FloatingState::append):
315         * layout/FloatingState.h:
316         (WebCore::Layout::FloatingState::isEmpty const):
317         (WebCore::Layout::FloatingState::FloatItem::layoutBox const):
318         (WebCore::Layout::FloatingState::FloatItem::containingBlock const):
319         (WebCore::Layout::FloatingState::FloatItem::displayBox const):
320         (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const):
321         (WebCore::Layout::FloatingState::floats const):
322         (WebCore::Layout::FloatingState::last const):
323         (WebCore::Layout::FloatingState::root const):
324         (WebCore::Layout::FloatingState::floatings const): Deleted.
325         * layout/displaytree/DisplayBox.h:
326
327 2018-08-02  Charlie Turner  <cturner@igalia.com>
328
329         [GStreamer] Dynamically adjust blocksize
330         https://bugs.webkit.org/show_bug.cgi?id=188194
331
332         Reviewed by Xabier Rodriguez-Calvar.
333
334         Update the blocksize depending on how much is obtained from a read
335         of the input stream. This avoids doing too many reads in small
336         chunks when larger amounts of data are available and also prevents
337         using a very large memory area to read a small chunk of data.
338
339         Adapted from https://bugzilla.gnome.org/show_bug.cgi?id=767833
340
341         No tests new tests since no change in functionality.
342
343         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
344         (webkit_web_src_init):
345         (CachedResourceStreamingClient::checkUpdateBlocksize):
346         (CachedResourceStreamingClient::dataReceived):
347
348 2018-08-02  Charlie Turner  <cturner@igalia.com>
349
350         [GStreamer] Stop pushing buffers when seeking status changes
351         https://bugs.webkit.org/show_bug.cgi?id=188193
352
353         Reviewed by Xabier Rodriguez-Calvar.
354
355         After switching to splitting buffers into smaller block sizes in
356
357             https://bugs.webkit.org/show_bug.cgi?id=182829
358
359         It was found that during the individual buffer pushes, the seeking
360         status could change behind our backs from another thread. When
361         this happens, buffers from incorrect offsets would find their way
362         into appsrc and eventually the demuxer itself, which would start
363         parsing from a random place and at best give a confusing error
364         message.
365
366         The solution here is break from pushing buffers when the seeking
367         status has been has changed. Flushes will clear out what we've
368         already delivered into the appsrc, then we must make sure to not
369         continue sending buffers in there after the flush.
370
371         No new tests since this is a timing bug.
372
373         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
374         (CachedResourceStreamingClient::dataReceived):
375
376 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
377
378         Unreviewed, revert TransformationMatrix::operator== change
379         https://bugs.webkit.org/show_bug.cgi?id=188197
380
381         This change partially revert cleaning up of TransformationMatrix since memcmp does not
382         follow double comparison algorithm. So semantics was accidentally changed.
383
384         * platform/graphics/transforms/TransformationMatrix.h:
385         (WebCore::TransformationMatrix::operator== const):
386
387 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
388
389         Unreviewed, rename TransformationMatrix::Identity to TransformationMatrix::identity
390         https://bugs.webkit.org/show_bug.cgi?id=188204
391
392         Follow the coding style.
393
394         * platform/graphics/GraphicsLayer.cpp:
395         (WebCore::GraphicsLayer::transform const):
396         (WebCore::GraphicsLayer::childrenTransform const):
397         * platform/graphics/transforms/TransformationMatrix.cpp:
398         * platform/graphics/transforms/TransformationMatrix.h:
399
400 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
401
402         Add self.queueMicrotask(f) on DOMWindow
403         https://bugs.webkit.org/show_bug.cgi?id=188212
404
405         Reviewed by Ryosuke Niwa.
406
407         This patch adds self.queueMicrotask(f) in DOMWindow, which takes a function and enqueue it into microtask queue.
408         We do not add this to Worker's global scope since our worker does not support microtasks correctly.
409
410         Tests: js/dom/queue-microtask-window.html
411
412         * bindings/js/JSDOMWindowCustom.cpp:
413         (WebCore::JSDOMWindow::queueMicrotask):
414         Post a microtask to JSC's microtask mechanism. This will eventually go to WebCore's MicrotaskQueue code.
415
416         * page/DOMWindow.idl:
417
418 2018-08-01  Tomas Popela  <tpopela@redhat.com>
419
420         [WTF] Rename String::format to String::deprecatedFormat
421         https://bugs.webkit.org/show_bug.cgi?id=188191
422
423         Reviewed by Darin Adler.
424
425         It should be replaced with string concatenation.
426
427         * Modules/indexeddb/IDBKeyData.cpp:
428         (WebCore::IDBKeyData::loggingString const):
429         * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
430         (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
431         * Modules/indexeddb/shared/IDBCursorInfo.cpp:
432         (WebCore::IDBCursorInfo::loggingString const):
433         * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
434         (WebCore::IDBGetAllRecordsData::loggingString const):
435         * Modules/indexeddb/shared/IDBGetRecordData.cpp:
436         (WebCore::IDBGetRecordData::loggingString const):
437         * Modules/indexeddb/shared/IDBIndexInfo.cpp:
438         (WebCore::IDBIndexInfo::loggingString const):
439         (WebCore::IDBIndexInfo::condensedLoggingString const):
440         * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
441         (WebCore::IDBIterateCursorData::loggingString const):
442         * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
443         (WebCore::IDBObjectStoreInfo::condensedLoggingString const):
444         * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
445         (WebCore::IDBResourceIdentifier::loggingString const):
446         * Modules/webdatabase/Database.cpp:
447         (WebCore::formatErrorMessage):
448         * Modules/webdatabase/SQLError.h:
449         (WebCore::SQLError::create):
450         * Modules/websockets/WebSocket.cpp:
451         (WebCore::encodeProtocolString):
452         * accessibility/win/AccessibilityObjectWrapperWin.cpp:
453         (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
454         * css/CSSUnicodeRangeValue.cpp:
455         (WebCore::CSSUnicodeRangeValue::customCSSText const):
456         * css/MediaQueryEvaluator.cpp:
457         (WebCore::aspectRatioValueAsString):
458         * css/parser/CSSParserToken.cpp:
459         (WebCore::CSSParserToken::serialize const):
460         * css/parser/CSSPropertyParserHelpers.cpp:
461         (WebCore::CSSPropertyParserHelpers::parseHexColor):
462         * dom/Document.cpp:
463         (WebCore::Document::lastModified):
464         * html/FTPDirectoryDocument.cpp:
465         (WebCore::processFilesizeString):
466         (WebCore::processFileDateString):
467         * html/HTMLMediaElement.h:
468         (WTF::ValueToString<WebCore::TextTrackCue::string):
469         * html/HTMLSelectElement.cpp:
470         (WebCore::HTMLSelectElement::setLength):
471         * html/ImageDocument.cpp:
472         (WebCore::ImageDocument::imageUpdated):
473         * html/canvas/WebGLRenderingContextBase.cpp:
474         * html/parser/XSSAuditor.cpp:
475         (WebCore::XSSAuditor::init):
476         * html/track/VTTCue.cpp:
477         (WebCore::VTTCueBox::applyCSSProperties):
478         * inspector/InspectorFrontendClientLocal.cpp:
479         (WebCore::InspectorFrontendClientLocal::setDockingUnavailable):
480         (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
481         (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled):
482         (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled):
483         (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
484         * inspector/agents/InspectorCSSAgent.cpp:
485         * inspector/agents/InspectorIndexedDBAgent.cpp:
486         * page/CaptionUserPreferencesMediaAF.cpp:
487         (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const):
488         * page/History.cpp:
489         (WebCore::History::stateObjectAdded):
490         * page/MemoryRelease.cpp:
491         (WebCore::logMemoryStatisticsAtTimeOfDeath):
492         * page/cocoa/ResourceUsageOverlayCocoa.mm:
493         (WebCore::formatByteNumber):
494         (WebCore::gcTimerString):
495         (WebCore::ResourceUsageOverlay::platformDraw):
496         * page/cocoa/ResourceUsageThreadCocoa.mm:
497         (WebCore::logFootprintComparison):
498         * page/linux/ResourceUsageOverlayLinux.cpp:
499         (WebCore::cpuUsageString):
500         (WebCore::formatByteNumber):
501         (WebCore::gcTimerString):
502         * page/scrolling/AxisScrollSnapOffsets.cpp:
503         (WebCore::snapOffsetsToString):
504         (WebCore::snapOffsetRangesToString):
505         (WebCore::snapPortOrAreaToString):
506         * platform/DateComponents.cpp:
507         (WebCore::DateComponents::toStringForTime const):
508         (WebCore::DateComponents::toString const):
509         * platform/LocalizedStrings.cpp:
510         * platform/animation/TimingFunction.cpp:
511         (WebCore::TimingFunction::cssText const):
512         * platform/audio/HRTFElevation.cpp:
513         (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
514         * platform/cocoa/KeyEventCocoa.mm:
515         (WebCore::keyIdentifierForCharCode):
516         * platform/gamepad/mac/HIDGamepad.cpp:
517         (WebCore::HIDGamepad::HIDGamepad):
518         * platform/glib/UserAgentGLib.cpp:
519         (WebCore::platformVersionForUAString):
520         * platform/graphics/Color.cpp:
521         (WebCore::Color::nameForRenderTreeAsText const):
522         * platform/graphics/FloatPolygon.h:
523         (WTF::ValueToString<WebCore::FloatPolygonEdge::string):
524         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
525         (WebCore::AVTrackPrivateAVFObjCImpl::id const):
526         * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
527         (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
528         * platform/graphics/ca/GraphicsLayerCA.cpp:
529         (WebCore::GraphicsLayerCA::setName):
530         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
531         (WebCore::GraphicsLayerCA::recursiveCommitChanges):
532         (WebCore::GraphicsLayerCA::updateContentsImage):
533         (WebCore::GraphicsLayerCA::updateContentsRects):
534         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
535         * platform/graphics/gstreamer/GStreamerCommon.cpp:
536         (WebCore::simpleBusMessageCallback):
537         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
538         (WebCore::MediaPlayerPrivateGStreamer::load):
539         (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
540         (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
541         * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
542         (WebCore::AppendPipeline::handleStateChangeMessage):
543         (WebCore::AppendPipeline::resetPipeline):
544         * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
545         (WebCore::MediaPlayerPrivateGStreamerMSE::load):
546         (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
547         * platform/graphics/gtk/ImageBufferGtk.cpp:
548         (WebCore::encodeImage):
549         * platform/gtk/PlatformKeyboardEventGtk.cpp:
550         (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode):
551         * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
552         (WebCore::GStreamerAudioCaptureSource::create):
553         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
554         (WebCore::webkitMediaStreamSrcAddPad):
555         * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
556         (WebCore::GStreamerVideoCaptureSource::create):
557         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
558         (WebCore::GStreamerVideoEncoder::makeElement):
559         * platform/mock/MockRealtimeVideoSource.cpp:
560         (WebCore::MockRealtimeVideoSource::drawText):
561         * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
562         * platform/network/ParsedContentRange.cpp:
563         (WebCore::ParsedContentRange::headerValue const):
564         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
565         (WebCore::NetworkStorageSession::switchToNewTestingSession):
566         * platform/sql/SQLiteDatabase.cpp:
567         (WebCore::unauthorizedSQLFunction):
568         * platform/text/PlatformLocale.cpp:
569         (WebCore::DateTimeStringBuilder::visitField):
570         * platform/win/GDIObjectCounter.cpp:
571         (WebCore::GDIObjectCounter::GDIObjectCounter):
572         * platform/win/KeyEventWin.cpp:
573         (WebCore::keyIdentifierForWindowsKeyCode):
574         * rendering/FloatingObjects.h:
575         (WTF::ValueToString<WebCore::FloatingObject::string):
576         * rendering/RenderFragmentedFlow.h:
577         (WTF::ValueToString<WebCore::RenderFragmentContainer::string):
578         * rendering/RenderLayerCompositor.cpp:
579         (WebCore::RenderLayerCompositor::logLayerInfo):
580         * rendering/RenderTheme.cpp:
581         (WebCore::RenderTheme::formatMediaControlsTime const):
582         * testing/Internals.cpp:
583         (WebCore::Internals::address):
584         * workers/service/server/RegistrationDatabase.cpp:
585         (WebCore::RegistrationDatabase::ensureValidRecordsTable):
586         (WebCore::RegistrationDatabase::importRecords):
587
588 2018-08-01  Alex Christensen  <achristensen@webkit.org>
589
590         Move all calls to ResourceLoader::start to WebKitLegacy
591         https://bugs.webkit.org/show_bug.cgi?id=184946
592
593         Reviewed by Andy Estes.
594
595         This is in preparation for moving ResourceLoader::start to WebKitLegacy along with all ResourceHandle code.
596         I move the code that moves m_deferredRequest into m_request into WebKitLegacy, which won't change behavior for
597         modern WebKit because modern WebKit never calls ResourceLoader::start, the only place where m_deferredRequest
598         is ever set.  This won't change behavior for WebKitLegacy because the same operations happen in the same order.
599
600         * loader/LoaderStrategy.h:
601         * loader/ResourceLoader.cpp:
602         (WebCore::ResourceLoader::setDefersLoading):
603         * loader/ResourceLoader.h:
604         (WebCore::ResourceLoader::setRequest):
605         (WebCore::ResourceLoader::deferredRequest const):
606         (WebCore::ResourceLoader::takeDeferredRequest):
607
608 2018-08-01  Nan Wang  <n_wang@apple.com>
609
610         AX: AOM: Add ARIA IDL Attribute Reflection
611         https://bugs.webkit.org/show_bug.cgi?id=184676
612         <rdar://problem/39476882>
613
614         Reviewed by Chris Fleizach.
615
616         Test: accessibility/ARIA-reflection.html
617
618         * CMakeLists.txt:
619         * DerivedSources.make:
620         * WebCore.xcodeproj/project.pbxproj:
621         * accessibility/AccessibilityRole.idl: Added.
622         * accessibility/AriaAttributes.idl: Added.
623         * dom/Element.idl:
624         * page/RuntimeEnabledFeatures.h:
625         (WebCore::RuntimeEnabledFeatures::setAriaReflectionEnabled):
626         (WebCore::RuntimeEnabledFeatures::ariaReflectionEnabled const):
627
628 2018-08-01  Zalan Bujtas  <zalan@apple.com>
629
630         [LFC][Floating] Revert back to only one list for the all the floatings.
631         https://bugs.webkit.org/show_bug.cgi?id=188232
632
633         Reviewed by Antti Koivisto.
634
635         If the combined floating list turns out to be a performance bottleneck, we can still split it into left and right. However at this point
636         having 2 dedicated lists just makes the implementation more complicated.
637
638         * layout/FloatingContext.cpp:
639         (WebCore::Layout::begin):
640         (WebCore::Layout::end):
641         (WebCore::Layout::FloatingPair::FloatingPair):
642         (WebCore::Layout::FloatingPair::left const):
643         (WebCore::Layout::FloatingPair::right const):
644         (WebCore::Layout::Iterator::Iterator):
645         (WebCore::Layout::previousFloatingIndex):
646         (WebCore::Layout::Iterator::operator++):
647         (WebCore::Layout::Iterator::set):
648         (WebCore::Layout::floatingDisplayBox): Deleted.
649         * layout/FloatingState.cpp:
650         (WebCore::Layout::FloatingState::remove):
651         (WebCore::Layout::FloatingState::append):
652         * layout/FloatingState.h:
653         (WebCore::Layout::FloatingState::isEmpty const):
654         (WebCore::Layout::FloatingState::floatings const):
655         (WebCore::Layout::FloatingState::last const):
656
657 2018-08-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
658
659         [Curl] Change synchronous request logic using MessageQueue to match with Mac port.
660         https://bugs.webkit.org/show_bug.cgi?id=188206
661
662         Reviewed by Alex Christensen.
663
664         Port synchronous request logic from ResourceHandleMac to use MessageQueue for
665         client callback invocation. This makes simplify the logic of CurlRequest because
666         now every requests are handled in Curl thread and there's no difference between
667         sync and async requests.
668
669         Test: Covered by these tests:
670         - http\tests\xmlhttprequest\simple-sync.html
671         - http\tests\xmlhttprequest\xmlhttprequest-unsafe-redirect.html
672
673         * platform/network/ResourceHandleInternal.h:
674         * platform/network/curl/CurlRequest.cpp: Remove synchronous request logics.
675         (WebCore::CurlRequest::CurlRequest):
676         (WebCore::CurlRequest::invalidateClient):
677         (WebCore::CurlRequest::start):
678         (WebCore::CurlRequest::cancel):
679         (WebCore::CurlRequest::runOnMainThread): Added message queue handling.
680         (WebCore::CurlRequest::runOnWorkerThreadIfRequired):
681         (WebCore::CurlRequest::didReceiveData):
682         (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
683         (WebCore::CurlRequest::completeDidReceiveResponse):
684         (WebCore::CurlRequest::updateHandlePauseState):
685         (WebCore::CurlRequest::isHandlePaused const):
686         * platform/network/curl/CurlRequest.h:
687         (WebCore::CurlRequest::create):
688         (WebCore::CurlRequest::resourceRequest const):
689         * platform/network/curl/ResourceHandleCurl.cpp:
690         (WebCore::ResourceHandle::createCurlRequest):
691         (WebCore::ResourceHandle::restartRequestWithCredential):
692         (WebCore::ResourceHandle::platformLoadResourceSynchronously):
693         (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
694         (WebCore::ResourceHandle::continueAfterDidReceiveResponse):
695         (WebCore::ResourceHandle::continueAfterWillSendRequest):
696         (WebCore::ResourceHandle::handleDataURL):
697
698 2018-08-01  Zalan Bujtas  <zalan@apple.com>
699
700         [LFC][Floating] Use margin box consistently while placing a floating.
701         https://bugs.webkit.org/show_bug.cgi?id=188222
702
703         Reviewed by Antti Koivisto.
704
705         The floating box fits when its margin box fits.
706
707         * layout/FloatingContext.cpp:
708         (WebCore::Layout::FloatingContext::computePosition const):
709         (WebCore::Layout::FloatingContext::floatingPosition const):
710         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
711         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
712         (WebCore::Layout::FloatingContext::alignWithFloatings const):
713         (WebCore::Layout::FloatingPair::intersects const):
714         * layout/displaytree/DisplayBox.h:
715         (WebCore::Display::Box::rectWithMargin const):
716
717 2018-08-01  Zalan Bujtas  <zalan@apple.com>
718
719         [LFC] Add FormattingContext::mapToAncestor geometry mapping function
720         https://bugs.webkit.org/show_bug.cgi?id=188188
721
722         Reviewed by Antti Koivisto.
723
724         * layout/FormattingContext.cpp:
725         (WebCore::Layout::FormattingContext::mapToAncestor):
726         * layout/FormattingContext.h:
727         * layout/displaytree/DisplayBox.cpp:
728         (WebCore::Display::Box::clone const):
729         * layout/displaytree/DisplayBox.h:
730
731 2018-08-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>
732
733         [Curl] Bugfix on ResourceHandle::cancel()
734         https://bugs.webkit.org/show_bug.cgi?id=188234
735
736         Reviewed by Darin Adler.
737         Trivial bug. The actual request was not cancelled correctly.
738
739         * platform/network/curl/ResourceHandleCurl.cpp:
740         (WebCore::ResourceHandle::cancel):
741
742 2018-08-01  Zalan Bujtas  <zalan@apple.com>
743
744         [LFC][Floating] FloatingState should take the formatting root box.
745         https://bugs.webkit.org/show_bug.cgi?id=188214
746
747         Reviewed by Antti Koivisto.
748
749         This will be taken into use when FormattingContext takes all boxes in the coordinate system of the formatting root.
750
751         * layout/FloatingState.cpp:
752         (WebCore::Layout::FloatingState::FloatingState):
753         (WebCore::Layout::belongsToThisFloatingContext):
754         (WebCore::Layout::FloatingState::append):
755         * layout/FloatingState.h:
756         (WebCore::Layout::FloatingState::create):
757         * layout/LayoutContext.cpp:
758         (WebCore::Layout::LayoutContext::establishedFormattingState):
759
760 2018-08-01  Zalan Bujtas  <zalan@apple.com>
761
762         [LFC][Floating] Align new floating with the bottom of the existing floatings.
763         https://bugs.webkit.org/show_bug.cgi?id=188213
764
765         Reviewed by Antti Koivisto.
766
767         When the incoming floating does not fit at all, align its top with the bottom of the existing floatings.
768
769         * layout/FloatingContext.cpp:
770         (WebCore::Layout::FloatingContext::floatingPosition const):
771         (WebCore::Layout::FloatingPair::bottom const):
772
773 2018-08-01  Eric Carlson  <eric.carlson@apple.com>
774
775         Always use MediaPlayback audio category when playing to AppleTV
776         https://bugs.webkit.org/show_bug.cgi?id=188230
777         <rdar://problem/42497809>
778
779         Reviewed by Jer Noble.
780
781         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
782         (PlatformMediaSessionManager::updateSessionState): Check session.isPlayingToWirelessPlaybackTarget().
783
784 2018-08-01  Timothy Hatcher  <timothy@apple.com>
785
786         Hardcode some system colors to avoid fingerprinting exposure.
787         https://bugs.webkit.org/show_bug.cgi?id=188203
788         rdar://problem/42781630
789
790         Reviewed by Tim Horton.
791
792         Passes existing tests with the hardcoded blue system appearance.
793
794         * rendering/RenderTheme.h:
795         * rendering/RenderThemeMac.mm:
796         (WebCore::RenderThemeMac::systemColor const):
797         Adds special handling for some system colors. Fixes -apple-system-selected-text-background
798         to match the real selection color by using blendWithWhite().
799
800 2018-08-01  Eric Carlson  <eric.carlson@apple.com>
801
802         [iOS] Remove the delay before setting audio session category added in r233535
803         https://bugs.webkit.org/show_bug.cgi?id=188225
804
805         Reviewed by Jer Noble.
806
807         * platform/audio/PlatformMediaSessionManager.cpp:
808         (WebCore::PlatformMediaSessionManager::beginInterruption): scheduleUpdateSessionState -> updateSessionState.
809         (WebCore::PlatformMediaSessionManager::addSession): Ditto.
810         (WebCore::PlatformMediaSessionManager::removeSession): Ditto.
811         (WebCore::PlatformMediaSessionManager::sessionStateChanged): Ditto.
812         (WebCore::PlatformMediaSessionManager::sessionCanProduceAudioChanged): Ditto.
813         (WebCore::PlatformMediaSessionManager::updateSessionState): Ditto.
814         (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged): Ditto.
815         (WebCore::PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
816         * platform/audio/PlatformMediaSessionManager.h:
817
818         * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
819         (PlatformMediaSessionManager::updateSessionState):
820         (PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
821         * rendering/RenderLayer.cpp:
822         (WebCore::RenderLayer::updateClipRects):
823
824 2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>
825
826         Add TransformationMatrix::Identity
827         https://bugs.webkit.org/show_bug.cgi?id=188204
828
829         Reviewed by Simon Fraser.
830
831         This patch adds TransformationMatrix::Identity, which is a static const variable holding an identity matrix.
832
833         No behavior change.
834
835         * platform/graphics/GraphicsLayer.cpp:
836         (WebCore::GraphicsLayer::transform const):
837         (WebCore::GraphicsLayer::childrenTransform const):
838         (): Deleted.
839         * platform/graphics/transforms/TransformationMatrix.cpp:
840         * platform/graphics/transforms/TransformationMatrix.h:
841
842 2018-08-01  Thibault Saunier  <tsaunier@igalia.com>
843
844         [GStreamer] Make sure that first buffer running time is 0 in GStreamerMediaStreamSource
845         https://bugs.webkit.org/show_bug.cgi?id=188210
846
847         This is a live source and the first frame is the beginning of the stream,
848         but that doesn't mean that the incoming stream from the camera didn't start
849         before. We need to set a pad offset on each srcpad of the source to compensate
850         for that. This is the exact same logic as in webrtc GStreamerVideo/Enc/Dec/oder.
851
852         Reviewed by Alejandro G. Castro.
853
854         * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
855         (WebCore::webkit_media_stream_src_init):
856         (WebCore::webkitMediaStreamSrcPushVideoSample):
857         (WebCore::webkitMediaStreamSrcPushAudioSample):
858
859 2018-08-01  Zan Dobersek  <zdobersek@igalia.com>
860
861         [CoordGraphics] Move CoordinatedBackingStore to WebCore
862         https://bugs.webkit.org/show_bug.cgi?id=188158
863
864         Reviewed by Carlos Garcia Campos.
865
866         Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
867         dependency on anything in the WebKit layer, and it's more suitable to
868         future needs to keep it in the WebCore layer.
869
870         * platform/TextureMapper.cmake:
871         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp.
872         * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h.
873         (WebCore::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
874         (WebCore::CoordinatedBackingStore::rect const):
875
876 2018-07-31  Myles C. Maxfield  <mmaxfield@apple.com>
877
878         [WIN] Fix tests for text with initial advances
879         https://bugs.webkit.org/show_bug.cgi?id=188099
880
881         Reviewed by Darin Adler.
882
883         Fixup after r234318.
884
885         Tests: fast/text/complex-first-glyph-with-initial-advance.html
886                fast/text/initial-advance-in-intermediate-run-complex.html
887
888         * platform/graphics/ComplexTextController.cpp:
889         * platform/graphics/FontCascade.cpp:
890         (WebCore::FontCascade::drawGlyphBuffer const):
891
892 2018-07-31  Alex Christensen  <achristensen@webkit.org>
893
894         REGRESSION (r231107): MoviStar+ launches to a blank black screen
895         https://bugs.webkit.org/show_bug.cgi?id=188139
896
897         Reviewed by Brent Fulgham.
898
899         For this app, revert behavior to how it was before r231107 with a linked-on-or-before check.
900         r231107 increased our fetch spec conformance, which we intend to keep.  This makes a low-risk
901         targeted fix that will fix the affected app until they update.  
902
903         I manually verified this fixes the app.
904
905         * loader/DocumentThreadableLoader.cpp:
906         (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
907         * platform/RuntimeApplicationChecks.h:
908         * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
909         (WebCore::applicationSDKVersionOverride):
910         (WebCore::setApplicationSDKVersion):
911         (WebCore::applicationSDKVersion):
912         (WebCore::IOSApplication::isMoviStarPlus):
913
914 2018-07-31  Myles C. Maxfield  <mmaxfield@apple.com>
915
916         [Cocoa] Addressing post-review comments on r234158
917         https://bugs.webkit.org/show_bug.cgi?id=188202
918
919         Reviewed by Darin Adler.
920
921         * platform/graphics/cocoa/FontCacheCoreText.cpp:
922         (WebCore::FontCache::lastResortFallbackFont):
923
924 2018-07-31  John Wilander  <wilander@apple.com>
925
926         Resource Load Statistics: Remove partitioned cookies for reduced complexity, lower memory footprint, and ability to support more platforms
927         https://bugs.webkit.org/show_bug.cgi?id=188109
928         <rdar://problem/42664391>
929
930         Reviewed by Brent Fulgham, Chris Dumez, and Alex Christensen.
931
932         Tests: http/tests/resourceLoadStatistics/cookie-deletion.html
933                http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html
934                http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-user-interaction.html
935                http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe-pop-window.html
936                http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe.html
937                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html
938                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-but-access-from-wrong-frame.html
939                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
940                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html
941                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe.html
942                http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe.html
943
944         This patch removes cookie partitioning which reduces the model to just
945         blocked cookies (in third-party contexts) and first-party cookie access.
946
947         Several of the changes are renaming to reflect that there are no more
948         cookie partitions. However, the compile-time check remains for now since
949         this change is not ready to ship.
950
951         The test cases mentioned about are not new. They are just renamed to
952         reflect the code changes and to shorten their names (as requested by
953         non-Cocoa platforms).
954
955         * loader/ResourceLoadStatistics.cpp:
956         (WebCore::ResourceLoadStatistics::toString const):
957         (WebCore::ResourceLoadStatistics::merge):
958             Removed the use of isMarkedForCookiePartitioning.
959         * loader/ResourceLoadStatistics.h:
960             Removed isMarkedForCookiePartitioning.
961         * platform/network/NetworkStorageSession.h:
962         * platform/network/ResourceHandle.h:
963             Renamed applySniffingPoliciesAndStoragePartitionIfNeeded() to
964             applySniffingPoliciesIfNeeded().
965         * platform/network/cf/NetworkStorageSessionCFNet.cpp:
966         (WebCore::getPartitioningDomain):
967         (WebCore::NetworkStorageSession::shouldBlockCookies const):
968             Now takes a frame ID and a page ID to be able to support
969             the Storage Access API. This was previously handled by
970             shouldPartitionCookies() which is now deleted.
971         (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
972             Renamed from setPrevalentDomainsToPartitionOrBlockCookies().
973         (WebCore::NetworkStorageSession::removePrevalentDomains):
974             No longer needs to clear the member variable for partitioned cookie domains.
975         (WebCore::NetworkStorageSession::setCookieStoragePartitioningEnabled): Deleted.
976         (WebCore::NetworkStorageSession::cookieStoragePartition const): Deleted.
977         (WebCore::NetworkStorageSession::shouldPartitionCookies const): Deleted.
978         (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies): Deleted.
979             Renamed to setPrevalentDomainsToBlockCookiesFor().
980         * platform/network/mac/CookieJarMac.mm:
981         (WebCore::cookiesForURL):
982             Now calls session.shouldBlockCookies() instead of the
983             wrapper cookiesAreBlockedForURL().
984         (WebCore::setCookiesFromDOM):
985             No longer checks for partition.
986         (WebCore::applyPartitionToCookies): Deleted.
987         (WebCore::cookiesAreBlockedForURL): Deleted.
988             This was just a wrapper for session.shouldBlockCookies().
989         (WebCore::cookiesInPartitionForURL): Deleted.
990         * platform/network/mac/ResourceHandleMac.mm:
991         (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
992             Renamed from applySniffingPoliciesAndStoragePartitionIfNeeded().
993         (WebCore::ResourceHandle::createNSURLConnection):
994             Consequence of function name change.
995         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Deleted.
996             Renamed to applySniffingPoliciesIfNeeded().
997
998 2018-07-31  Wenson Hsieh  <wenson_hsieh@apple.com>
999
1000         [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in
1001         https://bugs.webkit.org/show_bug.cgi?id=188107
1002         <rdar://problem/42354250>
1003
1004         Reviewed by Tim Horton.
1005
1006         After r232040, the synthetic click gesture recognizer was enabled when tapping inside of the focused element,
1007         which allows the page to handle click events inside editable content. However, this means that codepaths in
1008         EventHandler that are responsible for changing selection due to default click event behaviors on macOS are now
1009         active on iOS; this conflicts with selection changes due to text interaction gestures, which are the existing
1010         mechanism for modifying the selection on iOS.
1011
1012         To address this, we defer selection changes when clicking to text interaction gestures on iOS by tweaking the
1013         default behavior of a click on iOS to /not/ change selection when moving within the same editable root. This is
1014         similar to r233311, but in a different codepath that specifically handles selection changes when clicking on
1015         content that is already selected.
1016
1017         Test: fast/forms/ios/click-should-not-suppress-misspelling.html
1018
1019         * page/EventHandler.cpp:
1020         (WebCore::EventHandler::handleMouseReleaseEvent):
1021
1022 2018-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1023
1024         Clean up TransformationMatrix implementation
1025         https://bugs.webkit.org/show_bug.cgi?id=188197
1026
1027         Reviewed by Simon Fraser.
1028
1029         We perform cleaning up of TransformationMatrix.
1030
1031         1. We drop user-defined operator= and copy constructor. Default ones works well for TransformationMatrix.
1032         2. Remove unused setMatrix. We explicitly use memcpy in TransformationMatrix.cpp (only one place).
1033         3. Use memcmp for implementing operator==.
1034
1035         In (2) and (3), we use `memcpy(&matrix[0][0], &tmp[0][0], sizeof(Matrix4))` instead of `memcpy(matrix, tmp, sizeof(Matrix4))`,
1036         since they both are non nullptr and the former is easier to understand.
1037
1038         * platform/graphics/transforms/TransformationMatrix.cpp:
1039         (WebCore::TransformationMatrix::multiply):
1040         * platform/graphics/transforms/TransformationMatrix.h:
1041         (WebCore::TransformationMatrix::setMatrix):
1042         (WebCore::TransformationMatrix::operator== const):
1043         (WebCore::TransformationMatrix::operator =): Deleted.
1044
1045 2018-07-31  Timothy Hatcher  <timothy@apple.com>
1046
1047         Don't call RenderTheme::platformColorsDidChange() during printing.
1048         https://bugs.webkit.org/show_bug.cgi?id=188181
1049         rdar://problem/42360070
1050
1051         Reviewed by Tim Horton.
1052
1053         * inspector/agents/InspectorPageAgent.cpp:
1054         (WebCore::InspectorPageAgent::setEmulatedMedia): Call m_page.updateStyleAfterChangeInEnvironment()
1055         instead of going to styleStope() and remove call to RenderTheme::platformColorsDidChange().
1056         * page/FrameView.cpp:
1057         (WebCore::FrameView::adjustMediaTypeForPrinting): Remove call RenderTheme::platformColorsDidChange().
1058
1059 2018-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>
1060
1061         Use static const global variable for TransformationMatrix instead of NeverDestroyed
1062         https://bugs.webkit.org/show_bug.cgi?id=188195
1063
1064         Reviewed by Darin Adler.
1065
1066         Since TransformationMatrix does not have a non-trivial destructor, we can put it
1067         as static const global variable if its constructor is constexpr. This patch makes
1068         some of constructors constexpr and makes identityTransform static const global variable
1069         instead of NeverDestroyed<> + static function. This removes unnecessary static function
1070         and lazy initialization.
1071
1072         No behavior change.
1073
1074         * platform/graphics/GraphicsLayer.cpp:
1075         (WebCore::GraphicsLayer::transform const):
1076         (WebCore::GraphicsLayer::childrenTransform const):
1077         (WebCore::identityTransform): Deleted.
1078         * platform/graphics/transforms/TransformationMatrix.h:
1079         (WebCore::TransformationMatrix::TransformationMatrix):
1080
1081 2018-07-31  Zalan Bujtas  <zalan@apple.com>
1082
1083         [LFC][Floating] Add basic left/right floating positioning.
1084         https://bugs.webkit.org/show_bug.cgi?id=188148
1085
1086         Reviewed by Antti Koivisto.
1087
1088         This patch implements simple floating positioning.
1089         (Floatings with different containing blocks do not work yet.)
1090
1091         * layout/FloatingContext.cpp:
1092         (WebCore::Layout::FloatingPair::isEmpty const):
1093         (WebCore::Layout::Iterator::current const):
1094         (WebCore::Layout::Iterator::verticalPosition const):
1095         (WebCore::Layout::FloatingContext::FloatingContext):
1096         (WebCore::Layout::FloatingContext::computePosition const):
1097         (WebCore::Layout::FloatingContext::floatingPosition const):
1098         (WebCore::Layout::FloatingContext::initialVerticalPosition const):
1099         (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
1100         (WebCore::Layout::FloatingContext::alignWithFloatings const):
1101         (WebCore::Layout::floatingDisplayBox):
1102         (WebCore::Layout::FloatingPair::FloatingPair):
1103         (WebCore::Layout::FloatingPair::left const):
1104         (WebCore::Layout::FloatingPair::right const):
1105         (WebCore::Layout::FloatingPair::intersects const):
1106         (WebCore::Layout::Iterator::Iterator):
1107         (WebCore::Layout::Iterator::operator++):
1108         (WebCore::Layout::Iterator::set):
1109         (WebCore::Layout::FloatingContext::computePosition): Deleted.
1110         * layout/FloatingContext.h:
1111         * layout/FloatingState.cpp:
1112         (WebCore::Layout::FloatingState::append):
1113         * layout/FloatingState.h:
1114         (WebCore::Layout::FloatingState::floatings const):
1115         (WebCore::Layout::FloatingState::last const):
1116         * layout/blockformatting/BlockFormattingContext.cpp:
1117         (WebCore::Layout::BlockFormattingContext::layout const):
1118         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
1119         * layout/displaytree/DisplayBox.cpp:
1120         (WebCore::Display::Box::Rect::Rect):
1121         * layout/displaytree/DisplayBox.h:
1122         (WebCore::Display::Box::Rect::intersects const):
1123         (WebCore::Display::Box::rect const):
1124
1125 2018-07-31  Rob Buis  <rbuis@igalia.com>
1126
1127         Remove ResourceResponse::cacheBodyKey API
1128         https://bugs.webkit.org/show_bug.cgi?id=188192
1129
1130         Reviewed by Frédéric Wang.
1131
1132         Removed unused API.
1133
1134         No new tests needed since this API is not used.
1135
1136         * platform/network/ResourceResponseBase.h:
1137         (WebCore::ResourceResponseBase::encode const):
1138         (WebCore::ResourceResponseBase::decode):
1139         (WebCore::ResourceResponseBase::cacheBodyKey const): Deleted.
1140         (WebCore::ResourceResponseBase::setCacheBodyKey): Deleted.
1141
1142 2018-07-30  Simon Fraser  <simon.fraser@apple.com>
1143
1144         Shrink GraphicsLayerCA
1145         https://bugs.webkit.org/show_bug.cgi?id=188141
1146
1147         Reviewed by Zalan Bujtas.
1148         
1149         Shrink GraphicsLayerCA from 1040 to 880 bytes by:
1150         * moving all the clone-related stuff into the lazily-allocated m_layerClones
1151         * moving all the animation-related stuff into the lazily-allocated m_animations
1152         * making enums be 8-bit
1153         * re-ordering data members
1154
1155         * page/cocoa/ResourceUsageOverlayCocoa.mm:
1156         (WebCore::ResourceUsageOverlay::platformInitialize):
1157         * platform/graphics/GraphicsLayer.cpp:
1158         (WebCore::GraphicsLayer::GraphicsLayer):
1159         (WebCore::operator<<):
1160         * platform/graphics/GraphicsLayer.h:
1161         * platform/graphics/GraphicsLayerClient.h:
1162         * platform/graphics/WindRule.h:
1163         * platform/graphics/ca/GraphicsLayerCA.cpp:
1164         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
1165         (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
1166         (WebCore::GraphicsLayerCA::addProcessingActionForAnimation):
1167         (WebCore::GraphicsLayerCA::setContentsToSolidColor):
1168         (WebCore::GraphicsLayerCA::setContentsToImage):
1169         (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
1170         (WebCore::GraphicsLayerCA::contentsLayerForMedia const):
1171         (WebCore::GraphicsLayerCA::layerDidDisplay):
1172         (WebCore::layerTypeForCustomBackdropAppearance):
1173         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1174         (WebCore::GraphicsLayerCA::updateGeometry):
1175         (WebCore::GraphicsLayerCA::updateMasksToBounds):
1176         (WebCore::GraphicsLayerCA::updateContentsVisibility):
1177         (WebCore::GraphicsLayerCA::updateContentsOpaque):
1178         (WebCore::GraphicsLayerCA::updateBackfaceVisibility):
1179         (WebCore::GraphicsLayerCA::updateFilters):
1180         (WebCore::GraphicsLayerCA::updateBackdropFilters):
1181         (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
1182         (WebCore::GraphicsLayerCA::ensureStructuralLayer):
1183         (WebCore::GraphicsLayerCA::updateDrawsContent):
1184         (WebCore::GraphicsLayerCA::updateCoverage):
1185         (WebCore::GraphicsLayerCA::updateDebugIndicators):
1186         (WebCore::GraphicsLayerCA::updateContentsImage):
1187         (WebCore::GraphicsLayerCA::updateContentsPlatformLayer):
1188         (WebCore::GraphicsLayerCA::updateContentsColorLayer):
1189         (WebCore::GraphicsLayerCA::updateContentsRects):
1190         (WebCore::GraphicsLayerCA::updateMasksToBoundsRect):
1191         (WebCore::GraphicsLayerCA::updateMaskLayer):
1192         (WebCore::GraphicsLayerCA::updateAnimations):
1193         (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
1194         (WebCore::GraphicsLayerCA::ensureLayerAnimations):
1195         (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
1196         * platform/graphics/ca/GraphicsLayerCA.h:
1197         (WebCore::GraphicsLayerCA::animationIsRunning const):
1198         (WebCore::GraphicsLayerCA::primaryLayerClones const): Deleted.
1199         * platform/graphics/ca/PlatformCALayerClient.h:
1200         (WebCore::PlatformCALayerClient::platformCALayerContentsOrientation const):
1201         * platform/graphics/ca/TileCoverageMap.h:
1202         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
1203         * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
1204         (PlatformCALayerCocoa::PlatformCALayerCocoa):
1205         (PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const):
1206         (PlatformCALayerCocoa::updateCustomAppearance):
1207         (PlatformCALayer::drawLayerContents):
1208         * rendering/RenderLayerBacking.cpp:
1209         (WebCore::RenderLayerBacking::updateCustomAppearance):
1210         (WebCore::RenderLayerBacking::updateConfiguration):
1211         * rendering/RenderLayerCompositor.cpp:
1212         (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
1213         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
1214
1215 2018-07-30  Justin Fan  <justin_fan@apple.com>
1216
1217         [WebGL2] Support compilation of GLSL ES version 300 shaders
1218         https://bugs.webkit.org/show_bug.cgi?id=187982
1219         <rdar://problem/42564229>
1220
1221         Reviewed by Dean Jackson.
1222
1223         Test: fast/canvas/webgl/webgl2-glsl3-compile.html
1224
1225         * html/canvas/WebGLRenderingContextBase.cpp:
1226         (WebCore::WebGLRenderingContextBase::create): Rename 'useGLES3' to 'isWebGL2' (everywhere) to make more sense.
1227         * platform/graphics/GraphicsContext3DAttributes.h: Rename 'useGLES3' to 'isWebGL2'.
1228         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1229         (WebCore::setPixelFormat): Back WebGL2 contexts with OpenGL 4 for full OpenGL ES 3 support. 
1230         (WebCore::GraphicsContext3D::GraphicsContext3D): Request correct GLSL output version and WebGL 2 for ANGLE shader compilation.
1231         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
1232         (WebCore::GraphicsContext3D::checkVaryingsPacking const): MAX_VARYING_FLOATS is deprecated in OpenGL 3+.
1233         * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Rename 'useGLES3' to 'isWebGL2'.
1234         (WebCore::GraphicsContext3D::create):
1235         (WebCore::GraphicsContext3D::GraphicsContext3D):
1236
1237 2018-07-30  Justin Fan  <justin_fan@apple.com>
1238
1239         Match GraphicsContext3D with correct virtual screen using registryID
1240         https://bugs.webkit.org/show_bug.cgi?id=188072
1241         <rdar://problem/42634940>
1242
1243         Reviewed by Dean Jackson.
1244
1245         Follow up to https://bugs.webkit.org/show_bug.cgi?id=187750. Rather than matching rendererIDs, 
1246         which can vary between processes, match GPU to display using registryID that is unique to a GPU, 
1247         which was added to CGL in MacOS 10.13. 
1248
1249         No new tests. Manually tested on MacBookPro13,3 and iMacPro1,1 with Apple DisplayPort Cinema Display
1250         and RX 580 external GPU. 
1251
1252         * platform/PlatformScreen.h:
1253         * platform/ScreenProperties.h:
1254         (WebCore::ScreenData::encode const):
1255         (WebCore::ScreenData::decode):
1256         * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
1257         (WebCore::setGPUByRegistryID):
1258         (WebCore::setGPUByDisplayMask):
1259         (WebCore::GraphicsContext3D::GraphicsContext3D):
1260         (WebCore::GraphicsContext3D::screenDidChange):
1261         (WebCore::identifyAndSetCurrentGPU): Deleted.
1262         * platform/mac/PlatformScreenMac.mm:
1263         (WebCore::collectScreenProperties):
1264         (WebCore::primaryRegistryID):
1265         (WebCore::registryIDForDisplay):
1266         (WebCore::registryIDForDisplayMask):
1267         (WebCore::rendererIDForDisplayMask): Deleted.
1268         (WebCore::rendererIDForDisplay): Deleted.
1269         (WebCore::primaryRendererID): Deleted.
1270
1271 2018-07-30  Rob Buis  <rbuis@igalia.com>
1272
1273         Merge PlatformCookieJar functions into NetworkStorageSession
1274         https://bugs.webkit.org/show_bug.cgi?id=188137
1275
1276         Reviewed by Alex Christensen.
1277
1278         No new tests -- no change in WebKit functionality.
1279
1280         * PlatformMac.cmake: Remove CookieJarMac.mm reference
1281         * SourcesCocoa.txt: Remove CookieJarMac.mm reference
1282         * WebCore.xcodeproj/project.pbxproj:
1283         * loader/CookieJar.cpp: Remove PlatformCookieJar.h reference.
1284         * platform/Curl.cmake: Remove CookieJarCurl.cpp reference.
1285         * platform/SourcesSoup.txt: Remove CookieJarSoup.cpp reference.
1286         * platform/network/CacheValidation.cpp: Adapt callsites to use
1287         NetworkStorageSession instead of CookieJar functions.
1288
1289         (WebCore::headerValueForVary):
1290         * platform/network/NetworkStorageSession.h: Add PlatformCookieJar
1291         functions.
1292
1293         * platform/network/PlatformCookieJar.h: Removed.
1294         * platform/network/SocketStreamHandleImpl.cpp: Adapt callsites to
1295         use NetworkStorageSession instead of CookieJar functions.
1296         (WebCore::cookieDataForHandshake):
1297         * platform/network/cf/CookieJarCFNet.cpp: Removed.
1298         * platform/network/cf/NetworkStorageSessionCFNet.cpp: Move functions
1299         from CookieJarCFNet.cpp.
1300         (WebCore::cookieDomain):
1301         (WebCore::canonicalCookieTime):
1302         (WebCore::cookieCreatedTime):
1303         (WebCore::cookieExpirationTime):
1304         (WebCore::cookieName):
1305         (WebCore::cookiePath):
1306         (WebCore::cookieValue):
1307         (WebCore::filterCookies):
1308         (WebCore::copyCookiesForURLWithFirstPartyURL):
1309         (WebCore::createCookies):
1310         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1311         (WebCore::containsSecureCookies):
1312         (WebCore::NetworkStorageSession::cookiesForDOM const):
1313         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1314         (WebCore::NetworkStorageSession::cookiesEnabled const):
1315         (WebCore::NetworkStorageSession::getRawCookies const):
1316         (WebCore::NetworkStorageSession::deleteCookie const):
1317         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1318         (WebCore::NetworkStorageSession::deleteAllCookies):
1319         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1320         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
1321         * platform/network/cocoa/NetworkStorageSessionCocoa.mm: Move functions
1322         from CookieJarMac.mm.
1323         (WebCore::httpCookies):
1324         (WebCore::deleteHTTPCookie):
1325         (WebCore::policyProperties):
1326         (WebCore::cookiesForURL):
1327         (WebCore::setHTTPCookiesForURL):
1328         (WebCore::httpCookiesForURL):
1329         (WebCore::filterCookies):
1330         (WebCore::applyPartitionToCookies):
1331         (WebCore::cookiesAreBlockedForURL):
1332         (WebCore::cookiesInPartitionForURL):
1333         (WebCore::cookiesForSession):
1334         (WebCore::deleteAllHTTPCookies):
1335         (WebCore::NetworkStorageSession::cookiesForDOM const):
1336         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1337         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1338         (WebCore::httpCookieAcceptPolicy):
1339         (WebCore::NetworkStorageSession::cookiesEnabled const):
1340         (WebCore::NetworkStorageSession::getRawCookies const):
1341         (WebCore::NetworkStorageSession::deleteCookie const):
1342         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1343         (WebCore::NetworkStorageSession::deleteAllCookies):
1344         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1345         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
1346         * platform/network/curl/CookieJarCurl.cpp: Removed.
1347         * platform/network/curl/CookieJarCurl.h:
1348         * platform/network/curl/NetworkStorageSessionCurl.cpp: Merge functions
1349         from CookieJarCurl.cpp.
1350         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1351         (WebCore::NetworkStorageSession::cookiesEnabled const):
1352         (WebCore::NetworkStorageSession::cookiesForDOM const):
1353         (WebCore::NetworkStorageSession::deleteCookie const):
1354         (WebCore::NetworkStorageSession::deleteAllCookies):
1355         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
1356         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1357         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1358         (WebCore::NetworkStorageSession::getRawCookies const):
1359         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1360         * platform/network/mac/CookieJarMac.mm: Removed.
1361         * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
1362         * platform/network/soup/CookieJarSoup.cpp: Removed.
1363         * platform/network/soup/NetworkStorageSessionSoup.cpp: Merge functions
1364         from CookieJarSoup.cpp.
1365         (WebCore::NetworkStorageSession::cookiesEnabled const):
1366         (WebCore::httpOnlyCookieExists):
1367         (WebCore::NetworkStorageSession::setCookiesFromDOM const):
1368         (WebCore::NetworkStorageSession::deleteCookie const):
1369         (WebCore::NetworkStorageSession::deleteAllCookies):
1370         (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
1371         (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
1372         (WebCore::NetworkStorageSession::getHostnamesWithCookies):
1373         (WebCore::NetworkStorageSession::getRawCookies const):
1374         (WebCore::cookiesForSession):
1375         (WebCore::NetworkStorageSession::cookiesForDOM const):
1376         (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
1377
1378 2018-07-30  Chris Dumez  <cdumez@apple.com>
1379
1380         Nullptr crash accessing Document in GenericEventQueue::dispatchOneEvent()
1381         https://bugs.webkit.org/show_bug.cgi?id=187284
1382
1383         Unreviewed, roll r233496 and r233571 now that all known issues have been fixed via
1384         dependency bugs.
1385
1386         Test: media/track/video-track-addition-and-frame-removal.html
1387
1388         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
1389         (WebCore::WebKitMediaKeySession::suspend):
1390         (WebCore::WebKitMediaKeySession::resume):
1391         (WebCore::WebKitMediaKeySession::stop):
1392         * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
1393         * Modules/mediasource/MediaSource.cpp:
1394         (WebCore::MediaSource::removeSourceBuffer):
1395         (WebCore::MediaSource::suspend):
1396         (WebCore::MediaSource::resume):
1397         * Modules/mediasource/MediaSource.h:
1398         * Modules/mediasource/SourceBuffer.cpp:
1399         (WebCore::SourceBuffer::suspend):
1400         (WebCore::SourceBuffer::resume):
1401         (WebCore::SourceBuffer::stop):
1402         * Modules/mediasource/SourceBuffer.h:
1403         * Modules/mediasource/SourceBufferList.cpp:
1404         (WebCore::SourceBufferList::SourceBufferList):
1405         (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
1406         (WebCore::SourceBufferList::suspend):
1407         (WebCore::SourceBufferList::resume):
1408         (WebCore::SourceBufferList::stop):
1409         (WebCore::SourceBufferList::activeDOMObjectName const):
1410         * Modules/mediasource/SourceBufferList.h:
1411         * Modules/mediasource/SourceBufferList.idl:
1412         * dom/Document.h:
1413         (WebCore::Document::hasBrowsingContext const):
1414         * dom/GenericEventQueue.cpp:
1415         (WebCore::GenericEventQueue::dispatchOneEvent):
1416         * html/HTMLMediaElement.cpp:
1417         (WebCore::HTMLMediaElement::prepareForLoad):
1418         (WebCore::HTMLMediaElement::selectMediaResource):
1419         (WebCore::HTMLMediaElement::prepareToPlay):
1420         (WebCore::HTMLMediaElement::playInternal):
1421         (WebCore::HTMLMediaElement::pauseInternal):
1422         (WebCore::HTMLMediaElement::sourceWasAdded):
1423         * html/track/AudioTrackList.cpp:
1424         (AudioTrackList::activeDOMObjectName const):
1425         * html/track/AudioTrackList.h:
1426         * html/track/AudioTrackList.idl:
1427         * html/track/TextTrackList.cpp:
1428         (TextTrackList::activeDOMObjectName const):
1429         * html/track/TextTrackList.h:
1430         * html/track/TextTrackList.idl:
1431         * html/track/TrackListBase.cpp:
1432         (WebCore::TrackListBase::TrackListBase):
1433         (WebCore::TrackListBase::canSuspendForDocumentSuspension const):
1434         (WebCore::TrackListBase::suspend):
1435         (WebCore::TrackListBase::resume):
1436         (WebCore::TrackListBase::stop):
1437         * html/track/TrackListBase.h:
1438         * html/track/VideoTrackList.cpp:
1439         (VideoTrackList::activeDOMObjectName const):
1440         * html/track/VideoTrackList.h:
1441         * html/track/VideoTrackList.idl:
1442
1443 2018-07-30  Chris Dumez  <cdumez@apple.com>
1444
1445         Unreviewed internal build fix after r234347.
1446
1447         * html/StepRange.cpp:
1448         (WebCore::StepRange::StepRange):
1449
1450 2018-07-29  Simon Fraser  <simon.fraser@apple.com>
1451
1452         Shrink GraphicsLayer by making m_transform and m_childrenTransform be unique_ptrs
1453         https://bugs.webkit.org/show_bug.cgi?id=188143
1454
1455         Reviewed by Zalan Bujtas.
1456
1457         m_transform and m_childrenTransform are usually identity; save space by making
1458         these unique_ptrs. The getters still return references by returning a reference
1459         to a NeverDestroyed<TransformationMatrix> if necessary.
1460         
1461         Shrinks GraphicsLayerCA from 840 to 640 bytes.
1462
1463         * platform/graphics/GraphicsLayer.cpp:
1464         (WebCore::identityTransform):
1465         (WebCore::GraphicsLayer::transform const):
1466         (WebCore::GraphicsLayer::setTransform):
1467         (WebCore::GraphicsLayer::childrenTransform const):
1468         (WebCore::GraphicsLayer::setChildrenTransform):
1469         (WebCore::GraphicsLayer::dumpProperties const):
1470         * platform/graphics/GraphicsLayer.h:
1471         (WebCore::GraphicsLayer::hasNonIdentityTransform const):
1472         (WebCore::GraphicsLayer::hasNonIdentityChildrenTransform const):
1473         (WebCore::GraphicsLayer::transform const): Deleted.
1474         (WebCore::GraphicsLayer::setTransform): Deleted.
1475         (WebCore::GraphicsLayer::childrenTransform const): Deleted.
1476         (WebCore::GraphicsLayer::setChildrenTransform): Deleted.
1477         (WebCore::GraphicsLayer::hasFlattenedPerspectiveTransform): Deleted. It was unused.
1478         * platform/graphics/ca/GraphicsLayerCA.cpp:
1479         (WebCore::GraphicsLayerCA::setTransform):
1480         (WebCore::GraphicsLayerCA::setChildrenTransform):
1481         (WebCore::GraphicsLayerCA::layerTransform const):
1482         (WebCore::GraphicsLayerCA::updateTransform):
1483         (WebCore::GraphicsLayerCA::updateChildrenTransform):
1484         (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer):
1485
1486 2018-07-30  Thibault Saunier  <tsaunier@igalia.com>
1487
1488         [GStreamer] Make codecparsers optionnal
1489         https://bugs.webkit.org/show_bug.cgi?id=188010
1490
1491         And avoid building libWebRTC if it won't be used. While there is no other
1492         WebRTC backend, it makes no sense to expose an option.
1493
1494         Error out when WEBRTC or MEDIA_STREAM is enabled but GStreamer < 1.10
1495
1496         Reviewed by Alejandro G. Castro.
1497
1498         * platform/GStreamer.cmake:
1499
1500 2018-07-28  Darin Adler  <darin@apple.com>
1501
1502         [Cocoa] Update more WebCore Objective-C code to be ARC compatible
1503         https://bugs.webkit.org/show_bug.cgi?id=188140
1504
1505         Reviewed by Sam Weinig.
1506
1507         This make sure we don't put any Objective-C objects into HashMap/Set
1508         data structures, which doesn't work under ARC at this time. We could
1509         fix that some day, but it's pretty simple to change code not to rely
1510         on it, for now, and not as simple to support it in HashMap/Set.
1511
1512         * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
1513         (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
1514         Use CFRetain/CFAutorelease instead of retain/autorelease.
1515
1516         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1517         (createAccessibilityRoleMap): Use CFStringRef in a HashMap rather than
1518         NSString * for string constants.
1519         (roleValueToNSString): Updated for above change.
1520
1521         * bridge/objc/WebScriptObject.mm:
1522         (-[WebScriptObject stringRepresentation]): Updated since objectValue
1523         is now CFTypeRef rather than NSObject *.
1524
1525         * bridge/objc/objc_instance.mm:
1526         (ObjcInstance::create): Use CFTypeRef instead of id for the key types
1527         in a HashMap.
1528         (ObjcInstance::~ObjcInstance): Updated for the above change.
1529         (ObjcInstance::invokeObjcMethod): Updated since objectValue is now
1530         CFTypeRef.
1531         (ObjcInstance::invokeDefaultMethod): Ditto.
1532         (ObjcInstance::setValueOfUndefinedField): Ditto.
1533         * bridge/objc/objc_runtime.mm:
1534         (JSC::Bindings::ObjcArray::setValueAt const): Ditto.
1535
1536         * bridge/objc/objc_utility.h: Use #pragma once. Use CFTypeRef instead
1537         of NSObject * for objectValue, since it's in a union and ARC does not
1538         support strong Objective-C object pointers in a union.
1539
1540         * bridge/objc/objc_utility.mm:
1541         (JSC::Bindings::convertValueToObjcValue): Updated since objectValue is
1542         now CFTypeRef.
1543
1544         * editing/cocoa/HTMLConverter.mm:
1545         (HTMLConverter::_processElement): Use CFTypeRef rather than NSTextTable
1546         for a HashMap.
1547         (HTMLConverter::_exitElement): Ditto.
1548
1549         * editing/cocoa/WebContentReaderCocoa.mm:
1550         (WebCore::attributesForAttributedStringConversion): Use CFRetain rather
1551         than -[NSObject retain] in a workaround for an overrelease.
1552
1553         * editing/mac/DictionaryLookup.h: Removed code to make this usable from
1554         non-Objective-C source files. Use tuples rather than out arguments
1555         for the results of the various functions.
1556
1557         * editing/mac/DictionaryLookup.mm:
1558         (WebCore::DictionaryLookup::rangeForSelection): Return a tuple rather
1559         than using an out argument for options.
1560         (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto.
1561         (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.
1562         (WebCore::showPopupOrCreateAnimationController): Removed use of typedef
1563         PlatformAnimationController.
1564         (WebCore::DictionaryLookup::animationControllerForPopup): Ditto.
1565
1566         * html/HTMLMediaElement.h: Put the videoFullscreenLayer function inside
1567         an __OBJC__ ifdef since we can't do the type conversion without the
1568         full Objective-C type.
1569
1570         * page/mac/EventHandlerMac.mm:
1571         (WebCore::selfRetainingNSScrollViewScrollWheel): Use CFRetain/CFRelease
1572         instead of retain/release.
1573         (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
1574         Updated to use tuple return value from DictionaryLookup.
1575
1576         * page/scrolling/ScrollingStateNode.h: Replaced direct use of PlatformLayer*
1577         in a union with use of a "typless" void* pointer and added helper functions
1578         to convert in both directions.
1579         * page/scrolling/cocoa/ScrollingStateNode.mm:
1580         (WebCore::LayerRepresentation::retainPlatformLayer): Use CFRetain instead
1581         of retain.
1582         (WebCore::LayerRepresentation::releasePlatformLayer): Use CFRelease instead
1583         of release.
1584         (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
1585         (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
1586         * page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp:
1587         (WebCore::LayerRepresentation::retainPlatformLayer): Updated argument type.
1588         (WebCore::LayerRepresentation::releasePlatformLayer): Ditto.
1589         (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
1590         (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
1591
1592         * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Use CFTypeRef
1593         instad of GCController * for key type of HashMap.
1594         * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
1595         (WebCore::GameControllerGamepadProvider::controllerDidConnect): Updated
1596         for the above change.
1597         (WebCore::GameControllerGamepadProvider::controllerDidDisconnect): Ditto.
1598
1599         * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
1600         Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
1601         strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
1602         types under ARC.
1603         (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const): Added checks
1604         for the constants.
1605         (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const): Ditto.
1606         (WebCore::AVTrackPrivateAVFObjCImpl::label const): Ditto.
1607
1608         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
1609         Use #pragma once and use CFTypeRef instead of AVMediaSelectionOption *
1610         in the key to a HashMap.
1611         * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
1612         (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Updated for
1613         the above change.
1614
1615         * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
1616         Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
1617         strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
1618         types under ARC.
1619         (WebCore::customSchemeURL): Removed unnecessary use of
1620         NeverDestroyed<RetainPtr>. Can just use a straight pointer without calling
1621         release, and that works with or without ARC.
1622         (WebCore::imageDecoderAssetOptions): Ditto. Here, had to add a retain,
1623         which we'll remove when we turn on ARC. Added canLoad checks, needed
1624         because of SOFT_LINK_CONSTANT_MAY_FAIL.
1625         (WebCore::ImageDecoderAVFObjC::firstEnabledTrack): Added canLoad check,
1626         needed because of SOFT_LINK_CONSTANT_MAY_FAIL.
1627
1628         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1629         Use CFTypeRef instead of AVAssetResourceLoadingRequest in HashMap.
1630         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1631         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
1632         Updated for above.
1633         (WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Ditto.
1634         (WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Ditto.
1635
1636         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
1637         Use CFTypeRef instead of AVSampleBufferAudioRenderer in HashMap.
1638         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
1639         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): Updated for above.
1640         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): Ditto.
1641         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): Ditto.
1642         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): Ditto.
1643         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Ditto.
1644         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): Ditto.
1645
1646         * platform/graphics/metal/GPUDrawableMetal.mm: Updated include; under ARC, it's
1647         not safe to call a method on a class without seeing its interface.
1648
1649         * platform/mac/VideoFullscreenInterfaceMac.mm: Added an explicit
1650         __unsafe_unretained for a delegate. Could consider moving to weak, but for now
1651         this preserves the current behavior and compiles under ARC.
1652
1653         * platform/mac/WebCoreFullScreenPlaceholderView.h: Use strong for the contents,
1654         weak for the target, and changed the action to be hard-coded instead of an
1655         arbitrary selector. If we find we need the flexibility again later, we can do
1656         it with a block, which is more ARC-friendly than calling an arbitrary selector.
1657         * platform/mac/WebCoreFullScreenPlaceholderView.mm:
1658         (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Call function directly
1659         instead of taking advantage of "using".
1660         (-[WebCoreFullScreenPlaceholderView mouseDown:]): Call cancelOperation: on the
1661         target rather than performing an arbitrary selector.
1662
1663         * platform/mac/WebCoreObjCExtras.mm:
1664         (WebCoreObjCScheduleDeallocateOnMainThread): Use sel_registerName instead of
1665         @selector, since @selector is not supported under ARC.
1666
1667         * platform/network/ResourceHandle.h: Use a return value rather than using an
1668         inout argument in applySniffingPoliciesAndStoragePartitionIfNeeded.
1669
1670         * platform/network/cocoa/CookieStorageObserver.mm:
1671         (WebCore::CookieStorageObserver::startObserving): Removed unnecessary
1672         assertion of repondsToSelector since we are about to dispatch it immediately
1673         after. Call the selector in the conventional way instead of using performSelector.
1674
1675         * platform/network/cocoa/WebCoreNSURLSession.h: Use #pragma once and use
1676         CFTypeRef instead of an Objective-C type. Also use an explicit __unsafe_unretained
1677         for the session in the data task.
1678         * platform/network/cocoa/WebCoreNSURLSession.mm:
1679         (-[WebCoreNSURLSession dealloc]): Updated for the above.
1680         (-[WebCoreNSURLSession taskCompleted:]): Ditto.
1681         (-[WebCoreNSURLSession invalidateAndCancel]): Ditto.
1682         (-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Ditto.
1683         (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
1684         (-[WebCoreNSURLSession dataTaskWithRequest:]): Ditto.
1685         (-[WebCoreNSURLSession dataTaskWithURL:]): Ditto.
1686
1687         * platform/network/mac/ResourceHandleMac.mm:
1688         (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded):
1689         Use a return value instead of an inout argument. Also use bridging casts.
1690         (WebCore::ResourceHandle::createNSURLConnection): Updated for the change above.
1691         Also use a bridging cast.
1692         (WebCore::ResourceHandle::schedule): Use a bridging cast.
1693         (WebCore::ResourceHandle::unschedule): Ditto.
1694
1695         * platform/network/mac/WebCoreURLResponse.mm:
1696         (WebCore::adjustMIMETypeIfNecessary): Use a bridging cast.
1697
1698         * testing/Internals.cpp:
1699         (WebCore::Internals::rangeForDictionaryLookupAtLocation): Moved the macOS
1700         version of this function out of this file ...
1701         * testing/Internals.mm:
1702         (WebCore::Internals::rangeForDictionaryLookupAtLocation): ... to here.
1703
1704 2018-07-29  Yusuke Suzuki  <utatane.tea@gmail.com>
1705
1706         Use static global variables instead of static NeverDestroyed inside function if possible
1707         https://bugs.webkit.org/show_bug.cgi?id=188146
1708
1709         Reviewed by Darin Adler.
1710
1711         This patch leverages constexpr constructors / trivial destructors more to remove unnecessary `static NeverDestroyed`
1712         inside a function. It simplifies the code, removes the unnecessary function, and ensures the initialization at
1713         a program loader phase.
1714
1715         We make StepRange::StepDescription constructor constexpr to remove bunch of `static NeverDestroyed<const StepRange::StepDescription>`.
1716         And we use `static Lock` since WTF::Lock has constexpr constructor.
1717
1718         No behavior change.
1719
1720         * dom/MessagePort.cpp:
1721         (WebCore::MessagePort::deref const):
1722         (WebCore::MessagePort::isExistingMessagePortLocallyReachable):
1723         (WebCore::MessagePort::notifyMessageAvailable):
1724         (WebCore::MessagePort::MessagePort):
1725         (WebCore::MessagePort::~MessagePort):
1726         (WebCore::allMessagePortsLock): Deleted.
1727         * dom/ScriptExecutionContext.cpp:
1728         (WebCore::ScriptExecutionContext::contextIdentifier const):
1729         (WebCore::ScriptExecutionContext::removeFromContextsMap):
1730         (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
1731         (WebCore::ScriptExecutionContext::postTaskTo):
1732         (WebCore::allScriptExecutionContextsMapLock): Deleted.
1733         * html/DateInputType.cpp:
1734         (WebCore::DateInputType::createStepRange const):
1735         * html/DateTimeInputType.cpp:
1736         (WebCore::DateTimeInputType::createStepRange const):
1737         * html/DateTimeLocalInputType.cpp:
1738         (WebCore::DateTimeLocalInputType::createStepRange const):
1739         * html/MonthInputType.cpp:
1740         (WebCore::MonthInputType::createStepRange const):
1741         * html/RangeInputType.cpp:
1742         (WebCore::RangeInputType::createStepRange const):
1743         * html/StepRange.h:
1744         (WebCore::StepRange::StepDescription::StepDescription):
1745         * html/TimeInputType.cpp:
1746         (WebCore::TimeInputType::createStepRange const):
1747         * html/WeekInputType.cpp:
1748         (WebCore::WeekInputType::createStepRange const):
1749         * page/SecurityPolicy.cpp:
1750         (WebCore::originAccessMap):
1751         (WebCore::SecurityPolicy::isAccessWhiteListed):
1752         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
1753         (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
1754         (WebCore::SecurityPolicy::resetOriginAccessWhitelists):
1755         (WebCore::originAccessMapLock): Deleted.
1756         * platform/SchemeRegistry.cpp:
1757         (WebCore::allBuiltinSchemes):
1758         (WebCore::builtinLocalURLSchemes):
1759         (WebCore::localURLSchemes):
1760         (WebCore::displayIsolatedURLSchemes):
1761         (WebCore::builtinSecureSchemes):
1762         (WebCore::secureSchemes):
1763         (WebCore::builtinSchemesWithUniqueOrigins):
1764         (WebCore::schemesWithUniqueOrigins):
1765         (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
1766         (WebCore::canDisplayOnlyIfCanRequestSchemes):
1767         (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
1768         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
1769         (WebCore::ContentSecurityPolicyBypassingSchemes):
1770         (WebCore::cachePartitioningSchemes):
1771         (WebCore::serviceWorkerSchemes):
1772         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
1773         (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
1774         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
1775         (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
1776         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
1777         (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
1778         (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
1779         (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
1780         (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
1781         (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
1782         (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
1783         (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
1784         (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
1785         (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
1786         (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
1787         (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
1788         (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
1789         (WebCore::schemeRegistryLock): Deleted.
1790
1791 2018-07-29  Basuke Suzuki  <Basuke.Suzuki@sony.com>
1792
1793         [Curl] Fix the bug when client reject the redirect on WebKitLegacy.
1794         https://bugs.webkit.org/show_bug.cgi?id=188130
1795
1796         Reviewed by Darin Adler.
1797
1798         ResourceHandle for Curl port has a bug when a client returns en empty request which
1799         indicates the redirecti is rejected by the client. It should be quit the task immediately,
1800         but it kept doing the job. Fixed.
1801         NetworkDataTask implementation did the right thing and there's no bug for them. 
1802
1803         Test: http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt
1804
1805         * platform/network/curl/ResourceHandleCurl.cpp:
1806         (WebCore::ResourceHandle::continueAfterWillSendRequest):
1807
1808 2018-07-28  Simon Fraser  <simon.fraser@apple.com>
1809
1810         Reset CompositingPolicyOverride between tests
1811         https://bugs.webkit.org/show_bug.cgi?id=188138
1812
1813         Reviewed by Zalan Bujtas.
1814
1815         WK1 tests were failing after r234330 because the compositing policy override optional
1816         was left set on the Page (WK1 has injected bundle SPI to clear it). Fix by having 
1817         Internals::resetToConsistentState clear this state.
1818
1819         * testing/Internals.cpp:
1820         (WebCore::Internals::resetToConsistentState):
1821
1822 2018-07-24  Simon Fraser  <simon.fraser@apple.com>
1823
1824         Animation stops with object-fit:contain on an animated 2d canvas
1825         https://bugs.webkit.org/show_bug.cgi?id=187840
1826
1827         Reviewed by Zalan Bujtas.
1828         
1829         If a canvas has object-fit: cover or contain, repaints need to mapped through
1830         the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
1831         
1832         Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
1833         all but RenderVideo just pass the RenderReplaced's intrinsicSize.
1834
1835         Test: fast/repaint/canvas-object-fit.html
1836
1837         * html/HTMLCanvasElement.cpp:
1838         (WebCore::HTMLCanvasElement::didDraw):
1839         * rendering/RenderHTMLCanvas.cpp:
1840         (WebCore::RenderHTMLCanvas::paintReplaced):
1841         * rendering/RenderImage.cpp:
1842         (WebCore::RenderImage::updateInnerContentRect):
1843         (WebCore::RenderImage::paintReplaced):
1844         * rendering/RenderLayerBacking.cpp:
1845         (WebCore::RenderLayerBacking::contentsBox const):
1846         * rendering/RenderReplaced.h:
1847         (WebCore::RenderReplaced::replacedContentRect const):
1848         * rendering/shapes/ShapeOutsideInfo.cpp:
1849         (WebCore::ShapeOutsideInfo::createShapeForImage const):
1850
1851 2018-07-27  Simon Fraser  <simon.fraser@apple.com>
1852
1853         Adjust the color matrix for the inverse apple-invert-lightness() transformation
1854         https://bugs.webkit.org/show_bug.cgi?id=188131
1855         rdar://problem/42673070
1856
1857         Reviewed by Zalan Bujtas.
1858
1859         Use the correct inverse matrix values.
1860
1861         Test: editing/style/inverse-color-filter.html
1862
1863         * platform/graphics/filters/FilterOperation.cpp:
1864         (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
1865
1866 2018-07-27  Eric Carlson  <eric.carlson@apple.com>
1867
1868         [iOS] Don't deactivate audio session
1869         https://bugs.webkit.org/show_bug.cgi?id=188127
1870         <rdar://problem/42544143>
1871
1872         Reviewed by Jon Lee.
1873         
1874         r233435 includes a change that deactivates the shared audio session when there are no more
1875         active media sessions. This is a good in WK2 because it allows other applications to resume
1876         playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
1877         app may also be playing audio.
1878
1879         * platform/audio/PlatformMediaSessionManager.cpp:
1880         (WebCore::PlatformMediaSessionManager::removeSession): Don't deactivate the audio session.
1881
1882 2018-07-27  Chris Dumez  <cdumez@apple.com>
1883
1884         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable()
1885         https://bugs.webkit.org/show_bug.cgi?id=188097
1886         <rdar://problem/42558823>
1887
1888         Reviewed by Eric Carlson.
1889
1890         Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable(). RealtimeMediaSource::audioSamplesAvailable()
1891         is called on a background thread but iterates over observers that may get destroyed concurrently on the main thread.
1892
1893         To address the issue:
1894         - Introduce a Lock to protect m_observer accesses
1895         - Copy observers to a Vector before iterating over them
1896
1897         * platform/mediastream/MediaStreamTrackPrivate.cpp:
1898         (WebCore::MediaStreamTrackPrivate::forEachObserver const):
1899         (WebCore::MediaStreamTrackPrivate::addObserver):
1900         (WebCore::MediaStreamTrackPrivate::removeObserver):
1901         (WebCore::MediaStreamTrackPrivate::setEnabled):
1902         (WebCore::MediaStreamTrackPrivate::endTrack):
1903         (WebCore::MediaStreamTrackPrivate::sourceStarted):
1904         (WebCore::MediaStreamTrackPrivate::sourceStopped):
1905         (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
1906         (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
1907         (WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
1908         (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
1909         (WebCore::MediaStreamTrackPrivate::updateReadyState):
1910         * platform/mediastream/MediaStreamTrackPrivate.h:
1911         (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated):
1912         (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
1913         * platform/mediastream/RealtimeMediaSource.cpp:
1914         (WebCore::RealtimeMediaSource::addObserver):
1915         (WebCore::RealtimeMediaSource::removeObserver):
1916         (WebCore::RealtimeMediaSource::forEachObserver const):
1917         (WebCore::RealtimeMediaSource::notifyMutedObservers const):
1918         (WebCore::RealtimeMediaSource::settingsDidChange):
1919         (WebCore::RealtimeMediaSource::videoSampleAvailable):
1920         (WebCore::RealtimeMediaSource::audioSamplesAvailable):
1921         (WebCore::RealtimeMediaSource::start):
1922         (WebCore::RealtimeMediaSource::requestStop):
1923         (WebCore::RealtimeMediaSource::captureFailed):
1924         * platform/mediastream/RealtimeMediaSource.h:
1925         * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
1926         (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
1927         * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
1928         * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
1929
1930 2018-07-27  Alex Christensen  <achristensen@webkit.org>
1931
1932         Don't include WebPageProxy.h just for UndoOrRedo
1933         https://bugs.webkit.org/show_bug.cgi?id=188086
1934
1935         Reviewed by Saam Barati.
1936
1937         * platform/DragItem.h:
1938
1939 2018-07-27  Alex Christensen  <achristensen@webkit.org>
1940
1941         Make CompletionHandler more const correct
1942         https://bugs.webkit.org/show_bug.cgi?id=186543
1943
1944         Reviewed by Saam Barati.
1945
1946         * dom/messageports/MessagePortChannel.cpp:
1947         (WebCore::MessagePortChannel::checkRemotePortForActivity):
1948         * dom/messageports/MessagePortChannelProviderImpl.cpp:
1949         (WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
1950         * loader/DocumentLoader.cpp:
1951         (WebCore::DocumentLoader::responseReceived):
1952         * loader/FrameLoader.cpp:
1953         (WebCore::FrameLoader::loadURL):
1954         (WebCore::FrameLoader::loadWithDocumentLoader):
1955         (WebCore::FrameLoader::loadPostRequest):
1956         * platform/network/cocoa/WebCoreNSURLSession.mm:
1957         (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
1958         * workers/service/server/RegistrationDatabase.cpp:
1959         (WebCore::RegistrationDatabase::pushChanges):
1960         (WebCore::RegistrationDatabase::clearAll):
1961         * workers/service/server/SWServer.cpp:
1962         (WebCore::SWServer::matchAll):
1963         * workers/service/server/SWServer.h:
1964         * workers/service/server/SWServerWorker.cpp:
1965         (WebCore::SWServerWorker::matchAll):
1966         * workers/service/server/SWServerWorker.h:
1967
1968 2018-07-27  Simon Fraser  <simon.fraser@apple.com>
1969
1970         Be more conservative with compositing layer creation when memory is low
1971         https://bugs.webkit.org/show_bug.cgi?id=187866
1972         rdar://problem/42366345
1973
1974         Reviewed by Zalan Bujtas.
1975         
1976         When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
1977         compositing layers. We avoid compositing for these situations:
1978         1. Layers with 3D transforms which are affine (like translateZ(0)).
1979         2. Layers with will-change
1980         3. Layers for canvases (other than WebGL/WebGPU)
1981         
1982         We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
1983         falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
1984         Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
1985         
1986         Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
1987         flakily falling into a different mode, and so that we can impose the conservative
1988         mode for testing.
1989
1990         Test: compositing/layer-creation/compositing-policy.html
1991
1992         * page/Page.h:
1993         (WebCore::Page::compositingPolicyOverride const):
1994         (WebCore::Page::setCompositingPolicyOverride):
1995         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1996         (WebCore::Matrix3DTransformOperation::isRepresentableIn2D const):
1997         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1998         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1999         * platform/graphics/transforms/RotateTransformOperation.h:
2000         * platform/graphics/transforms/ScaleTransformOperation.h:
2001         * platform/graphics/transforms/TransformOperation.h:
2002         (WebCore::TransformOperation::isRepresentableIn2D const):
2003         * platform/graphics/transforms/TransformOperations.h:
2004         (WebCore::TransformOperations::has3DOperation const):
2005         (WebCore::TransformOperations::isRepresentableIn2D const):
2006         * platform/graphics/transforms/TranslateTransformOperation.h:
2007         * rendering/RenderLayerBacking.cpp:
2008         (WebCore::RenderLayerBacking::updateGeometry):
2009         * rendering/RenderLayerCompositor.cpp:
2010         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
2011         (WebCore::RenderLayerCompositor::updateCompositingPolicy):
2012         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2013         (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
2014         (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
2015         (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
2016         (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
2017         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
2018         (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
2019         (WebCore::operator<<):
2020         * rendering/RenderLayerCompositor.h:
2021         * testing/Internals.cpp:
2022         (WebCore::Internals::setCompositingPolicyOverride):
2023         (WebCore::Internals::compositingPolicyOverride const):
2024         * testing/Internals.h:
2025         * testing/Internals.idl:
2026
2027 2018-07-27  Zalan Bujtas  <zalan@apple.com>
2028
2029         [WK1] ASSERTION FAILED: renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint()) in WebCore::RenderLayer::updateLayerPositionsAfterScroll
2030         https://bugs.webkit.org/show_bug.cgi?id=188122
2031         <rdar://problem/42584790>
2032
2033         Reviewed by Simon Fraser.
2034
2035         When ScrollView's m_paintsEntireContents flag flips due to layer backing changes, the repaint area transitions from
2036         visual to layout overflow. When this happens the cached repaint rects become invalid and they need to be recomputed.
2037         Currently there's no mechanism to trigger repaint cache invalidation from ScrollView.
2038         Skip assertion for now on WK1 (see webkit.org/b/188121)
2039
2040         * rendering/RenderLayer.cpp:
2041         (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
2042
2043 2018-07-27  Myles C. Maxfield  <mmaxfield@apple.com>
2044
2045         [WIN] Crash when trying to access store pages
2046         https://bugs.webkit.org/show_bug.cgi?id=188032
2047         <rdar://problem/42467016>
2048
2049         Reviewed by Brent Fulgham.
2050
2051         The Windows implementation of GlyphBuffer has an additional member, m_offsets, which represents
2052         an additional offset to the position to paint each glyph. It also has two add() functions, one
2053         which appends to this vector, and one which doesn't. The one that doesn't append to the vector
2054         should never be called on Windows (because Windows requires this vector to be full).
2055
2056         There were two situations where it was getting called:
2057         1) Inside ComplexTextController
2058         2) Inside display list playback
2059
2060         Windows shouldn't be using ComplexTextController because the Windows implementation of this 
2061         class isn't ready yet; instead it should be using UniscribeController. The display list playback
2062         code should be used on Windows.
2063
2064         Rather than fix the function to append an offset, we actually don't need the m_offsets vector
2065         in the first place. Instead, we can do it the same way that the Cocoa ports do it, which is to
2066         bake the offsets into the glyph advances. This is possible because the GlyphBuffer doesn't need
2067         to distinguish between layout advances and paint advances, so we can bake them together and
2068         just put paint advances in the GlyphBuffer. This should be a small (probably within-the-noise)
2069         performance and memory improvement.
2070
2071         * platform/graphics/ComplexTextController.cpp:
2072         (WebCore::ComplexTextController::ComplexTextController): Make sure that ComplexTextController
2073         isn't used on Windows.
2074         * platform/graphics/FontCascade.cpp:
2075         (WebCore::FontCascade::widthOfTextRange const): Switch from ComplexTextController to
2076         UniscribeController on Windows.
2077         (WebCore::FontCascade::drawGlyphBuffer const): After deleting the m_offsets vector, there's
2078         no reason to consult it when drawing.
2079         * platform/graphics/GlyphBuffer.h: Remove m_offsets
2080         (WebCore::GlyphBuffer::clear):
2081         (WebCore::GlyphBuffer::advanceAt const):
2082         (WebCore::GlyphBuffer::add):
2083         (WebCore::GlyphBuffer::expandLastAdvance):
2084         (WebCore::GlyphBuffer::shrink):
2085         (WebCore::GlyphBuffer::swap):
2086         (WebCore::GlyphBuffer::offsetAt const): Deleted.
2087         * platform/graphics/win/FontCGWin.cpp:
2088         (WebCore::FontCascade::drawGlyphs): After deleting the m_offsets vector, there's no reason
2089         to consult it when drawing.
2090         * platform/graphics/win/FontCascadeDirect2D.cpp:
2091         (WebCore::FontCascade::drawGlyphs): Ditto.
2092         * platform/graphics/win/UniscribeController.cpp:
2093         (WebCore::UniscribeController::shapeAndPlaceItem): Bake in the offsets into the glyph advances.
2094
2095 2018-07-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2096
2097         [Curl] Crash on synchronous request via ResourceHandle.
2098         https://bugs.webkit.org/show_bug.cgi?id=188033
2099
2100         Reviewed by Alex Christensen.
2101
2102         The timing of instantiation of delegate was wrong. Move it inside `delegate` getter().
2103         This bug was introduced at r228577.
2104
2105         Test: http/tests/xmlhttprequest/simple-sync.html
2106
2107         * platform/network/curl/ResourceHandleCurl.cpp:
2108         (WebCore::ResourceHandle::start):
2109         (WebCore::ResourceHandle::delegate):
2110
2111 2018-07-03  David Fenton  <david_fenton@apple.com>
2112
2113         Unreviewed, rolling out r233461.
2114
2115         assertions triggered on ios11 Debug wk2
2116
2117         Reverted changeset:
2118
2119         "[iOS] Add assert to catch improper use of WebCore::Timer in
2120         UI Process"
2121         https://bugs.webkit.org/show_bug.cgi?id=185330
2122         https://trac.webkit.org/changeset/233461
2123
2124 2018-07-27  Chris Dumez  <cdumez@apple.com>
2125
2126         [Media] Avoid unnecessarily constructing *TrackList objects
2127         https://bugs.webkit.org/show_bug.cgi?id=188094
2128
2129         Reviewed by Eric Carlson.
2130
2131         Avoid unnecessarily constructing *TrackList objects as this is preventing us from making them
2132         ActiveDOMObjects.
2133
2134         * Modules/mediasource/MediaSource.cpp:
2135         (WebCore::MediaSource::removeSourceBuffer):
2136         * Modules/mediasource/SourceBuffer.cpp:
2137         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
2138         * html/HTMLMediaElement.cpp:
2139         (WebCore::HTMLMediaElement::addAudioTrack):
2140         (WebCore::HTMLMediaElement::addTextTrack):
2141         (WebCore::HTMLMediaElement::addVideoTrack):
2142         (WebCore::HTMLMediaElement::ensureAudioTracks):
2143         (WebCore::HTMLMediaElement::ensureTextTracks):
2144         (WebCore::HTMLMediaElement::ensureVideoTracks):
2145         (WebCore::HTMLMediaElement::setSelectedTextTrack):
2146         (WebCore::HTMLMediaElement::audioTracks): Deleted.
2147         (WebCore::HTMLMediaElement::textTracks): Deleted.
2148         (WebCore::HTMLMediaElement::videoTracks): Deleted.
2149         * html/HTMLMediaElement.h:
2150         (WebCore::HTMLMediaElement::audioTracks const):
2151         (WebCore::HTMLMediaElement::textTracks const):
2152         (WebCore::HTMLMediaElement::videoTracks const):
2153         * html/HTMLMediaElement.idl:
2154         * html/shadow/MediaControlElements.cpp:
2155         (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
2156         (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
2157         (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
2158         * html/track/TextTrack.cpp:
2159         (WebCore::TextTrack::setKind):
2160         (WebCore::TextTrack::trackIndex):
2161         (WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
2162         (WebCore::TextTrack::setLanguage):
2163         * html/track/VideoTrack.cpp:
2164         (WebCore::VideoTrack::setKind):
2165         (WebCore::VideoTrack::setLanguage):
2166         * platform/cocoa/PlaybackSessionModelMediaElement.mm:
2167         (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
2168         (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):
2169
2170 2018-07-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>
2171
2172         [Curl] Set correct source info to ResourceResponse.
2173         https://bugs.webkit.org/show_bug.cgi?id=188069
2174
2175         Reviewed by Fujii Hironori.
2176
2177         ResourceResponseBase::Source::Network must be set by each ports. Curl port
2178         didn't set this.
2179
2180         Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html
2181
2182         * platform/network/curl/ResourceResponseCurl.cpp:
2183         (WebCore::ResourceResponse::ResourceResponse):
2184
2185 2018-07-26  Andy VanWagoner  <andy@vanwagoner.family>
2186
2187         [INTL] Remove INTL sub-feature compile flags
2188         https://bugs.webkit.org/show_bug.cgi?id=188081
2189
2190         Reviewed by Michael Catanzaro.
2191
2192         Compile time feature flags for INTL sub features were removed, and are covered by existing tests.
2193
2194         * Configurations/FeatureDefines.xcconfig:
2195
2196 2018-07-26  Zalan Bujtas  <zalan@apple.com>
2197
2198         [Fullscreen] Do not create composited layers for renderers unless they are part of the fullscreen subtree.
2199         https://bugs.webkit.org/show_bug.cgi?id=188087
2200         <rdar://problem/42632124>
2201
2202         Reviewed by Simon Fraser.
2203
2204         Sibling composited layers prevent battery lifetime optimizations when in fullscreen.
2205
2206         Test: compositing/no-compositing-when-fulll-screen-is-present.html
2207
2208         * rendering/RenderLayer.cpp:
2209         (WebCore::RenderLayer::isDescendantOf const):
2210         * rendering/RenderLayer.h:
2211         * rendering/RenderLayerCompositor.cpp:
2212         (WebCore::isDescendantOfFullScreenLayer):
2213         (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
2214         (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
2215
2216 2018-07-26  Ryan Haddad  <ryanhaddad@apple.com>
2217
2218         Unreviewed, rolling out r234281.
2219
2220         Broke internal builds.
2221
2222         Reverted changeset:
2223
2224         "[Datalist] Add button to TextFieldInputs with a datalist"
2225         https://bugs.webkit.org/show_bug.cgi?id=187741
2226         https://trac.webkit.org/changeset/234281
2227
2228 2018-07-26  Aditya Keerthi  <akeerthi@apple.com>
2229
2230         [Datalist] Add button to TextFieldInputs with a datalist
2231         https://bugs.webkit.org/show_bug.cgi?id=187741
2232
2233         Reviewed by Tim Horton.
2234
2235         TextFieldInputs that have an associated datalist element should be drawn as
2236         combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
2237         is not height-resizable. Furthermore, the input should also be able to contain
2238         additional elements, such as the stepper for type=number and the cancel button
2239         for type=search. For these reasons, we draw a button at the end of the input,
2240         mimicking appearance of a combo box.
2241
2242         The list-button -webkit-appearance value was added to display the new button.
2243
2244         Tests: fast/forms/datalist/datalist-searchinput-appearance.html
2245                fast/forms/datalist/datalist-textinput-appearance.html
2246
2247         * Resources/ListButtonArrow.png: Added.
2248         * Resources/ListButtonArrow@2x.png: Added.
2249         * WebCore.xcodeproj/project.pbxproj:
2250         * css/CSSPrimitiveValueMappings.h:
2251         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2252         * css/CSSProperties.json:
2253         * css/CSSValueKeywords.in:
2254         * css/html.css:
2255         (input::-webkit-list-button):
2256         * html/HTMLInputElement.cpp:
2257         (WebCore::HTMLInputElement::dataListButtonElement const):
2258         (WebCore::HTMLInputElement::isShowingList const):
2259         * html/HTMLInputElement.h:
2260         * html/InputType.h:
2261         (WebCore::InputType::dataListButtonElement const):
2262         (WebCore::InputType::isShowingList const):
2263         * html/TextFieldInputType.cpp:
2264         (WebCore::TextFieldInputType::needsContainer const):
2265         (WebCore::TextFieldInputType::createShadowSubtree):
2266         (WebCore::TextFieldInputType::destroyShadowSubtree):
2267         (WebCore::TextFieldInputType::listAttributeTargetChanged):
2268         (WebCore::TextFieldInputType::dataListButtonElement const):
2269         (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
2270         (WebCore::TextFieldInputType::didCloseSuggestions):
2271         (WebCore::TextFieldInputType::isShowingList const):
2272         * html/TextFieldInputType.h:
2273         * html/shadow/DataListButtonElement.cpp: Added.
2274         (WebCore::DataListButtonElement::create):
2275         (WebCore::DataListButtonElement::DataListButtonElement):
2276         (WebCore::DataListButtonElement::~DataListButtonElement):
2277         (WebCore::DataListButtonElement::defaultEventHandler):
2278         * html/shadow/DataListButtonElement.h: Added.
2279         * platform/ThemeTypes.h:
2280         * rendering/RenderTheme.cpp:
2281         (WebCore::RenderTheme::adjustStyle):
2282         (WebCore::RenderTheme::adjustListButtonStyle const):
2283         * rendering/RenderTheme.h:
2284         * rendering/RenderThemeMac.h:
2285         * rendering/RenderThemeMac.mm:
2286         (-[WebListButtonCell drawWithFrame:inView:]):
2287         (WebCore::RenderThemeMac::paintListButtonForInput):
2288         (WebCore::RenderThemeMac::adjustListButtonStyle const):
2289         (WebCore::RenderThemeMac::paintTextField):
2290         (WebCore::RenderThemeMac::paintSearchField):
2291         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
2292         (WebCore::RenderThemeMac::listButton const):
2293
2294 2018-07-26  Antoine Quint  <graouts@apple.com>
2295
2296         [Web Animations] Accelerated animations don't respect a positive delay value
2297         https://bugs.webkit.org/show_bug.cgi?id=186930
2298         <rdar://problem/41393393>
2299
2300         Reviewed by Dean Jackson.
2301
2302         Test: webanimations/accelerated-animation-with-delay.html
2303
2304         We would mistakenly clear the list of pending accelerated actions in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
2305         even if we failed to proceed because of the target element's renderer not being composited yet. Now, we clear the list after
2306         we've established we can apply them, and if we can't we inform the animation with a call to acceleratedStateDidChange() which
2307         will in turn call into the document timeline so that we may consider these animations on the next tick.
2308
2309         For this to work correctly we must make a change to DocumentTimeline::applyPendingAcceleratedAnimations() which only cleared
2310         its list of pending accelerated animations _after_ iterating through them, which would be problematic since we would now add
2311         animations to this list. That list is now copied and cleared prior to iterating through its members.
2312
2313         We also fix the naming of the m_pendingAcceleratedActions copy in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
2314         to have a more similar name.
2315
2316         * animation/DocumentTimeline.cpp:
2317         (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
2318         * animation/KeyframeEffectReadOnly.cpp:
2319         (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
2320
2321 2018-07-26  Ross Kirsling  <ross.kirsling@sony.com>
2322
2323         String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
2324         https://bugs.webkit.org/show_bug.cgi?id=187963
2325
2326         Reviewed by Alex Christensen.
2327
2328         * Modules/applepay/cocoa/PaymentContactCocoa.mm:
2329         (WebCore::convert):
2330         * Modules/cache/DOMCache.cpp:
2331         (WebCore::hasResponseVaryStarHeaderValue):
2332         * Modules/cache/DOMCacheEngine.cpp:
2333         (WebCore::DOMCacheEngine::queryCacheMatch):
2334         * Modules/mediastream/PeerConnectionBackend.cpp:
2335         (WebCore::filterICECandidate):
2336         (WebCore::PeerConnectionBackend::filterSDP const):
2337         * Modules/websockets/WebSocketHandshake.cpp:
2338         (WebCore::WebSocketHandshake::checkResponseHeaders):
2339         * accessibility/AccessibilityObject.h:
2340         (WebCore::AccessibilityObject::determineARIADropEffects):
2341         * accessibility/AccessibilityRenderObject.cpp:
2342         (WebCore::AccessibilityRenderObject::determineARIADropEffects):
2343         * accessibility/AccessibilityRenderObject.h:
2344         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2345         (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2346         * editing/cocoa/DataDetection.mm:
2347         (WebCore::DataDetection::shouldCancelDefaultAction):
2348         * editing/markup.cpp:
2349         (WebCore::fillContainerFromString):
2350         (WebCore::createFragmentFromText):
2351         * html/EmailInputType.cpp:
2352         (WebCore::EmailInputType::typeMismatchFor const):
2353         (WebCore::EmailInputType::sanitizeValue const):
2354         * html/HTMLInputElement.cpp:
2355         (WebCore::parseAcceptAttribute):
2356         * html/ValidationMessage.cpp:
2357         (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
2358         * html/canvas/WebGLRenderingContextBase.cpp:
2359         (WebCore::WebGLRenderingContextBase::compileShader):
2360         * inspector/agents/InspectorDOMAgent.cpp:
2361         (WebCore::InspectorDOMAgent::nodeForPath):
2362         * loader/FormSubmission.cpp:
2363         (WebCore::encodingFromAcceptCharset):
2364         * loader/ResourceTiming.cpp:
2365         (WebCore::passesTimingAllowCheck):
2366         * page/WindowFeatures.cpp:
2367         (WebCore::parseDisabledAdaptations):
2368         (WebCore::parseDialogFeaturesMap):
2369         * platform/URL.cpp:
2370         (WebCore::isIPv4Address):
2371         (WebCore::isIPv6Address):
2372         * platform/graphics/GLContext.cpp:
2373         (WebCore::GLContext::version):
2374         * platform/graphics/freetype/FontCacheFreeType.cpp:
2375         (WebCore::patternToFamilies):
2376         * platform/graphics/gstreamer/GStreamerCommon.cpp:
2377         (WebCore::extractGStreamerOptionsFromCommandLine):
2378         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
2379         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
2380         (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
2381         * platform/gtk/PasteboardHelper.cpp:
2382         (WebCore::PasteboardHelper::fillSelectionData):
2383         * platform/gtk/SelectionData.cpp:
2384         (WebCore::SelectionData::setURIList):
2385         * platform/network/CacheValidation.cpp:
2386         (WebCore::collectVaryingRequestHeaders):
2387         * platform/network/HTTPParsers.cpp:
2388         (WebCore::filenameFromHTTPContentDisposition):
2389         (WebCore::parseXFrameOptionsHeader):
2390         (WebCore::parseAccessControlExposeHeadersAllowList):
2391         * platform/network/curl/CookieUtil.cpp:
2392         (WebCore::CookieUtil::parseCookieHeader):
2393         * platform/network/curl/CurlCacheEntry.cpp:
2394         (WebCore::CurlCacheEntry::loadResponseHeaders):
2395         * platform/network/curl/CurlCacheManager.cpp:
2396         (WebCore::CurlCacheManager::loadIndex):
2397         * platform/network/soup/CookieJarSoup.cpp:
2398         (WebCore::setCookiesFromDOM):
2399         * svg/SVGAnimationElement.cpp:
2400         (WebCore::SVGAnimationElement::parseAttribute):
2401         * svg/SVGToOTFFontConversion.cpp:
2402         (WebCore::SVGToOTFFontConverter::appendOS2Table):
2403         * svg/animation/SVGSMILElement.cpp:
2404         (WebCore::SVGSMILElement::parseBeginOrEnd):
2405         * testing/MockCDMFactory.cpp:
2406         (WebCore::MockCDM::sanitizeResponse const):
2407         (WebCore::MockCDMInstance::updateLicense):
2408         Update split/splitAllowingEmptyEntries usage.
2409
2410 2018-07-26  Nan Wang  <n_wang@apple.com>
2411
2412         AX: nothing returned for various previous text marker APIs from one div/p node to another
2413         https://bugs.webkit.org/show_bug.cgi?id=188071
2414
2415         Reviewed by Chris Fleizach.
2416
2417         TextIterator is emitting an extra '\n' at the end of the <p> node and there's no
2418         corresponding text node in the DOM tree, so we are not able to handle that for 
2419         text markers. Fixed it by ignoring the extra '\n' and anchor the text marker to 
2420         the previous child text node.
2421
2422         Test: accessibility/mac/text-marker-p-tags.html
2423
2424         * accessibility/AXObjectCache.cpp:
2425         (WebCore::AXObjectCache::traverseToOffsetInRange):
2426
2427 2018-07-26  Commit Queue  <commit-queue@webkit.org>
2428
2429         Unreviewed, rolling out r234181 and r234189.
2430         https://bugs.webkit.org/show_bug.cgi?id=188075
2431
2432         These are not needed right now (Requested by thorton on
2433         #webkit).
2434
2435         Reverted changesets:
2436
2437         "Enable Web Content Filtering on watchOS"
2438         https://bugs.webkit.org/show_bug.cgi?id=187979
2439         https://trac.webkit.org/changeset/234181
2440
2441         "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
2442         https://bugs.webkit.org/show_bug.cgi?id=187985
2443         https://trac.webkit.org/changeset/234189
2444
2445 2018-07-26  Timothy Hatcher  <timothy@apple.com>
2446
2447         Use the Page's appearance when converting pasteboard attributed strings.
2448         https://bugs.webkit.org/show_bug.cgi?id=188067
2449         rdar://problem/42632246
2450
2451         Reviewed by Wenson Hsieh.
2452
2453         * editing/cocoa/WebContentReaderCocoa.mm:
2454         (WebCore::createFragment): Create a LocalDefaultSystemAppearance based on the Page.
2455
2456 2018-07-26  Eric Carlson  <eric.carlson@apple.com>
2457
2458         Switching tabs should not close PiP window
2459         https://bugs.webkit.org/show_bug.cgi?id=188054
2460         <rdar://problem/41212379>
2461
2462         Reviewed by Jon Lee.
2463
2464         No new tests, fixes an existing test.
2465         
2466         Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
2467         In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
2468         selectors to close the PiP window. requestHideAndExitFullscreen is also called from 
2469         WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
2470         tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
2471         a new method that is only used by the delegate to exit PiP.
2472
2473         * platform/mac/VideoFullscreenInterfaceMac.h:
2474         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
2475         do-nothing method.
2476         * platform/mac/VideoFullscreenInterfaceMac.mm:
2477         (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
2478         (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
2479         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
2480         (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
2481
2482 2018-07-04  Darin Adler  <darin@apple.com>
2483
2484         Improve WebGPU implementation, including using Metal Objective-C protocols more simply and correctly
2485         https://bugs.webkit.org/show_bug.cgi?id=187333
2486
2487         Reviewed by Sam Weinig.
2488
2489         - Used a new OBJC_PROTOCOL macro to handle things in the Metal API that are protocols.
2490           The code previously had used OBJC_CLASS, but that created unrelated classes.
2491           Fixing this allows removing many typecasts that were in the existing code, makes it
2492           ARC-compatible, and also allowed the compiler to detect a couple mistakes where we
2493           were calling methods that don't exist.
2494
2495         - Eliminated use of separate heap-allocated, reference-counted objects to
2496           hold pointers to Metal objects.
2497
2498         - Reduced the use of the WebGPU wrappers to pass around arguments inside the code.
2499           They are now used only as part of the DOM binding; the inner GPU objects are used
2500           whenever possible. This cuts down the number of separate functions needed a bit,
2501           since we don't always need accessors for the things inside the wrappers.
2502
2503         - Used references rather than pointers in many cases.
2504
2505         - Took out three kinds of null checks: 1) Unneeded ones since Objective-C has the
2506           "do nothing and return 0" behavior for methods without return values and that return
2507           integer scalars. 2) Checks that aren't needed because the code has clear, invariant
2508           guarantees that the pointer won't be null. 3) The simplest variant of (2), checks
2509           that can be obviated by using reference types instead of pointer types.
2510
2511         - For Metal-specific functions and data members, used the function name metal() and
2512           the data member name m_metal rather than longer wordier names with the word "platform"
2513           in them. We could use "platform" if these objects were platform-specific objects used
2514           in a cross-platform way that needed a common name. But in this case it's clearer to
2515           call them "metal" since we are dropping down to the metal with Metal API, and
2516           shared platform-independent code will not be accessing these.
2517
2518         - Fixed the common mistake of using "unsigned long" in our C++ code to match IDL.
2519           The "unsigned long" type in IDL correponds to the "unsigned" type in WebKit code.
2520
2521         - Used "const" more in the GPU functions that are wrappers around Metal objects to
2522           reflect the fact that these have semantics of smart pointers; most operations can be
2523           done without changing which object is pointed to. This allows us to use const
2524           references to pass things around without reference count churn.
2525
2526         - Reduced includes.
2527
2528         - Added "explicit" keywords where appropriate.
2529
2530         - Removed unused functions. In particular, removed non-Metal stub versions of the
2531           functions in the GPU classes: the right way to start a new port is to clone the
2532           Metal-specific files and turn the into stubs if needed, it does not make it
2533           significantly more convenient to have stubs in the platform independent files,
2534           especially ones that are not compiled for any platform.
2535
2536         - Removed most the WEBCORE_EXPORT in the GPU headers; left only what's needed to
2537           support testing with TestWebKitAPI.
2538
2539         - Fixed two storage leaks in GPUDevice by adding missing adoptNS.
2540
2541         * PlatformMac.cmake: Moved files from platform/graphics/cocoa to platform/graphics/metal.
2542         * SourcesCocoa.txt: Ditto.
2543         * WebCore.xcodeproj/project.pbxproj: Ditto. Fixed paths on some files and groups/directories.
2544         Made the platform files that abstract GPU all be "project" visible, not "private", since
2545         they don't need to be visible outside WebCore. Removed reference to FontSelectionKeywordValues.h,
2546         which does not seem to be a source file, a derived source file, or mentioned in any change log.
2547
2548         * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
2549         (WebCore::toJSNewlyCreated): Create the correct wrapper for a
2550         WebGPURenderPassDepthAttachmentDescriptor. The old code would instead
2551         create a WebGPURenderPassAttachmentDescriptor wrapper, which can't be
2552         used to access the clearDepth attribute.
2553
2554         * html/canvas/WebGPUBuffer.cpp:
2555         (WebCore::WebGPUBuffer::create): Use more references rather than pointers for things
2556         that are never null. Added comment about possibly returning null on failure in future.
2557         (WebCore::WebGPUBuffer::WebGPUBuffer): Updated to store the GPUBuffer inside the class
2558         instead of in a separate reference counted object.
2559         * html/canvas/WebGPUBuffer.h: Ditto.
2560
2561         * html/canvas/WebGPUCommandBuffer.cpp:
2562         (WebCore::WebGPUCommandBuffer::create): Use references and lower level types.
2563         (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): Store the GPUCommandBuffer
2564         inside the class.
2565         (WebCore::WebGPUCommandBuffer::commit): Removed unneeded null checks.
2566         (WebCore::WebGPUCommandBuffer::presentDrawable): Ditto.
2567         (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
2568         Removed unneeded local variable.
2569         (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): Ditto.
2570         (WebCore::WebGPUCommandBuffer::completed): Store the DOMPromiseProxy in this
2571         class, not in GPUCommandBuffer.
2572         * html/canvas/WebGPUCommandBuffer.h: Ditto.
2573
2574         * html/canvas/WebGPUCommandQueue.cpp:
2575         (WebCore::WebGPUCommandQueue::create): Use references and lower level types.
2576         (WebCore::WebGPUCommandQueue::WebGPUCommandQueue): Store the GPUCommandQueue
2577         inside the class.
2578         (WebCore::WebGPUCommandQueue::createCommandBuffer): Ditto.
2579         * html/canvas/WebGPUCommandQueue.h: Ditto.
2580         * html/canvas/WebGPUCommandQueue.idl: The return value of createCommandBuffer
2581         is no longer nullable.
2582
2583         * html/canvas/WebGPUComputeCommandEncoder.cpp:
2584         (WebCore::WebGPUComputeCommandEncoder::create): More of the same.
2585         (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): Ditto.
2586         (WebCore::WebGPUComputeCommandEncoder::setComputePipelineState): Ditto.
2587         (WebCore::WebGPUComputeCommandEncoder::setBuffer): Ditto.
2588         (WebCore::WebGPUComputeCommandEncoder::dispatch): Ditto.
2589         (WebCore::WebGPUComputeCommandEncoder::endEncoding): Ditto.
2590         * html/canvas/WebGPUComputeCommandEncoder.h: Ditto.
2591
2592         * html/canvas/WebGPUComputePipelineState.cpp:
2593         (WebCore::WebGPUComputePipelineState::create): More of the same.
2594         (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): Ditto.
2595         * html/canvas/WebGPUComputePipelineState.h: Ditto.
2596
2597         * html/canvas/WebGPUDepthStencilDescriptor.cpp:
2598         (WebCore::WebGPUDepthStencilDescriptor::create): More of the same.
2599         (WebCore::WebGPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
2600         (WebCore::WebGPUDepthStencilDescriptor::setDepthWriteEnabled): Ditto.
2601         (WebCore::WebGPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
2602         (WebCore::WebGPUDepthStencilDescriptor::setDepthCompareFunction): Ditto.
2603         * html/canvas/WebGPUDepthStencilDescriptor.h: Ditto. Also fixed a bug
2604         where m_depthCompareFunction was uninitialized in newly created objects.
2605
2606         * html/canvas/WebGPUDepthStencilState.cpp:
2607         (WebCore::WebGPUDepthStencilState::create): More of the same.
2608         (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState): Ditto.
2609         (WebCore::WebGPUDepthStencilState::label const): Ditto.
2610         (WebCore::WebGPUDepthStencilState::setLabel): Ditto.
2611         * html/canvas/WebGPUDepthStencilState.h: Ditto.
2612
2613         * html/canvas/WebGPUDrawable.cpp:
2614         (WebCore::WebGPUDrawable::create): More of the same.
2615         (WebCore::WebGPUDrawable::WebGPUDrawable): Ditto.
2616         * html/canvas/WebGPUDrawable.h: Ditto.
2617
2618         * html/canvas/WebGPUEnums.cpp: Removed some stray const.
2619         * html/canvas/WebGPUEnums.h: Ditto.
2620
2621         * html/canvas/WebGPUFunction.cpp:
2622         (WebCore::WebGPUFunction::create): More of the same.
2623         (WebCore::WebGPUFunction::WebGPUFunction): Ditto.
2624         * html/canvas/WebGPUFunction.h: Ditto.
2625
2626         * html/canvas/WebGPULibrary.cpp:
2627         (WebCore::WebGPULibrary::create): More of the same.
2628         (WebCore::WebGPULibrary::WebGPULibrary): Ditto.
2629         (WebCore::WebGPULibrary::functionNames const): Ditto.
2630         (WebCore::WebGPULibrary::functionWithName const): Ditto.
2631         * html/canvas/WebGPULibrary.h: Ditto.
2632
2633         * html/canvas/WebGPUObject.cpp:
2634         (WebCore::WebGPUObject::WebGPUObject):
2635         (WebCore::WebGPUObject::deleteObject): Deleted this unused function.
2636         We can bring it back later if we find we need it the way we did with the
2637         WebGL implementation, but currently it's a never-called stub. Also
2638         deleted the isDeleted and m_deleted for the same reason.
2639         * html/canvas/WebGPUObject.h: Ditto.
2640
2641         * html/canvas/WebGPURenderCommandEncoder.cpp:
2642         (WebCore::WebGPURenderCommandEncoder::create): More of the same.
2643         (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder): Ditto.
2644         (WebCore::WebGPURenderCommandEncoder::setRenderPipelineState): Ditto.
2645         (WebCore::WebGPURenderCommandEncoder::setDepthStencilState): Ditto.
2646         (WebCore::WebGPURenderCommandEncoder::setVertexBuffer): Ditto.
2647         (WebCore::WebGPURenderCommandEncoder::setFragmentBuffer): Ditto.
2648         (WebCore::WebGPURenderCommandEncoder::drawPrimitives): Ditto.
2649         (WebCore::WebGPURenderCommandEncoder::endEncoding): Ditto.
2650         * html/canvas/WebGPURenderCommandEncoder.h: Ditto.
2651
2652         * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
2653         (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
2654         More of the same.
2655         (WebCore::WebGPURenderPassAttachmentDescriptor::loadAction const): Ditto.
2656         (WebCore::WebGPURenderPassAttachmentDescriptor::setLoadAction): Ditto.
2657         (WebCore::WebGPURenderPassAttachmentDescriptor::storeAction const): Ditto.
2658         (WebCore::WebGPURenderPassAttachmentDescriptor::setStoreAction): Ditto.
2659         (WebCore::WebGPURenderPassAttachmentDescriptor::texture const): Ditto.
2660         (WebCore::WebGPURenderPassAttachmentDescriptor::setTexture): Ditto.
2661         * html/canvas/WebGPURenderPassAttachmentDescriptor.h: Ditto.
2662
2663         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
2664         (WebCore::WebGPURenderPassColorAttachmentDescriptor::create): More of the same.
2665         (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor): Ditto.
2666         (WebCore::WebGPURenderPassColorAttachmentDescriptor::descriptor const): Ditto.
2667         (WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
2668         (WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor): Ditto.
2669         * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h: Ditto.
2670
2671         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
2672         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create): More of the same.
2673         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor): Ditto.
2674         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
2675         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth): Ditto.
2676         (WebCore::WebGPURenderPassDepthAttachmentDescriptor::descriptor const): Ditto.
2677         * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h: Ditto.
2678
2679         * html/canvas/WebGPURenderPassDescriptor.cpp:
2680         (WebCore::WebGPURenderPassDescriptor::create): More of the same.
2681         (WebCore::WebGPURenderPassDescriptor::depthAttachment): Ditto.
2682         (WebCore::WebGPURenderPassDescriptor::colorAttachments): Ditto.
2683         * html/canvas/WebGPURenderPassDescriptor.h: Ditto.
2684
2685         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
2686         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create): More of the same.
2687         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor): Ditto.
2688         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
2689         (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::setPixelFormat): Ditto.
2690         * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h: Ditto.
2691
2692         * html/canvas/WebGPURenderPipelineDescriptor.cpp:
2693         (WebCore::WebGPURenderPipelineDescriptor::create): More of the same.
2694         (WebCore::WebGPURenderPipelineDescriptor::vertexFunction const): Ditto.
2695         (WebCore::WebGPURenderPipelineDescriptor::setVertexFunction): Ditto.
2696         (WebCore::WebGPURenderPipelineDescriptor::fragmentFunction const): Ditto.
2697         (WebCore::WebGPURenderPipelineDescriptor::setFragmentFunction): Ditto.
2698         (WebCore::WebGPURenderPipelineDescriptor::colorAttachments): Ditto.
2699         (WebCore::WebGPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
2700         (WebCore::WebGPURenderPipelineDescriptor::setDepthAttachmentPixelFormat): Ditto.
2701         (WebCore::WebGPURenderPipelineDescriptor::reset): Ditto.
2702         * html/canvas/WebGPURenderPipelineDescriptor.h: Ditto.
2703
2704         * html/canvas/WebGPURenderPipelineState.cpp:
2705         (WebCore::WebGPURenderPipelineState::create): More of the same.
2706         (WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState): Ditto.
2707         (WebCore::WebGPURenderPipelineState::label const): Ditto.
2708         (WebCore::WebGPURenderPipelineState::setLabel): Ditto.
2709         * html/canvas/WebGPURenderPipelineState.h: Ditto.
2710
2711         * html/canvas/WebGPURenderingContext.cpp:
2712         (WebCore::WebGPURenderingContext::create): More of the same.
2713         (WebCore::WebGPURenderingContext::WebGPURenderingContext): Ditto.
2714         (WebCore::WebGPURenderingContext::initializeNewContext): Ditto.
2715         (WebCore::WebGPURenderingContext::platformLayer const): Ditto.
2716         (WebCore::WebGPURenderingContext::markLayerComposited): Ditto.
2717         (WebCore::WebGPURenderingContext::reshape): Ditto.
2718         (WebCore::WebGPURenderingContext::createLibrary): Ditto.
2719         (WebCore::WebGPURenderingContext::createRenderPipelineState): Ditto.
2720         (WebCore::WebGPURenderingContext::createDepthStencilState): Ditto.
2721         (WebCore::WebGPURenderingContext::createComputePipelineState): Ditto.
2722         (WebCore::WebGPURenderingContext::createCommandQueue): Ditto.
2723         (WebCore::WebGPURenderingContext::nextDrawable): Ditto.
2724         (WebCore::WebGPURenderingContext::createBuffer): Ditto.
2725         (WebCore::WebGPURenderingContext::createTexture): Ditto.
2726         * html/canvas/WebGPURenderingContext.h: Made many functions final and
2727         private.
2728         * html/canvas/WebGPURenderingContext.idl: The return value of most of
2729         the create functions are no longer nullable.
2730
2731         * html/canvas/WebGPUSize.h: Use "unsigned" instead of "unsigned long".
2732
2733         * html/canvas/WebGPUTexture.cpp:
2734         (WebCore::WebGPUTexture::createFromDrawableTexture): More of the same.
2735         (WebCore::WebGPUTexture::create): Ditto.
2736         (WebCore::WebGPUTexture::WebGPUTexture): Ditto.
2737         * html/canvas/WebGPUTexture.h: Ditto.
2738
2739         * html/canvas/WebGPUTextureDescriptor.cpp:
2740         (WebCore::WebGPUTextureDescriptor::create): More of the same.
2741         (WebCore::WebGPUTextureDescriptor::WebGPUTextureDescriptor): Ditto.
2742         (WebCore::WebGPUTextureDescriptor::width const): Ditto.
2743         (WebCore::WebGPUTextureDescriptor::setWidth): Ditto.
2744         (WebCore::WebGPUTextureDescriptor::height const): Ditto.
2745         (WebCore::WebGPUTextureDescriptor::setHeight): Ditto.
2746         (WebCore::WebGPUTextureDescriptor::sampleCount const): Ditto.
2747         (WebCore::WebGPUTextureDescriptor::setSampleCount): Ditto.
2748         (WebCore::WebGPUTextureDescriptor::textureType const): Ditto.
2749         (WebCore::WebGPUTextureDescriptor::setTextureType): Ditto.
2750         (WebCore::WebGPUTextureDescriptor::storageMode const): Ditto.
2751         (WebCore::WebGPUTextureDescriptor::setStorageMode): Ditto.
2752         (WebCore::WebGPUTextureDescriptor::usage const): Ditto.
2753         (WebCore::WebGPUTextureDescriptor::setUsage): Ditto.
2754         * html/canvas/WebGPUTextureDescriptor.h: Ditto.
2755
2756         * platform/graphics/metal/GPUBufferMetal.mm: Moved from "cocoa" directory.
2757         (WebCore::GPUBuffer::GPUBuffer): Simplify code using references and the
2758         "metal" naming.
2759
2760         * platform/graphics/metal/GPUCommandBufferMetal.mm:
2761         (WebCore::GPUCommandBuffer::GPUCommandBuffer): Take a function to be called as the
2762         completed handler and set it up.
2763         (WebCore::GPUCommandBuffer::presentDrawable const): Ditto.
2764         (WebCore::GPUCommandBuffer::commit const): Ditto.
2765         (WebCore::GPUCommandBuffer::addCompletedHandler): Deleted.
2766
2767         * platform/graphics/metal/GPUCommandQueueMetal.mm:
2768         (WebCore::GPUCommandQueue::GPUCommandQueue): Ditto. Also rewrote label handling a bit.
2769         (WebCore::GPUCommandQueue::label const): Ditto.
2770         (WebCore::GPUCommandQueue::setLabel const): Ditto.
2771
2772         * platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
2773         (WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder): Ditto.
2774         (WebCore::GPUComputeCommandEncoder::setComputePipelineState const): Ditto.
2775         (WebCore::GPUComputeCommandEncoder::setBuffer const): Ditto.
2776         (WebCore::GPUComputeCommandEncoder::dispatch const): Ditto.
2777         (WebCore::GPUComputeCommandEncoder::endEncoding const): Ditto.
2778
2779         * platform/graphics/metal/GPUComputePipelineStateMetal.mm:
2780         (WebCore::GPUComputePipelineState::GPUComputePipelineState): Ditto.
2781
2782         * platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
2783         (WebCore::GPUDepthStencilDescriptor::GPUDepthStencilDescriptor): Ditto.
2784         (WebCore::GPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
2785         (WebCore::GPUDepthStencilDescriptor::setDepthWriteEnabled const): Ditto.
2786         (WebCore::GPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
2787         (WebCore::GPUDepthStencilDescriptor::setDepthCompareFunction const): Ditto.
2788
2789         * platform/graphics/metal/GPUDepthStencilStateMetal.mm:
2790         (WebCore::GPUDepthStencilState::GPUDepthStencilState): Ditto.
2791         (WebCore::GPUDepthStencilState::label const): Ditto.
2792         (WebCore::GPUDepthStencilState::setLabel const): Ditto. This is one of the
2793         functions that was calling a method that does not exist. Added a comment.
2794
2795         * platform/graphics/metal/GPUDeviceMetal.mm:
2796         (WebCore::GPUDevice::GPUDevice): Ditto. Also fixed two storage leaks where
2797         we neglected to do adoptNS on the result of MTLCreateSystemDefaultDevice and
2798         on the result of -[[WebGPULayer alloc] initWithGPUDevice:].
2799         (WebCore::GPUDevice::reshape const): Ditto.
2800         (WebCore::GPUDevice::platformLayer const): Ditto.
2801         (WebCore::GPUDevice::operator! const): Ditto.
2802
2803         * platform/graphics/metal/GPUDrawableMetal.mm:
2804         (WebCore::GPUDrawable::GPUDrawable): Ditto.
2805         (WebCore::GPUDrawable::release): Ditto.
2806         (WebCore::GPUDrawable::metal const): Ditto.
2807         (WebCore::GPUDrawable::texture const): Ditto.
2808
2809         * platform/graphics/metal/GPUFunctionMetal.mm:
2810         (WebCore::GPUFunction::GPUFunction): Ditto.
2811         (WebCore::GPUFunction::name const): Ditto.
2812         (WebCore::GPUFunction::metal const): Ditto.
2813         (WebCore::GPUFunction::operator! const): Ditto.
2814
2815         * platform/graphics/metal/GPULibraryMetal.mm:
2816         (WebCore::GPULibrary::GPULibrary): Ditto.
2817         (WebCore::GPULibrary::label const): Ditto.
2818         (WebCore::GPULibrary::setLabel const): Ditto.
2819         (WebCore::GPULibrary::functionNames const): Ditto.
2820         (WebCore::GPULibrary::metal const): Ditto.
2821
2822         * platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
2823         (WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder): Ditto.
2824         (WebCore::GPURenderCommandEncoder::setRenderPipelineState const): Ditto.
2825         (WebCore::GPURenderCommandEncoder::setDepthStencilState const): Ditto.
2826         (WebCore::GPURenderCommandEncoder::setVertexBuffer const): Ditto.
2827         (WebCore::GPURenderCommandEncoder::setFragmentBuffer const): Ditto.
2828         (WebCore::GPURenderCommandEncoder::drawPrimitives const): Ditto.
2829         (WebCore::GPURenderCommandEncoder::endEncoding const): Ditto.
2830
2831         * platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
2832         (WebCore::GPURenderPassAttachmentDescriptor::GPURenderPassAttachmentDescriptor): Ditto.
2833         (WebCore::GPURenderPassAttachmentDescriptor::loadAction const): Ditto.
2834         (WebCore::GPURenderPassAttachmentDescriptor::setLoadAction const): Ditto.
2835         (WebCore::GPURenderPassAttachmentDescriptor::storeAction const): Ditto.
2836         (WebCore::GPURenderPassAttachmentDescriptor::setStoreAction const): Ditto.
2837         (WebCore::GPURenderPassAttachmentDescriptor::setTexture const): Ditto.
2838
2839         * platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
2840         (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor): Ditto.
2841         (WebCore::GPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
2842         (WebCore::GPURenderPassColorAttachmentDescriptor::setClearColor const): Ditto.
2843         (WebCore::GPURenderPassColorAttachmentDescriptor::metal const): Ditto.
2844
2845         * platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
2846         (WebCore::GPURenderPassDepthAttachmentDescriptor::GPURenderPassDepthAttachmentDescriptor): Ditto.
2847         (WebCore::GPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
2848         (WebCore::GPURenderPassDepthAttachmentDescriptor::setClearDepth const): Ditto.
2849         (WebCore::GPURenderPassDepthAttachmentDescriptor::metal const): Ditto.
2850
2851         * platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
2852         (WebCore::GPURenderPassDescriptor::GPURenderPassDescriptor): Ditto.
2853         (WebCore::GPURenderPassDescriptor::colorAttachments const): Ditto.
2854         (WebCore::GPURenderPassDescriptor::depthAttachment const): Ditto.
2855         (WebCore::GPURenderPassDescriptor::metal const): Ditto.
2856
2857         * platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
2858         (WebCore::GPURenderPipelineColorAttachmentDescriptor::GPURenderPipelineColorAttachmentDescriptor): Ditto.
2859         (WebCore::GPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
2860         (WebCore::GPURenderPipelineColorAttachmentDescriptor::setPixelFormat const): Ditto.
2861         (WebCore::GPURenderPipelineColorAttachmentDescriptor::metal const): Ditto.
2862
2863         * platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
2864         (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Ditto.
2865         (WebCore::GPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
2866         (WebCore::GPURenderPipelineDescriptor::setDepthAttachmentPixelFormat const): Ditto.
2867         (WebCore::GPURenderPipelineDescriptor::setVertexFunction const): Ditto.
2868         (WebCore::GPURenderPipelineDescriptor::setFragmentFunction const): Ditto.
2869         (WebCore::GPURenderPipelineDescriptor::colorAttachments const): Ditto.
2870         (WebCore::GPURenderPipelineDescriptor::reset const): Ditto.
2871         (WebCore::GPURenderPipelineDescriptor::metal const): Ditto.
2872
2873         * platform/graphics/metal/GPURenderPipelineStateMetal.mm:
2874         (WebCore::GPURenderPipelineState::GPURenderPipelineState): Ditto.
2875         (WebCore::GPURenderPipelineState::label const): Ditto.
2876         (WebCore::GPURenderPipelineState::setLabel const): Ditto. This is one of the
2877         functions that was calling a method that does not exist. Added a comment.
2878         (WebCore::GPURenderPipelineState::metal const): Ditto.
2879
2880         * platform/graphics/metal/GPUTextureDescriptorMetal.mm:
2881         (WebCore::GPUTextureDescriptor::GPUTextureDescriptor): Ditto.
2882         (WebCore::GPUTextureDescriptor::width const): Ditto.
2883         (WebCore::GPUTextureDescriptor::setWidth const): Ditto.
2884         (WebCore::GPUTextureDescriptor::height const): Ditto.
2885         (WebCore::GPUTextureDescriptor::setHeight const): Ditto.
2886         (WebCore::GPUTextureDescriptor::sampleCount const): Ditto.
2887         (WebCore::GPUTextureDescriptor::setSampleCount const): Ditto.
2888         (WebCore::GPUTextureDescriptor::textureType const): Ditto.
2889         (WebCore::GPUTextureDescriptor::setTextureType const): Ditto.
2890         (WebCore::GPUTextureDescriptor::storageMode const): Ditto.
2891         (WebCore::GPUTextureDescriptor::setStorageMode const): Ditto.
2892         (WebCore::GPUTextureDescriptor::usage const): Ditto.
2893         (WebCore::GPUTextureDescriptor::setUsage const): Ditto.
2894         (WebCore::GPUTextureDescriptor::metal const): Ditto.
2895
2896         * platform/graphics/metal/GPUTextureMetal.mm:
2897         (WebCore::GPUTexture::GPUTexture): Ditto.
2898         (WebCore::GPUTexture::width const): Ditto.
2899         (WebCore::GPUTexture::height const): Ditto.
2900         (WebCore::GPUTexture::metal const): Ditto.
2901
2902         * platform/graphics/gpu/GPUBuffer.cpp: Removed unused stubs.
2903         (WebCore::GPUBuffer::length const): Moved this function here since it has
2904         a useful platform-independent implementation.
2905
2906         * platform/graphics/gpu/GPUBuffer.h: Use OBJC_PROTOCOL for MTLBuffer.
2907         Did the other thigs mentioned above: USE(METAL), remove WEBCORE_EXPORT,
2908         no longer be RefCounted, etc.
2909
2910         * platform/graphics/gpu/GPUCommandBuffer.cpp: Ditto.
2911         * platform/graphics/gpu/GPUCommandBuffer.h: Ditto. Use OBJC_PROTOCOL
2912         for MTLCommandBuffer.
2913
2914         * platform/graphics/gpu/GPUCommandQueue.cpp: Ditto.
2915         * platform/graphics/gpu/GPUCommandQueue.h: Ditto. Use OBJC_PROTOCOL for
2916         MTLCommandQueue.
2917
2918         * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Ditto.
2919         * platform/graphics/gpu/GPUComputeCommandEncoder.h: Ditto. Use OBJC_PROTOCOL for
2920         MTLComputeCommandEncoder.
2921
2922         * platform/graphics/gpu/GPUComputePipelineState.cpp: Ditto.
2923         * platform/graphics/gpu/GPUComputePipelineState.h: Ditto. Use OBJC_PROTOCOL for
2924         MTLComputePipelineState.
2925
2926         * platform/graphics/gpu/GPUDepthStencilDescriptor.cpp: Ditto.
2927         * platform/graphics/gpu/GPUDepthStencilDescriptor.h: Ditto.
2928
2929         * platform/graphics/gpu/GPUDepthStencilState.cpp: Ditto.
2930         * platform/graphics/gpu/GPUDepthStencilState.h: Ditto. Use OBJC_PROTOCOL for
2931         MTLDepthStencilState.
2932
2933         * platform/graphics/gpu/GPUDevice.cpp: Ditto.
2934         * platform/graphics/gpu/GPUDevice.h: Ditto. Use OBJC_PROTOCOL for MTLDevice.
2935
2936         * platform/graphics/gpu/GPUDrawable.cpp: Ditto.
2937         * platform/graphics/gpu/GPUDrawable.h: Ditto. Use OBJC_PROTOCOL for
2938         MTLDrawable and MTLTexture.
2939
2940         * platform/graphics/gpu/GPUEnums.h: Tweaked formatting.
2941
2942         * platform/graphics/gpu/GPUFunction.cpp: Ditto.
2943         * platform/graphics/gpu/GPUFunction.h: Ditto. Use OBJC_PROTOCOL for
2944         MTLFunction.
2945
2946         * platform/graphics/gpu/GPULibrary.cpp: Ditto.
2947         * platform/graphics/gpu/GPULibrary.h: Ditto. Use OBJC_PROTOCOL for
2948         MTLLibrary.
2949
2950         * platform/graphics/gpu/GPURenderCommandEncoder.cpp: Ditto.
2951         * platform/graphics/gpu/GPURenderCommandEncoder.h: Ditto.
2952         Use OBJC_PROTOCOL for MTLRenderCommandEncoder.
2953
2954         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp: Ditto.
2955         * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h: Ditto.
2956
2957         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp: Ditto.
2958         * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Ditto.
2959
2960         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp: Ditto.
2961         * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h: Ditto.
2962
2963         * platform/graphics/gpu/GPURenderPassDescriptor.cpp: Ditto.
2964         * platform/graphics/gpu/GPURenderPassDescriptor.h: Ditto.
2965
2966         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp: Ditto.
2967         * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h: Ditto.
2968
2969         * platform/graphics/gpu/GPURenderPipelineDescriptor.cpp: Ditto.
2970         * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Ditto.
2971
2972         * platform/graphics/gpu/GPURenderPipelineState.cpp: Ditto.
2973         * platform/graphics/gpu/GPURenderPipelineState.h: Ditto. Use OBJC_PROTOCOL
2974         for MTLRenderPipelineState.
2975
2976         * platform/graphics/gpu/GPUSize.h: Use "unsigned" instead of "unsigned long".
2977
2978         * platform/graphics/gpu/GPUTexture.cpp: Ditto.
2979         * platform/graphics/gpu/GPUTexture.h: Ditto. Use OBJC_PROTOCOL for
2980         MTLTexture.
2981
2982         * platform/graphics/gpu/GPUTextureDescriptor.cpp: Ditto.
2983         * platform/graphics/gpu/GPUTextureDescriptor.h: Ditto.
2984
2985 2018-07-26  Zalan Bujtas  <zalan@apple.com>
2986
2987         [LFC][Floating] Add skeleton for basic positioning.
2988         https://bugs.webkit.org/show_bug.cgi?id=187974
2989
2990         Reviewed by Antti Koivisto.
2991
2992         Add floating boxes to an empty floating context.
2993
2994         * layout/FloatingContext.cpp:
2995         (WebCore::Layout::FloatingContext::FloatingContext):
2996         (WebCore::Layout::FloatingContext::computePosition):
2997         * layout/FloatingContext.h:
2998         (WebCore::Layout::FloatingContext::floatingState const):
2999         (WebCore::Layout::FloatingContext::layoutContext const):
3000         * layout/FloatingState.cpp:
3001         (WebCore::Layout::FloatingState::FloatingState):
3002         (WebCore::Layout::FloatingState::append):
3003         * layout/FloatingState.h:
3004         (WebCore::Layout::FloatingState::create):
3005         (WebCore::Layout::FloatingState::isEmpty const):
3006         (WebCore::Layout::FloatingState::layoutContext const):
3007         * layout/FormattingState.h:
3008         * layout/LayoutContext.cpp:
3009         (WebCore::Layout::LayoutContext::establishedFormattingState):
3010         * layout/LayoutContext.h:
3011         * layout/blockformatting/BlockFormattingContext.cpp:
3012         (WebCore::Layout::BlockFormattingContext::layout const):
3013         (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
3014         (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
3015         * layout/blockformatting/BlockFormattingContext.h:
3016         * layout/blockformatting/BlockInvalidation.cpp:
3017         (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
3018         * layout/layouttree/LayoutBox.cpp:
3019         (WebCore::Layout::Box::isLeftFloatingPositioned const):
3020         (WebCore::Layout::Box::isRightFloatingPositioned const):
3021         * layout/layouttree/LayoutBox.h:
3022
3023 2018-07-26  Zalan Bujtas  <zalan@apple.com>
3024
3025         [LFC][BFC] Do not try to access containing block's height during descendant height computation
3026         https://bugs.webkit.org/show_bug.cgi?id=187970
3027
3028         Reviewed by Antti Koivisto.
3029
3030         Mostly becasue in BFC, we compute the descendents' height first so the containing block's height is probably not computed yet.
3031
3032         * layout/FormattingContextGeometry.cpp:
3033         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
3034         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3035         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3036
3037 2018-07-26  Frederic Wang  <fwang@igalia.com>
3038
3039         Unreviewed, add bug references into FIXME comments for CSSOM View API
3040
3041         * dom/Element.idl:
3042         * page/ScrollToOptions.idl:
3043
3044 2018-07-26  Zalan Bujtas  <zalan@apple.com>
3045
3046         [LFC][BFC] assert-not-implemented-yet on inflow non-replaced height when style is not fixed/auto.
3047         https://bugs.webkit.org/show_bug.cgi?id=187969
3048
3049         Reviewed by Antti Koivisto.
3050
3051         Assert on unsupported height types when computing inflow non-replaced height.
3052
3053         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3054         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3055
3056 2018-07-26  Antoine Quint  <graouts@apple.com>
3057
3058         [Web Animations] REGRESSION: transition added immediately after element creation doesn't work
3059         https://bugs.webkit.org/show_bug.cgi?id=187942
3060
3061         Reviewed by Dean Jackson.
3062
3063         Tests: webanimations/accelerated-transition-by-removing-property.html
3064                webanimations/partly-accelerated-transition-by-removing-property.html
3065
3066         The Style::TreeResolver::createAnimatedElementUpdate() function expected a flag to be set that indicates that
3067         running animations on an element should yield a change in composited state for that element's layer. We did not
3068         have code accounting for this flag in the Web Animations engine. We now have a resolveAnimationsForElement()
3069         method on DocumentTimeline which looks at all animations resolved on the element and see if all of them are
3070         running accelerated and whether at least one of them is pending. In that case, we set the shouldRecompositeLayer
3071         flag in createAnimatedElementUpdate() to true which guarantees the element's layer will have a backing when
3072         we attempt to start the animation in KeyframeEffectReadOnly::applyPendingAcceleratedActions() where we would
3073         have previously failed to have layer-backed renderer to perform an accelerated animation on (under certain
3074         circumstances, see test).
3075
3076         * animation/DocumentTimeline.cpp:
3077         (WebCore::DocumentTimeline::resolveAnimationsForElement):
3078         * animation/DocumentTimeline.h:
3079         * animation/KeyframeEffectReadOnly.h:
3080         (WebCore::KeyframeEffectReadOnly::hasPendingAcceleratedAction const):
3081         * style/StyleTreeResolver.cpp:
3082         (WebCore::Style::TreeResolver::createAnimatedElementUpdate):
3083
3084 2018-07-25  Chris Dumez  <cdumez@apple.com>
3085
3086         Allow ActiveDOMObject's canSuspend / suspend / resume overrides to destroy ActiveDOMObjects
3087         https://bugs.webkit.org/show_bug.cgi?id=188025
3088
3089         Reviewed by Alex Christensen.
3090
3091         Apply the same logic as in ScriptExecutionContext::stopActiveDOMObjects() to support destruction of
3092         ActiveDOMObjects while we're calling ActiveDOMObject's canSuspend / suspend / resume overrides.
3093
3094         We copy m_activeDOMObjects into a Vector and iterate over the copy instead of m_activeDOMObjects.
3095         Since ActiveDOMObject is not RefCounted or CanMakeWeakPtr, we verify that the raw pointer is still
3096         valid by checking if m_activeDOMObjects still contains it, as we iterate. This is safe as the
3097         ActiveDOMObject destructor removes the object from ScriptExecutionContext::m_activeDOMObjects.
3098         New ActiveDOMObjects with the same pointer value cannot be created while we iterate as we already
3099         prevent the construction of new ActiveDOMObjects while we iterate via RELEASE_ASSERT().
3100
3101         * dom/ScriptExecutionContext.cpp:
3102         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
3103         (WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
3104         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
3105         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
3106         (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
3107         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
3108         * dom/ScriptExecutionContext.h:
3109
3110 2018-07-25  Justin Fan  <justin_fan@apple.com>
3111
3112         Systems with no NSScreens hitting assertion in rendererIDForDisplay when creating WebGL context
3113         https://bugs.webkit.org/show_bug.cgi?id=188023
3114         <rdar://problem/42476622>
3115
3116         Reviewed by Simon Fraser.
3117
3118         On systems with no NSScreens, PlatformScreenMac's screenData map is not populated; rendererIDForDisplay
3119         will thus hit an assertion rather than returning 0. Removing the assertion for now. 
3120
3121         Covered by existing tests.
3122
3123         * platform/mac/PlatformScreenMac.mm:
3124         (WebCore::rendererIDForDisplay):
3125
3126 2018-07-25  Zalan Bujtas  <zalan@apple.com>
3127
3128         Build fix after r234215. Unreviewed.
3129
3130         * rendering/RenderTheme.cpp:
3131
3132 2018-07-25  Zalan Bujtas  <zalan@apple.com>
3133
3134         REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
3135         https://bugs.webkit.org/show_bug.cgi?id=188018
3136         <rdar://problem/42517520>
3137
3138         Reviewed by Dean Jackson.
3139
3140         Manual rollout of r227577.
3141
3142         Test: fast/overflow/line-clamp-with-text-shadow.html
3143
3144         * Sources.txt:
3145         * WebCore.xcodeproj/project.pbxproj:
3146         * css/CSSComputedStyleDeclaration.cpp:
3147         (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
3148         * css/CSSProperties.json:
3149         * css/StyleBuilderCustom.h:
3150         (WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
3151         * css/parser/CSSParserContext.cpp:
3152         (WebCore::CSSParserContext::CSSParserContext):
3153         * css/parser/CSSParserContext.h:
3154         (WebCore::CSSParserContextHash::hash):
3155         * css/parser/CSSPropertyParser.cpp:
3156         (WebCore::CSSPropertyParser::parseSingleValue):
3157         (WebCore::consumeLinesClamp): Deleted.
3158         * page/Settings.yaml:
3159         * rendering/RenderBlockFlow.cpp:
3160         (WebCore::RenderBlockFlow::willCreateColumns const):
3161         (WebCore::getHeightForLineCount):
3162         (WebCore::RenderBlockFlow::heightForLineCount):
3163         (WebCore::RenderBlockFlow::layoutExcludedChildren):
3164         (WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
3165         (WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
3166         * rendering/RenderBlockFlow.h:
3167         * rendering/RenderDeprecatedFlexibleBox.cpp:
3168         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
3169         * rendering/RenderFragmentContainer.cpp:
3170         (WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
3171         * rendering/RenderFragmentContainer.h:
3172         * rendering/RenderFragmentedFlow.cpp:
3173         (WebCore::RenderFragmentedFlow::validateFragments):
3174         (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
3175         (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
3176         * rendering/RenderFragmentedFlow.h:
3177         * rendering/RenderLinesClampFlow.cpp: Removed.
3178         * rendering/RenderLinesClampFlow.h: Removed.
3179         * rendering/RenderLinesClampSet.cpp: Removed.
3180         * rendering/RenderLinesClampSet.h: Removed.
3181         * rendering/RenderMultiColumnFlow.cpp:
3182         (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
3183         (WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
3184         * rendering/RenderMultiColumnFlow.h:
3185         (WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
3186         (WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
3187         (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
3188         (WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
3189         (WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
3190         (WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
3191         (WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
3192         (WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
3193         (WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
3194         (WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
3195         (WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
3196         (WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
3197         (WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
3198         (WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
3199         (WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
3200         (WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
3201         (WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
3202         (WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
3203         * rendering/RenderMultiColumnSet.cpp:
3204         (WebCore::RenderMultiColumnSet::collectLayerFragments):
3205         (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
3206         * rendering/RenderMultiColumnSet.h:
3207         (WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
3208         (WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
3209         (WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
3210         (WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
3211         (WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
3212         (WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
3213         (WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
3214         (WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
3215         (WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
3216         (WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
3217         (WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
3218         (WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
3219         (WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
3220         (WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
3221         (WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
3222         (WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
3223         (WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
3224         (WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
3225         (WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
3226         (WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
3227         (WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
3228         * rendering/RenderObject.h:
3229         (WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
3230         (WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
3231         * rendering/style/LineClampValue.h:
3232         (WebCore::LinesClampValue::LinesClampValue): Deleted.
3233         (WebCore::LinesClampValue::isNone const): Deleted.
3234         (WebCore::LinesClampValue::operator== const): Deleted.
3235         (WebCore::LinesClampValue::operator!= const): Deleted.
3236         (WebCore::LinesClampValue::start const): Deleted.
3237         (WebCore::LinesClampValue::end const): Deleted.
3238         (WebCore::LinesClampValue::center const): Deleted.
3239         * rendering/style/RenderStyle.h:
3240         (WebCore::RenderStyle::lineClamp const):
3241         (WebCore::RenderStyle::setLineClamp):
3242         (WebCore::RenderStyle::initialLineClamp):
3243         (WebCore::RenderStyle::hasInlineColumnAxis const):
3244         (WebCore::RenderStyle::linesClamp const): Deleted.
3245         (WebCore::RenderStyle::hasLinesClamp const): Deleted.
3246         (WebCore::RenderStyle::setLinesClamp): Deleted.
3247         (WebCore::RenderStyle::initialLinesClamp): Deleted.
3248         * rendering/style/StyleRareNonInheritedData.cpp:
3249         (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
3250         (WebCore::StyleRareNonInheritedData::operator== const):
3251         * rendering/style/StyleRareNonInheritedData.h:
3252         * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
3253         (WebCore::isValidColumnSpanner):
3254         (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
3255         (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
3256
3257 2018-07-25  Chris Dumez  <cdumez@apple.com>
3258
3259         navigator.userAgent may return outdated value after webView.customUserAgent is set
3260         https://bugs.webkit.org/show_bug.cgi?id=188009
3261         <rdar://problem/42566456>
3262
3263         Reviewed by Alex Christensen.
3264
3265         Invalidate the navigator.userAgent cache whenever the user agent gets changed to avoid exposing
3266         outdated values to JavaScript.
3267
3268         * page/Navigator.cpp:
3269         (WebCore::Navigator::userAgentChanged):
3270         * page/Navigator.h:
3271         * page/NavigatorID.idl:
3272         * page/Page.cpp:
3273         (WebCore::Page::userAgentChanged):
3274         * page/Page.h:
3275
3276 2018-07-25  David Fenton  <david_fenton@apple.com>
3277
3278         Unreviewed, rolling out r234187.
3279
3280         the layout test added with this change is flaky on the bots
3281
3282         Reverted changeset:
3283
3284         "Animation stops with object-fit:contain on an animated 2d
3285         canvas"
3286         https://bugs.webkit.org/show_bug.cgi?id=187840
3287         https://trac.webkit.org/changeset/234187
3288
3289 2018-07-25  Chris Dumez  <cdumez@apple.com>
3290
3291         Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT
3292         https://bugs.webkit.org/show_bug.cgi?id=187978
3293
3294         Reviewed by Eric Carlson.
3295
3296         Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT.
3297         If code does this, this leads to hard to investigate crashes such as rdar://problem/42160890. With a
3298         release assertion, we would find the culprits right away. The assertion guarding against addition of
3299         ActiveDOMObjects while we iterate is already a RELEASE_ASSERT.
3300
3301         * dom/ScriptExecutionContext.cpp:
3302         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
3303         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
3304         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
3305         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
3306         * dom/ScriptExecutionContext.h:
3307
3308 2018-07-24  Chris Dumez  <cdumez@apple.com>
3309
3310         REGRESSION (r219757): Accessing response getter of XHR instance from IFRAME sets constructor to Object from the IFRAME
3311         https://bugs.webkit.org/show_bug.cgi?id=187411
3312         <rdar://problem/41920593>
3313
3314         Reviewed by Sam Weinig.
3315
3316         Update JSXMLHttpRequest::response() to use the XMLHttpRequest's global object exec when constructing a JSONObject
3317         for the response instead of the caller's exec.
3318
3319         Test: http/tests/xmlhttprequest/xhr-response-constructor-subframe.html
3320
3321         * bindings/js/JSXMLHttpRequestCustom.cpp:
3322         (WebCore::JSXMLHttpRequest::response const):
3323
3324 2018-07-24  Simon Fraser  <simon.fraser@apple.com>
3325
3326         Animation stops with object-fit:contain on an animated 2d canvas
3327         https://bugs.webkit.org/show_bug.cgi?id=187840
3328
3329         Reviewed by Zalan Bujtas.
3330         
3331         If a canvas has object-fit: cover or contain, repaints need to mapped through
3332         the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
3333         
3334         Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
3335         all but RenderVideo just pass the RenderReplaced's intrinsicSize.
3336
3337         Test: fast/repaint/canvas-object-fit.html
3338
3339         * html/HTMLCanvasElement.cpp:
3340         (WebCore::HTMLCanvasElement::didDraw):
3341         * rendering/RenderHTMLCanvas.cpp:
3342         (WebCore::RenderHTMLCanvas::paintReplaced):
3343         * rendering/RenderImage.cpp:
3344         (WebCore::RenderImage::updateInnerContentRect):
3345         (WebCore::RenderImage::paintReplaced):
3346         * rendering/RenderLayerBacking.cpp:
3347         (WebCore::RenderLayerBacking::contentsBox const):
3348         * rendering/RenderReplaced.h:
3349         (WebCore::RenderReplaced::replacedContentRect const):
3350         * rendering/shapes/ShapeOutsideInfo.cpp:
3351         (WebCore::ShapeOutsideInfo::createShapeForImage const):
3352
3353 2018-07-24  Basuke Suzuki  <Basuke.Suzuki@sony.com>
3354
3355         [Curl] Add support for wss:// websockets
3356         https://bugs.webkit.org/show_bug.cgi?id=172630
3357
3358         Reviewed by Fujii Hironori.
3359
3360         To support secure WebSocket connection, it is almost rewritten by using existing
3361         backend for CurlHandle to handle TLS connection and proxy support.
3362
3363         Test: http/tests/websocket/tests/hybi/simple-wss.html
3364
3365         * platform/network/curl/CurlContext.cpp:
3366         (WebCore::CurlSocketHandle::CurlSocketHandle):
3367         (WebCore::CurlSocketHandle::connect):
3368         (WebCore::CurlSocketHandle::send):
3369         (WebCore::CurlSocketHandle::receive):
3370         (WebCore::CurlSocketHandle::wait):
3371         * platform/network/curl/CurlContext.h:
3372         * platform/network/curl/SocketStreamHandleImpl.h:
3373         (WebCore::SocketStreamHandleImpl::SocketData::SocketData): Deleted.
3374         * platform/network/curl/SocketStreamHandleImplCurl.cpp:
3375         (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
3376         (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
3377         (WebCore::SocketStreamHandleImpl::platformSendInternal):
3378         (WebCore::SocketStreamHandleImpl::platformClose):
3379         (WebCore::SocketStreamHandleImpl::threadEntryPoint):
3380         (WebCore::SocketStreamHandleImpl::handleError):
3381         (WebCore::SocketStreamHandleImpl::stopThread):
3382         (WebCore::createCopy): Deleted.
3383         (WebCore::SocketStreamHandleImpl::readData): Deleted.
3384         (WebCore::SocketStreamHandleImpl::sendData): Deleted.
3385         (WebCore::SocketStreamHandleImpl::waitForAvailableData): Deleted.
3386         (WebCore::SocketStreamHandleImpl::startThread): Deleted.
3387         (WebCore::SocketStreamHandleImpl::didReceiveData): Deleted.
3388         (WebCore::SocketStreamHandleImpl::didOpenSocket): Deleted.
3389
3390 2018-07-24  Tim Horton  <timothy_horton@apple.com>
3391
3392         Enable Web Content Filtering on watchOS
3393         https://bugs.webkit.org/show_bug.cgi?id=187979
3394         <rdar://problem/42559346>
3395
3396         Reviewed by Wenson Hsieh.
3397
3398         * Configurations/FeatureDefines.xcconfig:
3399
3400 2018-07-24  Chris Dumez  <cdumez@apple.com>
3401
3402         Unreviewed, rolling out r233496 and r233571.
3403
3404         Likely cause of <rdar://problem/42160890> and
3405         <rdar://problem/42329658> as ActiveDOMObjects can now be
3406         constructed / destroyed while we are iterating over them.
3407
3408         Reverted changesets:
3409
3410         "Nullptr crash accessing Document in
3411         GenericEventQueue::dispatchOneEvent()"
3412         https://bugs.webkit.org/show_bug.cgi?id=187284
3413         https://trac.webkit.org/changeset/233496
3414
3415         "REGRESSION(r233496): macOS Sierra hits debug assertions in
3416         TrackListBase::suspend"
3417         https://bugs.webkit.org/show_bug.cgi?id=187378
3418         https://trac.webkit.org/changeset/233571
3419
3420 2018-07-24  Aditya Keerthi  <akeerthi@apple.com>
3421
3422         [Datalist][macOS] Display suggestions for input[type=color]
3423         https://bugs.webkit.org/show_bug.cgi?id=187794
3424
3425         Reviewed by Tim Horton.
3426
3427         * html/ColorInputType.cpp:
3428         (WebCore::ColorInputType::shouldRespectListAttribute):
3429
3430 2018-07-24  Ryan Haddad  <ryanhaddad@apple.com>
3431
3432         Unreviewed, rolling out r234121.
3433
3434         Caused perf test failures.
3435
3436         Reverted changeset:
3437
3438         "We should cache the compiled sandbox profile in a data vault"
3439         https://bugs.webkit.org/show_bug.cgi?id=184991
3440         https://trac.webkit.org/changeset/234121
3441
3442 2018-07-24  Antoine Quint  <graouts@apple.com>
3443
3444         [Web Animations] Add an ASSERT() to check the contract that a CSSTransition has a valid effect in setTimingProperties()
3445         https://bugs.webkit.org/show_bug.cgi?id=187954
3446
3447         Reviewed by Dean Jackson.
3448
3449         * animation/CSSTransition.cpp:
3450         (WebCore::CSSTransition::setTimingProperties):
3451
3452 2018-07-24  Antoine Quint  <graouts@apple.com>
3453
3454         [Web Animations] Crash when setting an animation style on an existing animation that had its effect set to null
3455         https://bugs.webkit.org/show_bug.cgi?id=187953
3456
3457         Reviewed by Dean Jackson.
3458
3459         Test: webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect.html
3460
3461         Ensure that we have a valid effect before proceeding to update its timing. 
3462
3463         * animation/CSSAnimation.cpp:
3464         (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
3465
3466 2018-07-24  Eric Carlson  <eric.carlson@apple.com>
3467
3468         [MediaStream] Restructure getDisplayMedia classes
3469         https://bugs.webkit.org/show_bug.cgi?id=187905
3470         <rdar://problem/42500215>
3471
3472         Unreviewed build fix.
3473
3474         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: 
3475
3476 2018-07-24  Antoine Quint  <graouts@apple.com>
3477
3478         [Web Animations] Crash when setting "animation: none" after clearing an animation's effect
3479         https://bugs.webkit.org/show_bug.cgi?id=187952
3480
3481         Reviewed by Dean Jackson.
3482
3483         Test: webanimations/setting-css-animation-none-after-clearing-effect.html
3484
3485         We need to ensure that the animation we're trying to remove has not had its effect cleared via the
3486         Web Animations API since its creation before trying to check its phase.
3487
3488         * animation/AnimationTimeline.cpp:
3489         (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):
3490
3491 2018-07-24  Antoine Quint  <graouts@apple.com>
3492
3493         [Web Animations] Crash accessing CSSAnimation::bindingsCurrentTime when effect has been set to null
3494         https://bugs.webkit.org/show_bug.cgi?id=187950
3495         <rdar://problem/42515747>
3496
3497         Reviewed by Dean Jackson.
3498
3499         Test: webanimations/accessing-current-time-after-clearing-css-animation-effect.html
3500
3501         While a CSSAnimation has an effect created for it by the implementation, the developer may yet manipulate
3502         its effect via the Web Animations API and set it to null. As such, we must not assume it's always non-null.
3503
3504         * animation/CSSAnimation.cpp:
3505         (WebCore::CSSAnimation::bindingsCurrentTime const):
3506
3507 2018-07-24  Zalan Bujtas  <zalan@apple.com>
3508
3509         [LFC][IFC] BlockContainer::establishesInlineFormattingContext should only check the first inflow child.
3510         https://bugs.webkit.org/show_bug.cgi?id=187965
3511
3512         Reviewed by Antti Koivisto.
3513
3514         * layout/layouttree/LayoutBlockContainer.cpp:
3515         (WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):
3516
3517 2018-07-24  Myles C. Maxfield  <mmaxfield@apple.com>
3518
3519         [Cocoa] Stop crashing in lastResortFallbackFont()
3520         https://bugs.webkit.org/show_bug.cgi?id=187936
3521
3522         Reviewed by Jon Lee.
3523
3524         CoreText can get into a state where both Times and Lucida Grande are inaccessible.
3525         Instead of crashing, we should use the real LastResort, which is backed by a section
3526         in the .rodata of the CoreText dylib, and as such should always exist.
3527
3528         * platform/graphics/FontCache.cpp:
3529         (WebCore::FontCache::fontForFamily):
3530         * platform/graphics/cocoa/FontCacheCoreText.cpp:
3531         (WebCore::FontCache::lastResortFallbackFont):
3532
3533 2018-07-24  Daniel Bates  <dabates@apple.com>
3534
3535         Cannot view PDF's on my.gov.au: "Refused to load https://my.gov.au/attachment/viewAttachment because it
3536         appears in neither the object-src directive nor the default-src directive of the Content Security Policy"
3537         https://bugs.webkit.org/show_bug.cgi?id=187870
3538         <rdar://problem/41190880>
3539
3540         Reviewed by Dean Jackson.
3541
3542         Fixes an issue where opening attachments on my.gov.au would show a "Blocked Plug-in" message.
3543
3544         Opening an attachment on my.gov.au opens a same-origin plugin document in a child window. Currently
3545         same-origin plugin documents inherit their CSP policy from their opener. If the opener's CSP policy
3546         disallows embedding plugins then the plugin document would be blocked from loading a plugin. For now
3547         we relax the inheritance model such that we only inherit the plugin-types and report-uri directives
3548         from the opener.
3549
3550         Developers that want to block plugin content from being loaded in a same-origin child window must now
3551         serve such plugin content with a CSP policy that includes "object-src 'none'". This matches the behavior
3552         described in the second Note in section object-src of the CSP 3 spec: <https://w3c.github.io/webappsec-csp/#directive-object-src>
3553         (Editor's Draft, 10 July 2018). It also makes the behavior in WebKit more closely aligned with the
3554         behavior of Chrome and Firefox.
3555
3556         Tests: http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html
3557                http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php
3558                http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html
3559
3560         * dom/Document.cpp:
3561         (WebCore::Document::initContentSecurityPolicy): For plugin documents that have an opener call ContentSecurityPolicy::createPolicyForPluginDocumentFrom()
3562         to only inherit the plugin-types and report-uri directives from its opener's CSP policy. Otherwise, call ContentSecurityPolicy::copyStateFrom()
3563         to inherit all directives from the owner frame as we do now.
3564         * page/csp/ContentSecurityPolicy.cpp:
3565         (WebCore::ContentSecurityPolicy::createPolicyForPluginDocumentFrom): Create a new policy from the specified policy
3566         inheriting only the plugin-types and report-uri directives.
3567         * page/csp/ContentSecurityPolicy.h: Define a new PolicyFrom enumerator, InheritedForPluginDocument, for plugin documents
3568         loaded in a child window.
3569         * page/csp/ContentSecurityPolicyDirectiveList.cpp:
3570         (WebCore::ContentSecurityPolicyDirectiveList::parse): When policyFrom is InheritedForPluginDocument then only
3571         recognize the plugin-types and report-uri directives when parsing the policy.
3572
3573 2018-07-24  Daniel Bates  <dabates@apple.com>
3574
3575         Rename Document::firstPartyForSameSiteCookies() to siteForCookies()
3576         https://bugs.webkit.org/show_bug.cgi?id=187892
3577
3578         Reviewed by Dean Jackson.
3579
3580         Standardize on the spec. language "site for cookies" for the names of the setter and getter
3581         on Document. The latest description of Same-Site cookies is in <https://httpwg.org/http-extensions/rfc6265bis.html>.
3582
3583         No functionality changed. So, no new tests.
3584
3585         * dom/Document.h:
3586         (WebCore::Document::siteForCookies const):
3587         (WebCore::Document::setSiteForCookies):
3588         (WebCore::Document::firstPartyForSameSiteCookies const): Deleted.
3589         (WebCore::Document::setFirstPartyForSameSiteCookies): Deleted.
3590         * loader/FrameLoader.cpp:
3591         (WebCore::FrameLoader::setFirstPartyForCookies):
3592         (WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded):
3593         * workers/service/context/ServiceWorkerThreadProxy.cpp:
3594         (WebCore::createPageForServiceWorker):
3595         * xml/XSLTProcessor.cpp:
3596         (WebCore::XSLTProcessor::createDocumentFromSource):
3597
3598 2018-07-24  Ross Kirsling  <ross.kirsling@sony.com>
3599
3600         WebCore::URL::hostIsIPAddress needs a Windows implementation
3601         https://bugs.webkit.org/show_bug.cgi?id=187859
3602
3603         Reviewed by Fujii Hironori.
3604
3605         * platform/URL.cpp:
3606         (WebCore::isIPv4Address): Added.
3607         (WebCore::isIPv6Address): Added.
3608         (WebCore::URL::hostIsIPAddress):
3609         Turn this stub into a platform-agnostic default implementation.
3610
3611 2018-07-24  Eric Carlson  <eric.carlson@apple.com>
3612
3613         [MediaStream] Restructure getDisplayMedia classes
3614         https://bugs.webkit.org/show_bug.cgi?id=187905
3615
3616         Reviewed by Dean Jackson.
3617
3618         No new tests, no functional changes.
3619
3620         * platform/mediastream/CaptureDeviceManager.h:
3621         (WebCore::CaptureDeviceManager::refreshCaptureDevices): Deleted, no need for it to be a 
3622         virtual method.
3623         * platform/mediastream/mac/AVCaptureDeviceManager.h:
3624
3625         * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: refreshCaptureDevices is
3626         no longer virtual.
3627
3628         * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
3629         (WebCore::DisplayCaptureManagerCocoa::captureDevices):
3630         (WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices): Moved functionality 
3631         to ScreenDisplayCaptureSourceMac.
3632         (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Ditto.
3633         (WebCore::displayReconfigurationCallBack): Deleted, moved to ScreenDisplayCaptureSourceMac.
3634         (WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Deleted.
3635         (WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Deleted.
3636         * platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
3637
3638         * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
3639         (WebCore::roundUpToMacroblockMultiple): Moved from ScreenDisplayCaptureSourceMac.
3640         (WebCore::DisplayCaptureSourceCocoa::applySize): Ditto.
3641         (WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Ditto.
3642         (WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Ditto.
3643         * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
3644
3645         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
3646         * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
3647         (WebCore::updateDisplayID):
3648         (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Fix log message.
3649         (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
3650         (WebCore::ScreenDisplayCaptureSourceMac::applySize): Update for base class changes.
3651         (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Ditto.
3652         (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
3653         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID): Moved from
3654         DisplayCaptureManagerCocoa.
3655         (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices): Ditto.
3656         (WebCore::roundUpToMacroblockMultiple): Moved to DisplayCaptureSourceCocoa.
3657         (WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID): Ditto.
3658         (WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer): Ditto.
3659         (WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface): Ditto.
3660
3661 2018-07-24  Zalan Bujtas  <zalan@apple.com>
3662
3663         [LFC] Move geometry data structures to a dedicated file
3664         https://bugs.webkit.org/show_bug.cgi?id=187939
3665
3666         Reviewed by Antti Koivisto.
3667
3668         * WebCore.xcodeproj/project.pbxproj:
3669         * layout/FormattingContext.h:
3670         (WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const): Deleted.
3671         * layout/FormattingContextGeometry.cpp:
3672         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
3673         (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
3674         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
3675         (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
3676         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
3677         (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
3678         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
3679         (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
3680         (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
3681         (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
3682         (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
3683         (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
3684         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
3685         (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
3686         (WebCore::Layout::FormattingContext::Geometry::computedBorder):
3687         (WebCore::Layout::FormattingContext::Geometry::computedPadding):
3688         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
3689         (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
3690         * layout/blockformatting/BlockFormattingContext.h:
3691         * layout/blockformatting/BlockFormattingContextGeometry.cpp:
3692         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
3693         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
3694         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
3695         (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
3696         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
3697         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
3698         (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
3699         * layout/displaytree/DisplayBox.h:
3700         (WebCore::Display::Box::setHorizontalMargin):
3701         (WebCore::Display::Box::setVerticalMargin):
3702         (WebCore::Display::Box::setVerticalNonCollapsedMargin):
3703         (WebCore::Display::Box::setBorder):
3704         (WebCore::Display::Box::setPadding):
3705
3706 2018-07-24  Thibault Saunier  <tsaunier@igalia.com>
3707
3708         [GStreamer] Implement bitrate modulation support in GStreamer based libwebrtc Encoders
3709         https://bugs.webkit.org/show_bug.cgi?id=187643
3710
3711         Reviewed by Philippe Normand.
3712
3713         Problem being that we do not have a proper unified encoder API in GStreamer, some work
3714         started at https://bugzilla.gnome.org/show_bug.cgi?id=796716 but it is quite controversial
3715         and meanwhile we should just move forward working around that limitation.
3716
3717         Source/WebCore:
3718         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
3719         (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
3720         (WebCore::GStreamerVideoEncoder::InitEncode):
3721         (WebCore::GStreamerVideoEncoder::getBitrateSetter):
3722         (WebCore::GStreamerVideoEncoder::createEncoder):
3723         (WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
3724         (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
3725         (WebCore::GStreamerVideoEncoder::CreateEncoder): Deleted.
3726
3727 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
3728
3729         REGRESSION(r234055): inverted return values in MediaPlayer::wouldTaintOrigin()
3730         https://bugs.webkit.org/show_bug.cgi?id=187944
3731
3732         Reviewed by Carlos Garcia Campos.
3733
3734         The MediaPlayer::wouldTaintOrigin(), as introduced in r234055, should
3735         return false when the URL protocol is `data:`, and should return true
3736         when the given SecurityOrigin cannot access the media URL.
3737
3738         This matches behavior of CanvasRenderingContext::wouldTaintOrigin()
3739         which the new method falls back to when the MediaPlayerPrivate
3740         implementation doesn't or can't determine the would-taint result.
3741
3742         This fixes a bunch of failing and timing-out WebGL test cases on ports
3743         using GStreamer (on which the MediaPlayerPrivate derivate doesn't
3744         implement the wouldTaintOrigin() method).
3745
3746         * platform/graphics/MediaPlayer.cpp:
3747         (WebCore::MediaPlayer::wouldTaintOrigin const):
3748
3749 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
3750
3751         [TextureMapper] Separate repaint counter state from debug visuals
3752         https://bugs.webkit.org/show_bug.cgi?id=187946
3753
3754         Reviewed by Carlos Garcia Campos.
3755
3756         Instead of managing the repaint counter visibility along with the
3757         debug border visuals, do that together with the repaint count value.
3758
3759         TextureMapperLayer::setRepaintCount() is renamed to setRepaintCounter()
3760         and now also sets the repaint counter visibility state instead of the
3761         setDebugVisuals() method.
3762
3763         GraphicsLayerTextureMapper implementation is adjusted appropriately.
3764         The unused setRepaintCount() method is also removed.
3765
3766         CoordinatedGraphicsLayerState now holds repaint counter state (both
3767         visibility and count value) in a struct that's separate from debug
3768         border state. CoordinatedGraphicsLayer implementation now updates
3769         that state accordingly.
3770
3771         No new tests -- no change in behavior.
3772
3773         * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
3774         (WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter):
3775         (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
3776         (WebCore::GraphicsLayerTextureMapper::setRepaintCount): Deleted.
3777         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3778         * platform/graphics/texmap/TextureMapperLayer.cpp:
3779         (WebCore::TextureMapperLayer::setDebugVisuals):
3780         (WebCore::TextureMapperLayer::setRepaintCounter):
3781         (WebCore::TextureMapperLayer::setRepaintCount): Deleted.
3782         * platform/graphics/texmap/TextureMapperLayer.h:
3783         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3784         (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
3785         (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
3786         (WebCore::CoordinatedGraphicsLayer::syncLayerState):
3787         * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
3788         (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
3789         (WebCore::DebugVisuals::DebugVisuals): Deleted.
3790
3791 2018-07-24  Thibault Saunier  <tsaunier@igalia.com>
3792
3793         [WPE][GTK] Implement PeerConnection API on top of libwebrtc
3794         https://bugs.webkit.org/show_bug.cgi?id=186932
3795
3796         Reviewed by Philippe Normand.
3797
3798         Enabled many webrtc tests.
3799
3800         * platform/GStreamer.cmake: Build new files
3801         * platform/graphics/gstreamer/GStreamerCommon.cpp: Fix minor style issues
3802         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Add a way to give precise name to pipelines
3803         and give useful names to pipelines with sources comming from a PeerConnection
3804         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
3805         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: Added. Implement a subclass of webrtc::VideoFrame
3806         to represent a kNative GStreamer video frame.
3807         * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: Added. Ditto.
3808         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: Handle incoming audio samples from libwebrtc.
3809         * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h: Ditto.
3810         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp: Handle incoming video frames from libwebrtc.
3811         * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h: Ditto.
3812         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: Handle passing locally captured audio sample to libwebrtc.
3813         * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: Ditto.
3814         * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: Handle passing locally captured vidoe frames to libwebrtc.
3815         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Added. Implement a video decoder factory and LibWebRTC Video decoders based on GStreamer.
3816         * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.h: Added. Ditto.
3817         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Added. Implement a video encoder factory and LibWebRTC H264/VP8 Video encoders based on GStreamer.
3818         * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Added. Ditto.
3819         * platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Add information about signness of the LibWebRTC audio format.
3820         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Add support for newly added Encoder/Decoder factories.
3821         * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Ditto.
3822
3823 2018-07-24  Dirk Schulze  <krit@webkit.org>
3824
3825         [css-masking] Black backdrop on -webkit-clip-path on SVG root
3826         https://bugs.webkit.org/show_bug.cgi?id=187880
3827
3828         Reviewed by Simon Fraser.
3829
3830         For SVG document root elements, we currently clip twice:
3831         In RenderLayer and SVGRenderSupport.
3832         Avoid clipping in RenderLayer which currently clips before we established a
3833         backdrop for an SVG document.
3834
3835         Tests: svg/clip-path/clip-path-on-svg-005-expected.svg
3836                svg/clip-path/clip-path-on-svg-005.svg
3837
3838         * rendering/RenderLayer.cpp:
3839         (WebCore::RenderLayer::setupClipPath): Skip actual clipping.
3840
3841 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
3842
3843         [Nicosia] Add TextureMapperAnimations member to CompositingLayer::LayerState
3844         https://bugs.webkit.org/show_bug.cgi?id=187941
3845
3846         Reviewed by Carlos Garcia Campos.
3847
3848         Nicosia::CompositingLayer::LayerState gains a TextureMapperAnimations
3849         member that will be assigned a list of all active animations during each
3850         layer flush. Despite the name, TextureMapperAnimations doesn't depend on
3851         any other TextureMapper class. It might be renamed and moved in the
3852         future, but for now it's used as-is.
3853
3854         In CoordinatedGraphicsLayer, the syncAnimations() method now flips on
3855         the animationsChanged flag in the LayerState::Delta struct. This causes
3856         all the active animations to be copied over into the layer state in
3857         flushCompositingStateForThisLayerOnly().
3858
3859         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
3860         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3861         (WebCore::CoordinatedGraphicsLayer::syncAnimations):
3862         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3863
3864 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
3865
3866         [Nicosia] Add FilterOperations member to CompositionLayer::LayerState
3867         https://bugs.webkit.org/show_bug.cgi?id=187901
3868
3869         Reviewed by Carlos Garcia Campos.
3870
3871         Nicosia::CompositionLayer::LayerState gains a FilterOperations member
3872         that can be assigned the list of filter operations for a given layer.
3873         The corresponding filtersChanged boolean is added to LayerState::Delta.
3874
3875         CoordinatedGraphicsLayer::syncFilters() flips on that delta member,
3876         which in turn causes the FilterOperations value to be updated during
3877         the layer flush, in flushCompositingStateForThisLayerOnly().
3878
3879         * platform/graphics/nicosia/NicosiaPlatformLayer.h:
3880         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3881         (WebCore::CoordinatedGraphicsLayer::syncFilters):
3882         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3883
3884 2018-07-24  Zan Dobersek  <zdobersek@igalia.com>
3885
3886         [CoordGraphics] Use adjusted position, anchor point, size values for Nicosia::CompositionLayer state
3887         https://bugs.webkit.org/show_bug.cgi?id=187899
3888
3889         Reviewed by Carlos Garcia Campos.
3890
3891         As is done for the CoordinatedGraphicsLayerState, the scale-adjusted
3892         position, anchor point and size values should be used when updating the
3893         corresponding Nicosia::CompositionLayer::LayerState members.
3894
3895         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
3896         (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
3897
3898 2018-07-23  Manuel Rego Casasnovas  <rego@igalia.com>
3899
3900         [css-grid] Add support for calc() in gutter properties
3901         https://bugs.webkit.org/show_bug.cgi?id=187902
3902
3903         Reviewed by Simon Fraser.
3904
3905         The parsing was already accepting calc() in grid row and column gaps,
3906         however the code was not taking that into account properly.
3907         If the calc() had a percentage it was ignored and that's wrong.
3908
3909         The fix is just a change in the ceck at RenderGrid::availableSpaceForGutters().
3910
3911         Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002-rtl.html
3912                imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002.html
3913                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-011.html
3914                imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-012.html
3915
3916         * rendering/RenderGrid.cpp:
3917         (WebCore::RenderGrid::availableSpaceForGutters const):
3918
3919 2018-07-23  Aditya Keerthi  <akeerthi@apple.com>
3920
3921         Remove extraneous #endif in html.css
3922         https://bugs.webkit.org/show_bug.cgi?id=187934
3923
3924         Reviewed by Tim Horton.
3925
3926         * css/html.css: Remove extraneous #endif.
3927
3928 2018-07-23  Sihui Liu  <sihui_liu@apple.com>
3929
3930         CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
3931         https://bugs.webkit.org/show_bug.cgi?id=187927
3932
3933         Reviewed by Chris Dumez.
3934
3935         IDBKeyData is valid only when each key of it is valid.
3936
3937         Test: LayoutTests/storage/indexeddb/index-multientry.html
3938
3939         * Modules/indexeddb/IDBKeyData.cpp:
3940         (WebCore::IDBKeyData::isValid const):
3941         * Modules/indexeddb/IDBKeyData.h:
3942         (WebCore::IDBKeyData::isValid const): Deleted.
3943
3944 2018-07-23  Ben Richards  <benton_richards@apple.com>
3945
3946         We should cache the compiled sandbox profile