1 2016-12-16 Ryan Haddad <ryanhaddad@apple.com>
3 Rebaseline bindings tests after r209897.
5 Unreviewed test gardening.
7 * bindings/scripts/test/JS/JSTestObj.cpp:
8 (WebCore::JSTestObj::visitChildren):
9 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
10 (WebCore::JSTestSerializedScriptValueInterface::visitChildren):
12 2016-12-15 Brent Fulgham <bfulgham@apple.com>
14 Arguments called in wrong order
15 https://bugs.webkit.org/show_bug.cgi?id=165923
17 Reviewed by Simon Fraser.
19 Correct the ordering of several function calls.
21 * Modules/mediasource/SourceBuffer.cpp:
22 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): The 'nearestToPresentationStartTime'
23 argument is being checked for validity, but 'nearestToPresentationEndTime' is being used in the
24 calculation. This seems like a copy/paste error.
25 * page/PrintContext.cpp:
26 (WebCore::PrintContext::outputLinkedDestinations): FloatPoint::expandedTo returns a new object that
27 has been expanded. This code continued using the 'unexpanded' point.
28 * platform/graphics/GraphicsContext3D.cpp:
29 (WebCore::GraphicsContext3D::computeImageSizeInBytes): The 'bytesPerComponent' and 'componentsPerPixel'
30 variables were being passed in the wrong order.
31 * platform/network/CacheValidation.cpp: The 'last-modified' header string was being concatenated with
32 the following string, resulting in an incorrect 'last-modifiedproxy-authenticate' string value.
33 * svg/SVGToOTFFontConversion.cpp:
34 (WebCore::SVGToOTFFontConverter::firstGlyph): The ASSERT was assigning to the (by-value) input
35 parameter 'codePoint', rather than comparing it to the firstGlyph value's codePoint.
37 2016-12-16 Youenn Fablet <youenn@apple.com>
39 [Fetch API] Improve resource loading console logging
40 https://bugs.webkit.org/show_bug.cgi?id=160546
42 Reviewed by Alex Christensen.
44 Covered by rebased tests.
46 Adding support for logging of resource loading failures in ThreadableLoader.
47 This will allow doing consistent logging for clients such as fetch, XHR, event source...
49 Doing logging for Fetch API only at the moment in ThreadableLoader.
50 Future patches should migrate XHR to this logging system.
52 Logging routine is implemented in ThreadableLoader.
53 It is used directly by DocumentThreadableLoader before calling didFail client callback.
54 DocumentThreadableLoader has a new option to not log errors, in the case the client is WorkerThreadableLoader::MainBridge.
55 In that case, the logging is done in the worker context within WorkerThreadableLoader::MainBridge::didFail
57 * loader/DocumentThreadableLoader.cpp:
58 (WebCore::DocumentThreadableLoader::loadResourceSynchronously): Enable logging.
59 (WebCore::DocumentThreadableLoader::create): Passing logging parameter to constructor.
60 (WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Adding initialization of logging parameter.
61 (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest): Making use of the new logErrorAndFail helper routine.
62 (WebCore::DocumentThreadableLoader::cancel): No need to log error if it is being cancelled.
63 (WebCore::DocumentThreadableLoader::redirectReceived): Made the reportXX routines methods of DocumentThreadableLoaders and using logErrorAndFail internally.
64 (WebCore::DocumentThreadableLoader::didFail): Wrapper around logErrorAndFail since cancel is not calling it anymore.
65 (WebCore::DocumentThreadableLoader::preflightFailure):
66 (WebCore::DocumentThreadableLoader::loadRequest):
67 (WebCore::DocumentThreadableLoader::reportRedirectionWithBadScheme):
68 (WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError):
69 (WebCore::DocumentThreadableLoader::reportCrossOriginResourceSharingError):
70 (WebCore::DocumentThreadableLoader::logErrorAndFail):
71 (WebCore::reportContentSecurityPolicyError): Deleted.
72 (WebCore::reportCrossOriginResourceSharingError): Deleted.
73 (WebCore::reportRedirectionWithBadScheme): Deleted.
74 * loader/DocumentThreadableLoader.h:
75 * loader/ThreadableLoader.cpp:
76 (WebCore::ThreadableLoader::logError):
77 * loader/ThreadableLoader.h:
78 * loader/ThreadableLoaderClientWrapper.h:
79 (WebCore::ThreadableLoaderClientWrapper::create):
80 (WebCore::ThreadableLoaderClientWrapper::initiator):
81 (WebCore::ThreadableLoaderClientWrapper::ThreadableLoaderClientWrapper):
82 * loader/WorkerThreadableLoader.cpp:
83 (WebCore::WorkerThreadableLoader::WorkerThreadableLoader):
84 (WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
85 (WebCore::WorkerThreadableLoader::MainThreadBridge::didFail):
87 2016-12-16 Enrique Ocaña González <eocanha@igalia.com>
89 [GStreamer][MSE] Fix build warning in MediaPlayerPrivateGStreamer.cpp using gcc 6.2
90 https://bugs.webkit.org/show_bug.cgi?id=165900
92 Reviewed by Žan Doberšek.
94 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
95 (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs):
96 Move the variable asignation out of the if condition.
98 2016-12-16 Romain Bellessort <romain.bellessort@crf.canon.fr>
100 [Readable Streams API] Implement ReadableByteStreamController cancel internal method
101 https://bugs.webkit.org/show_bug.cgi?id=165798
103 Reviewed by Youenn Fablet.
105 Implemented cancel method of ReadableByteStreamController.
106 Also fixed small inconsistency in readableByteStreamControllerClose.
108 Added one test to check cancel behaviour. More tests may be added as the API is implemented.
110 * Modules/streams/ReadableByteStreamInternals.js:
111 (privateInitializeReadableByteStreamController): Define cancel internal method.
112 (readableByteStreamControllerCancel): Added.
113 (readableByteStreamControllerClose): Fixed behaviour (no value should be dequeued).
114 * bindings/js/WebCoreBuiltinNames.h: Removed bytesFilled (previous addition was not needed).
116 2016-12-16 Youenn Fablet <youennf@gmail.com>
118 svg/as-image/svg-image-with-data-uri-use-data-uri.svg is flaky after r207754
119 https://bugs.webkit.org/show_bug.cgi?id=163887
120 <rdar://problem/29266436>
122 Reviewed by Alex Christensen.
124 Test: http/tests/security/cross-origin-cached-images-with-memory-pressure.html
126 With the introduction of cached resource cloning, an Image may be referenced by several CachedImage.
127 This did not work well with Image observer system as it mandates a one-to-one relationship.
129 Introducing CachedImageObserver to restore the one-to-one relationship between Image and its observer.
130 CachedImageObserver can keep references for more than one CachedImage.
132 In the future, it might be better to split more clearly CachedImageObserver and its API from CachedImage.
133 Or remove the concept of CachedResource cloning and find new ways to provide CachedResource origin information to clients.
135 * loader/cache/CachedImage.cpp:
136 (WebCore::CachedImage::load): Moved boolean image observer fields to CachedImageObserver.
137 (WebCore::CachedImage::setBodyDataFrom): Keeping a reference of the image observer when cloning the resource.
138 (WebCore::CachedImage::createImage): Creating the observer when creating the image.
139 (WebCore::CachedImage::CachedImageObserver::CachedImageObserver):
140 (WebCore::CachedImage::CachedImageObserver::decodedSizeChanged):
141 (WebCore::CachedImage::CachedImageObserver::didDraw):
142 (WebCore::CachedImage::CachedImageObserver::animationAdvanced):
143 (WebCore::CachedImage::CachedImageObserver::changedInRect):
144 (WebCore::CachedImage::clearImage):
145 * loader/cache/CachedImage.h:
146 * loader/cache/CachedResource.cpp:
147 (WebCore::CachedResource::setBodyDataFrom): Now that each cached image receives decodedSizeChanged callback, we need to set its size correctly.
149 2016-12-15 Joonghun Park <jh718.park@samsung.com>
151 [EFL] Fix debug build break since r209873. Unreviewed.
152 https://bugs.webkit.org/show_bug.cgi?id=165945
154 No new tests, no new behaviours.
156 Use Primitive System Data Type uint64_t instead of unsigned long long.
158 * Modules/indexeddb/IDBFactory.cpp:
159 (WebCore::IDBFactory::openInternal):
160 * Modules/indexeddb/IDBFactory.h:
162 2016-12-15 Zalan Bujtas <zalan@apple.com>
164 text-align: justify and word-spacing combine to overflow column
165 https://bugs.webkit.org/show_bug.cgi?id=165796
166 rdar://problem/29672168
168 Reviewed by Myles C. Maxfield.
170 The value of the word-spacing property is not applied on the inline-tree boxes (normal line layout)
171 with kerning enabled. It causes hittest failures and selection/rendering glitches.
172 We normally use the pre-computed 'WordMeasurements' values to figure out the run widths. However
173 with kerning on, in some cases we need to re-measure a certain part of the text by calling RenderText::width().
174 This function omits the word-spacing value for leading whitespace, so when this text fragment starts with a whitespace,
175 (while it's not at the beginning of the run) we have to manually add the word-spacing value back.
176 r146087 added this logic with the restriction of applying it only to whitespace-only runs.
178 Test: fast/css/word-spacing-with-normal-layout.html
180 * rendering/RenderBlockLineLayout.cpp:
181 (WebCore::setLogicalWidthForTextRun):
183 2016-12-15 Myles C. Maxfield <mmaxfield@apple.com>
185 Stop reinterpret_casting UBreakIterators to the undefined type TextBreakIterator
186 https://bugs.webkit.org/show_bug.cgi?id=165931
188 Reviewed by Alex Christensen.
190 No new tests because there is no behavior change.
192 * dom/CharacterData.cpp:
193 (WebCore::CharacterData::parserAppendData):
194 * editing/TextCheckingHelper.cpp:
195 (WebCore::findMisspellings):
196 * editing/VisibleUnits.cpp:
197 (WebCore::wordBreakIteratorForMinOffsetBoundary):
198 (WebCore::wordBreakIteratorForMaxOffsetBoundary):
199 (WebCore::isLogicalStartOfWord):
200 (WebCore::islogicalEndOfWord):
201 (WebCore::visualWordPosition):
202 (WebCore::startSentenceBoundary):
203 (WebCore::endSentenceBoundary):
204 (WebCore::previousSentencePositionBoundary):
205 (WebCore::nextSentencePositionBoundary):
206 * html/HTMLInputElement.cpp:
207 * html/HTMLTextAreaElement.cpp:
208 * html/InputType.cpp:
209 * html/TextFieldInputType.cpp:
210 * html/TextInputType.cpp:
211 * platform/graphics/StringTruncator.cpp:
212 (WebCore::textBreakAtOrPreceding):
213 (WebCore::boundedTextBreakFollowing):
214 (WebCore::rightClipToWordBuffer):
215 * platform/graphics/mac/ComplexTextController.cpp:
216 (WebCore::ComplexTextController::offsetForPosition):
217 * platform/text/TextBoundaries.cpp:
218 (WebCore::findNextWordFromIndex):
219 (WebCore::findWordBoundary):
220 (WebCore::findEndWordBoundary):
221 * platform/text/mac/TextBoundaries.mm:
222 (WebCore::findNextWordFromIndex):
223 * rendering/BreakLines.h:
224 (WebCore::nextBreakablePositionNonLoosely):
225 (WebCore::nextBreakablePositionLoosely):
226 * rendering/RenderBlock.cpp:
227 * rendering/RenderText.cpp:
228 (WebCore::makeCapitalized):
229 (WebCore::RenderText::previousOffset):
230 (WebCore::RenderText::previousOffsetForBackwardDeletion):
231 (WebCore::RenderText::nextOffset):
232 * rendering/SimpleLineLayoutTextFragmentIterator.h:
233 * rendering/line/LineBreaker.h:
235 2016-12-15 Darin Adler <darin@apple.com>
237 Use asString instead of toWTFString, toString, or getString when we already checked isString
238 https://bugs.webkit.org/show_bug.cgi?id=165895
240 Reviewed by Yusuke Suzuki.
242 * Modules/fetch/FetchBody.cpp:
243 (WebCore::FetchBody::extract): Use asString/value instead of toWTFString.
245 * Modules/mediastream/SDPProcessor.cpp:
246 (WebCore::SDPProcessor::callScript): Use asString/value instead of getString.
248 * bindings/js/ArrayValue.cpp:
249 (WebCore::ArrayValue::get): Use asString/value instead of toWTFString.
251 * bindings/js/IDBBindingUtilities.cpp:
252 (WebCore::get): Use asString/length instead of toString/length.
253 (WebCore::createIDBKeyFromValue): Use asString/value instead of toWTFString.
254 * bindings/js/JSCryptoAlgorithmDictionary.cpp:
255 (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier): Ditto.
256 * bindings/js/JSDataCueCustom.cpp:
257 (WebCore::constructJSDataCue): Use asString/value instead of getString.
258 * bindings/js/JSInspectorFrontendHostCustom.cpp:
259 (WebCore::populateContextMenuItems): Use asString/value instead of toWTFString.
261 * bindings/js/ScriptController.cpp:
262 (WebCore::jsValueToModuleKey): Use asString/toIdentifier instead of
263 jsCast<JSString*>/value/Identifier::fromString.
265 * bindings/js/SerializedScriptValue.cpp:
266 (WebCore::CloneSerializer::dumpIfTerminal): Streamline by getting rid of local variable.
268 * contentextensions/ContentExtensionParser.cpp:
269 (WebCore::ContentExtensions::getDomainList): Use asString instead of jsCast<JSString*>.
270 (WebCore::ContentExtensions::loadTrigger): Use asString/value instead of toWTFString.
271 (WebCore::ContentExtensions::loadAction): Ditto.
274 (WebCore::FontFace::create): Use asString/value instead of getString.
276 2016-12-15 Zalan Bujtas <zalan@apple.com>
278 Change ::computeLogicalHeight's computedValues out argument to the return value.
279 https://bugs.webkit.org/show_bug.cgi?id=165789
281 Reviewed by Simon Fraser.
283 No change in functionality.
285 * html/shadow/SliderThumbElement.cpp:
286 (WebCore::RenderSliderContainer::computeLogicalHeight):
287 * html/shadow/mac/ImageControlsButtonElementMac.cpp:
288 (WebCore::RenderImageControlsButton::computeLogicalHeight):
289 * html/shadow/mac/ImageControlsRootElementMac.cpp:
290 (WebCore::RenderImageControls::computeLogicalHeight):
291 * rendering/RenderBlock.cpp:
292 (WebCore::RenderBlock::computeBlockPreferredLogicalWidths):
293 (WebCore::RenderBlock::estimateRegionRangeForBoxChild):
294 * rendering/RenderBlockFlow.cpp:
295 (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
296 * rendering/RenderBox.cpp:
297 (WebCore::RenderBox::updateLogicalHeight):
298 (WebCore::RenderBox::computeLogicalHeight):
299 (WebCore::RenderBox::computePercentageLogicalHeight):
300 (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
301 (WebCore::RenderBox::availableLogicalHeightUsing):
302 * rendering/RenderBox.h:
303 (WebCore::RenderBox::ComputedMarginValues::ComputedMarginValues): Deleted.
304 (WebCore::RenderBox::LogicalExtentComputedValues::LogicalExtentComputedValues): Deleted.
305 * rendering/RenderFlexibleBox.cpp:
306 (WebCore::RenderFlexibleBox::mainAxisContentExtent):
307 * rendering/RenderFlowThread.cpp:
308 (WebCore::RenderFlowThread::computeLogicalHeight):
309 * rendering/RenderFlowThread.h:
310 * rendering/RenderListBox.cpp:
311 (WebCore::RenderListBox::computeLogicalHeight):
312 * rendering/RenderListBox.h:
313 * rendering/RenderMeter.cpp:
314 (WebCore::RenderMeter::computeLogicalHeight):
315 * rendering/RenderMeter.h:
316 * rendering/RenderMultiColumnFlowThread.cpp:
317 (WebCore::RenderMultiColumnFlowThread::computeLogicalHeight):
318 * rendering/RenderMultiColumnFlowThread.h:
319 * rendering/RenderMultiColumnSet.cpp:
320 (WebCore::RenderMultiColumnSet::computeLogicalHeight):
321 * rendering/RenderMultiColumnSet.h:
322 * rendering/RenderProgress.cpp:
323 (WebCore::RenderProgress::computeLogicalHeight):
324 * rendering/RenderProgress.h:
325 * rendering/RenderTextControl.cpp:
326 (WebCore::RenderTextControl::computeLogicalHeight):
327 * rendering/RenderTextControl.h:
328 * rendering/RenderView.cpp:
329 (WebCore::RenderView::computeLogicalHeight):
330 * rendering/RenderView.h:
331 * rendering/svg/RenderSVGForeignObject.cpp:
332 (WebCore::RenderSVGForeignObject::computeLogicalHeight):
333 * rendering/svg/RenderSVGForeignObject.h:
335 2016-12-15 Chris Dumez <cdumez@apple.com>
337 Make sure HTML validation bubble's state is updated after layout
338 https://bugs.webkit.org/show_bug.cgi?id=165922
339 <rdar://problem/29694730>
341 Reviewed by Simon Fraser.
343 Make sure HTML validation bubble's state is updated after layout.
344 In particular, if the validation bubble's associated element has
345 moved or is no longer visible, we now hide the bubble.
347 Tests: fast/forms/validation-bubble-disappears-when-input-detached.html
348 fast/forms/validation-bubble-disappears-when-input-moved.html
349 fast/forms/validation-bubble-disappears-when-input-no-longer-visible.html
351 * page/FrameView.cpp:
352 (WebCore::FrameView::viewportContentsChanged):
354 (WebCore::Page::updateValidationBubbleStateIfNeeded):
356 * page/ValidationMessageClient.h:
358 2016-12-15 Sam Weinig <sam@webkit.org>
360 [WebIDL] Remove use of Dictionary from JSCryptoAlgorithmDictionary
361 https://bugs.webkit.org/show_bug.cgi?id=165919
363 Reviewed by Darin Adler.
365 * bindings/js/JSCryptoAlgorithmDictionary.cpp:
366 * bindings/js/JSCryptoAlgorithmDictionary.h:
367 * bindings/js/JSCryptoOperationData.cpp:
368 * bindings/js/JSCryptoOperationData.h:
369 * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
370 Replace simplistic use of Dictionary with simplistic use of direct JSObject
371 functions. Also, pass the ExecState by reference.
373 2016-12-15 Filip Pizlo <fpizlo@apple.com>
375 Get rid of HeapRootVisitor and make SlotVisitor less painful to use
376 https://bugs.webkit.org/show_bug.cgi?id=165911
378 Reviewed by Geoffrey Garen.
380 No new tests because no new behavior.
382 This updates WebCore code to new JSC API.
384 * bindings/js/JSDOMBinding.cpp:
385 (WebCore::DOMConstructorJSBuiltinObject::visitChildren):
386 * bindings/js/JSDOMGlobalObject.cpp:
387 (WebCore::JSDOMGlobalObject::visitChildren):
388 * bindings/js/JSDOMPromise.h:
389 (WebCore::DeferredPromise::visitAggregate):
390 * bindings/js/JSEventListener.cpp:
391 (WebCore::JSEventListener::visitJSFunction):
392 * bindings/js/JSWorkerGlobalScopeBase.cpp:
393 (WebCore::JSWorkerGlobalScopeBase::visitChildren):
394 * bindings/scripts/CodeGeneratorJS.pm:
395 (GenerateImplementation):
397 2016-12-15 Myles C. Maxfield <mmaxfield@apple.com>
399 Sort Xcode project files
400 https://bugs.webkit.org/show_bug.cgi?id=165937
402 Reviewed by Simon Fraser.
404 No new tests because there is no behavior change.
406 * WebCore.xcodeproj/project.pbxproj:
408 2016-12-15 Chris Dumez <cdumez@apple.com>
410 Move charCode / keyCode / which attributes from UIEvent to KeyboardEvent
411 https://bugs.webkit.org/show_bug.cgi?id=165904
413 Reviewed by Sam Weinig.
415 Move 'charCode' / 'keyCode' attributes from UIEvent to KeyboardEvent and add
416 'which' to KeyboardEvent to match the specification:
417 - https://w3c.github.io/uievents/#legacy-interface-KeyboardEvent
419 We keep a 'which' attribute on UIEvent even though the specification does
420 not say we should because Firefox and Chrome have 'which' on UIEvent still.
423 - 'charCode' / 'keyCode' / 'which' on KeyboardEvent only
426 - 'charCode' / 'keyCode' on KeyboardEvent only
427 - 'which' on UIEvent only
430 - 'charCode' / 'keyCode' / 'which' on KeyboardEvent
431 - 'which' on UIEvent as well
434 - 'charCode' / 'keyCode' / 'which' on UIEvent only
437 - 'charCode' / 'keyCode' / 'which' on KeyboardEvent
438 - 'which' on UIEvent as well
440 Our new behavior is identical to Chrome, much closer to the specification,
441 and closer to Firefox as well.
443 No new tests, updated / rebaselined existing tests.
445 * dom/KeyboardEvent.cpp:
446 (WebCore::KeyboardEvent::KeyboardEvent):
447 (WebCore::KeyboardEvent::keyCode):
448 (WebCore::KeyboardEvent::charCode):
449 (WebCore::KeyboardEvent::which):
450 * dom/KeyboardEvent.h:
451 * dom/KeyboardEvent.idl:
452 * dom/MouseEvent.cpp:
453 (WebCore::MouseEvent::which):
458 2016-12-15 Brady Eidson <beidson@apple.com>
460 IndexedDB: Add an "IDBCursorRecord" struct.
461 https://bugs.webkit.org/show_bug.cgi?id=165929
463 Reviewed by Alex Christensen.
465 No new tests (Refactor, no behavior change).
467 * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
468 (WebCore::IDBServer::SQLiteIDBCursor::currentData):
469 (WebCore::IDBServer::SQLiteIDBCursor::resetAndRebindStatement):
470 (WebCore::IDBServer::SQLiteIDBCursor::advanceUnique):
471 (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
472 (WebCore::IDBServer::SQLiteIDBCursor::iterate):
474 * Modules/indexeddb/server/SQLiteIDBCursor.h:
475 (WebCore::IDBServer::SQLiteIDBCursor::currentKey):
476 (WebCore::IDBServer::SQLiteIDBCursor::currentPrimaryKey):
477 (WebCore::IDBServer::SQLiteIDBCursor::currentValue):
479 * Modules/indexeddb/shared/IDBCursorRecord.h: Added.
480 (WebCore::IDBCursorRecord::encode):
481 (WebCore::IDBCursorRecord::decode):
483 * WebCore.xcodeproj/project.pbxproj:
485 2016-12-15 Keith Rollin <krollin@apple.com>
487 Refactor Document::suspend/resume
488 https://bugs.webkit.org/show_bug.cgi?id=165921
490 Reviewed by Chris Dumez.
492 Update Document::suspend to call Document::suspendScheduledTasks
493 rather than duplicating the latter's code within itself. Similar
494 treatment of Document::resume and Document::resumeScheduledTasks.
496 No new tests -- no new functionality, just refactoring existing code.
499 (WebCore::Document::suspend):
500 (WebCore::Document::resume):
502 2016-12-15 Alex Christensen <achristensen@webkit.org>
504 Remove flex and bison build dependencies; commit generated XPath parser
505 https://bugs.webkit.org/show_bug.cgi?id=165783
507 Reviewed by Brent Fulgham.
509 flex and bison are annoying to install and use, especially on Windows.
510 Since only XPathGrammar uses them and that's not actively developed, let's just check in the one generated file
511 and make building WebKit easier forever!
514 * DerivedSources.make:
515 * WebCore.xcodeproj/project.pbxproj:
516 * css/makegrammar.pl: Removed.
517 * xml/XPathGrammar.cpp: Added.
521 * xml/XPathGrammar.h: Added.
522 * xml/XPathGrammar.y: Rename TEXT to TEXT_ to fix a build error on Windows. TEXT is already defined.
524 2016-12-15 Brady Eidson <beidson@apple.com>
526 Enhance some of the logging statements just added for IndexedDB Operation scheduling.
528 Rubberstamped by Tim Horton.
530 No new tests (No behavior change).
532 * Modules/indexeddb/IDBTransaction.cpp:
533 (WebCore::IDBTransaction::iterateCursor):
534 (WebCore::IDBTransaction::requestGetRecord):
535 (WebCore::IDBTransaction::requestIndexRecord):
536 (WebCore::IDBTransaction::requestPutOrAdd):
538 * Modules/indexeddb/shared/IDBCursorInfo.cpp:
539 (WebCore::IDBCursorInfo::loggingString):
541 * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
542 (WebCore::IDBIterateCursorData::loggingString):
544 2016-12-15 Myles C. Maxfield <mmaxfield@apple.com>
546 [Cocoa] Implement font-synthesis: small-caps
547 https://bugs.webkit.org/show_bug.cgi?id=165892
549 Reviewed by David Hyatt.
551 The CSS Fonts level 4 spec adds a new value to the "font-synthesis"
552 property which controls whether or not small-caps is allowed to be
553 synthesized. Luckily, we already have an implementation of this
554 straightforward, so the implementation is quite simple.
556 Tests: css3/font-synthesis-small-caps.html
557 fast/text/font-synthesis-parsing.html
559 * css/CSSComputedStyleDeclaration.cpp:
560 (WebCore::fontSynthesisFromStyle):
561 * css/StyleBuilderConverter.h:
562 (WebCore::StyleBuilderConverter::convertFontSynthesis):
563 * css/parser/CSSPropertyParser.cpp:
564 (WebCore::consumeFontSynthesis):
565 * platform/graphics/FontCache.h:
566 (WebCore::FontDescriptionKey::makeFlagsKey):
567 * platform/graphics/FontDescription.cpp:
568 (WebCore::FontDescription::FontDescription):
569 * platform/graphics/FontDescription.h:
570 (WebCore::FontCascadeDescription::initialFontSynthesis):
571 * platform/graphics/mac/ComplexTextController.cpp:
572 (WebCore::shouldSynthesize):
573 (WebCore::ComplexTextController::collectComplexTextRuns):
575 2016-12-15 Brady Eidson <beidson@apple.com>
577 Add a new Logging Channel for IndexedDB Operation scheduling.
578 https://bugs.webkit.org/show_bug.cgi?id=165912
580 Reviewed by Alex Christensen.
582 No new tests (No behavior change).
584 * Modules/indexeddb/IDBDatabase.cpp:
585 (WebCore::IDBDatabase::transaction):
587 * Modules/indexeddb/IDBFactory.cpp:
588 (WebCore::IDBFactory::openInternal):
589 (WebCore::IDBFactory::deleteDatabase):
591 * Modules/indexeddb/IDBTransaction.cpp:
592 (WebCore::IDBTransaction::internalAbort):
593 (WebCore::IDBTransaction::commit):
594 (WebCore::IDBTransaction::createObjectStore):
595 (WebCore::IDBTransaction::renameObjectStore):
596 (WebCore::IDBTransaction::createIndex):
597 (WebCore::IDBTransaction::renameIndex):
598 (WebCore::IDBTransaction::doRequestOpenCursor):
599 (WebCore::IDBTransaction::iterateCursor):
600 (WebCore::IDBTransaction::requestGetAllObjectStoreRecords):
601 (WebCore::IDBTransaction::requestGetAllIndexRecords):
602 (WebCore::IDBTransaction::requestGetRecord):
603 (WebCore::IDBTransaction::requestIndexRecord):
604 (WebCore::IDBTransaction::requestCount):
605 (WebCore::IDBTransaction::requestDeleteRecord):
606 (WebCore::IDBTransaction::requestClearObjectStore):
607 (WebCore::IDBTransaction::requestPutOrAdd):
608 (WebCore::IDBTransaction::deleteObjectStore):
609 (WebCore::IDBTransaction::deleteIndex):
611 * Modules/indexeddb/shared/IDBCursorInfo.cpp:
612 (WebCore::IDBCursorInfo::loggingString):
613 * Modules/indexeddb/shared/IDBCursorInfo.h:
615 * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
616 (WebCore::IDBGetAllRecordsData::loggingString):
617 * Modules/indexeddb/shared/IDBGetAllRecordsData.h:
619 * Modules/indexeddb/shared/IDBGetRecordData.cpp:
620 (WebCore::IDBGetRecordData::loggingString):
621 * Modules/indexeddb/shared/IDBGetRecordData.h:
623 * Modules/indexeddb/shared/IDBIndexInfo.cpp:
624 (WebCore::IDBIndexInfo::condensedLoggingString):
625 * Modules/indexeddb/shared/IDBIndexInfo.h:
627 * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
628 (WebCore::IDBIterateCursorData::loggingString):
629 * Modules/indexeddb/shared/IDBIterateCursorData.h:
631 * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
632 (WebCore::IDBObjectStoreInfo::condensedLoggingString):
633 * Modules/indexeddb/shared/IDBObjectStoreInfo.h:
635 * platform/Logging.h:
637 2016-12-15 Konstantin Tokarev <annulen@yandex.ru>
639 Added missing override and final specifiers
640 https://bugs.webkit.org/show_bug.cgi?id=165903
642 Reviewed by Darin Adler.
646 * Modules/mediastream/OverconstrainedErrorEvent.h:
647 * bindings/js/JSCallbackData.h:
648 * bindings/js/JSCustomXPathNSResolver.h:
649 * bindings/js/JSErrorHandler.h:
650 * css/StyleRuleImport.h:
651 * dom/SecurityPolicyViolationEvent.h:
652 * editing/CreateLinkCommand.h:
653 * editing/DeleteSelectionCommand.h:
654 * editing/DictationCommand.h:
655 * editing/Editor.cpp:
656 * editing/FormatBlockCommand.h:
657 * editing/IndentOutdentCommand.h:
658 * editing/InsertLineBreakCommand.h:
659 * editing/InsertParagraphSeparatorCommand.h:
660 * editing/ModifySelectionListLevel.h:
661 * editing/MoveSelectionCommand.h:
662 * editing/RemoveFormatCommand.h:
663 * editing/RemoveNodePreservingChildrenCommand.h:
664 * editing/ReplaceSelectionCommand.h:
665 * editing/SimplifyMarkupCommand.h:
666 * editing/SplitTextNodeContainingElementCommand.h:
667 * editing/UnlinkCommand.h:
668 * fileapi/FileReaderLoader.h:
669 * html/canvas/ANGLEInstancedArrays.h:
670 * html/canvas/WebGLVertexArrayObjectBase.h:
671 * loader/SinkDocument.h:
672 * loader/archive/mhtml/MHTMLArchive.h:
673 * page/animation/CSSPropertyAnimation.cpp:
674 * platform/audio/MultiChannelResampler.cpp:
675 * platform/audio/SincResampler.cpp:
676 * platform/audio/gstreamer/AudioDestinationGStreamer.h:
677 * platform/audio/gstreamer/AudioSourceProviderGStreamer.h:
678 * platform/graphics/TextTrackRepresentation.cpp:
679 * platform/graphics/displaylists/DisplayListItems.h:
680 * platform/graphics/filters/FEBlend.h:
681 * platform/graphics/filters/FEColorMatrix.h:
682 * platform/graphics/filters/FEComponentTransfer.h:
683 * platform/graphics/filters/FEConvolveMatrix.h:
684 * platform/graphics/filters/FEDiffuseLighting.h:
685 * platform/graphics/filters/FEDropShadow.h:
686 * platform/graphics/filters/FEGaussianBlur.h:
687 * platform/graphics/filters/FELighting.h:
688 * platform/graphics/filters/FEMerge.h:
689 * platform/graphics/filters/FEMorphology.h:
690 * platform/graphics/filters/FEOffset.h:
691 * platform/graphics/filters/FESpecularLighting.h:
692 * platform/graphics/filters/FETile.h:
693 * platform/graphics/filters/FETurbulence.h:
694 * platform/graphics/filters/SourceAlpha.h:
695 * platform/graphics/filters/SourceGraphic.h:
696 * platform/graphics/opengl/Extensions3DOpenGL.h:
697 * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
698 * platform/graphics/texmap/TextureMapperBackingStore.h:
699 * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
700 * platform/mock/GeolocationClientMock.h:
701 * platform/text/TextCodecICU.h:
702 * platform/text/TextCodecLatin1.h:
703 * platform/text/TextCodecUTF16.h:
704 * platform/text/TextCodecUTF8.h:
705 * platform/text/TextCodecUserDefined.h:
706 * rendering/RenderFullScreen.cpp:
707 * storage/StorageEvent.h:
708 * svg/properties/SVGListProperty.h:
709 * svg/properties/SVGStaticListPropertyTearOff.h:
710 * svg/properties/SVGStaticPropertyTearOff.h:
711 * xml/NativeXPathNSResolver.h:
712 * xml/XMLHttpRequestProgressEvent.h:
713 * xml/XMLHttpRequestProgressEventThrottle.h:
714 * xml/XPathVariableReference.h:
715 * xml/XSLImportRule.h:
717 2016-12-15 Chris Dumez <cdumez@apple.com>
719 Inline Document::existingAXObjectCache()
720 https://bugs.webkit.org/show_bug.cgi?id=165906
722 Reviewed by Darin Adler.
724 Inline Document::existingAXObjectCache() to avoid paying function call
725 cost in the common case where AX is disabled.
728 (WebCore::Document::existingAXObjectCacheSlow):
729 (WebCore::Document::existingAXObjectCache): Deleted.
731 (WebCore::Document::existingAXObjectCache):
733 2016-12-15 Ryan Haddad <ryanhaddad@apple.com>
735 Rebaseline bindings tests after r209864.
737 Unreviewed test gardening.
739 * bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
740 (WebCore::convertDictionary<DictionaryImplName>):
742 2016-12-15 Andreas Kling <akling@apple.com>
744 Always clear RenderLayer backing stores when going into page cache.
745 <https://webkit.org/b/165901>
747 Reviewed by Simon Fraser.
749 We were already doing this for the iOS and GTK+ ports, let's do it everywhere
750 for consistency, and a bit of memory usage improvement.
752 This patch just removes the setting and always calls FrameView::clearBackingStores()
753 when there is composited content going into page cache.
755 * history/CachedFrame.cpp:
756 (WebCore::CachedFrame::CachedFrame):
757 * history/PageCache.h:
758 (WebCore::PageCache::shouldClearBackingStores): Deleted.
759 (WebCore::PageCache::setShouldClearBackingStores): Deleted.
761 2016-12-15 Darin Adler <darin@apple.com>
763 Remove custom binding for MediaDevices
764 https://bugs.webkit.org/show_bug.cgi?id=165894
766 Reviewed by Eric Carlson.
768 Removes the explicit code to parse the MediaStreamConstraints and
769 MediaTrackConstraints. Next step could be to change the internal
770 code to use the structs from bindings directly so we don't need
771 code to convert to an internal format.
773 * CMakeLists.txt: Added MediaTrackConstraints.idl and MediaTrackConstraints.cpp,
774 removed JSMediaDevicesCustom.cpp.
776 * DerivedSources.make: Added MediaTrackConstraints.idl.
777 Also sorted list of IDL files and fixed use of tabs.
779 * Modules/mediastream/MediaDevices.cpp:
780 (WebCore::createMediaConstraintsImpl): Added.
781 (WebCore::MediaDevices::getUserMedia): Changed this function to take arguments that
782 are generated by the bindings script, and call createMediaConstraintsImpl to convert
783 into the internal data structure.
784 * Modules/mediastream/MediaDevices.h: Added StreamConstraints struct and changed
785 getUserMedia to take that as specified in the IDL.
786 * Modules/mediastream/MediaDevices.idl: Added definition of the MediaStreamConstraints
787 dictionary. Removed [Custom] from getUserMedia.
789 * Modules/mediastream/MediaStream.cpp:
790 (WebCore::MediaStream::MediaStream): Pass a reference to addObserver.
791 (WebCore::MediaStream::~MediaStream): Pass a rference to removeObserver.
792 (WebCore::MediaStream::internalAddTrack): Ditto.
793 (WebCore::MediaStream::internalRemoveTrack): Ditto.
795 * Modules/mediastream/MediaStreamTrack.cpp:
796 (WebCore::createMediaConstraintsImpl): Added.
797 (WebCore::MediaStreamTrack::applyConstraints): Changed to take an optional
798 MediaTrackConstraints argument and call createMediaConstraintsImpl to convert
799 into the internal data structure. Also merged the multiple overloads of this
800 all into a single function, used auto to make the code easier to read, and
801 moved the code that stores new constrains into the success handling, since the
802 specification says that's the only case where we should store it.
803 (WebCore::MediaStreamTrack::addObserver): Take a reference instead of a pointer.
804 (WebCore::MediaStreamTrack::removeObserver): Ditto.
805 * Modules/mediastream/MediaStreamTrack.h: Removed many unneeded includes.
806 Changed getConstraints to return const MediaTrackConstraints&, applyConstraints
807 to take an optional MediaTrackConstraints, add/removeObserver to take a reference
808 rather than a pointer, and changed m_constraints to be a MediaTrackConstraints
809 instead of a RefPtr<MediaConstraints>.
810 * Modules/mediastream/MediaStreamTrack.idl: Removed [Custom] from getConstraints
811 and applyConstraints.
813 * Modules/mediastream/MediaTrackConstraints.cpp: Added.
814 (WebCore::set): Overloaded function to set constriaints in a
815 MediaTrackConstraintSetMap.
816 (WebCore::convertToInternalForm): Helper function that takes a
817 MediaTrackConstraintSet and turns it into a MediaTrackConstraintSetMap.
818 (WebCore::convertAdvancedToInternalForm): More of the same, but for vectors.
819 (WebCore::createMediaConstraintsImpl): Top level function. Calls the other
820 functions and then MediaConstraintsImpl::create.
821 * Modules/mediastream/MediaTrackConstraints.h: Added. Contains all the structures
822 and type definitions for the dictionaries defined in the IDL file, and also the
823 createMediaConstraintsImpl function declaration.
824 * Modules/mediastream/MediaTrackConstraints.idl: Added. Contains the
825 MediaTrackConstraints and all the other dictionaries and typedefs that are needed
826 to define that dictionary.
827 * Modules/mediastream/UserMediaRequest.cpp:
828 (WebCore::UserMediaRequest::start): Changed to not depend on MediaDevices::Promise.
829 (WebCore::UserMediaRequest::UserMediaRequest): Ditto.
830 (WebCore::isSecure): Rearranged to be easier to understand.
831 (WebCore::UserMediaRequest::start): Removed a local variable for simplicity.
832 (WebCore::UserMediaRequest::document): Removed a redundant null check.
833 * Modules/mediastream/UserMediaRequest.h: Reduced includes, changed to not depend
834 on MediaDevices::Promise, removing the reason to include MediaDevices.h.
836 * WebCore.xcodeproj/project.pbxproj: Updated to remove old files and add new ones.
838 * bindings/js/JSBindingsAllInOne.cpp: Removed JSMediaDevicesCustom.cpp.
840 * bindings/js/JSMediaDevicesCustom.cpp: Removed.
841 * bindings/js/JSMediaDevicesCustom.h: Removed.
843 * bindings/js/JSMediaStreamTrackCustom.cpp:
844 (WebCore::JSMediaStreamTrack::applyConstraints): Deleted.
845 (WebCore::JSMediaStreamTrack::getConstraints): Deleted.
847 * bindings/scripts/CodeGenerator.pm:
848 (ProcessDocument): Updated to allow multiple standalone dictionaries, as long as
849 the name of one of the dictionaries matches the name of the file.
851 * bindings/scripts/CodeGeneratorJS.pm:
852 (GenerateDictionary): Added "other dictionaries" argument so we can support
853 files with multiple dictionaries in them.
854 (GenerateDictionariesHeaderContent): Completed support for dictionaries that
855 are not named after a top level interface by added one more check for a missing
856 $interface in a place that otherwise would not handle it correctly.
857 (GenerateImplementation): Removed code that set $currentCachedAttribute and
858 $cacheIndex, since no was reading the value of either any longer.
859 (GenerateDictionaryHeader): Added "other dictionaries".
860 (GenerateDictionaryImplementation): Ditto.
861 (WriteData): Removed unnnecessarily indirect code that was using FileNamePrefix
862 and a local variable named $prefix instead of just writing "JS".
864 * bindings/scripts/generate-bindings.pl: Corrected the use of the fileparse
865 function from the Path::Basename module; after reading the documentation for
866 this it is clear that there is no need to first call basename, and fileparse
867 should also be used instead of basename.
869 * platform/mediastream/MediaConstraints.h: Removed unneeded includes.
870 (WebCore::StringConstraint::appendExact): Removed an incorrect use of clear
871 here that would mess up cases where there is supposed to be more than one
874 * platform/mediastream/MediaStreamTrackPrivate.cpp: Remvoed unneeded includes.
875 (WebCore::MediaStreamTrackPrivate::clone): Removed code to copy m_constraints.
876 (WebCore::MediaStreamTrackPrivate::constraints): Deleted.
877 * platform/mediastream/MediaStreamTrackPrivate.h: Removed the constraints
878 function member and the m_constraints data member.
880 2016-12-15 Dave Hyatt <hyatt@apple.com>
882 [CSS Parser] Enable CSS Deferred Parsing
883 https://bugs.webkit.org/show_bug.cgi?id=165869
885 Reviewed by Sam Weinig.
887 Enable CSS deferred parsing once again. It's now behind a pref,
888 so it's easy to flip off and on.
890 To address the memory regression that caused the previous rollout,
891 the tokenizer is no longer retained. Instead the sheet text and escaped
892 strings are retained by CSSDeferredParser, and then DeferredStyleProperties
893 and DeferredStyleGroupRuleList make copies of the tokens from the original
894 tokenization process. As the rules get parsed, these tokens get thrown
897 This means that instead of the entire set of tokens staying in memory
898 as long as even one unparsed rule remained, now only the tokens that
899 still need parsing will remain alive.
901 Unparsed rules will consume slightly more memory than parsed rules, but
902 the more unparsed rules you have, the bigger the performance win as
903 well, so this is a tradeoff. Given that the parsing speed is going up
904 by anywhere from 25-40% on cold loads of pages (where all stylesheets
905 have to parse), this seems worth it to me.
907 * css/parser/CSSParserMode.h:
910 2016-12-15 Alejandro G. Castro <alex@igalia.com>
912 [OWR] Unskip fast/mediastream/MediaStream-video-element-track-stop.html
913 https://bugs.webkit.org/show_bug.cgi?id=165316
915 Reviewed by Philippe Normand.
917 Fixed the ended support of the video element in the OWR player and
918 fixed the videoTracks support. Now the OW player properly adds and
919 removes the audio and video tracks. Added the getSettings support
920 to the mediastream interface. Solved also the size handling in
921 some of the enable/muted situations.
923 Unskipping fast/mediastream/MediaStream-video-element-track-stop.html.
925 * platform/GStreamer.cmake: Added the new
926 RealtimeMediaSourceOwr.cpp with the new code handling the
928 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.cpp:
929 (WebCore::MediaPlayerPrivateGStreamerOwr::~MediaPlayerPrivateGStreamerOwr):
930 Release the new video and audio maps that creates a relationship
931 of the mediastream tracks with the mediatracks of the video element.
932 (WebCore::MediaPlayerPrivateGStreamerOwr::play): Set ended to
933 false when we start playing.
934 (WebCore::MediaPlayerPrivateGStreamerOwr::load): Create the media
935 tracks to the player so that the videoTracks API returns it, and
936 add an entry in the map to be able to restore it using the
938 (WebCore::MediaPlayerPrivateGStreamerOwr::disableMediaTracks):
939 Move some part of the stop function to this one in order to use it
940 in pause method and avoid changing the video selection in that
942 (WebCore::MediaPlayerPrivateGStreamerOwr::stop): Now we call the
943 function disableMediaTracks and we also change teh selected
945 (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnded): For
946 videoTrack reset the size and the selected element. In case there
947 is no media playing we Make sure we set the ended variable to true
948 and call the timeChange to modify the state of the player.
949 (WebCore::MediaPlayerPrivateGStreamerOwr::trackEnabledChanged):
950 Handle properly the situation when the user changed the enabled
951 value, we disable the media.
952 (WebCore::MediaPlayerPrivateGStreamerOwr::setSize): Modify the
954 (WebCore::MediaPlayerPrivateGStreamerOwr::naturalSize): Overrided
955 to make sure we return a size even when the sample is not ready
957 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerOwr.h:
958 Added the ended attribute and the maps.
959 * platform/mediastream/openwebrtc/MediaEndpointOwr.cpp:
960 (WebCore::MediaEndpointOwr::createMutedRemoteSource): Use the new
961 realtime video and audio sources classes, this new classes
962 implement the settings of each type of media element.
963 * platform/mediastream/openwebrtc/RealtimeMediaSourceCenterOwr.cpp:
964 (WebCore::RealtimeMediaSourceCenterOwr::mediaSourcesAvailable):
965 Use the new audio and video source classes instead of the general
966 one in order to handle the settings properly.
967 * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.cpp: Added
968 (WebCore::RealtimeMediaSourceOwr::settings): Initialize using the
969 subclass and return the new currentSettings attribute.
970 (WebCore::RealtimeMediaSourceOwr::supportedConstraints): Call the
971 subclass initialization of the supportedSettings.
972 * platform/mediastream/openwebrtc/RealtimeMediaSourceOwr.h:
973 (WebCore::RealtimeMediaSourceOwr::initializeSettings): Added to
974 initialize the settings before returning the value. Implemented in
976 (WebCore::RealtimeMediaSourceOwr::initializeSupportedConstraints):
977 Added to initialize the supported settings of the
978 media. Implemented in the subclass.
979 (WebCore::RealtimeMediaSourceOwr::settings): Moved to the cpp
980 file, implemented using the initialize functions of the subclass
981 * platform/mediastream/openwebrtc/RealtimeVideoSourceOwr.h: Added
982 this new class to handle the settings of the video elements. The
983 class initializes the settings and the supportedSettings.
984 * platform/mediastream/openwebrtc/RealtimeAudioSourceOwr.h: Added
985 this new class to handle the settings of the audio elements. The
986 class initializes the settings and the supportedSettings.
989 2016-12-15 Alex Christensen <achristensen@webkit.org>
991 REGRESSION (r208902) Null pointer dereference in wkIsPublicSuffix
992 https://bugs.webkit.org/show_bug.cgi?id=165885
993 <rdar://problem/29476917>
995 Reviewed by Darin Adler.
997 wkIsPublicSuffix crashes if you give it a nil NSString*.
998 This was possible before IDN2008 adoption, but it's more common now
999 because domains like "r4---asdf.example.com" fail in uidna_nameToASCII but not in uidna_IDNToASCII.
1000 decodeHostName can return a nil NSString. We can't use it unchecked, so instead we use an algorithm that allows
1001 for decoding failures while still finding top privately controlled domains correctly.
1003 Tested by new API tests which crash before this change and verify the behavior matches behavior before r208902.
1005 * platform/mac/PublicSuffixMac.mm:
1006 (WebCore::isPublicSuffix):
1007 (WebCore::topPrivatelyControlledDomain):
1009 2016-12-15 Alex Christensen <achristensen@webkit.org>
1011 Fix Windows WebGL build after r209832
1015 2016-12-14 Hunseop Jeong <hs85.jeong@samsung.com>
1017 Unreviewed build fix after r209832
1019 * platform/graphics/PlatformDisplay.cpp:
1020 (WebCore::PlatformDisplay::sharedDisplay): Added the guard for the clang
1022 2016-12-14 Yusuke Suzuki <utatane.tea@gmail.com>
1024 [GTK] Support latest SubtleCrypto HMAC APIs
1025 https://bugs.webkit.org/show_bug.cgi?id=165863
1027 Reviewed by Sam Weinig.
1029 SubtleCrypto spec is updated, and new delegate implementations are required to support these interfaces.
1030 This patch implements platformSign and platformVerify with WorkQueues for gcrypt backend.
1032 * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp:
1033 (WebCore::calculateSignature):
1034 (WebCore::CryptoAlgorithmHMAC::platformSign):
1035 (WebCore::CryptoAlgorithmHMAC::platformVerify):
1037 2016-12-14 Chris Dumez <cdumez@apple.com>
1039 Unreviewed, rolling out r209415.
1041 This workaround is no longer needed now that
1042 <rdar://problem/29518605> has been fixed
1046 "Add HTML interactive form validation blacklist for some
1047 WebKit-specific sites"
1048 https://bugs.webkit.org/show_bug.cgi?id=165470
1049 http://trac.webkit.org/changeset/209415
1051 2016-12-14 Dean Jackson <dino@apple.com>
1053 Update prefers-reduced-motion syntax
1054 https://bugs.webkit.org/show_bug.cgi?id=165880
1055 <rdar://problems/29671807>
1057 Reviewed by Sam Weinig.
1059 After discussion in:
1060 https://github.com/w3c/csswg-drafts/issues/442
1061 ... the syntax of prefers-reduced-motion was changed
1062 to accept "reduce" or "no-preference".
1064 Updated the tests in fast/media.
1066 * css/CSSValueKeywords.in: Add no-preference keyword.
1067 * css/MediaQueryEvaluator.cpp:
1068 (WebCore::prefersReducedMotionEvaluate):
1070 2016-12-14 Sam Weinig <sam@webkit.org>
1072 REGRESSION (204679): Google notifications never load (expecting DOMStringList rather than JS array for Location.ancestorOrigins)
1073 <rdar://problem/29573563>
1074 https://bugs.webkit.org/show_bug.cgi?id=165872
1076 Reviewed by Chris Dumez.
1078 Revert the Location.ancestorOrigins part of r204679 because google.com is relying on
1079 it returning a DOMStringList (or at least something with a .item() function), rather
1080 than a frozen javascript array.
1082 Spec changes are tracked with https://github.com/whatwg/html/issues/2179.
1084 * page/Location.cpp:
1085 (WebCore::Location::ancestorOrigins):
1087 * page/Location.idl:
1088 Change Location.ancestorOrigins back to returning a DOMStringList.
1090 2016-12-14 Dave Hyatt <hyatt@apple.com>
1092 [CSS Parser] Rename StyleKeyframe to StyleRuleKeyframe
1093 https://bugs.webkit.org/show_bug.cgi?id=165876
1095 Reviewed by Simon Fraser.
1097 * css/CSSKeyframeRule.cpp:
1098 (WebCore::StyleRuleKeyframe::StyleRuleKeyframe):
1099 (WebCore::StyleRuleKeyframe::~StyleRuleKeyframe):
1100 (WebCore::StyleRuleKeyframe::mutableProperties):
1101 (WebCore::StyleRuleKeyframe::keyText):
1102 (WebCore::StyleRuleKeyframe::setKeyText):
1103 (WebCore::StyleRuleKeyframe::cssText):
1104 (WebCore::CSSKeyframeRule::CSSKeyframeRule):
1105 (WebCore::StyleKeyframe::StyleKeyframe): Deleted.
1106 (WebCore::StyleKeyframe::~StyleKeyframe): Deleted.
1107 (WebCore::StyleKeyframe::mutableProperties): Deleted.
1108 (WebCore::StyleKeyframe::keyText): Deleted.
1109 (WebCore::StyleKeyframe::setKeyText): Deleted.
1110 (WebCore::StyleKeyframe::cssText): Deleted.
1111 * css/CSSKeyframeRule.h:
1112 * css/CSSKeyframesRule.cpp:
1113 (WebCore::StyleRuleKeyframes::keyframes):
1114 (WebCore::StyleRuleKeyframes::parserAppendKeyframe):
1115 (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
1116 (WebCore::CSSKeyframesRule::appendRule):
1117 (WebCore::CSSKeyframesRule::item):
1118 * css/CSSKeyframesRule.h:
1119 * css/StyleResolver.cpp:
1120 (WebCore::StyleResolver::styleForKeyframe):
1121 (WebCore::StyleResolver::keyframeStylesForAnimation):
1122 * css/StyleResolver.h:
1123 * css/StyleRule.cpp:
1124 (WebCore::StyleRuleBase::destroy):
1126 * css/parser/CSSParser.cpp:
1127 (WebCore::CSSParser::parseKeyframeRule):
1128 * css/parser/CSSParser.h:
1129 * css/parser/CSSParserImpl.cpp:
1130 (WebCore::CSSParserImpl::parseDeferredKeyframeList):
1131 (WebCore::CSSParserImpl::consumeKeyframesRule):
1132 (WebCore::CSSParserImpl::consumeKeyframeStyleRule):
1133 * css/parser/CSSParserImpl.h:
1135 2016-12-14 Dave Hyatt <hyatt@apple.com>
1137 [CSS Parser] Make deferred parsing retain the sheet text. Fix invalidation to avoid deferred parsing.
1138 https://bugs.webkit.org/show_bug.cgi?id=165868
1140 Reviewed by Simon Fraser.
1142 With this new model of token copying, the sheet text needs to be retained. The tokenizer did this,
1143 but we're no longer keeping it around.
1145 StyleInvalidation is also aggressively crawling media rules, even unsupported ones, so fix it
1146 to avoid deferred parsing.
1148 * css/StyleInvalidationAnalysis.cpp:
1149 (WebCore::shouldDirtyAllStyle):
1150 * css/parser/CSSDeferredParser.cpp:
1151 (WebCore::CSSDeferredParser::CSSDeferredParser):
1152 * css/parser/CSSDeferredParser.h:
1153 (WebCore::CSSDeferredParser::create):
1154 * css/parser/CSSParserImpl.cpp:
1155 (WebCore::CSSParserImpl::CSSParserImpl):
1157 2016-12-14 Ryosuke Niwa <rniwa@webkit.org>
1159 iOS: An element with tabindex is not focusable unless there is no mouse event handler
1160 https://bugs.webkit.org/show_bug.cgi?id=165843
1162 Reviewed by Antti Koivisto.
1164 The bug was caused by ancestorRespondingToClickEvents not checking the precense of tabindex attribute.
1165 Check that condition along with event listeners.
1167 Test: fast/events/focusing-element-with-tabindex-by-tap-or-click.html
1169 * page/ios/FrameIOS.mm:
1170 (WebCore::ancestorRespondingToClickEvents):
1172 2016-12-14 Alex Christensen <achristensen@webkit.org>
1174 Progress towards using ANGLE to do WebGL rendering
1175 https://bugs.webkit.org/show_bug.cgi?id=165864
1177 Reviewed by Dean Jackson.
1179 No new tests, no change in behavior.
1180 Just compile fixes for a configuration that will soon be standard
1181 that can be landed now without breaking anything.
1183 * platform/graphics/PlatformDisplay.cpp:
1184 (WebCore::PlatformDisplay::sharedDisplay):
1185 Ignore some clang warnings that will cause problems when this is compiled on Mac.
1187 2016-12-14 Dean Jackson <dino@apple.com>
1189 [iOS] MediaDocuments have controls on the bottom of the page
1190 https://bugs.webkit.org/show_bug.cgi?id=165865
1191 <rdar://problem/28757268>
1193 Reviewed by Jon Lee.
1195 MediaDocuments on iOS are incorrectly placing the controls at
1196 the bottom of the page. This is due to the <video> element
1197 getting a height of 100%. It should be "auto" instead.
1199 * html/MediaDocument.cpp:
1200 (WebCore::MediaDocumentParser::createDocumentStructure):
1202 2016-12-14 Dave Hyatt <hyatt@apple.com>
1204 [CSS Parser] Implement deferred parsing of properties, @media, @supports and @keyframes
1205 https://bugs.webkit.org/show_bug.cgi?id=165743
1207 Reviewed by Dean Jackson.
1209 Added new tests in fast/css/deferred-parsing.
1211 This patch implements deferred parsing in CSS. By default, when parsing
1212 author stylesheets, the parser goes into a deferred mode where it leaves
1213 the declaration block of all style rules unparsed initially. Instead of
1214 creating and setting an ImmutableStyleProperties object on the StyleRule,
1215 the parser creates a DeferredStyleProperties object instead that is
1216 capable of calling into CSSDeferredParser to parse the properties and values
1217 only when the properties are finally asked for.
1219 In addition, this patch defers the parsing of the interior of @media,
1220 @supports, and @keyframes rules. @media blocks that are never matched will
1221 never parse any of the rules inside. @supports conditions for unsupported
1222 features will also not be parsed. For @keyframes, if the animation is never
1223 referenced/used, then the @keyframes child rules will never be parsed.
1226 * WebCore.xcodeproj/project.pbxproj:
1227 Add CSSDeferredParser to the build.
1229 * css/CSSFontFaceSet.cpp:
1230 (WebCore::CSSFontFaceSet::matchingFaces):
1231 Patched to drop the StyleSheetContents* argument from parseValue, since it
1232 is no longer needed.
1234 * css/CSSKeyframesRule.cpp:
1235 (WebCore::StyleRuleKeyframes::StyleRuleKeyframes):
1236 (WebCore::StyleRuleKeyframes::parseDeferredRulesIfNeeded):
1237 (WebCore::StyleRuleKeyframes::keyframes):
1238 (WebCore::StyleRuleKeyframes::wrapperAppendKeyframe):
1239 (WebCore::StyleRuleKeyframes::wrapperRemoveKeyframe):
1240 (WebCore::StyleRuleKeyframes::findKeyframeIndex):
1241 * css/CSSKeyframesRule.h:
1242 Keyframes now hold both a keyframes Vector and a DeferredStyleGroupRuleList
1243 object. The keyframes vector won't be populated until it is needed, and the
1244 population is done by DeferredStyleGroupRuleList, which holds both the original
1245 tokens of the keyframes rule interior, and a references to the
1246 CSSDeferredParser that will do the parsing.
1248 * css/DOMCSSNamespace.cpp:
1249 (WebCore::DOMCSSNamespace::supports):
1250 Patched to drop the StyleSheetContents* argument from parseValue, since it
1251 is no longer needed.
1253 * css/ElementRuleCollector.cpp:
1254 (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1255 ElementRuleCollector tests to see if a rule is empty by counting properties(),
1256 but we don't want to initiate deferred parsing just to check this. Instead we
1257 invoke propertiesWithoutDeferredParsing, which will hand back a nullptr if
1258 the properties haven't been parsed yet. In order to ensure this optimization
1259 continues to work, any rules whose interiors consist of only whitespace do
1263 (WebCore::FontFace::setVariant):
1264 * css/PropertySetCSSStyleDeclaration.cpp:
1265 (WebCore::PropertySetCSSStyleDeclaration::setProperty):
1266 (WebCore::PropertySetCSSStyleDeclaration::setPropertyInternal):
1267 Patched to drop the StyleSheetContents* argument from parseValue, since it
1268 is no longer needed.
1270 * css/StyleProperties.cpp:
1271 (WebCore::MutableStyleProperties::MutableStyleProperties):
1272 (WebCore::MutableStyleProperties::setProperty):
1273 (WebCore::DeferredStyleProperties::create):
1274 (WebCore::DeferredStyleProperties::DeferredStyleProperties):
1275 (WebCore::DeferredStyleProperties::~DeferredStyleProperties):
1276 (WebCore::DeferredStyleProperties::parseDeferredProperties):
1277 * css/StyleProperties.h:
1278 (WebCore::StylePropertiesBase::type):
1279 (WebCore::StylePropertiesBase::cssParserMode):
1280 (WebCore::StylePropertiesBase::StylePropertiesBase):
1281 (WebCore::StyleProperties::isMutable):
1282 (WebCore::StyleProperties::StyleProperties):
1283 (WebCore::StylePropertiesBase::deref):
1285 (WebCore::StyleProperties::cssParserMode): Deleted.
1286 (WebCore::StyleProperties::deref): Deleted.
1287 Right now StyleProperties has two subclasses, ImmutableStyleProperties (which
1288 is created by the parser when not deferring), and MutableStyleProperties (used
1289 when making changes and doing DOM Manipulations).
1291 This patch adds a new base class called StylePropertiesBase, and StyleProperties
1292 now derives from it. DeferredStyleProperties derives from this base. The members
1293 of StyleProperties have been moved up into StylePropertiesBase.
1295 The m_isMutable bit, used to determine the type for downcasting has been enhanced
1296 to m_type (2 bits), since there are now three possible subclasses.
1298 * css/StyleRule.cpp:
1299 (WebCore::StyleRule::StyleRule):
1300 (WebCore::StyleRule::properties):
1301 (WebCore::StyleRule::mutableProperties):
1302 (WebCore::StyleRule::splitIntoMultipleRulesWithMaximumSelectorComponentCount):
1303 Patched to ensure that when properties() are accessed, that if the current
1304 stored StylePropertyBase in the rule is a DeferredStyleProperties, we then
1305 parse and replace DeferredStyleProperties with ImmutableStyleProperties on the
1306 rule. By using a common base class, we avoid increasing memory usage in
1309 (WebCore::DeferredStyleGroupRuleList::create):
1310 (WebCore::DeferredStyleGroupRuleList::DeferredStyleGroupRuleList):
1311 (WebCore::DeferredStyleGroupRuleList::parseDeferredRules):
1312 (WebCore::DeferredStyleGroupRuleList::parseDeferredKeyframes):
1313 DeferredStyleGroupList is used to handle deferred parsing of objects with
1314 child rules. These include @media, @supports and @keyframes.
1316 (WebCore::StyleRuleGroup::StyleRuleGroup):
1317 (WebCore::StyleRuleGroup::childRules):
1318 (WebCore::StyleRuleGroup::wrapperInsertRule):
1319 (WebCore::StyleRuleGroup::wrapperRemoveRule):
1320 (WebCore::StyleRuleGroup::parseDeferredRulesIfNeeded):
1321 (WebCore::StyleRuleMedia::StyleRuleMedia):
1322 (WebCore::StyleRuleSupports::StyleRuleSupports):
1323 StyleRuleGroup now holds both a child rules Vector and a
1324 DeferredStyleGroupRuleList. If DeferredStyleGroupRuleList is set, then
1325 when the childRules are finally accessed, we will populate the childRules
1326 Vector and then null out the DeferredStyleGroupRuleList.
1329 (WebCore::StyleRule::propertiesWithoutDeferredParsing):
1330 (WebCore::StyleRuleGroup::childRulesWithoutDeferredParsing):
1331 (WebCore::StyleRuleGroup::childRules): Deleted.
1332 Add new accesors for fetching properties and child rules without causing
1333 deferred parsing to happen.
1335 * css/StyleSheetContents.cpp:
1336 (WebCore::StyleSheetContents::parseAuthorStyleSheet):
1337 (WebCore::StyleSheetContents::parseString):
1338 Patched to turn on deferred parsing for author sheets and for all
1339 non-UA stylesheets parsed from a string (e.g., <style>).
1341 (WebCore::traverseSubresourcesInRules):
1342 The broken resource check was aggressively accessing properties(). Patch
1343 it to call propertiesWithoutDeferredParsing() instead so that it doesn't
1344 defeat the new optimization.
1346 * css/WebKitCSSMatrix.cpp:
1347 (WebCore::WebKitCSSMatrix::setMatrixValue):
1348 Patched to drop the StyleSheetContents* argument from parseValue, since it
1349 is no longer needed.
1351 * css/parser/CSSDeferredParser.cpp: Added.
1352 (WebCore::CSSDeferredParser::CSSDeferredParser):
1353 (WebCore::CSSDeferredParser::parseDeclaration):
1354 (WebCore::CSSDeferredParser::parseRuleList):
1355 (WebCore::CSSDeferredParser::parseKeyframeList):
1356 * css/parser/CSSDeferredParser.h: Added.
1357 (WebCore::CSSDeferredParser::create):
1358 (WebCore::CSSDeferredParser::tokenizer):
1359 (WebCore::CSSDeferredParser::mode):
1360 (WebCore::CSSDeferredParser::context):
1361 (WebCore::CSSDeferredParser::styleSheet):
1362 The CSSDeferredParser. It caches the original tokenizer's' escaped strings. Because
1363 the CSSDeferredParser is referenced by all the rules that have yet to parse,
1364 it will stay alive until all rules in the stylesheet has been fully parsed.
1366 The parser receives CSSParserTokenRanges from DeferredStyleProperties or
1367 DeferredStyleGroupRuleList and feeds them to CSSParserImpl, which then
1368 is able to do the parsing as it would have occurred originally had the
1369 range not been deferred.
1371 * css/parser/CSSParser.cpp:
1372 (WebCore::CSSParser::parseSheet):
1373 (WebCore::CSSParser::parseSupportsCondition):
1374 (WebCore::CSSParser::parseSingleValue):
1375 (WebCore::CSSParser::parseValue):
1376 * css/parser/CSSParser.h:
1377 * css/parser/CSSParserFastPaths.cpp:
1378 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
1379 (WebCore::parseKeywordValue):
1380 (WebCore::CSSParserFastPaths::maybeParseValue):
1381 * css/parser/CSSParserFastPaths.h:
1382 Drop the StyleSheetContents* argument from the methods that no longer need
1385 * css/parser/CSSParserImpl.cpp:
1386 (WebCore::CSSParserImpl::CSSParserImpl):
1387 (WebCore::CSSParserImpl::tokenizer):
1388 (WebCore::CSSParserImpl::parseValue):
1389 (WebCore::CSSParserImpl::parseCustomPropertyValue):
1390 (WebCore::CSSParserImpl::parseDeclarationList):
1391 (WebCore::CSSParserImpl::parseInlineStyleDeclaration):
1392 (WebCore::CSSParserImpl::parseRule):
1393 (WebCore::CSSParserImpl::parseStyleSheet):
1394 (WebCore::CSSParserImpl::parseDeclarationListForInspector):
1395 (WebCore::CSSParserImpl::parseStyleSheetForInspector):
1396 (WebCore::CSSParserImpl::consumeQualifiedRule):
1397 (WebCore::CSSParserImpl::consumeMediaRule):
1398 (WebCore::CSSParserImpl::consumeSupportsRule):
1399 (WebCore::CSSParserImpl::consumeKeyframesRule):
1400 (WebCore::CSSParserImpl::consumeStyleRule):
1401 Drop the StyleSheetContents* argument from the methods that no longer need
1404 (WebCore::CSSParserImpl::createDeferredStyleProperties):
1405 (WebCore::CSSParserImpl::parseDeferredDeclaration):
1406 (WebCore::CSSParserImpl::parseDeferredRuleList):
1407 (WebCore::CSSParserImpl::parseDeferredKeyframeList):
1408 The methods that handle deferred parsing. They make sure to initialize
1409 new CSSParserImpls with the original deferred parser, and then call existing
1410 methods to do the parsing.
1412 * css/parser/CSSParserImpl.h:
1413 Patched to remove StyleSheetContents* arguments from some methods and
1414 to add the new deferred parsing methods.
1416 * css/parser/CSSParserTokenRange.cpp:
1417 (WebCore::CSSParserTokenRange::consumeBlockCheckingForEditability):
1418 * css/parser/CSSParserTokenRange.h:
1419 In order to preserve the editability optimization from r180867, when
1420 a style rule's block is consumed, we use a special method that looks
1421 for -webkit-user-modify tokens. If one is seen, then the editability
1422 optimization is turned off. Because we do this at the token level,
1423 the optimization keeps working even if properties don't get parsed.
1425 * css/parser/CSSPropertyParser.cpp:
1426 (WebCore::CSSPropertyParser::parseSingleValue):
1427 (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
1428 (WebCore::CSSPropertyParser::consumeFont):
1429 (WebCore::CSSPropertyParser::parseShorthand):
1430 Patched to remove StyleSheetContents* arguments now that the editability
1431 check is in CSSTokenizer instead.
1433 * css/parser/CSSTokenizer.cpp:
1434 (WebCore::CSSTokenizer::tokenRange):
1435 * css/parser/CSSTokenizer.h:
1436 Make tokenRange() const.
1438 * html/canvas/CanvasRenderingContext2D.cpp:
1439 (WebCore::CanvasRenderingContext2D::setFont):
1440 Patched to drop the StyleSheetContents* argument.
1442 * testing/Internals.cpp:
1443 (WebCore::deferredStyleRulesCountForList):
1444 (WebCore::Internals::deferredStyleRulesCount):
1445 (WebCore::deferredGroupRulesCountForList):
1446 (WebCore::Internals::deferredGroupRulesCount):
1447 (WebCore::deferredKeyframesRulesCountForList):
1448 (WebCore::Internals::deferredKeyframesRulesCount):
1449 * testing/Internals.h:
1450 * testing/Internals.idl:
1451 Add new testing methods that can count the deferred style rules and
1452 group child rule lists. These methods are used by the new layout tests.
1454 2016-12-14 Brady Eidson <beidson@apple.com>
1456 IndexedDB 2.0: Massively speedup IDBIndex.get().
1457 https://bugs.webkit.org/show_bug.cgi?id=165802
1459 Reviewed by Alex Christensen.
1461 No new tests (No behavior change to Javascript, table upgrade change covered by API test).
1463 This change upgrades the IndexRecords schema to include the ObjectStore record ID for the referenced record.
1464 It also adds a SQLite Index-by-key on IndexRecords.
1466 This speeds up PerformanceTests/IndexedDB/index-get.html by 15-20x.
1468 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
1469 (WebCore::IDBServer::v3IndexRecordsTableSchema):
1470 (WebCore::IDBServer::v3IndexRecordsTableSchemaAlternate):
1471 (WebCore::IDBServer::v1IndexRecordsIndexSchema):
1472 (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsTable):
1473 (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidIndexRecordsIndex):
1474 (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
1475 (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
1476 (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexKey):
1477 (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
1478 (WebCore::IDBServer::SQLiteIDBBackingStore::updateOneIndexForAddRecord):
1479 (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
1480 (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
1481 (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
1482 (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
1483 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
1485 * Modules/indexeddb/server/SQLiteIDBCursor.cpp:
1486 (WebCore::IDBServer::SQLiteIDBCursor::markAsErrored):
1487 (WebCore::IDBServer::SQLiteIDBCursor::internalAdvanceOnce):
1488 * Modules/indexeddb/server/SQLiteIDBCursor.h:
1489 (WebCore::IDBServer::SQLiteIDBCursor::currentRecordRowID):
1491 2016-12-14 Sam Weinig <sam@webkit.org>
1493 Actually set the shipping contact when validating the payment request
1495 Reviewed by Anders Carlsson.
1497 * Modules/applepay/ApplePaySession.cpp:
1498 (WebCore::convertAndValidate):
1501 2016-12-14 John Wilander <wilander@apple.com>
1503 Handle key generation with empty challenge string
1504 https://bugs.webkit.org/show_bug.cgi?id=165835
1505 <rdar://problem/29128710>
1507 Reviewed by Anders Carlsson.
1509 https://bugs.webkit.org/show_bug.cgi?id=160945 didn't set the challenge length to
1510 1 for empty challenge strings. Thus the null terminator was not included. Empty
1511 challenge strings are allowed:
1512 "If the element has a challenge attribute, then let challenge be that attribute's
1513 value. Otherwise, let challenge be the empty string."
1514 https://www.w3.org/TR/html5/forms.html#the-keygen-element (fetched 2016-12-13)
1516 Email certificate generation at
1517 https://www.comodo.com/home/email-security/free-email-certificate.php broke
1518 because of https://bugs.webkit.org/show_bug.cgi?id=160945.
1520 No new tests. The original patch did not have tests and the breakage was in the
1521 produced key material so a test would have to validate the crypto output.
1523 * platform/mac/SSLKeyGeneratorMac.mm:
1524 (WebCore::signedPublicKeyAndChallengeString):
1525 Now adds 1 to the length of the challenge to account for its null terminator.
1526 This matches the old behavior.
1528 2016-12-14 Daniel Bates <dabates@apple.com>
1530 CSP: Allow HTTPS URL to match HTTP source expression
1531 https://bugs.webkit.org/show_bug.cgi?id=159520
1532 <rdar://problem/27287177>
1534 Reviewed by Brent Fulgham.
1536 Test: http/tests/security/contentSecurityPolicy/script-src-parsing-implicit-and-explicit-port-number.html
1538 * page/csp/ContentSecurityPolicySource.cpp:
1539 (WebCore::ContentSecurityPolicySource::schemeMatches):
1540 (WebCore::ContentSecurityPolicySource::portMatches):
1542 2016-12-14 Alex Christensen <achristensen@webkit.org>
1544 REGRESSION (r209776): [ios-simulator] LayoutTest http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html is timing out
1545 https://bugs.webkit.org/show_bug.cgi?id=165836
1547 Reviewed by Brady Eidson.
1549 * loader/CrossOriginAccessControl.cpp:
1550 (WebCore::createAccessControlPreflightRequest):
1551 Use the platform default timeout for CORS preflight requests.
1553 2016-12-14 Antti Koivisto <antti@apple.com>
1555 WebContent crash under WebCore::CachedResource::load in WebCore::FrameLoader::outgoingReferrer const
1556 https://bugs.webkit.org/show_bug.cgi?id=165852
1557 <rdar://problem/27297153>
1559 Reviewed by Chris Dumez.
1561 There appears to be some path where we get here with a null frame.
1562 No test, don't know how exactly this happens.
1564 * loader/FrameLoader.cpp:
1565 (WebCore::FrameLoader::outgoingReferrer):
1567 Null check the frame.
1569 2016-12-14 Chris Dumez <cdumez@apple.com>
1571 Unreviewed, rolling out r209766.
1573 Regressed Dromaeo JSLib by ~50%
1577 "Make opaque root scanning truly constraint-based"
1578 https://bugs.webkit.org/show_bug.cgi?id=165760
1579 http://trac.webkit.org/changeset/209766
1581 2016-12-14 Andy Estes <aestes@apple.com>
1583 EventDispatcher::dispatchEvent() should take its Node by reference
1584 https://bugs.webkit.org/show_bug.cgi?id=165840
1586 Reviewed by Andreas Kling.
1588 No new tests. No change in behavior.
1591 (WebCore::Element::dispatchWheelEvent): Dereferenced |this| when calling
1592 EventDispatcher::dispatchEvent().
1593 (WebCore::Element::dispatchKeyEvent): Ditto.
1594 (WebCore::Element::dispatchFocusEvent): Ditto.
1595 (WebCore::Element::dispatchBlurEvent): Ditto.
1596 * dom/EventDispatcher.cpp:
1597 (WebCore::EventDispatcher::dispatchEvent): Changed |origin| from a Node* to a Node&, renamed
1598 it to |node|, and protected it with a Ref called |protectedNode| to match our preferred
1600 * dom/EventDispatcher.h: Changed dispatchEvent's first parameter type from Node* to Node&.
1602 (WebCore::Node::dispatchEvent): Dereferenced |this| when calling
1603 EventDispatcher::dispatchEvent().
1604 (WebCore::Node::dispatchTouchEvent): Ditto.
1605 (WebCore::Node::dispatchUIRequestEvent): Ditto.
1606 * dom/ScopedEventQueue.cpp:
1607 (WebCore::ScopedEventQueue::dispatchEvent): Dereferenced |node| when calling
1608 EventDispatcher::dispatchEvent().
1609 * dom/SimulatedClick.cpp:
1610 (WebCore::simulateMouseEvent): Passed |element| as a reference to
1611 EventDispatcher::dispatchEvent().
1613 2016-12-14 Chris Dumez <cdumez@apple.com>
1615 Remove Unicode case-insensitive matching for usemap=""
1616 https://bugs.webkit.org/show_bug.cgi?id=163894
1618 Reviewed by Antti Koivisto.
1620 Remove Unicode case-insensitive matching for usemap="" as this no longer
1621 matches the specification [1] or Firefox. Also align our parsing logic for
1622 the usemap attribute to match the specification [2].
1624 This simplifies the code a bit, is more efficient and the compatibility
1625 risk should be low based on Firefox's behavior and Chome's usage data.
1627 [1] https://github.com/whatwg/html/commit/6acdb2122298d2bb7bb839c0a61b4e1f9b0f9bc9
1628 [2] https://html.spec.whatwg.org/#rules-for-parsing-a-hash-name-reference
1630 Test: fast/images/image-usemap-parsing.html
1633 (WebCore::Document::addImageElementByUsemap):
1634 (WebCore::Document::removeImageElementByUsemap):
1635 (WebCore::Document::imageElementByUsemap):
1637 * dom/DocumentOrderedMap.cpp:
1638 (WebCore::DocumentOrderedMap::getElementByUsemap):
1639 * dom/DocumentOrderedMap.h:
1640 * dom/TreeScope.cpp:
1641 (WebCore::TreeScope::getImageMap):
1642 * html/HTMLImageElement.cpp:
1643 (WebCore::HTMLImageElement::parseAttribute):
1644 (WebCore::HTMLImageElement::insertedInto):
1645 (WebCore::HTMLImageElement::removedFrom):
1646 (WebCore::HTMLImageElement::matchesUsemap):
1647 * html/HTMLImageElement.h:
1648 * html/HTMLMapElement.cpp:
1649 (WebCore::HTMLMapElement::imageElement):
1650 (WebCore::HTMLMapElement::parseAttribute):
1651 * html/parser/HTMLParserIdioms.cpp:
1652 (WebCore::parseHTMLHashNameReference):
1653 * html/parser/HTMLParserIdioms.h:
1655 2016-12-14 Ryan Haddad <ryanhaddad@apple.com>
1657 Attempt to fix the Windows build after r209805.
1659 Unreviewed build fix.
1661 * css/CSSAllInOne.cpp:
1663 2016-12-14 Dave Hyatt <hyatt@apple.com>
1665 [CSS Parser] Remove WebkitCSSTransformValue
1666 https://bugs.webkit.org/show_bug.cgi?id=165844
1668 Reviewed by Zalan Bujtas.
1670 Remove WebkitCSSTransformValue and just use a CSSFunctionValue instead. No other
1671 browsers support it, and the information it provides is easily obtainable from cssText.
1674 * DerivedSources.cpp:
1675 * DerivedSources.make:
1676 * WebCore.xcodeproj/project.pbxproj:
1677 * bindings/js/JSCSSValueCustom.cpp:
1678 (WebCore::toJSNewlyCreated):
1679 * css/CSSComputedStyleDeclaration.cpp:
1680 (WebCore::matrixTransformValue):
1682 (WebCore::CSSValue::equals):
1683 (WebCore::CSSValue::cssText):
1684 (WebCore::CSSValue::destroy):
1685 (WebCore::CSSValue::cloneForCSSOM):
1687 (WebCore::CSSValue::isSpringTimingFunctionValue):
1688 (WebCore::CSSValue::isWebKitCSSTransformValue): Deleted.
1689 * css/StyleResolver.cpp:
1690 * css/TransformFunctions.cpp:
1691 (WebCore::transformOperationType):
1692 (WebCore::transformsForValue):
1693 * css/TransformFunctions.h:
1694 * css/WebKitCSSTransformValue.cpp: Removed.
1695 * css/WebKitCSSTransformValue.h: Removed.
1696 * css/WebKitCSSTransformValue.idl: Removed.
1697 * css/parser/CSSParserFastPaths.cpp:
1698 (WebCore::parseTransformTranslateArguments):
1699 (WebCore::parseTransformNumberArguments):
1700 (WebCore::parseSimpleTransformValue):
1701 (WebCore::parseSimpleTransformList):
1702 * css/parser/CSSPropertyParser.cpp:
1703 (WebCore::consumeTranslate3d):
1704 (WebCore::consumeNumbers):
1705 (WebCore::consumePerspective):
1706 (WebCore::consumeTransformValue):
1707 (WebCore::transformOperationForCSSValueID): Deleted.
1709 2016-12-14 Antti Koivisto <antti@apple.com>
1711 Make Style::Update const in RenderTreeUpdater
1712 https://bugs.webkit.org/show_bug.cgi?id=165845
1714 Reviewed by Andreas Kling.
1716 Moving style away from unique_ptrs leaves them in weird state.
1718 * style/RenderTreeUpdater.cpp:
1719 (WebCore::findRenderingRoots):
1720 (WebCore::RenderTreeUpdater::commit):
1721 (WebCore::RenderTreeUpdater::updateElementRenderer):
1723 Clone the style instead of moving it. This is not meaningfully more expensive.
1724 Remove null checks, style is never null.
1726 * style/RenderTreeUpdater.h:
1728 2016-12-13 Yusuke Suzuki <utatane.tea@gmail.com>
1730 Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
1731 https://bugs.webkit.org/show_bug.cgi?id=165795
1733 Reviewed by Saam Barati.
1735 * bindings/js/IDBBindingUtilities.cpp:
1736 (WebCore::createIDBKeyFromValue):
1737 * bindings/js/JSAudioTrackCustom.cpp:
1738 (WebCore::JSAudioTrack::setKind):
1739 (WebCore::JSAudioTrack::setLanguage):
1740 * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1741 (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
1742 * bindings/js/JSCustomXPathNSResolver.cpp:
1743 (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1744 * bindings/js/JSDOMWindowCustom.cpp:
1745 (WebCore::JSDOMWindow::setLocation):
1746 * bindings/js/JSDeviceMotionEventCustom.cpp:
1747 (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
1748 * bindings/js/JSDeviceOrientationEventCustom.cpp:
1749 (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
1750 * bindings/js/JSEventListener.cpp:
1751 (WebCore::JSEventListener::handleEvent):
1752 * bindings/js/JSHTMLAllCollectionCustom.cpp:
1753 (WebCore::callHTMLAllCollection):
1754 (WebCore::JSHTMLAllCollection::namedItem):
1755 * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
1756 (WebCore::JSHTMLFormControlsCollection::namedItem):
1757 * bindings/js/JSHTMLInputElementCustom.cpp:
1758 (WebCore::JSHTMLInputElement::setSelectionDirection):
1759 * bindings/js/JSInspectorFrontendHostCustom.cpp:
1760 (WebCore::populateContextMenuItems):
1761 * bindings/js/JSMessageEventCustom.cpp:
1762 (WebCore::handleInitMessageEvent):
1763 * bindings/js/JSSQLTransactionCustom.cpp:
1764 (WebCore::JSSQLTransaction::executeSql):
1765 * bindings/js/JSTextTrackCustom.cpp:
1766 (WebCore::JSTextTrack::setLanguage):
1767 * bindings/js/JSVideoTrackCustom.cpp:
1768 (WebCore::JSVideoTrack::setKind):
1769 (WebCore::JSVideoTrack::setLanguage):
1770 * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1771 (WebCore::cryptoKeyFormatFromJSValue):
1772 (WebCore::cryptoKeyUsagesFromJSValue):
1773 * bindings/js/JSXMLHttpRequestCustom.cpp:
1774 (WebCore::JSXMLHttpRequest::send):
1775 * bindings/js/JSXSLTProcessorCustom.cpp:
1776 (WebCore::JSXSLTProcessor::setParameter):
1777 (WebCore::JSXSLTProcessor::getParameter):
1778 (WebCore::JSXSLTProcessor::removeParameter):
1779 * bindings/js/ScheduledAction.cpp:
1780 (WebCore::ScheduledAction::create):
1781 * bridge/c/c_utility.cpp:
1782 (JSC::Bindings::convertValueToNPVariant):
1783 * bridge/testbindings.cpp:
1786 2016-12-14 Joonghun Park <jh718.park@samsung.com>
1788 [EFL] Fix debug build break since r207192. Unreviewed.
1789 https://bugs.webkit.org/show_bug.cgi?id=165847
1791 No new tests, no new behaviours.
1793 In JSDOMBinding.h, JSClass::info() returns each js class's
1794 "static const JSC::ClassInfo s_info"'s address.
1795 It's static variable's address, so always non-null.
1797 * bindings/js/JSDOMBinding.h:
1798 (WebCore::BindingCaller::callPromiseOperation):
1799 (WebCore::BindingCaller::callOperation):
1800 (WebCore::BindingCaller::setAttribute):
1801 (WebCore::BindingCaller::attribute):
1803 2016-12-14 Enrique Ocaña González <eocanha@igalia.com>
1805 REGRESSION(r207879-207891): [GStreamer] Introduced many layout test failures and crashes, bots exiting early
1806 https://bugs.webkit.org/show_bug.cgi?id=164022
1808 Reviewed by Xabier Rodriguez-Calvar.
1810 Covered by existing tests.
1812 * page/Settings.cpp:
1813 Added new setting to disable GStreamer players, so the selection of
1814 MockMediaPlayerMediaSource can be forced for some tests, just like
1815 it's already being done for the AVFoundation player in Mac.
1816 (WebCore::Settings::setGStreamerEnabled):
1818 (WebCore::Settings::isGStreamerEnabled):
1819 * platform/graphics/MediaPlayer.cpp:
1820 (WebCore::buildMediaEnginesVector):
1821 Don't register GStreamer players when they're disabled.
1822 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1823 (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime):
1824 Use doubles instead of floats.
1825 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
1826 Use doubles instead of floats for m_durationAtEOS.
1827 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
1828 Don't reset m_sample on videoSink drain, it causes too many problems.
1829 (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):
1830 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
1831 Removed unused methods.
1832 * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
1833 Keep releasing m_sample on drain, but don't report the event
1834 externally via signal anymore. The base player private isn't
1835 listening to it anymore.
1836 (webkitVideoSinkEvent):
1837 (webkit_video_sink_class_init):
1838 * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
1839 (WebCore::AppendPipeline::parseDemuxerSrcPadCaps):
1840 Check if the demuxer caps correspond to a supported codec.
1841 (WebCore::AppendPipeline::didReceiveInitializationSegment):
1842 Empty m_track is now legal and means unsupported codec.
1843 (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
1844 Warn about more than one stream, but "support" it by ignoring it using
1846 (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
1847 Also report the duration when it's detected for the first time. Invalid
1848 stream types now mean that unsupported codecs have been detected.
1849 Complete init segment processing in that case.
1850 (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread):
1851 Disconnect black hole probe.
1852 (WebCore::appendPipelineDemuxerBlackHolePadProbe): Ignore buffers.
1853 (WebCore::appendPipelineDemuxerPadRemoved): New parameter used.
1854 * platform/graphics/gstreamer/mse/AppendPipeline.h:
1855 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1856 (WebCore::MediaPlayerPrivateGStreamerMSE::supportsCodecs):
1857 Check supported codecs by matching against wildcard expressions.
1858 (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
1859 Check for supported codecs.
1860 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
1861 New supportsCodecs() method.
1862 * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
1863 (WebCore::MediaSourceClientGStreamerMSE::resetParserState):
1864 Implemented parser resetting by aborting the AppendPipeline.
1865 * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.h:
1866 Added resetParserState().
1867 * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp:
1868 (WebCore::SourceBufferPrivateGStreamer::resetParserState):
1870 * testing/Internals.cpp:
1871 (WebCore::Internals::initializeMockMediaSource):
1872 Disable the GStreamer players when initializing the mock media source,
1873 like it's already done for the AVFoundation player to force the
1874 selection of MockMediaPlayerMediaSource.
1876 2016-12-14 Enrique Ocaña González <eocanha@igalia.com>
1878 [GStreamer][MSE] Fix player private selection when MSE is enabled
1879 https://bugs.webkit.org/show_bug.cgi?id=164116
1881 Reviewed by Philippe Normand.
1883 Covered by existing tests.
1885 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
1886 (WebCore::MediaPlayerPrivateGStreamer::load):
1887 * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
1888 (WebCore::MediaPlayerPrivateGStreamerMSE::load):
1890 2016-12-13 Commit Queue <commit-queue@webkit.org>
1892 Unreviewed, rolling out r209792.
1893 https://bugs.webkit.org/show_bug.cgi?id=165841
1895 Cause build failures (Requested by yusukesuzuki on #webkit).
1899 "Use JSValue::toWTFString instead of calling toString(exec)
1901 https://bugs.webkit.org/show_bug.cgi?id=165795
1902 http://trac.webkit.org/changeset/209792
1904 2016-12-13 Yusuke Suzuki <utatane.tea@gmail.com>
1906 Use JSValue::toWTFString instead of calling toString(exec) and value(exec)
1907 https://bugs.webkit.org/show_bug.cgi?id=165795
1909 Reviewed by Saam Barati.
1911 * bindings/js/IDBBindingUtilities.cpp:
1912 (WebCore::createIDBKeyFromValue):
1913 (WebCore::getNthValueOnKeyPath): Deleted.
1914 (WebCore::internalCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
1915 (WebCore::ensureNthValueOnKeyPath): Deleted.
1916 (WebCore::canInjectNthValueOnKeyPath): Deleted.
1917 (WebCore::injectIDBKeyIntoScriptValue): Deleted.
1918 (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
1919 (WebCore::canInjectIDBKeyIntoScriptValue): Deleted.
1920 (WebCore::deserializeIDBValueToJSValue): Deleted.
1921 (WebCore::scriptValueToIDBKey): Deleted.
1922 (WebCore::idbKeyDataToScriptValue): Deleted.
1923 (WebCore::createKeyPathArray): Deleted.
1924 (WebCore::generateIndexKeyForValue): Deleted.
1925 * bindings/js/JSAudioTrackCustom.cpp:
1926 (WebCore::JSAudioTrack::setKind):
1927 (WebCore::JSAudioTrack::setLanguage):
1928 * bindings/js/JSCryptoAlgorithmDictionary.cpp:
1929 (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
1930 * bindings/js/JSCustomXPathNSResolver.cpp:
1931 (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1932 * bindings/js/JSDOMWindowCustom.cpp:
1933 (WebCore::JSDOMWindow::setLocation):
1934 * bindings/js/JSDeviceMotionEventCustom.cpp:
1935 (WebCore::JSDeviceMotionEvent::initDeviceMotionEvent):
1936 * bindings/js/JSDeviceOrientationEventCustom.cpp:
1937 (WebCore::JSDeviceOrientationEvent::initDeviceOrientationEvent):
1938 * bindings/js/JSEventListener.cpp:
1939 (WebCore::JSEventListener::handleEvent):
1940 (WebCore::JSEventListener::virtualisAttribute): Deleted.
1941 (WebCore::JSEventListener::operator==): Deleted.
1942 (WebCore::eventHandlerAttribute): Deleted.
1943 (WebCore::createEventListenerForEventHandlerAttribute): Deleted.
1944 (WebCore::setEventHandlerAttribute): Deleted.
1945 (WebCore::windowEventHandlerAttribute): Deleted.
1946 (WebCore::setWindowEventHandlerAttribute): Deleted.
1947 (WebCore::documentEventHandlerAttribute): Deleted.
1948 (WebCore::setDocumentEventHandlerAttribute): Deleted.
1949 * bindings/js/JSHTMLAllCollectionCustom.cpp:
1950 (WebCore::callHTMLAllCollection):
1951 (WebCore::JSHTMLAllCollection::namedItem):
1952 * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
1953 (WebCore::JSHTMLFormControlsCollection::namedItem):
1954 * bindings/js/JSHTMLInputElementCustom.cpp:
1955 (WebCore::JSHTMLInputElement::setSelectionDirection):
1956 (WebCore::JSHTMLInputElement::setSelectionRange): Deleted.
1957 * bindings/js/JSInspectorFrontendHostCustom.cpp:
1958 (WebCore::populateContextMenuItems):
1959 (WebCore::JSInspectorFrontendHost::showContextMenu): Deleted.
1960 * bindings/js/JSMessageEventCustom.cpp:
1961 (WebCore::handleInitMessageEvent):
1962 * bindings/js/JSSQLTransactionCustom.cpp:
1963 (WebCore::JSSQLTransaction::executeSql):
1964 * bindings/js/JSTextTrackCustom.cpp:
1965 (WebCore::JSTextTrack::setLanguage):
1966 * bindings/js/JSVideoTrackCustom.cpp:
1967 (WebCore::JSVideoTrack::setKind):
1968 (WebCore::JSVideoTrack::setLanguage):
1969 * bindings/js/JSWebKitSubtleCryptoCustom.cpp:
1970 (WebCore::cryptoKeyFormatFromJSValue):
1971 (WebCore::cryptoKeyUsagesFromJSValue):
1972 * bindings/js/JSXMLHttpRequestCustom.cpp:
1973 (WebCore::JSXMLHttpRequest::send):
1974 (WebCore::JSXMLHttpRequest::responseText): Deleted.
1975 (WebCore::JSXMLHttpRequest::retrieveResponse): Deleted.
1976 * bindings/js/JSXSLTProcessorCustom.cpp:
1977 (WebCore::JSXSLTProcessor::setParameter):
1978 (WebCore::JSXSLTProcessor::getParameter):
1979 (WebCore::JSXSLTProcessor::removeParameter):
1980 * bindings/js/ScheduledAction.cpp:
1981 (WebCore::ScheduledAction::create):
1982 * bridge/c/c_utility.cpp:
1983 (JSC::Bindings::convertValueToNPVariant):
1984 * bridge/testbindings.cpp:
1986 * inspector/InspectorDOMAgent.cpp:
1987 (WebCore::InspectorDOMAgent::buildObjectForEventListener):
1989 2016-12-13 Yusuke Suzuki <utatane.tea@gmail.com>
1991 ASSERTION FAILED: hasParserBlockingScript() seen with js/dom/modules/module-will-fire-beforeload.html
1992 https://bugs.webkit.org/show_bug.cgi?id=164883
1994 Reviewed by Ryosuke Niwa.
1996 This is *attempt to fix* patch since I cannot reproduce the crash reported in this issue.
1997 One possible scenario of this crash is the following.
1999 1. There is pending deferred scripts, that is not fetched yet.
2000 2. Then, we start watching on the script. And stop document parser.
2001 3. The document parser is stopped/detached by calling finishJSTest in beforeload.
2002 4. At this critical timing, (2)'s script is fetched, and notifyFinished is called since it is watched.
2004 In this patch, we ignore the script execution if the document parser is stopped / detached.
2005 Previously, it goes into the wrong path. And it causes assertion failure.
2007 * html/parser/HTMLDocumentParser.cpp:
2008 (WebCore::HTMLDocumentParser::notifyFinished):
2010 2016-12-13 Keith Rollin <krollin@apple.com>
2012 Memory warning logging appears to capture resident footprint, missing compress/swap.
2013 https://bugs.webkit.org/show_bug.cgi?id=165533
2014 <rdar://problem/29318410>
2016 Reviewed by Daniel Bates.
2018 Fix GTK build by adding an explicit constructor.
2020 * platform/MemoryPressureHandler.h:
2021 (WebCore::MemoryPressureHandler::ReliefLogger::MemoryUsage::MemoryUsage):
2023 2016-12-13 Daniel Bates <dabates@apple.com>
2025 CSP: ws: and wss: blocked with connect-src *
2026 https://bugs.webkit.org/show_bug.cgi?id=165804
2027 <rdar://problem/28563643>
2029 Reviewed by David Kilzer.
2031 Allow * to match ws: and wss:. This will make our behavior of * more closely conform
2032 the behavior of * in the Content Security Policy Level 3 spec.,
2033 <https://w3c.github.io/webappsec-csp/#match-url-to-source-expression> (Editor's Draft, 2 December 2016).
2035 Tests: http/tests/security/contentSecurityPolicy/connect-src-star-secure-websocket-allowed.html
2036 http/tests/security/contentSecurityPolicy/connect-src-star-websocket-allowed.html
2037 http/tests/security/contentSecurityPolicy/default-src-star-secure-websocket-allowed.html
2038 http/tests/security/contentSecurityPolicy/default-src-star-websocket-allowed.html
2040 * page/csp/ContentSecurityPolicySourceList.cpp:
2041 (WebCore::ContentSecurityPolicySourceList::isProtocolAllowedByStar):
2043 2016-12-13 Dave Hyatt <hyatt@apple.com>
2045 [CSS Parser] Make CSSFunctionValue derive from CSSValueList
2046 https://bugs.webkit.org/show_bug.cgi?id=165832
2048 Reviewed by Dean Jackson.
2050 With the old parser gone, we can now shrink CSSFunctionValue a bit by
2051 having it derive from CSSValueList instead of having an extra member
2052 that holds a value list of arguments. This is similar to the trick
2053 already employed by WebkitCSSTransformValue.
2055 * css/CSSComputedStyleDeclaration.cpp:
2056 (WebCore::specifiedValueForGridTrackSize):
2057 * css/CSSFunctionValue.cpp:
2058 (WebCore::CSSFunctionValue::customCSSText):
2059 (WebCore::CSSFunctionValue::CSSFunctionValue): Deleted.
2060 (WebCore::CSSFunctionValue::equals): Deleted.
2061 (WebCore::CSSFunctionValue::append): Deleted.
2062 * css/CSSFunctionValue.h:
2063 * css/StyleBuilderConverter.h:
2064 (WebCore::StyleBuilderConverter::convertScrollSnapPoints):
2065 (WebCore::StyleBuilderConverter::createGridTrackSize):
2066 * css/StyleResolver.cpp:
2067 (WebCore::StyleResolver::createFilterOperations):
2068 * css/parser/CSSPropertyParser.cpp:
2069 (WebCore::isGridTrackFixedSized):
2071 2016-12-13 Chris Dumez <cdumez@apple.com>
2073 Make Document a FrameDestructionObserver
2074 https://bugs.webkit.org/show_bug.cgi?id=165810
2075 <rdar://problem/29157645>
2077 Reviewed by Ryosuke Niwa.
2079 Make Document a FrameDestructionObserver to make sure Document::m_frame
2080 is properly nulled out when a Frame gets destroyed.
2081 Document::disconnectFromFrame() is supposed to be called before the Frame
2082 gets destroyed so this also adds an assertion to try and identify places
2083 where we fail to call it.
2085 No new tests, no known reproduction case.
2088 (WebCore::Document::Document):
2089 (WebCore::Document::disconnectFromFrame):
2090 (WebCore::Document::frameDestroyed):
2092 (WebCore::Document::frame): Deleted.
2094 2016-12-13 Joseph Pecoraro <pecoraro@apple.com>
2096 REGRESSION(r204163): Web Inspector: Page crashes when Inspector tries to load insecure SourceMap
2097 https://bugs.webkit.org/show_bug.cgi?id=165806
2098 <rdar://problem/28169025>
2100 Reviewed by Alex Christensen.
2102 Test: http/tests/inspector/network/loadResource-insecure-resource.html
2104 * inspector/InspectorNetworkAgent.cpp:
2105 (WebCore::InspectorNetworkAgent::loadResource):
2106 DocumentThreadableLoader now triggers the ThreadableLoaderClient's didFail
2107 callback, so this didFailLoaderCreation is now redundent and incorrect.
2109 2016-12-13 Dave Hyatt <hyatt@apple.com>
2111 [CSS Parser] Enhance fast path translate transforms to allow percentages
2112 https://bugs.webkit.org/show_bug.cgi?id=165822
2114 Reviewed by Simon Fraser.
2116 * css/parser/CSSParserFastPaths.cpp:
2117 (WebCore::parseTransformTranslateArguments):
2119 2016-12-13 Ryosuke Niwa <rniwa@webkit.org>
2121 :hover rule causes a single tap to not activate a slotted anchor element
2122 https://bugs.webkit.org/show_bug.cgi?id=165551
2124 Reviewed by Antti Koivisto.
2126 Fixed a bug in ancestorRespondingToClickEvents that we were traversing the ancestor nodes without taking
2127 shadow roots and slots into account. This prevented tapping on a text node assigned to a slot inside
2128 an anchor element to activate the hyperlink on iOS.
2130 This bug was supposed to be fixed in r206605, and it was still broken on iOS due to the bug in
2131 ancestorRespondingToClickEvents. It is now tested by click-text-inside-linked-slot.html.
2133 Tests: fast/shadow-dom/click-on-slotted-anchor-with-hover.html
2134 fast/shadow-dom/click-text-inside-linked-slot.html
2136 * page/ios/FrameIOS.mm:
2137 (WebCore::ancestorRespondingToClickEvents):
2138 (WebCore::Frame::qualifyingNodeAtViewportLocation):
2140 2016-12-13 Dave Hyatt <hyatt@apple.com>
2142 [CSS Parser] Eliminate SVGPaint and SVGColor
2143 https://bugs.webkit.org/show_bug.cgi?id=165819
2145 Reviewed by Dean Jackson.
2147 Remove SVGColor and SVGPaint CSS values from the tree. The new parser
2148 already stopped making these values when parsing, so all that's left
2149 is to make sure computed style doesn't use these values either.
2151 We are the only browser engine to support these CSS values, they see no use
2152 on the Web, and they're already gone at the parsing level, so it's time
2153 to remove these interfaces from our tree.
2156 * DerivedSources.make:
2157 * WebCore.xcodeproj/project.pbxproj:
2158 * bindings/js/JSCSSValueCustom.cpp:
2159 (WebCore::toJSNewlyCreated):
2160 * css/CSSComputedStyleDeclaration.h:
2162 (WebCore::CSSValue::equals):
2163 (WebCore::CSSValue::cssText):
2164 (WebCore::CSSValue::destroy):
2165 (WebCore::CSSValue::cloneForCSSOM):
2167 (WebCore::CSSValue::isSubtypeExposedToCSSOM):
2168 (WebCore::CSSValue::isSVGColor): Deleted.
2169 (WebCore::CSSValue::isSVGPaint): Deleted.
2170 * css/SVGCSSComputedStyleDeclaration.cpp:
2171 (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor):
2172 (WebCore::ComputedStyleExtractor::svgPropertyValue):
2173 * css/StyleBuilderConverter.h:
2174 (WebCore::StyleBuilderConverter::convertSVGColor):
2175 * css/StyleBuilderCustom.h:
2176 (WebCore::StyleBuilderCustom::applyValueFill):
2177 (WebCore::StyleBuilderCustom::applyValueStroke):
2178 * page/animation/CSSPropertyAnimation.cpp:
2179 (WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
2180 * rendering/style/RenderStyle.h:
2181 (WebCore::RenderStyle::fillPaintType):
2182 (WebCore::RenderStyle::setFillPaintColor):
2183 (WebCore::RenderStyle::strokePaintType):
2184 (WebCore::RenderStyle::setStrokePaintColor):
2185 * rendering/style/SVGRenderStyle.h:
2186 (WebCore::SVGRenderStyle::initialFillPaintType):
2187 (WebCore::SVGRenderStyle::initialStrokePaintType):
2188 (WebCore::SVGRenderStyle::setFillPaint):
2189 (WebCore::SVGRenderStyle::setStrokePaint):
2190 (WebCore::SVGRenderStyle::fillPaintType):
2191 (WebCore::SVGRenderStyle::strokePaintType):
2192 (WebCore::SVGRenderStyle::visitedLinkFillPaintType):
2193 (WebCore::SVGRenderStyle::visitedLinkStrokePaintType):
2194 (WebCore::SVGRenderStyle::hasStroke):
2195 (WebCore::SVGRenderStyle::hasFill):
2196 * rendering/style/SVGRenderStyleDefs.h:
2197 * rendering/svg/RenderSVGResource.cpp:
2198 (WebCore::requestPaintingResource):
2199 * rendering/svg/SVGResources.cpp:
2200 (WebCore::paintingResourceFromSVGPaint):
2201 * svg/SVGAllInOne.cpp:
2202 * svg/SVGAnimatedColor.cpp:
2203 (WebCore::SVGAnimatedColorAnimator::constructFromString):
2204 (WebCore::parseColorFromString):
2205 (WebCore::SVGAnimatedColorAnimator::calculateDistance):
2206 * svg/SVGAnimatedType.cpp:
2207 (WebCore::SVGAnimatedType::setValueAsString):
2208 * svg/SVGAnimatedType.h:
2209 * svg/SVGColor.cpp: Removed.
2210 * svg/SVGColor.h: Removed.
2211 * svg/SVGColor.idl: Removed.
2212 * svg/SVGFEDiffuseLightingElement.cpp:
2213 * svg/SVGFESpecularLightingElement.cpp:
2214 * svg/SVGPaint.cpp: Removed.
2215 * svg/SVGPaint.h: Removed.
2216 * svg/SVGPaint.idl: Removed.
2218 2016-12-13 Alex Christensen <achristensen@webkit.org>
2220 Restore NSURLRequest's default time interval to match behavior before NSURLSession adoption
2221 https://bugs.webkit.org/show_bug.cgi?id=165821
2222 <rdar://problem/28492939>
2224 Reviewed by Brady Eidson.
2226 Before adopting NSURLSession, iOS used CFURLConnection, not NSURLConnection.
2227 iOS used to have a default timeout of INT_MAX and it now has a default timeout of 0, which means use the
2228 default NSURLRequest timeout, which is 60 seconds. This is not enough for some slow mobile networks,
2229 so we want to match behavior of our CFURLConnection code here.
2231 * platform/network/ResourceRequestBase.cpp:
2232 Use INT_MAX as the default timeout of requests on iOS.
2234 2016-12-13 Filip Pizlo <fpizlo@apple.com>
2236 Make opaque root scanning truly constraint-based
2237 https://bugs.webkit.org/show_bug.cgi?id=165760
2239 Reviewed by Saam Barati.
2241 No new tests yet. I think that writing tests for this is a big investigation:
2242 https://bugs.webkit.org/show_bug.cgi?id=165808
2244 Remove the previous advancing wavefront DOM write barrier. I don't think this will scale
2245 very well. It's super confusing.
2247 This change makes it so that visitChildren can become a GC constraint that executes as
2248 part of the fixpoint. This changes all WebCore visitChildren methods that do opaque
2249 roots into constraints.
2251 * bindings/js/CommonVM.cpp:
2252 (WebCore::commonVMSlow):
2253 (WebCore::writeBarrierOpaqueRootSlow): Deleted.
2254 * bindings/js/CommonVM.h:
2255 (WebCore::writeBarrierOpaqueRoot): Deleted.
2256 * bindings/js/JSAttrCustom.cpp:
2257 (WebCore::JSAttr::visitAdditionalChildren):
2258 * bindings/js/JSDOMWindowCustom.cpp:
2259 (WebCore::JSDOMWindow::visitAdditionalChildren):
2260 * bindings/js/JSIDBCursorCustom.cpp:
2261 (WebCore::JSIDBCursor::visitAdditionalChildren):
2262 * bindings/js/JSMessageChannelCustom.cpp:
2263 (WebCore::JSMessageChannel::visitAdditionalChildren):
2264 * bindings/js/JSMessagePortCustom.cpp:
2265 (WebCore::JSMessagePort::visitAdditionalChildren):
2266 * bindings/js/JSNodeIteratorCustom.cpp:
2267 (WebCore::JSNodeIterator::visitAdditionalChildren):
2268 * bindings/js/JSTextTrackCueCustom.cpp:
2269 (WebCore::JSTextTrackCue::visitAdditionalChildren):
2270 * bindings/js/JSTreeWalkerCustom.cpp:
2271 (WebCore::JSTreeWalker::visitAdditionalChildren):
2272 * bindings/js/JSWorkerGlobalScopeCustom.cpp:
2273 (WebCore::JSWorkerGlobalScope::visitAdditionalChildren):
2274 * bindings/js/JSXMLHttpRequestCustom.cpp:
2275 (WebCore::JSXMLHttpRequest::visitAdditionalChildren):
2276 * bindings/js/JSXPathResultCustom.cpp:
2277 (WebCore::JSXPathResult::visitAdditionalChildren):
2278 * dom/ContainerNodeAlgorithms.cpp:
2279 (WebCore::notifyChildNodeInserted):
2280 (WebCore::notifyChildNodeRemoved):
2282 2016-12-12 Sam Weinig <sam@webkit.org>
2284 [WebIDL] Remove use of Dictionary in ApplePaySession
2285 https://bugs.webkit.org/show_bug.cgi?id=165787
2287 Reviewed by Anders Carlsson.
2289 First take at generating the bindings for ApplePaySession and removing
2290 all use of Dictionary.
2292 - Removes all use of Dictionary!
2293 - Removes use of logging errors to the console with improved Exception messages.
2294 - Use ExceptionOr extensively to pass exception state.
2297 - Reconcile / merge ApplePaySession::PaymentRequest with WebCore::PaymentRequest
2298 and all the sub-objects held within.
2299 - Remove PaymentRequestValidator entirely, merging validation into the validation
2300 we already do in ApplePaySession.cpp
2301 - Make ApplePayEvents use generated dictionary creation code.
2303 Test: http/tests/ssl/applepay/ApplePaySession.html
2305 * Modules/applepay/ApplePaySession.cpp:
2306 (WebCore::convertAndValidate):
2307 (WebCore::canCallApplePaySessionAPIs):
2308 (WebCore::ApplePaySession::create):
2309 (WebCore::ApplePaySession::ApplePaySession):
2310 (WebCore::ApplePaySession::supportsVersion):
2311 (WebCore::ApplePaySession::canMakePayments):
2312 (WebCore::ApplePaySession::canMakePaymentsWithActiveCard):
2313 (WebCore::ApplePaySession::openPaymentSetup):
2314 (WebCore::ApplePaySession::begin):
2315 (WebCore::ApplePaySession::completeMerchantValidation):
2316 (WebCore::ApplePaySession::completeShippingMethodSelection):
2317 (WebCore::ApplePaySession::completeShippingContactSelection):
2318 (WebCore::ApplePaySession::completePaymentMethodSelection):
2319 (WebCore::ApplePaySession::didSelectShippingMethod):
2320 (WebCore::createContactFields): Deleted.
2321 (WebCore::toLineItemType): Deleted.
2322 (WebCore::isValidLineItemPropertyName): Deleted.
2323 (WebCore::createLineItem): Deleted.
2324 (WebCore::createLineItems): Deleted.
2325 (WebCore::createMerchantCapabilities): Deleted.
2326 (WebCore::createSupportedNetworks): Deleted.
2327 (WebCore::toShippingType): Deleted.
2328 (WebCore::isValidShippingMethodPropertyName): Deleted.
2329 (WebCore::createShippingMethod): Deleted.
2330 (WebCore::createShippingMethods): Deleted.
2331 (WebCore::isValidPaymentRequestPropertyName): Deleted.
2332 (WebCore::createPaymentRequest): Deleted.
2333 * Modules/applepay/ApplePaySession.h:
2334 Replace hand written dictionary extraction code with autogenerated code
2335 and hand written additional validation.
2337 * Modules/applepay/ApplePaySession.idl:
2338 Add helper dictionaries and enums.
2340 * Modules/applepay/PaymentRequestValidator.cpp:
2341 (WebCore::PaymentRequestValidator::validate):
2342 (WebCore::PaymentRequestValidator::validateTotal):
2343 (WebCore::validateCountryCode):
2344 (WebCore::validateCurrencyCode):
2345 (WebCore::validateMerchantCapabilities):
2346 (WebCore::validateSupportedNetworks):
2347 (WebCore::validateShippingMethod):
2348 (WebCore::validateShippingMethods):
2349 (WebCore::PaymentRequestValidator::PaymentRequestValidator): Deleted.
2350 (WebCore::PaymentRequestValidator::~PaymentRequestValidator): Deleted.
2351 (WebCore::PaymentRequestValidator::validateCountryCode): Deleted.
2352 (WebCore::PaymentRequestValidator::validateCurrencyCode): Deleted.
2353 (WebCore::PaymentRequestValidator::validateMerchantCapabilities): Deleted.
2354 (WebCore::PaymentRequestValidator::validateShippingMethod): Deleted.
2355 (WebCore::PaymentRequestValidator::validateSupportedNetworks): Deleted.
2356 (WebCore::PaymentRequestValidator::validateShippingMethods): Deleted.
2357 * Modules/applepay/PaymentRequestValidator.h:
2358 Instead of reporting the validation errors to the console, pass them in the exception.
2359 This allows us to remove the window member, and move the helpers to the implementation
2362 * WebCore.xcodeproj/project.pbxproj:
2365 * bindings/generic/IDLTypes.h:
2366 (WebCore::IDLObject::nullValue):
2367 (WebCore::IDLObject::isNullValue):
2368 (WebCore::IDLObject::extractValueFromNullable):
2369 Add nullability traits for IDLObject.
2371 * bindings/js/JSApplePaySessionCustom.cpp:
2374 2016-12-13 Daniel Bates <dabates@apple.com>
2376 CSP: Teach the preload scanner about the 'nonce' attribute
2377 https://bugs.webkit.org/show_bug.cgi?id=161192
2378 <rdar://problem/28010354>
2380 Reviewed by Darin Adler.
2382 This patch was inspired by a similar Blink change:
2383 <https://chromium.googlesource.com/chromium/src/+/dde5487f380cf774e4c0e96ba7f88ea68e723907>
2385 Preload external scripts and stylesheets whose HTML script and link elements have a nonce
2386 attribute that is listed in the Content Security Policy (CSP) of the page.
2388 Currently the preload scanner ignores the nonce attribute on HTML script and link elements.
2389 So, WebKit does not preload their associated subresources unless the value of the src
2390 attribute or href attribute is whitelisted in the CSP of the page for script and link
2391 elements, respectively. Instead the preload scanner should recognize the nonce attribute on
2392 script and link elements and query the CSP of the page with it. If the nonce attribute is
2393 whitelisted then the request should be preloaded.
2395 Tests: http/tests/loading/do-not-preload-css-blocked-by-csp.html
2396 http/tests/loading/do-not-preload-script-src-blocked-by-csp.html
2397 http/tests/loading/preload-css-with-csp-nonce.html
2398 http/tests/loading/preload-script-src-with-csp-nonce.html
2400 * html/parser/HTMLPreloadScanner.cpp:
2401 (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest): Set the nonce on the
2402 PreloadRequest to the nonce that we found during the scan.
2403 (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): For script and link tag names,
2404 save the value of the nonce attribute (if it has one).
2405 * html/parser/HTMLResourcePreloader.cpp:
2406 (WebCore::PreloadRequest::resourceRequest): Skip CSP policy check if the nonce is listed in
2407 the CSP of the page.
2408 * html/parser/HTMLResourcePreloader.h:
2409 (WebCore::PreloadRequest::setNonce): Added.
2411 2016-12-13 Dave Hyatt <hyatt@apple.com>
2413 [CSS Parser] Rename CSSPrimitiveValue::UnitTypes to CSSPrimitiveValue::UnitType
2414 https://bugs.webkit.org/show_bug.cgi?id=165776
2416 Reviewed by Zalan Bujtas.
2418 * css/CSSCalculationValue.cpp:
2419 (WebCore::unitCategory):
2420 (WebCore::hasDoubleValue):
2421 (WebCore::determineCategory):
2422 (WebCore::CSSCalcExpressionNodeParser::parseValue):
2423 * css/CSSCalculationValue.h:
2424 * css/CSSPrimitiveValue.cpp:
2425 (WebCore::isValidCSSUnitTypeForDoubleConversion):
2426 (WebCore::isStringType):
2427 (WebCore::CSSPrimitiveValue::unitCategory):
2428 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
2429 (WebCore::CSSPrimitiveValue::cleanup):
2430 (WebCore::CSSPrimitiveValue::computeLengthDouble):
2431 (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble):
2432 (WebCore::CSSPrimitiveValue::conversionToCanonicalUnitsScaleFactor):
2433 (WebCore::CSSPrimitiveValue::getFloatValue):
2434 (WebCore::CSSPrimitiveValue::doubleValue):
2435 (WebCore::CSSPrimitiveValue::canonicalUnitTypeForCategory):
2436 (WebCore::CSSPrimitiveValue::doubleValueInternal):
2437 (WebCore::CSSPrimitiveValue::cloneForCSSOM):
2438 * css/CSSPrimitiveValue.h:
2439 (WebCore::CSSPrimitiveValue::isFontRelativeLength):
2440 (WebCore::CSSPrimitiveValue::isLength):
2441 (WebCore::CSSPrimitiveValue::isResolution):
2442 (WebCore::CSSPrimitiveValue::createAllowingMarginQuirk):
2444 * css/CSSValuePool.cpp:
2445 (WebCore::CSSValuePool::createValue):
2446 * css/CSSValuePool.h:
2447 (WebCore::CSSValuePool::createValue):
2448 * css/MediaQueryExp.cpp:
2449 (WebCore::featureWithValidDensity):
2450 (WebCore::MediaQueryExpression::MediaQueryExpression):
2451 * css/parser/CSSParserFastPaths.cpp:
2452 (WebCore::parseSimpleLength):
2453 (WebCore::parseSimpleLengthValue):
2454 (WebCore::parseColorIntOrPercentage):
2455 (WebCore::fastParseColorInternal):
2456 (WebCore::parseTransformTranslateArguments):
2457 (WebCore::parseTransformNumberArguments):
2458 * css/parser/CSSParserToken.cpp:
2459 (WebCore::cssPrimitiveValueUnitFromTrie):
2460 (WebCore::stringToUnitType):
2461 (WebCore::CSSParserToken::CSSParserToken):
2462 (WebCore::CSSParserToken::convertToPercentage):
2463 * css/parser/CSSParserToken.h:
2464 (WebCore::CSSParserToken::unitType):
2465 * css/parser/CSSPropertyParser.cpp:
2466 (WebCore::CSSPropertyParser::consumeTransformOrigin):
2467 (WebCore::consumeCounter):
2468 (WebCore::consumeAnimationName):
2469 (WebCore::consumePerspective):
2470 (WebCore::consumePositionLonghand):
2471 (WebCore::consumeCounterContent):
2472 (WebCore::consumeReflect):
2473 (WebCore::consumeGridBreadth):
2474 (WebCore::CSSPropertyParser::consumeFlex):
2475 * css/parser/CSSPropertyParserHelpers.cpp:
2476 (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumber):
2477 (WebCore::CSSPropertyParserHelpers::consumeInteger):
2478 (WebCore::CSSPropertyParserHelpers::consumeLength):
2479 (WebCore::CSSPropertyParserHelpers::consumePercent):
2480 (WebCore::CSSPropertyParserHelpers::consumeAngle):
2481 (WebCore::CSSPropertyParserHelpers::consumeTime):
2482 (WebCore::CSSPropertyParserHelpers::consumeCustomIdent):
2483 (WebCore::CSSPropertyParserHelpers::consumeString):
2484 (WebCore::CSSPropertyParserHelpers::consumeUrl):
2485 (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientPoint):
2486 (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradientColorStop):
2487 (WebCore::CSSPropertyParserHelpers::consumeCrossFade):
2488 (WebCore::CSSPropertyParserHelpers::consumeImageSet):
2489 (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
2490 * css/parser/MediaQueryParser.cpp:
2491 (WebCore::MediaQueryParser::readFeatureValue):
2492 * css/parser/SizesAttributeParser.cpp:
2493 (WebCore::SizesAttributeParser::computeLength):
2494 * css/parser/SizesAttributeParser.h:
2495 * dom/StyledElement.cpp:
2496 (WebCore::StyledElement::setInlineStyleProperty):
2497 (WebCore::StyledElement::addPropertyToPresentationAttributeStyle):
2498 * dom/StyledElement.h:
2499 * svg/SVGLengthValue.cpp:
2500 (WebCore::SVGLengthValue::toCSSPrimitiveValue):
2502 2016-12-13 Eric Carlson <eric.carlson@apple.com>
2504 Annotate MediaStream and WebRTC idl with EnabledAtRuntime flag
2505 https://bugs.webkit.org/show_bug.cgi?id=165251
2507 Reviewed by Youenn Fablet.
2509 No new tests, fixes an API test.
2511 * page/Settings.in: Delete mediaStreamEnabled and peerConnectionEnabled, we don't need a
2512 setting and a runtime feature.
2514 2016-12-13 Antti Koivisto <antti@apple.com>
2516 REGRESSION (r198990): Cannot edit content inside <details> in wysiwyg editor
2517 https://bugs.webkit.org/show_bug.cgi?id=165757
2519 Reviewed by Andreas Kling.
2521 Test: fast/html/details-edit.html
2523 -webkit-user-modify is reset on shadow boundary so it doesn't go through <details> shadow tree.
2525 * css/StyleResolver.cpp:
2526 (WebCore::StyleResolver::styleForElement):
2527 (WebCore::StyleResolver::pseudoStyleForElement):
2528 (WebCore::StyleResolver::styleForPage):
2529 (WebCore::StyleResolver::applyMatchedProperties):
2531 (WebCore::computeEditabilityFromComputedStyle):
2532 (WebCore::Node::computeEditability):
2534 Make -webkit-user-modify (which we would want to get rid of completely eventually) have no effect in shadow trees.
2535 Check for contenteditable directly instead.
2537 * html/HTMLInputElement.cpp:
2538 (WebCore::HTMLInputElement::createInnerTextStyle):
2539 * html/HTMLTextAreaElement.cpp:
2540 (WebCore::HTMLTextAreaElement::createInnerTextStyle):
2541 * html/shadow/TextControlInnerElements.cpp:
2542 * rendering/RenderFlowThread.cpp:
2543 (WebCore::RenderFlowThread::createFlowThreadStyle):
2544 * rendering/RenderLayer.cpp:
2545 (WebCore::RenderLayer::calculateClipRects):
2546 * rendering/RenderListItem.cpp:
2547 (WebCore::RenderListItem::styleDidChange):
2548 * rendering/style/RenderStyle.cpp:
2549 (WebCore::RenderStyle::createAnonymousStyleWithDisplay):
2550 (WebCore::RenderStyle::createStyleInheritingFromPseudoStyle):
2551 (WebCore::RenderStyle::inheritFrom):
2553 Let -webkit-user-modify inherit through shadow boundary as normal.
2555 * rendering/style/RenderStyle.h:
2557 2016-12-12 Darin Adler <darin@apple.com>
2559 Remove bindings generation support for legacy WebCore::Dictionary
2560 https://bugs.webkit.org/show_bug.cgi?id=165762
2562 Reviewed by Sam Weinig.
2564 After this patch, all use of legacy WebCore::Dictionary is within custom bindings or
2565 inside the DOM code itself. Bindings generation machinery no longer has a special
2566 type named "Dictionary" but has increasingly good support for IDL-defined dictionaries.
2568 * Modules/applepay/ApplePaySession.cpp:
2569 (WebCore::ApplePaySession::create): Take ExecState and a JSValue rather than a Dictionary.
2570 (WebCore::ApplePaySession::completeMerchantValidation): Ditto.
2571 * Modules/applepay/ApplePaySession.h: Updated for the above changes.
2572 * Modules/applepay/ApplePaySession.idl: For this last file using Dictionary in IDL, move
2573 to "[CallWith=ScriptState]" and "any" as a stopgap. Later we can return and use IDL
2574 dictionaries or other more modern solutions.
2576 * Modules/mediastream/MediaDevices.idl: For the custom binding written in JavaScript,
2577 use the type mentioned in the specification rather than Dictionary. The bindings generator
2578 ignores the type, so this is more like changing a comment rather than changing source code.
2580 * Modules/mediastream/RTCPeerConnection.js:
2581 (initializeRTCPeerConnection): Refer to a non-object as not a valid "dictionary", lowercase
2582 rather than "Dictionary".
2583 * Modules/mediastream/RTCPeerConnectionInternals.js:
2584 (callbacksAndDictionaryOverload): Ditto.
2586 * bindings/generic/IDLTypes.h: Removed IDLLegacyDictionary.
2588 * bindings/js/JSCryptoAlgorithmDictionary.cpp:
2589 (WebCore::getHashAlgorithm): Fixed a comment.
2591 * bindings/js/JSDOMConvert.h:
2592 (WebCore::Converter<IDLLegacyDictionary<T>>::convert): Deleted.
2594 * bindings/scripts/CodeGenerator.pm:
2595 (IsBuiltinType): Removed special case for "Dictionary".
2596 * bindings/scripts/CodeGeneratorJS.pm:
2597 (AddToIncludesForIDLType): Ditto.
2598 (AreTypesDistinguishableForOverloadResolution): Ditto.
2599 (GenerateOverloadedFunctionOrConstructor): Ditto.
2600 (GenerateParametersCheck): Ditto.
2601 (GetBaseIDLType): Ditto.
2603 * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated results.
2604 * bindings/scripts/test/TestObj.idl: Removed test case for Dictionary.
2606 2016-12-12 Chris Dumez <cdumez@apple.com>
2608 Drop unnecessary null check in removeDetachedChildrenInContainer()
2609 https://bugs.webkit.org/show_bug.cgi?id=165778
2611 Reviewed by Alex Christensen.
2613 Drop unnecessary null check in removeDetachedChildrenInContainer().
2614 Node cannot be null but we do an implicit null check.
2616 No new tests, no Web-exposed behavior change.
2618 * dom/ContainerNodeAlgorithms.cpp:
2619 (WebCore::removeDetachedChildrenInContainer):
2621 2016-12-12 Chris Dumez <cdumez@apple.com>
2623 Add Document.onvisibilitychange event handler attribute
2624 https://bugs.webkit.org/show_bug.cgi?id=165784
2626 Reviewed by Daniel Bates.
2628 Add Document.onvisibilitychange event handler attribute as per Page
2629 Visibility Level 2 API:
2630 - http://w3c.github.io/page-visibility/#onvisiblitychange-event-handler
2632 Test: fast/events/page-visibility-onvisibilitychange.html
2636 2016-12-12 Dean Jackson <dino@apple.com>
2638 [iOS] MediaDocument "Done" button should navigate the page back
2639 https://bugs.webkit.org/show_bug.cgi?id=165779
2641 Reviewed by Sam Weinig.
2643 Detect if the exit from fullscreen was caused by the Done button,
2644 and if so, tell the page to navigate back.
2646 Unfortunately this is not yet testable. It's waiting on the
2647 UI-based device testing in development by the media team.
2649 * platform/cocoa/WebVideoFullscreenModel.h: Add a finishedWithMedia parameter to
2650 requestFullscreenMode, to indicate if the change in mode is associated with
2651 the closing of the media document.
2652 * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
2653 * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
2654 (WebVideoFullscreenModelVideoElement::requestFullscreenMode): If we're a media
2655 document, and we say we're finished with the media, tell the document
2656 to navigate back a page.
2657 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2658 (WebVideoFullscreenControllerContext::requestFullscreenMode):
2659 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2660 (WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
2662 2016-12-12 Zalan Bujtas <zalan@apple.com>
2664 Infinite recursion when viewport is set to the size of the content but the content overflows the viewport.
2665 https://bugs.webkit.org/show_bug.cgi?id=165775
2666 rdar://problem/29366628
2668 Reviewed by Simon Fraser.
2670 In certain cases when the viewport is sized to accomodate the content and
2671 the content always overflows the viewport, we might end up in recursive FrameView::layout calls.
2672 This is specific to content with viewport units, because we always invalidate elements with vw/vh units on
2673 viewport size change. However if this viewport size change is in response to content size change (layout),
2674 invalidating elements could trigger synchronous layout, while we are still inside this current layout.
2675 This is very similar to the m_setNeedsLayoutWasDeferred case and they should eventually be merged.
2676 It also means that we might be behind by one layout on elements with vw/vh units (fixed layout only though).
2678 Currently not testable.
2680 * page/FrameView.cpp:
2681 (WebCore::FrameView::availableContentSizeChanged):
2683 2016-12-12 Keith Rollin <krollin@apple.com>
2685 Memory warning logging appears to capture resident footprint, missing compress/swap.
2686 https://bugs.webkit.org/show_bug.cgi?id=165533
2687 <rdar://problem/29318410>
2689 Reviewed by Andreas Kling.
2691 Have platformMemoryUsage return both resident and resident + swapped
2692 values. This is now returned as a struct in a std::optional to better
2693 support cases where values cannot or are not returned. Report these
2694 values in logMemoryUsageChange.
2696 Remove most of the ReliefLogger instances and their messages. We no
2697 longer free up fastMalloc memory after each memory-release operation,
2698 so there are no memory regions returned to the OS. Instead, we now
2699 free up fastMalloc memory regions at the end of all memory-releasing
2700 operations in one fell swoop and report a grand total of memory
2703 No new tests -- no changes to user accessible functionality.
2705 * page/MemoryRelease.cpp:
2706 (WebCore::releaseNoncriticalMemory):
2707 (WebCore::releaseCriticalMemory):
2708 (WebCore::releaseMemory):
2709 * page/cocoa/MemoryReleaseCocoa.mm:
2710 (WebCore::platformReleaseMemory):
2711 * platform/MemoryPressureHandler.cpp:
2712 (WebCore::MemoryPressureHandler::releaseMemory):
2713 (WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
2714 (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2715 * platform/MemoryPressureHandler.h:
2716 (WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
2717 (WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
2718 (WebCore::MemoryPressureHandler::ReliefLogger::loggingEnabled):
2719 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2720 (WebCore::MemoryPressureHandler::platformReleaseMemory):
2721 (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2722 * platform/linux/MemoryPressureHandlerLinux.cpp:
2723 * platform/win/MemoryPressureHandlerWin.cpp:
2724 (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
2726 2016-12-12 Chris Dumez <cdumez@apple.com>
2728 Document.visibilityState should use an IDL string enumeration
2729 https://bugs.webkit.org/show_bug.cgi?id=165774
2731 Reviewed by Daniel Bates.
2733 Document.visibilityState should use an IDL string enumeration:
2734 - http://w3c.github.io/page-visibility/#extensions-to-the-document-interface
2736 No new tests, there should be no Web-exposed behavior change.
2739 * Modules/vibration/NavigatorVibration.cpp:
2740 (WebCore::NavigatorVibration::vibrate):
2741 * WebCore.xcodeproj/project.pbxproj:
2743 (WebCore::Document::hidden):
2744 (WebCore::Document::pageVisibilityState): Deleted.
2745 (WebCore::Document::visibilityState): Deleted.
2749 (WebCore::Page::visibilityState):
2750 * page/PageVisibilityState.cpp: Removed.
2751 * page/PageVisibilityState.h:
2754 2016-12-12 Jer Noble <jer.noble@apple.com>
2756 Remove implementation of legacy Mozilla-based Fullscreen API.
2757 https://bugs.webkit.org/show_bug.cgi?id=165689
2759 Reviewed by Eric Carlson.
2761 Alias the legacy webkitRequestFull_S_creen() function on Element to webkitRequestFull_s_creen().
2762 Remove the custom behavior in Document::requestFullScreenForElement() to handle the legacy path.
2765 (WebCore::Document::requestFullScreenForElement):
2768 (WebCore::Element::webkitRequestFullscreen):
2769 (WebCore::Element::webkitRequestFullScreen): Deleted.
2772 * html/HTMLMediaElement.cpp:
2773 (WebCore::HTMLMediaElement::enterFullscreen):
2774 * html/shadow/MediaControlElements.cpp:
2775 (WebCore::MediaControlFullscreenButtonElement::defaultEventHandler):
2777 2016-12-12 Zalan Bujtas <zalan@apple.com>
2779 The CSS 'columns' property when set on the <body> element makes short columns
2780 https://bugs.webkit.org/show_bug.cgi?id=164891
2782 Reviewed by Darin Adler and David Hyatt.
2784 Currently when the body has auto height, we use the height of the viewport as
2785 the available height for the columns defined on the body element.
2786 This is the desired behaviour for paginated content.
2787 However in case of a simple, non-paginated multicolumn context, we should let the columns grow beyond
2788 the viewport vertically. This is also what other browsers do.
2789 This patch sets the available height on columns (in non-paginated context) only if the logical height
2790 is defined (we are right before layout, so applying non-defined values does not make much sense anyway).
2791 The reason why it is only broken on the <body> is because it stretches to the viewport by
2792 default (see stretchesToViewport()) while other block renderers do not.
2794 Test: fast/multicol/columns-on-body.html
2796 * rendering/RenderBlockFlow.cpp:
2797 (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
2799 2016-12-09 Dean Jackson <dino@apple.com>
2801 Autoplay isn't working in iPhone MediaDocuments
2802 https://bugs.webkit.org/show_bug.cgi?id=165710
2803 <rdar://problems/29606761>
2805 Reviewed by Darin Adler.
2807 Our silent video autoplay detection disabled autoplay
2808 of videos in MediaDocuments.
2810 Test: media/ios/autoplay-only-in-main-document.html
2812 * html/MediaElementSession.cpp:
2813 (WebCore::MediaElementSession::playbackPermitted):
2814 Return true if we're in a top-level media document.
2816 2016-12-12 Zan Dobersek <zdobersek@igalia.com>
2818 Unreviewed. Fixing build breakage in GStreamer's WebKitCommonEncryptionDecryptorGStreamer.
2820 * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
2821 (webkitMediaCommonEncryptionDecryptTransformInPlace):
2822 WTF::Seconds should be used instead of std::chrono::seconds.
2824 2016-12-11 Simon Fraser <simon.fraser@apple.com>
2826 REGRESSION (r200283): Transform, overflow hidden and filter combination completely hides the element
2827 https://bugs.webkit.org/show_bug.cgi?id=161509
2829 Reviewed by David Hyatt.
2831 When the filter painting code needs to recompute a paintDirtyRect, it was using selfClipRect()
2832 which is obviously wrong because it returns a rect in absolute coordinates. Use code factored
2833 out of localClipRect() instead, which returns a rect relative to the painting root.
2835 Test: css3/filters/filter-on-overflow-hidden.html
2837 * rendering/RenderLayer.cpp:
2838 (WebCore::RenderLayer::paintLayerContents):
2840 2016-12-11 Saam Barati <sbarati@apple.com>
2842 We should be able to throw exceptions from Wasm code and when Wasm frames are on the stack
2843 https://bugs.webkit.org/show_bug.cgi?id=165429
2845 Reviewed by Keith Miller.
2847 * bindings/js/JSDOMBinding.cpp:
2848 (WebCore::GetCallerGlobalObjectFunctor::operator()):
2850 2016-12-11 Darin Adler <darin@apple.com>
2852 Remove uses of Dictionary in WebRTC IDL files
2853 https://bugs.webkit.org/show_bug.cgi?id=165736
2855 Reviewed by Sam Weinig.
2857 Also removed quite a bit of unused code. There were some mocks that were out of date and
2858 no longer matched the types used in the real code, that also were no longer hooked up,
2859 and other types of dead code. We will have to implement anew when we want to restore tests
2860 like the ones these were intended to enable.
2862 * CMakeLists.txt: Updated for all the removed files.
2864 * Modules/mediastream/MediaEndpointPeerConnection.cpp: Moved some types in here
2865 that don't need to be in the header.
2866 (WebCore::MediaEndpointPeerConnection::MediaEndpointPeerConnection): Use make_unique.
2867 (WebCore::MediaEndpointPeerConnection::setConfiguration): Changed argument type,
2868 obviating the need for most of the code that was here.
2869 * Modules/mediastream/MediaEndpointPeerConnection.h: Updated for the above. Made more
2870 things private and final. Marked the constructor explicit. Removed unneeded includes.
2872 * Modules/mediastream/PeerConnectionBackend.h: Removed unneeded includes and forward
2873 declarations. Changed the argument type for setConfiguration (see above).
2875 * Modules/mediastream/RTCConfiguration.cpp: Removed.
2876 None of the code here was needed except for the ICE server validation, and that was
2877 moved into RTCPeerConnection::setConfiguration.
2878 * Modules/mediastream/RTCConfiguration.h: Changed this from a class to a struct since
2879 this is now a dictionary rather than an interface.
2880 * Modules/mediastream/RTCConfiguration.idl: Changed this from an interface to a dictionary.
2882 * Modules/mediastream/RTCDTMFSender.cpp: Removed some of the code from this file. This
2883 class currently isn't implemented, but was depending on RTCPeerConnectionHandler. I removed
2884 some of the dead code. Someone will have to straighten this out so we can turn it back on.
2885 * Modules/mediastream/RTCDTMFSender.h: Ditto.
2887 * Modules/mediastream/RTCDataChannel.cpp: Updated includes.
2889 * Modules/mediastream/RTCIceCandidate.cpp:
2890 (WebCore::RTCIceCandidate::create): Removed most of the code, since this now takes
2891 a structure rather than a WebCore::Dictionary, and so the bindings take care of the work.
2892 * Modules/mediastream/RTCIceCandidate.h: Updated for the above.
2893 * Modules/mediastream/RTCIceCandidate.idl: Changed the constructor to take a
2894 RTCIceCandidateInit instead of a Dictionary.
2896 * Modules/mediastream/RTCIceServer.h: Changed this from a class to a struct since
2897 this is now a dictionary rather than an interface.
2898 * Modules/mediastream/RTCIceServer.idl: Changed this from an interface to a dictionary.
2900 * Modules/mediastream/RTCPeerConnection.cpp:
2901 (WebCore::RTCPeerConnection::initializeWith): Take an RTCConfiguration rather than
2903 (WebCore::RTCPeerConnection::getConfiguration): Moved to header, now an inline.
2904 (WebCore::RTCPeerConnection::setConfiguration): Use the configuration dictionary now instead
2905 of the configuration class. Also moved validation of server URLs here, formerly in the
2906 RTCConfiguration RTCConfiguration::initialize function. Also moved code to convert from
2907 RTCConfiguration to MediaEndpointConfiguration here, formerly in
2908 MediaEndpointPeerConnection::setConfiguration.
2909 * Modules/mediastream/RTCPeerConnection.h: Updated for the above.
2910 * Modules/mediastream/RTCPeerConnection.idl: Changed argument to initializeWith and
2911 setConfiguration from Dictionary to RTCConfiguration.
2913 * Modules/mediastream/RTCSessionDescription.cpp:
2914 (WebCore::parseTypeString): Deleted.
2915 (WebCore::RTCSessionDescription::create): Changed to take struct instead of Dictionary.
2916 * Modules/mediastream/RTCSessionDescription.h: Added Init struct and changed create to
2918 * Modules/mediastream/RTCSessionDescription.idl: Changed constructor argument to take
2919 RTCSessionDescriptionInit dictionary instead of Dictionary.
2921 * Modules/webaudio/MediaStreamAudioDestinationNode.cpp: Updated includes.
2923 * WebCore.xcodeproj/project.pbxproj: Updated for all the removed files.
2925 * bindings/scripts/CodeGeneratorJS.pm:
2926 (GenerateDictionaryImplementationContent): Fixed convertDictionaryToJS to work with other
2927 nullable types besides RefPtr.
2928 * bindings/scripts/test/JS/JSTestObj.cpp: Regenerated.
2930 * platform/mediastream/RTCConfigurationPrivate.h: Removed.
2931 * platform/mediastream/RTCIceServerPrivate.h: Removed.
2932 * platform/mediastream/RTCPeerConnectionHandler.cpp: Removed.
2933 * platform/mediastream/RTCPeerConnectionHandler.h: Removed.
2934 * platform/mock/RTCDTMFSenderHandlerMock.cpp: Removed.
2935 * platform/mock/RTCDTMFSenderHandlerMock.h: Removed.
2937 * platform/mock/RTCDataChannelHandlerMock.h: Updated includes, made more things private and final.
2939 * platform/mock/RTCPeerConnectionHandlerMock.cpp: Removed.
2940 * platform/mock/RTCPeerConnectionHandlerMock.h: Removed.
2942 * testing/Internals.cpp:
2943 (WebCore::Internals::Internals): Removed call to enableMockRTCPeerConnectionHandler.
2944 (WebCore::Internals::enableMockRTCPeerConnectionHandler): Deleted.
2946 2016-12-11 Darin Adler <darin@apple.com>
2948 Use std::vsnprintf instead of vasprintf
2949 https://bugs.webkit.org/show_bug.cgi?id=165740
2951 Reviewed by Sam Weinig.
2953 * platform/FileHandle.cpp:
2954 (WebCore::FileHandle::printf): Use vsnprintf, including StringExtras.h to
2955 ensure compatibility with older versions of the Visual Studio library,
2956 and Vector for the buffer. Use inline capacity in the vector so we normally
2957 don't need to allocate any memory on the heap.
2958 * xml/XSLTUnicodeSort.cpp:
2959 (xsltTransformErrorTrampoline): Ditto.
2960 * xml/parser/XMLDocumentParserLibxml2.cpp:
2961 (WebCore::XMLDocumentParser::error): Ditto.
2963 2016-12-11 Darin Adler <darin@apple.com>
2965 Make some refinements to HTMLPlugInImageElement
2966 https://bugs.webkit.org/show_bug.cgi?id=165742
2968 Reviewed by Sam Weinig.
2970 * html/HTMLPlugInImageElement.cpp: Removed many unneeded includes.
2971 (WebCore::titleText): Use HashMap::ensure, correct argument types.
2972 (WebCore::subtitleText): Ditto.
2973 (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement): Moved
2974 initialization of most scalars to the class definition.
2975 (WebCore::HTMLPlugInImageElement::isImageType): Use auto.
2976 (WebCore::HTMLPlugInImageElement::wouldLoadAsPlugIn): Removed
2977 unneeded local variable and if statement.
2978 (WebCore::HTMLPlugInImageElement::willDetachRenderers): Use auto.
2979 (WebCore::HTMLPlugInImageElement::updateSnapshot): Do not call
2980 renderer twice unnecessarily.
2981 (WebCore::plugInImageElementIsolatedWorld): Use auto.
2982 (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot): Use auto.
2983 (WebCore::HTMLPlugInImageElement::partOfSnapshotOverlay): Use auto.
2984 (WebCore::HTMLPlugInImageElement::restartSimilarPlugIns): Got rid of
2985 unnecessary typedef.
2986 (WebCore::HTMLPlugInImageElement::userDidClickSnapshot): Take a
2987 reference rather than PassRefPtr.
2988 (WebCore::documentHadRecentUserGesture): Removed unneeded if.
2989 (WebCore::HTMLPlugInImageElement::checkSizeChangeForSnapshotting): Use auto.
2990 (WebCore::isSmallerThanTinySizingThreshold): Use auto.
2991 (WebCore::HTMLPlugInImageElement::isTopLevelFullPagePlugin): Use auto.
2992 (WebCore::HTMLPlugInImageElement::checkSnapshotStatus): Use auto.
2993 (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Got rid
2994 of unnecessary local variable. Use auto.
2995 (WebCore::HTMLPlugInImageElement::requestObject): Got rid of unnecessary
2997 * html/HTMLPlugInImageElement.h: Updated for the above. Removed incorrect
2998 use of const. Initialized all scalars. Made function private and final.
3000 * rendering/RenderSnapshottedPlugIn.cpp:
3001 (WebCore::RenderSnapshottedPlugIn::handleEvent): Pass reference instead
3004 2016-12-11 Joseph Pecoraro <pecoraro@apple.com>
3006 Web Inspector: Cleanup some InspectorInstrumentation network loading notifications
3007 https://bugs.webkit.org/show_bug.cgi?id=165688
3009 Reviewed by Brian Burg.
3011 Eliminate InspectorInstrumentation::willReceiveResourceResponse by folding
3012 it into InspectorInstrumentation::didReceiveResourceResponse. Simplify other
3013 related InspectorInstrumentation calls by using references and using more
3014 consistent InspectorInstrumentation patterns.
3016 * inspector/InspectorInstrumentation.cpp:
3017 (WebCore::InspectorInstrumentation::didReceiveResourceResponseImpl):
3018 (WebCore::InspectorInstrumentation::willReceiveResourceResponseImpl): Deleted.
3019 (WebCore::InspectorInstrumentation::didReceiveResourceResponseButCanceledImpl): Deleted.
3020 (WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDeniedImpl): Deleted.
3021 (WebCore::InspectorInstrumentation::continueWithPolicyDownloadImpl): Deleted.
3022 (WebCore::InspectorInstrumentation::continueWithPolicyIgnoreImpl): Deleted.
3023 * inspector/InspectorInstrumentation.h:
3024 (WebCore::InspectorInstrumentation::didReceiveResourceResponse):
3025 (WebCore::InspectorInstrumentation::continueAfterXFrameOptionsDenied):
3026 (WebCore::InspectorInstrumentation::continueWithPolicyDownload):
3027 (WebCore::InspectorInstrumentation::continueWithPolicyIgnore):
3028 (WebCore::InspectorInstrumentation::willReceiveResourceResponse): Deleted.
3029 * loader/CrossOriginPreflightChecker.cpp:
3030 (WebCore::CrossOriginPreflightChecker::validatePreflightResponse):
3031 * loader/DocumentLoader.cpp:
3032 (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
3033 (WebCore::DocumentLoader::continueAfterContentPolicy):
3034 * loader/ResourceLoadNotifier.cpp:
3035 (WebCore::ResourceLoadNotifier::dispatchDidReceiveResponse):
3036 * loader/appcache/ApplicationCacheGroup.cpp:
3037 (WebCore::ApplicationCacheGroup::didReceiveResponse):
3039 2016-12-11 Eric Carlson <eric.carlson@apple.com>
3041 [MediaStream] Protect MediaDevicesRequest during callback
3042 https://bugs.webkit.org/show_bug.cgi?id=165711
3043 <rdar://problem/28400468>
3045 Reviewed by Sam Weinig.
3047 No new tests, I was unable to create a reproducible test but this fix avoids
3048 an occasional crash in existing tests.
3050 * Modules/mediastream/MediaDevicesEnumerationRequest.cpp:
3051 (WebCore::MediaDevicesEnumerationRequest::start): Take a reference to the object
3052 before calling the controller in case the completion handler is called synchronously.
3054 2016-12-09 Filip Pizlo <fpizlo@apple.com>
3056 The DOM should have an advancing wavefront opaque root barrier
3057 https://bugs.webkit.org/show_bug.cgi?id=165712
3059 Reviewed by Yusuke Suzuki.
3061 No new tests because this was covered by crashing tests.
3063 Consider these two cases:
3066 1) DOM at start: D->X->Y
3067 2) Mark X, X->visitChildren, addOpaqueRoot(D)
3069 4) Y thinks it's not reachable (its opaque root, X, is not in the set).
3072 1) DOM at start: D, X->Y
3073 2) Mark X, X->visitChildren, addOpaqueRoot(X)
3075 4) Y thinks it's not reachable (its opaque root, D, is not in the set).
3077 We can fix this with two barriers:
3079 Removal: add X (the removed child) to the opaque root set.
3080 Insertion: add D (the insertion point) to the opaque root set.
3082 Thanks Rysosuke for coming up with this idea!
3084 Both barriers advance the wavefront. We could consider retreating wavefront barriers in
3085 the future (where we cause visitChildren to be called again on wrappers that belonged to
3086 roots that got affected by insertion/removal) but those would probably require more
3089 To make this barrier very fast, the WebCore caches the JSC VM's barrier state in
3090 its own global variable for very fast access. This variable will be false most of the
3091 time. It's false when there is no VM, so triggering the barrier won't cause the VM to be
3092 created. It's only true when GC is running, which is rare by design.
3094 To make that caching more sensible, I finally gave WebCore a central header for
3095 the common VM (CommonVM.h).
3098 * Modules/mediastream/SDPProcessor.cpp:
3099 (WebCore::SDPProcessor::callScript):
3100 * WebCore.xcodeproj/project.pbxproj:
3101 * bindings/js/CommonVM.cpp: Added.
3102 (WebCore::commonVMSlow):
3103 (WebCore::writeBarrierOpaqueRootSlow):
3104 * bindings/js/CommonVM.h: Added.
3105 (WebCore::commonVM):
3106 (WebCore::writeBarrierOpaqueRoot):
3107 * bindings/js/DOMWrapperWorld.cpp:
3108 (WebCore::mainThreadNormalWorld):
3109 * bindings/js/GCController.cpp:
3111 (WebCore::GCController::garbageCollectSoon):
3112 (WebCore::GCController::garbageCollectNow):
3113 (WebCore::GCController::garbageCollectNowIfNotDoneRecently):
3114 (WebCore::GCController::setJavaScriptGarbageCollectorTimerEnabled):
3115 (WebCore::GCController::deleteAllCode):
3116 (WebCore::GCController::deleteAllLinkedCode):
3117 * bindings/js/JSCustomXPathNSResolver.cpp:
3118 (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
3119 * bindings/js/JSDOMBinding.cpp:
3120 (WebCore::addImpureProperty):
3121 * bindings/js/JSDOMWindowBase.cpp:
3122 (WebCore::JSDOMWindowBase::fireFrameClearedWatchpointsForWindow):
3123 (WebCore::JSDOMWindowBase::commonVM): Deleted.
3124 * bindings/js/JSDOMWindowBase.h:
3125 * bindings/js/JSDOMWindowShell.cpp:
3126 (WebCore::JSDOMWindowShell::setWindow):
3127 * bindings/js/JSNodeCustom.h:
3129 * bindings/js/ScriptCachedFrameData.cpp:
3130 (WebCore::ScriptCachedFrameData::ScriptCachedFrameData):
3131 (WebCore::ScriptCachedFrameData::restore):
3132 (WebCore::ScriptCachedFrameData::clear):
3133 * bindings/js/ScriptController.cpp:
3134 (WebCore::ScriptController::~ScriptController):
3135 (WebCore::ScriptController::createWorld):
3136 (WebCore::ScriptController::getAllWorlds):
3137 (WebCore::ScriptController::clearWindowShell):
3138 (WebCore::ScriptController::cacheableBindingRootObject):
3139 (WebCore::ScriptController::bindingRootObject):
3140 (WebCore::ScriptController::windowScriptNPObject):
3141 (WebCore::ScriptController::jsObjectForPluginElement):
3142 (WebCore::ScriptController::clearScriptObjects):
3143 * dom/CollectionIndexCache.cpp:
3144 (WebCore::reportExtraMemoryAllocatedForCollectionIndexCache):
3145 * dom/ContainerNode.cpp:
3146 * dom/ContainerNodeAlgorithms.cpp:
3147 (WebCore::notifyChildNodeInserted):
3148 (WebCore::notifyChildNodeRemoved):
3150 (WebCore::Document::shouldBypassMainWorldContentSecurityPolicy):
3152 (WebCore::Node::opaqueRoot):
3153 * dom/ScriptExecutionContext.cpp:
3154 (WebCore::ScriptExecutionContext::vm):
3155 * html/HTMLImageLoader.cpp:
3156 (WebCore::HTMLImageLoader::notifyFinished):
3157 * html/HTMLMediaElement.cpp:
3158 (WebCore::HTMLMediaElement::pauseAfterDetachedTask):
3159 (WebCore::HTMLMediaElement::ensureIsolatedWorld):
3160 * html/HTMLPlugInImageElement.cpp:
3161 (WebCore::plugInImageElementIsolatedWorld):
3162 * inspector/InspectorController.cpp:
3163 (WebCore::InspectorController::vm):
3164 * inspector/PageScriptDebugServer.cpp:
3165 (WebCore::PageScriptDebugServer::PageScriptDebugServer):
3166 * page/PerformanceLogging.cpp:
3167 (WebCore::PerformanceLogging::memoryUsageStatistics):
3168 (WebCore::PerformanceLogging::javaScriptObjectCounts):
3169 * page/ResourceUsageThread.cpp:
3170 (WebCore::ResourceUsageThread::createThreadIfNeeded):
3171 * svg/graphics/SVGImage.cpp:
3172 (WebCore::SVGImage::reportApproximateMemoryCost):
3173 * testing/MemoryInfo.h:
3174 (WebCore::MemoryInfo::MemoryInfo):
3176 2016-12-11 Dan Bernstein <mitz@apple.com>
3178 [Cocoa] NSAttributedString representation of text copied from -webkit-nbsp-mode:space element contains non-breaking space characters, but shouldn’t
3179 https://bugs.webkit.org/show_bug.cgi?id=165515
3180 <rdar://problem/4108460>
3182 Reviewed by Darin Adler.
3184 Test: platform/mac/fast/text/attributed-substring-from-range.html
3186 * editing/cocoa/HTMLConverter.mm:
3187 (HTMLConverter::_processText): Emit a space instead of a non-breaking space if the text node
3188 is styled with -webkit-nbsp-mode:space.
3189 (WebCore::editingAttributedStringFromRange): Replace all non-breaking spaces with spaces if
3190 they come from a text node with -webkit-nbsp-mode:space.
3192 2016-12-11 Konstantin Tokarev <annulen@yandex.ru>
3194 Unreviewed, add KHR include dir to fix ANGLE build after r209665
3195 https://bugs.webkit.org/show_bug.cgi?id=165686
3199 2016-12-10 Dave Hyatt <hyatt@apple.com>
3201 Rolling out 165737, since it broke layout tests. I need to find a
3202 different place to put the init.
3204 * contentextensions/ContentExtensionParser.cpp:
3205 (WebCore::ContentExtensions::isValidSelector):
3207 2016-12-10 Simon Fraser <simon.fraser@apple.com>
3209 Support the deprecated dictionary constructor for DOMPointReadOnly and DOMPoint
3210 https://bugs.webkit.org/show_bug.cgi?id=165732
3212 Reviewed by Sam Weinig.
3214 For compatibility with other browsers, support the DOMPointInit constructor to
3215 DOMPoint and DOMPointReadOnly per <https://www.w3.org/TR/geometry-1/#DOMPoint>
3217 Extended geometry/DOMPoint-001.html to test.
3221 * dom/DOMPointReadOnly.h:
3222 (WebCore::DOMPointReadOnly::create):
3223 * dom/DOMPointReadOnly.idl:
3225 2016-12-10 Dave Hyatt <hyatt@apple.com>
3227 [CSS Parser] Make sure content extensions initialize AtomicString
3228 https://bugs.webkit.org/show_bug.cgi?id=165737
3230 Reviewed by Simon Fraser.
3232 Fixes two broken tests in TestWebkitAPI.
3234 * contentextensions/ContentExtensionParser.cpp:
3235 (WebCore::ContentExtensions::isValidSelector):
3237 2016-12-10 Simon Fraser <simon.fraser@apple.com>
3239 Animation followed by transition doesn't always fire transitionend event
3240 https://bugs.webkit.org/show_bug.cgi?id=165731
3241 rdar://problem/28471240
3243 Reviewed by Zalan Bujtas.
3245 After r200047, a keyframe animation of an accelerated property followed by a
3246 transition didn't always fire a transitionend event.
3248 This happened if CompositeAnimation::timeToNextService() happend to be called
3249 when the transitions's timeToNextService() returned a positive value, but the
3250 keyframe animation still existed, but its timeToNextService() returned -1. In
3251 this case that -1 would clobber the positing minT.
3253 Fix by just continuing in each loop when the timeToNextService() returns -1.
3255 This code should probably be rewritten to use std::optional<double> rather than
3258 Test: animations/animation-followed-by-transition.html
3260 * page/animation/CompositeAnimation.cpp:
3261 (WebCore::CompositeAnimation::timeToNextService):
3262 * platform/graphics/ca/GraphicsLayerCA.cpp:
3263 (WebCore::GraphicsLayerCA::addAnimation):
3264 (WebCore::GraphicsLayerCA::pauseAnimation):
3265 (WebCore::GraphicsLayerCA::removeAnimation):
3266 (WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
3267 (WebCore::GraphicsLayerCA::platformCALayerAnimationEnded):
3269 2016-12-10 Sam Weinig <sam@webkit.org>
3271 [WebIDL] Merge JSDictionary into Dictionary, and remove unused bits
3272 https://bugs.webkit.org/show_bug.cgi?id=165641
3274 Reviewed by Dan Bernstein.
3277 * WebCore.xcodeproj/project.pbxproj:
3278 * bindings/js/JSBindingsAllInOne.cpp:
3279 Remove JSDictionary.h/cpp
3281 * Modules/mediastream/RTCDataChannel.cpp:
3282 Remove unused #include of Dictionary.h
3284 * Modules/mediastream/RTCPeerConnection.cpp:
3285 * Modules/mediastream/RTCPeerConnection.h:
3286 Replace unnecessary #include of Dictionary in a header with forward declaration.
3288 * bindings/js/Dictionary.cpp:
3289 (WebCore::Dictionary::Dictionary):
3290 (WebCore::Dictionary::tryGetProperty):
3291 (WebCore::Dictionary::getOwnPropertyNames):
3292 (WebCore::Dictionary::convertValue):
3293 (WebCore::Dictionary::asJSObject<Notification>): Deleted.
3294 (WebCore::Dictionary::getOwnPropertiesAsStringHashMap): Deleted.
3295 (WebCore::Dictionary::getWithUndefinedOrNullCheck): Deleted.
3296 * bindings/js/Dictionary.h:
3297 (WebCore::Dictionary::isObject):
3298 (WebCore::Dictionary::isUndefinedOrNull):
3299 (WebCore::Dictionary::execState):
3300 (WebCore::Dictionary::initializerObject):
3301 (WebCore::Dictionary::isValid):
3302 (WebCore::Dictionary::convertValue):
3303 (WebCore::Dictionary::get):
3304 (WebCore::Dictionary::tryGetPropertyAndResult):
3305 (WebCore::Dictionary::getEventListener): Deleted.
3306 Merge JSDictionary into Dictionary. Remove all unused functions (some getters, lots
3307 of convertValue overrides). Modernize to taste.
3309 * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3310 (WebCore::JSCryptoAlgorithmDictionary::getAlgorithmIdentifier):
3311 (WebCore::getHashAlgorithm):
3312 (WebCore::createHmacParams):
3313 (WebCore::createHmacKeyParams):
3314 (WebCore::createRsaKeyGenParams):
3315 (WebCore::createRsaOaepParams):
3316 (WebCore::createRsaSsaParams):
3317 Update for rename. JSDictionary is now Dictionary.
3319 * bindings/js/JSDictionary.cpp: Removed.
3320 * bindings/js/JSDictionary.h: Removed.
3322 * dom/MutationObserver.cpp:
3323 Remove unused #include of Dictionary.h
3325 2016-12-10 Dave Hyatt <hyatt@apple.com>
3327 [CSS Parser] Move CSSParserValues.h/.cpp to CSSParserSelector.h/.cpp
3328 https://bugs.webkit.org/show_bug.cgi?id=165730
3330 Reviewed by Simon Fraser.
3332 * WebCore.xcodeproj/project.pbxproj:
3333 * css/CSSCustomPropertyValue.cpp:
3334 * css/CSSPrimitiveValue.cpp:
3335 * css/CSSSelectorList.cpp:
3336 * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
3337 * css/parser/CSSParserImpl.cpp:
3338 * css/parser/CSSParserSelector.cpp: Copied from Source/WebCore/css/parser/CSSParserValues.cpp.
3339 * css/parser/CSSParserSelector.h: Copied from Source/WebCore/css/parser/CSSParserValues.h.
3340 * css/parser/CSSParserValues.cpp: Removed.
3341 * css/parser/CSSParserValues.h: Removed.
3342 * css/parser/CSSSelectorParser.h:
3344 2016-12-10 Dave Hyatt <hyatt@apple.com>
3346 [CSS Parser] Remove the pseudoclass/element hacks
3347 https://bugs.webkit.org/show_bug.cgi?id=165729
3349 Reviewed by Sam Weinig.
3351 * css/SelectorPseudoClassAndCompatibilityElementMap.in:
3352 * css/SelectorPseudoElementTypeMap.in:
3353 * css/parser/CSSSelectorParser.cpp:
3354 (WebCore::CSSSelectorParser::consumePseudo):
3356 2016-12-09 Sam Weinig <sam@webkit.org>
3358 [WebIDL] Remove custom bindings for Geolocation
3359 https://bugs.webkit.org/show_bug.cgi?id=165625
3361 Reviewed by Alex Christensen.
3364 * DerivedSources.cpp:
3365 * DerivedSources.make:
3366 * WebCore.xcodeproj/project.pbxproj:
3367 * bindings/js/JSBindingsAllInOne.cpp:
3370 * Modules/geolocation/GeoNotifier.cpp:
3371 (WebCore::GeoNotifier::GeoNotifier):
3372 (WebCore::GeoNotifier::hasZeroTimeout):
3373 (WebCore::GeoNotifier::startTimerIfNeeded):
3374 * Modules/geolocation/GeoNotifier.h:
3375 (WebCore::GeoNotifier::create):
3376 (WebCore::GeoNotifier::options):
3377 Update to store PositionOptions as a value, and pass the PositionCallback
3378 as a Ref, rather than a RefPtr, since it is not optional.
3380 * Modules/geolocation/Geolocation.cpp:
3381 (WebCore::createGeoposition):
3382 Use auto, to get the good type for Coordinates (Ref).
3384 (WebCore::Geolocation::getCurrentPosition):
3385 (WebCore::Geolocation::watchPosition):
3386 (WebCore::Geolocation::haveSuitableCachedPosition):
3387 (WebCore::Geolocation::startUpdating):
3388 * Modules/geolocation/Geolocation.h:
3389 Update to pass PositionOptions itself now that it is a plain struct.
3391 * Modules/geolocation/Geolocation.idl:
3392 Remove [Custom] extended attribute and add FIXME about nullable annotation.
3394 * Modules/geolocation/Geoposition.h:
3395 Pass/store Coordinates as a Ref.
3397 * Modules/geolocation/PositionOptions.h:
3398 Convert to be a simple struct.
3400 * Modules/geolocation/PositionOptions.idl:
3403 * bindings/js/JSGeolocationCustom.cpp:
3406 2016-12-09 Dave Hyatt <hyatt@apple.com>
3408 [CSS Parser] Remove the old CSS Parser
3409 https://bugs.webkit.org/show_bug.cgi?id=165645
3411 Reviewed by Daniel Bates.
3413 Remove the old CSS parser code. In doing so, code that used documentless
3414 CSSParserContexts is now going through the new parser. This resulted in
3415 some additional changes. These include:
3417 (1) Canvas color parsing switched to new parser's code. This resulted in
3418 progressions on canvas tests.
3420 (2) Support for CSSNamespaceRule in the CSS OM, since the Inspector's