1 2016-04-13 Eric Carlson <eric.carlson@apple.com>
3 [iOS] remote command should be considered user events
4 https://bugs.webkit.org/show_bug.cgi?id=156546
5 <rdar://problem/25560877>
9 Test: media/remote-control-command-is-user-gesture.html
11 * html/HTMLMediaElement.cpp:
12 (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Increment/decrement
13 m_processingRemoteControlCommand around calling remote command method.
14 (WebCore::HTMLMediaElement::processingUserGesture): Return true if called while handling
15 a remote control command.
16 * html/HTMLMediaElement.h:
18 2016-04-13 Antonio Gomes <tonikitoo@webkit.org>
20 Non-resizable text field looks resizable
21 https://bugs.webkit.org/show_bug.cgi?id=152271
23 Reviewed by Darin Adler.
25 The 'resizability' of an HTML element is controlled by its 'resize' CSS property value.
26 By default it is 'none', but certain HTML elements, including <textarea>, have it
27 set to 'both' by default (defined in html.css). These values mean no resize at all, and
28 resizable in both vertical and horizontal axis, respectively.
29 Additionally, 'vertical' and 'horizontal' values are also valid.
31 Problem here is that the way WebKit handles the 'resize' property on single line
32 input elements (e.g. <input>) is different than other engines (read Gecko, Blink and Presto):
34 - Match: WebKit, Firefox, Presto and Blink all force single line input elements to be non-resizable,
35 regardless of either the 'resize' properly is set or not.
37 - Mismatch: WebKit is the only engine that actually paints the resize control on single line
38 input elements, even it having no effect.
40 On WebKit, this happens because the 'resize' property is wrongly implemented as 'inheritable',
41 differently from other engines. In the way WebKit contructs its RenderTree, 'resize' property
42 ends up spilling out of <input> and entering its shadow representation, carrying the 'resize'
45 Patch fixes this by making the 'resize' properly be non-inherited, matching other vendors
48 [1] https://drafts.csswg.org/css-ui/#resize
50 Tests: fast/css/resize-not-inherited.html
51 fast/css/resize-single-line-input-no-paint.html
53 * rendering/style/RenderStyle.h:
54 * rendering/style/StyleRareInheritedData.cpp:
55 (WebCore::StyleRareInheritedData::StyleRareInheritedData):
56 (WebCore::StyleRareInheritedData::operator==):
57 * rendering/style/StyleRareInheritedData.h:
58 * rendering/style/StyleRareNonInheritedData.cpp:
59 (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
60 (WebCore::StyleRareNonInheritedData::operator==):
61 * rendering/style/StyleRareNonInheritedData.h:
63 2016-04-13 Darin Adler <darin@apple.com>
65 Remove UsePointersEvenForNonNullableObjectArguments from DataTransfer
66 https://bugs.webkit.org/show_bug.cgi?id=156495
68 Reviewed by Chris Dumez.
70 * dom/DataTransfer.idl: Removed UsePointersEvenForNonNullableObjectArguments
71 and marked the element argument to setDragImage as nullable.
73 2016-04-13 Brady Eidson <beidson@apple.com>
75 Modern IDB (Blob support): Support deleting stored blob files.
76 https://bugs.webkit.org/show_bug.cgi?id=156523
78 Reviewed by Alex Christensen.
80 No new tests (No testable change in behavior yet, current tests pass).
82 There's 3 points in time when we need to delete blob files (and records of them):
83 1 - When deleting a specific object store record.
84 2 - When deleting an entire object store.
85 3 - When deleting a whole database.
87 This patch does those three things.
89 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
90 (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
91 (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
92 (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
93 (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
94 (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
95 (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
96 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
98 * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
99 (WebCore::IDBServer::SQLiteIDBTransaction::commit):
100 (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary):
101 (WebCore::IDBServer::SQLiteIDBTransaction::addRemovedBlobFile):
102 * Modules/indexeddb/server/SQLiteIDBTransaction.h:
104 2016-04-13 Frederic Wang <fwang@igalia.com>
106 Fix two coding mistakes in MathMLInlineContainerElement::childrenChanged
107 https://bugs.webkit.org/show_bug.cgi?id=156538
109 Reviewed by Darin Adler.
111 We fix the call to updateOperatorProperties inside MathMLInlineContainerElement::childrenChanged
112 for the <math> and <msqrt> tags.
114 The <math> tag is already a RenderMathMLRow so the hasTagName(mathTag)
115 conditional is never executed. The tag does not create any anonymous
116 wrapper so we do not need a special case for it anyway.
118 The <msqrt> tag is not a RenderMathMLRow (yet). However, the anonymous
119 wrapper behaving as a RenderMathMLRow is actually the last child, not
122 No new tests, this is already covered by mathml/presentation/mo-form-dynamic.html
123 Note that for some reason the coding error for <msqrt> only shows up
124 after the refactoring of bug 152244.
126 * mathml/MathMLInlineContainerElement.cpp:
127 (WebCore::MathMLInlineContainerElement::childrenChanged): Fix the two mistakes and add some FIXME comments.
129 2016-04-12 Chris Dumez <cdumez@apple.com>
131 Attr.value should not be nullable
132 https://bugs.webkit.org/show_bug.cgi?id=156515
134 Reviewed by Benjamin Poulain.
136 Update Attr.value so that it is no longer nullable, as per:
137 https://dom.spec.whatwg.org/#interface-attr
139 This aligns our behavior with Firefox and Chrome as well.
141 Test: fast/dom/Attr/value-not-nullable.html
144 (WebCore::Attr::setValueForBindings):
145 (WebCore::Attr::setNodeValue):
146 (WebCore::Attr::setValue):
150 2016-04-12 Konstantin Tokarev <annulen@yandex.ru>
152 Fixed uninitialization of Node::DataUnion with GCC 4.8.
153 https://bugs.webkit.org/show_bug.cgi?id=156507
155 Reviewed by Michael Catanzaro.
157 This change fixes run time crashes caused by access to uninitialized
158 memory in Node::renderer().
164 2016-04-12 Eric Carlson <eric.carlson@apple.com>
166 [iOS] do not exit AirPlay when the screen locks
167 https://bugs.webkit.org/show_bug.cgi?id=156502
168 <rdar://problem/24616592>
170 Reviewed by Jer Noble.
172 * html/HTMLMediaElement.cpp:
173 (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction): Add logging.
174 (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): Don't tell the media engine to purge
175 data if it is playing to a wireless target because that will drop the connection.
177 * html/MediaElementSession.cpp:
178 (WebCore::MediaElementSession::playbackPermitted): Add logging.
179 (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget): Drive by fix: iOS doesn't
180 have an explicit playbackTarget, don't test for it.
181 (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget): Ditto.
183 2016-04-12 Gavin Barraclough <barraclough@apple.com>
185 WebKit should adopt journal_mode=wal for all SQLite databases.
186 https://bugs.webkit.org/show_bug.cgi?id=133496
188 Rubber stamped by Chris Dumez.
190 Temporarily disable on iOS - this broke a test.
191 (storage/websql/alter-to-info-table.html)
193 * platform/sql/SQLiteDatabase.cpp:
194 (WebCore::SQLiteDatabase::open):
196 2016-04-12 Joseph Pecoraro <pecoraro@apple.com>
198 Web Inspector: Keyboard shortcut for "Inspect Element" only works when Web Inspector is open.
199 https://bugs.webkit.org/show_bug.cgi?id=111193
200 <rdar://problem/13325889>
202 Reviewed by Timothy Hatcher.
204 * inspector/InspectorClient.h:
205 (WebCore::InspectorClient::elementSelectionChanged):
206 * inspector/InspectorDOMAgent.cpp:
207 (WebCore::InspectorDOMAgent::setSearchingForNode):
208 Inform the client when element selection changes.
210 2016-04-12 Chris Dumez <cdumez@apple.com>
212 Regression(r199360): assertion hit in Element::fastGetAttribute()
213 https://bugs.webkit.org/show_bug.cgi?id=156509
215 Reviewed by Ryosuke Niwa.
217 Stop using fastGetAttribute() / setAttributeWithoutSynchronization()
218 given that DOMTokenList is used for the class attribute and we need
219 to synchronize in this case.
221 No new tests, already covered by existing tests.
223 * html/DOMTokenList.cpp:
224 (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
225 (WebCore::DOMTokenList::tokens):
227 2016-04-12 Myles C. Maxfield <mmaxfield@apple.com>
229 [RTL Scrollbars] Overlay scrollbars push contents inwards
230 https://bugs.webkit.org/show_bug.cgi?id=156225
231 <rdar://problem/25137040>
233 Reviewed by Darin Adler.
235 The contents should be pushed in by the occupied width of the
236 scrollbar, which is 0 for overlay scrollbars.
238 Test: fast/scrolling/rtl-scrollbars-overlay-no-push-contents.html
240 * rendering/RenderLayer.cpp:
241 (WebCore::RenderLayer::computeScrollDimensions):
243 2016-04-12 Myles C. Maxfield <mmaxfield@apple.com>
245 [OS X] Flakey crash after ScrollAnimatorMac destruction
246 https://bugs.webkit.org/show_bug.cgi?id=156372
248 Reviewed by Darin Adler.
250 Previously, we were disabling the mock scrollbars using JavaScript after
251 the WebView was created. However, enabling these mock scrollbars can be
252 triggered with a bit of state inside the WebPreferences object, which
253 means WebKit clients can change it at any point. DumpRenderTree is doing
254 this during the document's lifetime.
256 This means that the creation of the Scrollbar objects saw a non-mock
257 ScrollbarTheme, but the destruction of the Scrollbar objects saw a mock
258 ScrollbarTheme. Therefore, the non-mock ScrollbarTheme doesn't get
259 cleaned up correctly (ScrollAnimatorMac::willRemoveVerticalScrollbar()
260 returns early because it sees that there is nothing to deregister
261 due to the ScrollbarTheme being mocked).
263 This cleanup is necessary because it sets the NSScrollerImp's delegate
264 to nil before the NSScrollerImpDelegate gets destroyed. Because the
265 cleanup wasn't happening, the delegate pointer wasn't getting set to
266 nil, so the pointer was dangling, and AppKit was following it and
269 Because the clients of this bit of state can change it at any time,
270 it is incorrect to change it in JavaScript. Instead, the client must
271 manage this bit of state (so the client and the web process are always
272 in sync). Therefore, the correct way to set this bit of state must be
273 done in the test runner rather than Javascript internals. The mechanism
274 we have to do that is the <!-- webkit-test-runner --> comment at the
275 beginning of the test. This patch migrates to this mechanism and removes
276 the old internals method.
278 Test: fast/scrolling/rtl-scrollbars-animation-property.html
281 * testing/Internals.cpp:
282 (WebCore::Internals::setMockScrollbarsEnabled): Deleted.
283 * testing/Internals.h:
284 * testing/Internals.idl:
286 2016-04-12 Darin Adler <darin@apple.com>
288 Remove UsePointersEvenForNonNullableObjectArguments from SVG lists
289 https://bugs.webkit.org/show_bug.cgi?id=156494
291 Reviewed by Chris Dumez.
293 * bindings/scripts/CodeGenerator.pm:
294 (ShouldPassWrapperByReference): For now, don't do this for any tear-off classes.
295 This includes the items stored in most SVG list classes.
297 * svg/SVGLengthList.idl: Removed UsePointersEvenForNonNullableObjectArguments.
298 * svg/SVGNumberList.idl: Ditto.
299 * svg/SVGPointList.idl: Ditto.
300 * svg/SVGTransformList.idl: Ditto.
302 * svg/SVGPathSegList.idl: Removed UsePointersEvenForNonNullableObjectArguments.
303 Marked the arguments nullable, and added FIXMEs about returning later since they
304 don't really need to be nullable. But fixing this requires some reworking of the
305 SVG list template and it's not urgent at this time. Preserves behavior where we
306 get an exception when passing null, it's just an SVG exception instead of TypeError.
308 2016-04-12 Chris Dumez <cdumez@apple.com>
310 Lazily update tokens in DOMTokenList when the associated attribute value changes
311 https://bugs.webkit.org/show_bug.cgi?id=156474
313 Reviewed by Ryosuke Niwa.
315 Lazily update tokens in DOMTokenList when the associated attribute value
316 changes for performance. Constructing the sanitized vector of tokens
317 every time the associated Element attribute changes is too expensive.
318 Instead, we mark the vector as dirty whenever the attribute changes, and
319 we only construct the sanitized vector when it is actually required.
321 Also do some renaming for clarity.
323 There is no web-exposed behavior change.
326 (WebCore::Element::classAttributeChanged):
327 * html/DOMTokenList.cpp:
328 (WebCore::DOMTokenList::contains):
329 (WebCore::DOMTokenList::addInternal):
330 (WebCore::DOMTokenList::removeInternal):
331 (WebCore::DOMTokenList::toggle):
332 (WebCore::DOMTokenList::value):
333 (WebCore::DOMTokenList::setValue):
334 (WebCore::DOMTokenList::updateTokensFromAttributeValue):
335 (WebCore::DOMTokenList::associatedAttributeValueChanged):
336 (WebCore::DOMTokenList::updateAssociatedAttributeFromTokens):
337 (WebCore::DOMTokenList::tokens):
338 (WebCore::DOMTokenList::DOMTokenList): Deleted.
339 * html/DOMTokenList.h:
340 (WebCore::DOMTokenList::tokens):
341 (WebCore::DOMTokenList::length):
342 (WebCore::DOMTokenList::item):
343 * html/HTMLAnchorElement.cpp:
344 (WebCore::HTMLAnchorElement::parseAttribute):
345 * html/HTMLIFrameElement.cpp:
346 (WebCore::HTMLIFrameElement::parseAttribute):
347 * html/HTMLLinkElement.cpp:
348 (WebCore::HTMLLinkElement::parseAttribute):
349 * html/HTMLOutputElement.cpp:
350 (WebCore::HTMLOutputElement::parseAttribute):
352 2016-04-12 Darin Adler <darin@apple.com>
354 Remove UsePointersEvenForNonNullableObjectArguments from HTMLMediaElement
355 https://bugs.webkit.org/show_bug.cgi?id=156492
357 Reviewed by Chris Dumez.
359 * html/HTMLMediaElement.idl: Removed UsePointersEvenForNonNullableObjectArguments,
360 sorted remaining class attributes, simplified #if around canPlayType a bit,
361 removed comment that is not all that useful, made the argument to
362 webkitSetMediaKeys nullable since the implementation supports that.
364 2016-04-12 Eric Carlson <eric.carlson@apple.com>
366 [iOS] media title sometimes remain in Control Center after tab is closed
367 https://bugs.webkit.org/show_bug.cgi?id=156243
368 <rdar://problem/20167445>
370 Reviewed by Darin Adler.
372 * Modules/webaudio/AudioContext.h: Implement characteristics.
374 * html/HTMLMediaElement.cpp:
375 (WebCore::HTMLMediaElement::mediaLoadingFailed): Call mediaSession->clientCharacteristicsChanged.
376 (WebCore::HTMLMediaElement::setReadyState): Ditto.
377 (WebCore::HTMLMediaElement::clearMediaPlayer): Ditto.
378 (WebCore::HTMLMediaElement::stop): Call mediaSession->stopSession.
379 (WebCore::HTMLMediaElement::characteristics): New, return current characteristics.
380 * html/HTMLMediaElement.h:
382 * platform/audio/PlatformMediaSession.cpp:
383 (WebCore::PlatformMediaSession::stopSession): Suspend playback, and remove the session
384 from the manager, it will never play again.
385 (WebCore::PlatformMediaSession::characteristics): Return client characteristics.
386 (WebCore::PlatformMediaSession::clientCharacteristicsChanged):
387 * platform/audio/PlatformMediaSession.h:
389 * platform/audio/PlatformMediaSessionManager.cpp:
390 (WebCore::PlatformMediaSessionManager::stopAllMediaPlaybackForProcess): Call stopSession
391 instead of pauseSession to signal that playback will never start again.
392 * platform/audio/PlatformMediaSessionManager.h:
394 * platform/audio/ios/MediaSessionManagerIOS.h:
395 * platform/audio/ios/MediaSessionManagerIOS.mm:
396 (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Add logging.
397 (WebCore::MediaSessionManageriOS::removeSession): Update NowPlaying.
398 (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Add logging.
399 (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Update NowPlaying.
400 (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): New, return the first session
401 that is an audio or video element with playable audio. WebAudio is not currently controllable
402 so it isn't appropriate to show it in the NowPlaying info center.
403 (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Remember the last state passed to
404 NowPlaying so we can call it only when something has changed.
406 2016-04-12 Carlos Garcia Campos <cgarcia@igalia.com>
408 [GTK] Rework scrollbars theming code for GTK+ 3.20
409 https://bugs.webkit.org/show_bug.cgi?id=156462
411 Reviewed by Michael Catanzaro.
413 In r199292, we reworked the theming code to ensure it works with the new GTK+ CSS theming system. The same is
414 needed for scrollbars, this patch uses the RenderThemeGadget classes introduced in r199292 to render the native
415 scrollbars. The code is now split in 3 parts: stub methods for GTK+2 (since this file is compiled for
416 WebCoreGTK, but not used), the implementation for GTK+ < 3.20 and the implementation for GTK+ >= 3.20. This
417 reduces the amount of ifdefed code, and ensures that changes in new code don't break the rendering with older
418 versions of GTK+. I noticed that we were overriding both, the specific paint methods to render scrollbars
419 parts and the global paint method that renders all the scrollbar parts. We don't really need the specific paint
420 methods, so I've removed the implemention leaving only the paint method. This also allows us to get rid of the
421 GtkStyleContext cache.
423 * platform/gtk/RenderThemeGadget.cpp:
424 (WebCore::RenderThemeGadget::create): Handle scrollbars gadgets.
425 (WebCore::appendElementToPath): In case of scrollbar gadget, use the scrollbar GType when creating the path to
426 be able to get non-CSS style properties.
427 (WebCore::RenderThemeGadget::opacity): Add method to get the opacity CSS style property.
428 (WebCore::RenderThemeScrollbarGadget::RenderThemeScrollbarGadget): Initialize m_steppers option set with the
429 steppers used by the theme.
430 * platform/gtk/RenderThemeGadget.h:
431 * platform/gtk/ScrollbarThemeGtk.cpp:
432 (WebCore::themeChangedCallback):
433 (WebCore::ScrollbarThemeGtk::ScrollbarThemeGtk):
434 (WebCore::createStyleContext):
435 (WebCore::createChildStyleContext):
436 (WebCore::ScrollbarThemeGtk::themeChanged):
437 (WebCore::ScrollbarThemeGtk::updateThemeProperties):
438 (WebCore::scrollbarPartStateFlags):
439 (WebCore::scrollbarGadgetForLayout):
440 (WebCore::contentsGadgetForLayout):
441 (WebCore::ScrollbarThemeGtk::trackRect):
442 (WebCore::ScrollbarThemeGtk::hasThumb):
443 (WebCore::ScrollbarThemeGtk::backButtonRect):
444 (WebCore::ScrollbarThemeGtk::forwardButtonRect):
445 (WebCore::ScrollbarThemeGtk::paint):
446 (WebCore::paintStepper):
447 (WebCore::adjustRectAccordingToMargin):
448 (WebCore::ScrollbarThemeGtk::scrollbarThickness):
449 (WebCore::ScrollbarThemeGtk::minimumThumbLength):
450 * platform/gtk/ScrollbarThemeGtk.h:
452 2016-03-17 Sergio Villar Senin <svillar@igalia.com>
454 [css-grid] Add parsing support for <auto-repeat> syntax
455 https://bugs.webkit.org/show_bug.cgi?id=155583
457 Reviewed by Antti Koivisto.
459 The repeat() notation allows now to specify auto-fill or auto-fit instead of
460 a fixed number of repetitions meaning that it will be automatically computed
461 depending on the available space.
463 This patch just adds the parsing support, the expansion of the repeat notation
464 will be implemented in a follow up patch because it cannot be done at
465 parsing level (since it requires knowledge about the available space).
467 Test: fast/css-grid-layout/grid-element-auto-repeat-get-set.html
470 * css/CSSGridAutoRepeatValue.cpp: Added.
471 (WebCore::CSSGridAutoRepeatValue::customCSSText):
472 * css/CSSGridAutoRepeatValue.h: Added.
473 (WebCore::CSSGridAutoRepeatValue::create):
474 (WebCore::CSSGridAutoRepeatValue::autoRepeatID):
475 (WebCore::CSSGridAutoRepeatValue::CSSGridAutoRepeatValue):
477 (WebCore::allTracksAreFixedSized):
478 (WebCore::CSSParser::parseGridTrackList):
479 (WebCore::CSSParser::parseGridTrackRepeatFunction):
480 (WebCore::CSSParser::parseGridTrackSize):
481 (WebCore::CSSParser::parseGridBreadth):
484 (WebCore::CSSValue::equals):
485 (WebCore::CSSValue::cssText):
486 (WebCore::CSSValue::destroy):
488 (WebCore::CSSValue::isGridAutoRepeatValue):
489 * css/CSSValueKeywords.in:
491 2016-04-12 Yusuke Suzuki <utatane.tea@gmail.com>
493 [JSC] addStaticGlobals should emit SymbolTableEntry watchpoints to encourage constant folding in DFG
494 https://bugs.webkit.org/show_bug.cgi?id=155110
496 Reviewed by Saam Barati.
498 * bindings/js/JSDOMWindowBase.cpp:
499 (WebCore::JSDOMWindowBase::updateDocument):
501 2016-04-12 Sergio Villar Senin <svillar@igalia.com>
503 [css-grid] Pass GridSizingData instead of columnTracks to track sizing methods
504 https://bugs.webkit.org/show_bug.cgi?id=156466
506 Reviewed by Darin Adler.
508 Several methods used to compute the items' size contribution to the tracks they span in, get
509 as an argument a vector with the sizes of the column tracks.
511 In order to support grids with orthogonal flows (among other things) it's much better to
512 pass the GridSizingData struct and let those methods decide whether to use the columns or
515 No new tests as this is just a minor refactoring with no change in behavior.
517 * rendering/RenderGrid.cpp:
518 (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
519 (WebCore::RenderGrid::logicalContentHeightForChild):
520 (WebCore::RenderGrid::minSizeForChild):
521 (WebCore::RenderGrid::minContentForChild):
522 (WebCore::RenderGrid::maxContentForChild):
523 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
524 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForNonSpanningItems):
525 (WebCore::RenderGrid::currentItemSizeForTrackSizeComputationPhase):
526 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
527 * rendering/RenderGrid.h:
529 2016-04-11 Darin Adler <darin@apple.com>
531 Remove UsePointersEvenForNonNullableObjectArguments from HTMLOptionsCollection
532 https://bugs.webkit.org/show_bug.cgi?id=156491
534 Reviewed by Chris Dumez.
536 * html/HTMLOptionsCollection.cpp:
537 (WebCore::HTMLOptionsCollection::add): Take a reference instead of a pointer.
538 * html/HTMLOptionsCollection.h: Removed unneeded forward declaration. Changed
539 add to take a reference instead of a pointer for the element to add. Used
540 final instead of override on virtual functions.
541 * html/HTMLOptionsCollection.idl: Removed now-unneeded attribute
542 UsePointersEvenForNonNullableObjectArguments; the only function affected was
543 add, and the overloading code was already checking for null.
545 2016-04-11 Darin Adler <darin@apple.com>
547 Remove UsePointersEvenForNonNullableObjectArguments from HTMLSelectElement
548 https://bugs.webkit.org/show_bug.cgi?id=156458
550 Reviewed by Chris Dumez.
552 * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
553 (WebCore::JSHTMLOptionsCollection::remove): Updated to call remove with a reference
554 rather than a pointer.
556 * bindings/js/JSHTMLSelectElementCustom.cpp:
557 (WebCore::JSHTMLSelectElement::remove): Updated to call remove with a reference
558 rather than a pointer.
559 (WebCore::selectIndexSetter): Updated to call setOption with a reference rather
562 * bindings/scripts/CodeGeneratorGObject.pm:
563 (GenerateFunction): Added basic support for passing wrappers by reference.
564 GObject bindings already check arguments for null, so didn't add any new checks.
566 * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
567 * bindings/scripts/test/GObject/WebKitDOMTestCallback.cpp:
568 * bindings/scripts/test/GObject/WebKitDOMTestCallbackFunction.cpp:
569 * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
570 * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
573 * editing/FrameSelection.cpp: Updated includes.
575 * html/HTMLOptionElement.cpp:
576 (WebCore::HTMLOptionElement::setSelected): Pass reference when calling
577 HTMLSelectElement::optionSelectionStateChanged.
578 (WebCore::HTMLOptionElement::insertedInto): Ditto.
580 * html/HTMLOptionsCollection.cpp:
581 (WebCore::HTMLOptionsCollection::add): Moved null checking behavior here.
582 Preserves existing "silently do nothing if null".
583 (WebCore::HTMLOptionsCollection::remove): Changed function to take a reference
584 instead of a pointer.
586 * html/HTMLOptionsCollection.h: Updated include. Changed remove to take a
587 reference instead of a pointer.
589 * html/HTMLSelectElement.cpp:
590 (WebCore::HTMLSelectElement::add): Changed to take a reference instead of
591 a pointer. Also removed unneeded protect code, since insertBefore already
592 protects itself, and unneeded call to updateValidity, since the
593 HTMLSelectElement::childrenChanged function already calls updateValidity.
594 (WebCore::HTMLSelectElement::remove): Changed to take a reference instead
596 (WebCore::HTMLSelectElement::setOption): Changed to take a reference
597 instead of a pointer.
598 (WebCore::HTMLSelectElement::setLength): Renamed "newLen" to "newLength".
599 Use Ref instead of RefPtr for result of createElement, which makes the
600 argument passed to add be a reference rather than a pointer.
601 (WebCore::HTMLSelectElement::willRespondToMouseClickEvents): Put the #if
602 for this here instead of in the header.
603 (WebCore::HTMLSelectElement::optionSelectionStateChanged): Changed to take
604 a reference instead of a pointer for the option element.
606 * html/HTMLSelectElement.h: Removed unneeded includes. Derive privately
607 from TypeAheadDataSource instead of publicly. Make all overrides final
608 except for the one that is actually overridden by a derived class.
609 Changed the arguments of the add, remove, setOption, and
610 optionSelectionStateChanged functions to be references instead of pointers.
611 Tweaked formatting a bit and used nullptr instead of 0. Override
612 willRespondToMouseClickEvents on all platforms, not just iOS.
614 * html/HTMLSelectElement.idl: Removed UsePointersEvenForNonNullableObjectArguments.
615 Removed a comment that is no longer needed. Made some types nullable to match
616 the specification, in places that currently have no effect on code generation.
617 Added a FIXME comment about the argument to setCustomValidity incorrectly being
620 2016-04-11 Brent Fulgham <bfulgham@apple.com>
622 Use WeakPtrs to avoid using deallocated Widgets and ScrollableAreas
623 https://bugs.webkit.org/show_bug.cgi?id=156420
624 <rdar://problem/25637378>
626 Reviewed by Darin Adler.
628 Avoid the risk of using deallocated Widgets and ScrollableAreas by using WeakPtrs instead of
629 bare pointers. This allows us to remove some explicit calls to get ScrollableArea and Widget
630 members in the event handling logic. Instead, null checks are sufficient to ensure we never
631 accidentally dereference a deleted element.
633 1. Modify the ScrollableArea class to support vending WeakPtrs.
634 2. Modify the Event Handling code to use WeakPtrs to hold ScrollableArea and RenderWidget
635 objects, and to null-check these elements after event handling dispatching is finished
636 to handle cases where these objects are destroyed.
638 Test: fast/events/wheel-event-destroys-frame.html
639 fast/events/wheel-event-destroys-overflow.html
641 * page/EventHandler.cpp:
642 (WebCore::EventHandler::platformPrepareForWheelEvents): Change signature for WeakPtr.
643 (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
644 (WebCore::EventHandler::platformNotifyIfEndGesture): Ditto.
645 (WebCore::widgetForElement): Change to return a WeakPtr.
646 (WebCore::EventHandler::handleWheelEvent): Use WeakPtrs to hold elements that might be destroyed
647 during event handling.
648 * page/EventHandler.h:
649 * page/mac/EventHandlerEfl.cpp: Rename passWheelEventToWidget to widgetDidHandleWheelEvent.
650 * page/mac/EventHandlerGtk.cpp: Ditto.
651 * page/mac/EventHandlerIOS.mm: Ditto.
652 * page/mac/EventHandlerMac.mm:
653 (WebCore::scrollableAreaForEventTarget): Renamed from scrollViewForEventTarget. Return
654 a WeakPtr rather than a bare pointer.
655 (WebCore::scrollableAreaForContainerNode): Return WeakPtr rather than bare pointer.
656 (WebCore::EventHandler::completeWidgetWheelEvent): Added.
657 (WebCore::EventHandler::passWheelEventToWidget): Deleted.
658 (WebCore::EventHandler::platformPrepareForWheelEvents): Convert to WeakPtrs.
659 (WebCore::EventHandler::platformCompleteWheelEvent): Ditto.
660 (WebCore::EventHandler::platformCompletePlatformWidgetWheelEvent): Ditto.
661 (WebCore::EventHandler::platformNotifyIfEndGesture): Ditto.
662 (WebCore::EventHandler::widgetDidHandleWheelEvent): Renamed from passWheelEventToWidget.
663 (WebCore::EventHandler::widgetForEventTarget): Converted from static function to static
664 method so it can be shared with EventHandlerMac.
665 (WebCore::scrollViewForEventTarget): Deleted.
666 * page/mac/EventHandlerWin.cpp: Rename passWheelEventToWidget to widgetDidHandleWheelEvent.
667 * platform/ScrollableArea.cpp:
668 * platform/ScrollableArea.h:
669 (WebCore::ScrollableArea::createWeakPtr): Added.
671 (WebCore::ScrollableArea::createWeakPtr): Added.
673 2016-04-11 Dean Jackson <dino@apple.com>
675 putImageData needs to premultiply input
676 https://bugs.webkit.org/show_bug.cgi?id=156488
677 <rdar://problem/25672675>
679 Reviewed by Zalan Bujtas.
681 I made a mistake in r187534 as I was converting get and putImageData
682 to use Accelerate. The incoming data is unmultiplied, and should
683 be premultiplied before copying into the backing store. I was
684 accidentally unmultiplying unmultiplied data, which caused
685 some pretty psychedelic results.
687 Test: fast/canvas/putImageData-unmultiplied.html
689 * platform/graphics/cg/ImageBufferDataCG.cpp:
690 (WebCore::ImageBufferData::putData): Call premultiply, not unpremultiply.
692 2016-04-11 Jeremy Jones <jeremyj@apple.com>
694 When clearing cache, also clear AVFoundation cache.
695 https://bugs.webkit.org/show_bug.cgi?id=155783
696 rdar://problem/25252541
698 Reviewed by Darin Adler.
700 Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
701 can then be used to manage the cache storage used by AVFoundation. It is used to query the
702 contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
703 clearMediaCache() and clearMediaCacheForOrigins().
705 Use SecurityOrigin instead of the less formal site String to represent origins in the cache.
707 * html/HTMLMediaElement.cpp:
708 (WebCore::sharedMediaCacheDirectory): Added.
709 (WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
710 (WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
711 (WebCore::HTMLMediaElement::originsInMediaCache): Added.
712 (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
713 (WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
714 (WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
715 (WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
716 (WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
717 * html/HTMLMediaElement.h:
718 (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
719 * platform/graphics/MediaPlayer.cpp:
720 (WebCore::addMediaEngine): Add new cache methods.
721 (WebCore::addToHash): Added.
722 (WebCore::MediaPlayer::originsInMediaCache): Added.
723 (WebCore::MediaPlayer::clearMediaCache): Added parameter.
724 (WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
725 (WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
726 (WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
727 * platform/graphics/MediaPlayer.h:
728 (WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
729 * platform/graphics/MediaPlayerPrivate.h:
730 (WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
731 (WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
732 (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
733 (WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
734 (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
735 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
736 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
737 (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
738 (WebCore::assetCacheForPath): Added.
739 (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
740 (WebCore::toSystemClockTime): Added.
741 (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
742 (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
743 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
744 * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
745 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
746 (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
747 (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
748 (WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
749 (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
750 (WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
751 (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
752 * platform/spi/mac/AVFoundationSPI.h:
754 2016-04-11 Commit Queue <commit-queue@webkit.org>
756 Unreviewed, rolling out r199310.
757 https://bugs.webkit.org/show_bug.cgi?id=156483
759 This change turns many indexeddb tests into crashes (Requested
760 by jwtan on #webkit).
764 "Clean up IDBBindingUtilities."
765 https://bugs.webkit.org/show_bug.cgi?id=156472
766 http://trac.webkit.org/changeset/199310
768 2016-04-11 Commit Queue <commit-queue@webkit.org>
770 Unreviewed, rolling out r199315.
771 https://bugs.webkit.org/show_bug.cgi?id=156482
773 This change broke the OS X Yosemite build. (Requested by jwtan
778 "When clearing cache, also clear AVFoundation cache."
779 https://bugs.webkit.org/show_bug.cgi?id=155783
780 http://trac.webkit.org/changeset/199315
782 2016-04-11 Brian Burg <bburg@apple.com>
784 Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
785 https://bugs.webkit.org/show_bug.cgi?id=156407
786 <rdar://problem/25627659>
788 Reviewed by Joseph Pecoraro.
790 * inspector/InspectorDatabaseAgent.cpp: Don't use deleted subclasses.
792 2016-04-11 Commit Queue <commit-queue@webkit.org>
794 Unreviewed, rolling out r198909.
795 https://bugs.webkit.org/show_bug.cgi?id=156479
797 made double-click-and-drag on text drag instead of
798 highlighting (Requested by alexchristensen_ on #webkit).
802 "eventMayStartDrag() does not check for shiftKey or
804 https://bugs.webkit.org/show_bug.cgi?id=155746
805 http://trac.webkit.org/changeset/198909
807 2016-04-11 Chris Dumez <cdumez@apple.com>
809 [WebIDL] Add support for [ImplementedAs] for EventHandler attributes
810 https://bugs.webkit.org/show_bug.cgi?id=156421
812 Reviewed by Darin Adler.
814 Add support for [ImplementedAs] for EventHandler attributes so we can
815 get rid of some ugly name hard-coding in the bindings generator.
817 * Modules/notifications/Notification.idl:
818 * bindings/scripts/CodeGeneratorJS.pm:
819 (EventHandlerAttributeEventName):
820 * bindings/scripts/test/JS/JSTestObj.cpp:
821 (WebCore::jsTestObjOnwebkitfoo):
822 (WebCore::setJSTestObjOnwebkitfoo):
823 * bindings/scripts/test/TestObj.idl:
825 * page/DOMWindow.idl:
827 2016-04-11 Jeremy Jones <jeremyj@apple.com>
829 When clearing cache, also clear AVFoundation cache.
830 https://bugs.webkit.org/show_bug.cgi?id=155783
831 rdar://problem/25252541
833 Reviewed by Darin Adler.
835 Use AVAssetCache at a specified location on disk for all AVURLAssets. This AVAssetCache
836 can then be used to manage the cache storage used by AVFoundation. It is used to query the
837 contents of the cache in originsInMediaCache() and to clear the cache completely or partially in
838 clearMediaCache() and clearMediaCacheForOrigins().
840 Use SecurityOrigin instead of the less formal site String to represent origins in the cache.
842 * html/HTMLMediaElement.cpp:
843 (WebCore::sharedMediaCacheDirectory): Added.
844 (WebCore::HTMLMediaElement::setMediaCacheDirectory): Added.
845 (WebCore::HTMLMediaElement::mediaCacheDirectory): Added.
846 (WebCore::HTMLMediaElement::originsInMediaCache): Added.
847 (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
848 (WebCore::HTMLMediaElement::clearMediaCacheForOrigins): Added.
849 (WebCore::HTMLMediaElement::mediaPlayerMediaCacheDirectory): Added.
850 (WebCore::HTMLMediaElement::getSitesInMediaCache): Deleted.
851 (WebCore::HTMLMediaElement::clearMediaCacheForSite): Deleted.
852 * html/HTMLMediaElement.h:
853 (WebCore::HTMLMediaElement::clearMediaCache): Added parameter.
854 * platform/graphics/MediaPlayer.cpp:
855 (WebCore::addMediaEngine): Add new cache methods.
856 (WebCore::addToHash): Added.
857 (WebCore::MediaPlayer::originsInMediaCache): Added.
858 (WebCore::MediaPlayer::clearMediaCache): Added parameter.
859 (WebCore::MediaPlayer::clearMediaCacheForOrigins): Added.
860 (WebCore::MediaPlayer::getSitesInMediaCache): Deleted.
861 (WebCore::MediaPlayer::clearMediaCacheForSite): Deleted.
862 * platform/graphics/MediaPlayer.h:
863 (WebCore::MediaPlayerClient::mediaPlayerMediaCacheDirectory): Added.
864 * platform/graphics/MediaPlayerPrivate.h:
865 (WebCore::MediaPlayerPrivateInterface::originsInMediaCache): Added.
866 (WebCore::MediaPlayerPrivateInterface::clearMediaCache): Added parameter.
867 (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForOrigins): Added.
868 (WebCore::MediaPlayerPrivateInterface::getSitesInMediaCache): Deleted.
869 (WebCore::MediaPlayerPrivateInterface::clearMediaCacheForSite): Deleted.
870 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
871 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
872 (WebCore::MediaPlayerPrivateAVFoundationObjC::registerMediaEngine): Added cache methods.
873 (WebCore::assetCacheForPath): Added.
874 (WebCore::MediaPlayerPrivateAVFoundationObjC::originsInMediaCache): Added.
875 (WebCore::toSystemClockTime): Added.
876 (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache): Added parameter.
877 (WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins): Added.
878 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Added.
879 * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
880 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
881 (WebCore::MediaPlayerPrivateQTKit::registerMediaEngine): Added cache methods.
882 (WebCore::MediaPlayerPrivateQTKit::originsInMediaCache): Added.
883 (WebCore::MediaPlayerPrivateQTKit::clearMediaCache): Added parameter.
884 (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForOrigins): Added.
885 (WebCore::MediaPlayerPrivateQTKit::getSitesInMediaCache): Deleted.
886 (WebCore::MediaPlayerPrivateQTKit::clearMediaCacheForSite): Deleted.
887 * platform/spi/mac/AVFoundationSPI.h:
889 2016-04-11 Antoine Quint <graouts@apple.com>
891 [WebGL2] Use Open GL ES 3.0 to back WebGL2 contexts
892 https://bugs.webkit.org/show_bug.cgi?id=141178
894 Reviewed by Dean Jackson.
896 We add a new `useGLES3` attribute when creating a GraphicsContext3D in the event that the
897 context type is "webgl2". This attribute is then read by the GraphicsContext3D constructor
898 to request an Open GL ES 3.0 backend when creating the EAGLContext on iOS.
900 * html/canvas/WebGLRenderingContextBase.cpp:
901 (WebCore::WebGLRenderingContextBase::create):
902 * platform/graphics/GraphicsContext3D.h:
903 (WebCore::GraphicsContext3D::Attributes::Attributes):
904 * platform/graphics/mac/GraphicsContext3DMac.mm:
905 (WebCore::GraphicsContext3D::GraphicsContext3D):
907 2016-04-11 Jiewen Tan <jiewen_tan@apple.com>
909 fast/loader/opaque-base-url.html crashing during mac and ios debug tests
910 https://bugs.webkit.org/show_bug.cgi?id=156179
911 <rdar://problem/25507719>
913 Reviewed by Ryosuke Niwa.
915 Navigate to about:blank if the provided src of an iframe/frame cannot be
916 resolved to a valid URL.
918 Test: fast/loader/iframe-src-invalid-url.html
920 * loader/SubframeLoader.cpp:
921 (WebCore::SubframeLoader::requestFrame):
923 2016-04-11 Said Abou-Hallawa <sabouhallawa@apple,com>
925 Merge CG ImageSource and non CG ImageSource implementation in one file
926 https://bugs.webkit.org/show_bug.cgi?id=155456
928 Reviewed by Darin Adler.
930 ImageSource for CG and CG code paths look very similar. All the platform
931 specific code can be moved to ImageDecoder classes for CG and non CG. And
932 we can have the ImageSource be platform independent and we get rid of
935 Test: fast/images/image-subsampling.html
938 * PlatformAppleWin.cmake:
940 * WebCore.xcodeproj/project.pbxproj:
941 Delete ImageSourceCG.cpp form all make files and add ImageSource.cpp to
944 * platform/Cursor.cpp:
945 (WebCore::determineHotSpot):
946 * platform/graphics/BitmapImage.cpp:
947 (WebCore::BitmapImage::hotSpot):
948 (WebCore::BitmapImage::getHotSpot): Deleted.
949 * platform/graphics/BitmapImage.h:
950 * platform/graphics/Image.h:
951 (WebCore::Image::hotSpot):
952 (WebCore::Image::getHotSpot): Deleted.
953 Rename getHotSpot() to hotSpot() and change it to return Optional<IntPoint>.
955 * platform/graphics/ImageSource.cpp:
956 (WebCore::ImageSource::~ImageSource): Remove clear(true) call. It does nothing.
957 (WebCore::ImageSource::clearFrameBufferCache): A wrapper which calls ImageDecoder::clearFrameBufferCache().
958 (WebCore::ImageSource::clear): Calls clearFrameBufferCache() which will do nothing for CG.
960 (WebCore::ImageSource::ensureDecoderIsCreated): Change SharedBuffer* to
961 const SharedBuffer& and remove the call to ImageDecoder::setMaxNumPixels().
962 The value of const static int CG ImageDecoder::m_maxNumPixels will be set
963 based on IMAGE_DECODER_DOWN_SAMPLING.
965 (WebCore::ImageSource::setData): Pass SharedBuffer& to the underlying functions.
967 (WebCore::ImageSource::calculateMaximumSubsamplingLevel): Returns the maximum
968 subsampling level allowed for an image.
970 (WebCore::ImageSource::subsamplingLevelForScale): Converts from a scale to
971 SubsamplingLevel taking into consideration the maximumSubsamplingLevel for
974 (WebCore::ImageSource::bytesDecodedToDetermineProperties): Returns the number
975 of encoded bytes which can determine the image properties. For non CG it's
976 zero. For CG it is a maximum value which can be corrected later.
978 (WebCore::ImageSource::isSizeAvailable):
979 (WebCore::ImageSource::sizeRespectingOrientation):
980 (WebCore::ImageSource::frameCount):
981 (WebCore::ImageSource::repetitionCount):
982 (WebCore::ImageSource::filenameExtension):
983 (WebCore::ImageSource::getHotSpot):
984 (WebCore::ImageSource::frameIsCompleteAtIndex):
985 (WebCore::ImageSource::frameHasAlphaAtIndex):
986 (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
987 (WebCore::ImageSource::frameSizeAtIndex):
988 (WebCore::ImageSource::frameBytesAtIndex):
989 (WebCore::ImageSource::frameDurationAtIndex):
990 (WebCore::ImageSource::orientationAtIndex):
991 (WebCore::ImageSource::createFrameImageAtIndex):
992 These are wrappers for the ImageDecoder APIs. The purpose of these functions
993 is to ensure the ImageDecoder is created.
995 (WebCore::ImageSource::dump): Called from BitmapImage::dump().
997 (WebCore::ImageSource::getHotSpot): Deleted.
999 * platform/graphics/ImageSource.h:
1000 (WebCore::ImageSource::setAllowSubsampling): Called from BitmapImage::setAllowSubsampling().
1002 (WebCore::ImageSource::maxPixelsPerDecodedImage): Deleted.
1003 (WebCore::ImageSource::setMaxPixelsPerDecodedImage): Deleted.
1004 Setting maxPixelsPerDecodedImage was moved to the non CG ImageDecoder.
1006 * platform/graphics/cg/ImageDecoderCG.cpp:
1007 (WebCore::ImageDecoder::setData): Change SharedBuffer* to SharedBuffer&.
1009 (WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
1010 The code was moved to ImageSource::subsamplingLevelForScale().
1012 * platform/graphics/cg/ImageDecoderCG.h:
1013 (WebCore::ImageDecoder::create): Make the prototype of this function
1014 suitable for CG and non CG cases.
1015 (WebCore::ImageDecoder::clearFrameBufferCache): Empty functions for CG.
1017 * platform/graphics/cg/ImageSourceCG.cpp: Removed.
1019 * platform/image-decoders/ImageDecoder.cpp:
1020 (WebCore::ImageDecoder::frameIsCompleteAtIndex): A mew function to return
1021 whether the frame decoding is complete or not.
1023 (WebCore::ImageDecoder::frameHasAlphaAtIndex): Simplify the logic.
1025 (WebCore::ImageDecoder::frameDurationAtIndex): The code was moved from
1026 ImageSource::frameDurationAtIndex() in ImageSource.cpp.
1028 (WebCore::ImageDecoder::createFrameImageAtIndex): The code was moved from
1029 ImageSource::createFrameImageAtIndex() in ImageSource.cpp.
1031 * platform/image-decoders/ImageDecoder.h:
1032 (WebCore::ImageDecoder::ImageDecoder): Initialize the members in class.
1033 (WebCore::ImageDecoder::~ImageDecoder): Fix the braces style.
1034 (WebCore::ImageDecoder::setData): Change the type of the argument from
1035 SharedBuffer* to SharedBuffer&.
1036 (WebCore::ImageDecoder::frameSizeAtIndex): Add the argument SubsamplingLevel
1037 so it can have the same prototype as CG.
1038 (WebCore::ImageDecoder::orientationAtIndex): Rename it to the same of CG.
1040 (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
1041 (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
1042 (WebCore::ImageDecoder::subsamplingLevelForScale): Add these functions
1043 and return the default values so we do not have to add directive compiled
1044 non CG blocks in ImageSource.cpp.
1046 (WebCore::ImageDecoder::hotSpot): Return Optional<IntPoint>.
1048 (WebCore::ImageDecoder::orientation): Deleted.
1049 (WebCore::ImageDecoder::setMaxNumPixels): Deleted.
1051 * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1052 (WebCore::BMPImageDecoder::setData):
1053 * platform/image-decoders/bmp/BMPImageDecoder.h:
1054 * platform/image-decoders/gif/GIFImageDecoder.cpp:
1055 (WebCore::GIFImageDecoder::setData):
1056 (WebCore::GIFImageDecoder::decode):
1057 * platform/image-decoders/gif/GIFImageDecoder.h:
1058 * platform/image-decoders/gif/GIFImageReader.h:
1059 (GIFImageReader::setData):
1060 * platform/image-decoders/ico/ICOImageDecoder.cpp:
1061 (WebCore::ICOImageDecoder::setData):
1062 Use reference SharedBuffer instead of pointer SharedBuffer.
1064 (WebCore::ICOImageDecoder::hotSpot):
1065 (WebCore::ICOImageDecoder::hotSpotAtIndex):
1066 Change hotSpot() to return Optional<IntPoint>.
1067 * platform/image-decoders/ico/ICOImageDecoder.h:
1069 (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
1070 Pass reference SharedBuffer instead of pointer SharedBuffer.
1072 2016-04-08 Said Abou-Hallawa <sabouhallawa@apple,com>
1074 Timing attack on SVG feComposite filter circumvents same-origin policy
1075 https://bugs.webkit.org/show_bug.cgi?id=154338
1077 Reviewed by Oliver Hunt.
1079 Ensure the FEComposite arithmetic filter is clamping the resulted color
1080 components in a constant time.
1082 * platform/graphics/filters/FEComposite.cpp:
1083 (WebCore::clampByte):
1084 (WebCore::computeArithmeticPixels):
1086 2016-04-11 Brady Eidson <beidson@apple.com>
1088 Clean up IDBBindingUtilities.
1089 https://bugs.webkit.org/show_bug.cgi?id=156472
1091 Reviewed by Alex Christensen.
1093 No new tests (No change in behavior).
1095 - Get rid of a whole bunch of unused functions (since we got rid of Legacy IDB).
1096 - Make more functions deal in ExecState/ScriptExecutionContexts instead of DOMRequestState.
1097 - Make more functions deal in JSValue instead of Deprecated::ScriptValue.
1099 * bindings/scripts/IDLAttributes.txt: Add a new attribute to signify that an implementation returns
1100 JSValues instead of Deprecated::ScriptState
1101 * bindings/scripts/CodeGeneratorJS.pm:
1102 (NativeToJSValue): Use that new attribute.
1104 * Modules/indexeddb/IDBAny.cpp:
1105 (WebCore::IDBAny::IDBAny):
1106 (WebCore::IDBAny::scriptValue):
1107 * Modules/indexeddb/IDBAny.h:
1108 (WebCore::IDBAny::create):
1109 * Modules/indexeddb/IDBCursor.cpp:
1110 (WebCore::IDBCursor::key):
1111 (WebCore::IDBCursor::primaryKey):
1112 (WebCore::IDBCursor::value):
1113 (WebCore::IDBCursor::update):
1114 (WebCore::IDBCursor::continueFunction):
1115 (WebCore::IDBCursor::deleteFunction):
1116 (WebCore::IDBCursor::setGetResult):
1117 * Modules/indexeddb/IDBCursor.h:
1118 * Modules/indexeddb/IDBCursor.idl:
1119 * Modules/indexeddb/IDBCursorWithValue.idl:
1120 * Modules/indexeddb/IDBFactory.cpp:
1121 (WebCore::IDBFactory::cmp):
1122 * Modules/indexeddb/IDBIndex.cpp:
1123 (WebCore::IDBIndex::count):
1124 (WebCore::IDBIndex::get):
1125 (WebCore::IDBIndex::getKey):
1126 * Modules/indexeddb/IDBKeyRange.cpp:
1127 (WebCore::IDBKeyRange::lowerValue):
1128 (WebCore::IDBKeyRange::upperValue):
1129 (WebCore::IDBKeyRange::only):
1130 (WebCore::IDBKeyRange::lowerBound):
1131 (WebCore::IDBKeyRange::upperBound):
1132 (WebCore::IDBKeyRange::bound):
1133 * Modules/indexeddb/IDBKeyRange.h:
1134 * Modules/indexeddb/IDBKeyRange.idl:
1135 * Modules/indexeddb/IDBObjectStore.cpp:
1136 (WebCore::IDBObjectStore::get):
1137 (WebCore::IDBObjectStore::modernDelete):
1138 (WebCore::IDBObjectStore::count):
1139 * Modules/indexeddb/IDBRequest.cpp:
1140 (WebCore::IDBRequest::setResult):
1141 (WebCore::IDBRequest::setResultToStructuredClone):
1142 * Modules/indexeddb/server/MemoryObjectStore.cpp:
1143 (WebCore::IDBServer::MemoryObjectStore::updateIndexesForPutRecord):
1144 (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords):
1145 * bindings/js/IDBBindingUtilities.cpp:
1146 (WebCore::idbKeyPathFromValue):
1147 (WebCore::deserializeIDBValueDataToJSValue):
1148 (WebCore::scriptValueToIDBKey):
1149 (WebCore::idbKeyDataToScriptValue):
1150 (WebCore::idbKeyDataToJSValue): Deleted.
1151 (WebCore::injectIDBKeyIntoScriptValue): Deleted.
1152 (WebCore::createIDBKeyFromScriptValueAndKeyPath): Deleted.
1153 (WebCore::maybeCreateIDBKeyFromScriptValueAndKeyPath): Deleted.
1154 (WebCore::canInjectIDBKeyIntoScriptValue): Deleted.
1155 (WebCore::deserializeIDBValue): Deleted.
1156 (WebCore::deserializeIDBValueData): Deleted.
1157 (WebCore::deserializeIDBValueBuffer): Deleted.
1158 (WebCore::idbValueDataToJSValue): Deleted.
1159 (WebCore::idbKeyToScriptValue): Deleted.
1160 * bindings/js/IDBBindingUtilities.h:
1161 * bindings/js/JSIDBAnyCustom.cpp:
1163 * bindings/js/JSIDBDatabaseCustom.cpp:
1164 (WebCore::JSIDBDatabase::createObjectStore):
1165 * bindings/js/JSIDBObjectStoreCustom.cpp:
1166 (WebCore::JSIDBObjectStore::createIndex):
1167 * dom/ScriptExecutionContext.cpp:
1168 (WebCore::ScriptExecutionContext::execState):
1169 * dom/ScriptExecutionContext.h:
1170 * inspector/InspectorIndexedDBAgent.cpp:
1172 2016-04-09 Gavin Barraclough <barraclough@apple.com>
1174 WebKit should adopt journal_mode=wal for all SQLite databases.
1175 https://bugs.webkit.org/show_bug.cgi?id=133496
1177 Reviewed by Darin Adler.
1179 The statement intended to enable WAL mode is always failing because it is missing a
1180 prepare(). Fix this. We were also previously permitting SQLITE_OK results - this
1181 was in error (we were only getting these because stepping the unprepared statement
1182 returned SQLITE_OK). Also set the SQLITE_OPEN_AUTOPROXY flag when opening the
1183 database - this will improve perfomance when the database is accessed via an AFP
1186 This exposed a bug, that deleteAllDatabases does not actually delete the databases on
1187 iOS, for testing to reset back to a known state between tests it should be doing so.
1189 * Modules/webdatabase/DatabaseTracker.cpp:
1190 (WebCore::DatabaseTracker::deleteAllDatabases):
1191 - force databases to actually be deleted on iOS.
1192 This method is only used from testing code (DumpRenderTree / WebKitTestRunner).
1193 (WebCore::DatabaseTracker::deleteOrigin):
1194 - added IOSDeletionMode.
1195 (WebCore::DatabaseTracker::deleteDatabaseFile):
1196 - added IOSDeletionMode, modified to actually delete if this is set.
1197 * Modules/webdatabase/DatabaseTracker.h:
1198 - added IOSDeletionMode.
1199 * platform/sql/SQLiteDatabase.cpp:
1200 (WebCore::SQLiteDatabase::open):
1201 - call prepareAndStep(), only check for SQLITE_ROW result.
1202 * platform/sql/SQLiteFileSystem.cpp:
1203 (WebCore::SQLiteFileSystem::openDatabase):
1204 - should set SQLITE_OPEN_AUTOPROXY flag when opening database.
1206 2016-04-11 Zalan Bujtas <zalan@apple.com>
1208 Simplify InlineTextBox::selectionStartEnd()
1209 https://bugs.webkit.org/show_bug.cgi?id=156459
1211 Reviewed by Darin Adler.
1213 No change in functionality.
1215 * rendering/InlineTextBox.cpp:
1216 (WebCore::InlineTextBox::selectionState):
1217 (WebCore::InlineTextBox::paint):
1218 (WebCore::InlineTextBox::selectionStartEnd):
1219 (WebCore::InlineTextBox::paintSelection):
1220 (WebCore::InlineTextBox::paintCompositionBackground):
1221 * rendering/InlineTextBox.h:
1222 * rendering/svg/SVGInlineTextBox.cpp:
1223 (WebCore::SVGInlineTextBox::paintSelectionBackground):
1224 (WebCore::SVGInlineTextBox::paintText):
1226 2016-04-11 Zalan Bujtas <zalan@apple.com>
1228 REGRESSION (r193857): Text selection causes text to disappear.
1229 https://bugs.webkit.org/show_bug.cgi?id=156448
1230 rdar://problem/25578952
1232 Reviewed by Simon Fraser.
1234 Apparently when the end position of the selection range is smaller than the start position, we need
1235 to repaint the entire text as it indicates selection clearing.
1237 Test: fast/text/text-disappear-on-deselect.html
1239 * rendering/TextPainter.cpp:
1240 (WebCore::TextPainter::paintText):
1242 2016-04-05 Oliver Hunt <oliver@apple.com>
1244 Remove compile time define for SEPARATED_HEAP
1245 https://bugs.webkit.org/show_bug.cgi?id=155508
1247 Reviewed by Mark Lam.
1249 * Configurations/FeatureDefines.xcconfig:
1251 2016-04-11 Chris Dumez <cdumez@apple.com>
1253 Merge AttributedDOMTokenList into DOMTokenList
1254 https://bugs.webkit.org/show_bug.cgi?id=156468
1256 Reviewed by Ryosuke Niwa.
1258 Merge AttributedDOMTokenList into DOMTokenList to simplify the code.
1259 DOMTokenList is not constructible and AttributedDOMTokenList is its
1260 only constructible subclass after r196123.
1263 * WebCore.xcodeproj/project.pbxproj:
1265 (WebCore::Element::classList):
1266 * dom/ElementRareData.h:
1267 (WebCore::ElementRareData::classList):
1268 (WebCore::ElementRareData::setClassList):
1269 * html/AttributeDOMTokenList.cpp: Removed.
1270 * html/AttributeDOMTokenList.h: Removed.
1271 * html/DOMTokenList.cpp:
1272 (WebCore::DOMTokenList::DOMTokenList):
1273 (WebCore::DOMTokenList::attributeValueChanged):
1274 (WebCore::DOMTokenList::updateAfterTokenChange):
1275 * html/DOMTokenList.h:
1276 (WebCore::DOMTokenList::ref):
1277 (WebCore::DOMTokenList::deref):
1278 (WebCore::DOMTokenList::element):
1279 (WebCore::DOMTokenList::~DOMTokenList): Deleted.
1280 (WebCore::DOMTokenList::updateAfterTokenChange): Deleted.
1281 * html/HTMLAnchorElement.cpp:
1282 (WebCore::HTMLAnchorElement::relList):
1283 * html/HTMLAnchorElement.h:
1284 * html/HTMLIFrameElement.cpp:
1285 (WebCore::HTMLIFrameElement::sandbox):
1286 * html/HTMLIFrameElement.h:
1287 * html/HTMLLinkElement.cpp:
1288 (WebCore::HTMLLinkElement::sizes):
1289 (WebCore::HTMLLinkElement::relList):
1290 * html/HTMLLinkElement.h:
1291 * html/HTMLOutputElement.cpp:
1292 (WebCore::HTMLOutputElement::htmlFor):
1293 * html/HTMLOutputElement.h:
1295 2016-04-11 Chris Dumez <cdumez@apple.com>
1297 DOMTokenList.contains() should not throw
1298 https://bugs.webkit.org/show_bug.cgi?id=156453
1300 Reviewed by Ryosuke Niwa.
1302 DOMTokenList.contains() should not throw if the input token is invalid:
1303 https://github.com/whatwg/dom/commit/6d3076e3cbcba662489b272a718bc6b8c0082a74
1305 We now return false in such cases, instead of throwing, which should be
1306 safe with regards to backward compatibility.
1308 No new tests, already covered by existing tests.
1310 * html/DOMTokenList.cpp:
1311 (WebCore::DOMTokenList::contains):
1312 * html/DOMTokenList.h:
1313 * html/DOMTokenList.idl:
1315 2016-04-11 Frederic Wang <fwang@igalia.com>
1317 Refactor RenderMathMLFraction layout to avoid using flexbox
1318 https://bugs.webkit.org/show_bug.cgi?id=153917
1320 Reviewed by Sergio Villar Senin.
1322 Based on a patch by Alejandro G. Castro <alex@igalia.com>
1324 Implement the layoutBlock method to handle the layout calculations
1325 directly in the class. This also fixes parsing of absolute values for
1326 linethickness attribute (e.g. 10px) and adds support for the AxisHeight
1327 and FractionRuleThickness MATH parameters.
1329 Test: mathml/opentype/fraction-line.html
1331 * accessibility/AccessibilityRenderObject.cpp:
1332 (WebCore::AccessibilityRenderObject::mathLineThickness): Use the thickness relative to the
1333 default line thickness since that's really what is expected by mathml-line-fraction.html
1334 * css/mathml.css: Remove flexbox properties for mfrac.
1336 (mfrac > *): Deleted.
1337 (mfrac[numalign="left"] > :first-child): Deleted.
1338 (mfrac[numalign="right"] > :first-child): Deleted.
1339 (mfrac[denomalign="left"] > :last-child): Deleted.
1340 (mfrac[denomalign="right"] > :last-child): Deleted.
1341 (mfrac > :first-child): Deleted.
1342 (mfrac > :last-child): Deleted.
1344 * rendering/mathml/RenderMathMLBlock.cpp: Introduce a helper function to retrieve the math
1346 (WebCore::RenderMathMLBlock::mathAxisHeight):
1347 * rendering/mathml/RenderMathMLBlock.h: Declare mathAxisHeight.
1348 * rendering/mathml/RenderMathMLFraction.cpp:
1349 (WebCore::RenderMathMLFraction::RenderMathMLFraction):
1350 (WebCore::RenderMathMLFraction::parseAlignmentAttribute): Helper function to parse the align
1352 (WebCore::RenderMathMLFraction::isValid): Helper function to verify whether the child list
1353 is valid with respect to the MathML specificitation.
1354 (WebCore::RenderMathMLFraction::numerator): Helper function to retrieve the numerator.
1355 (WebCore::RenderMathMLFraction::denominator): Helper function to retrieve the denominator.
1356 (WebCore::RenderMathMLFraction::updateFromElement): Use the FractionRuleThickness parameter
1357 when avaiable to calculate the default linethickness.
1358 Fix computation of linethickness for absolute values (e.g. 10px), the default linethickness
1359 must not be involved for such values.
1360 We no longer need to manage style of anonymous wrappers.
1361 (WebCore::RenderMathMLFraction::unembellishedOperator): Use the helper function and we no
1362 longer care about anonymous wrappers.
1363 (WebCore::RenderMathMLFraction::computePreferredLogicalWidths): Implement this function
1364 without using flexbox.
1365 (WebCore::RenderMathMLFraction::horizontalOffset): Helper function to get the horizontal
1366 offsets of children depending of the alignment.
1367 (WebCore::RenderMathMLFraction::layoutBlock): Implement this function without using flexbox.
1368 (WebCore::RenderMathMLFraction::paint): Do not paint if the fraction is invalid. Use helper
1369 function. Use the width of the renderer (instead of the one of the denominator) as the
1370 length of the fraction bar.
1371 (WebCore::RenderMathMLFraction::firstLineBaseline): Use the helper functions to get children
1373 (WebCore::RenderMathMLFraction::paintChildren): Temporary function to remove in a
1375 (WebCore::RenderMathMLFraction::fixChildStyle): Deleted. We no longer need to manage style
1376 of anonymous wrappers.
1377 (WebCore::RenderMathMLFraction::addChild): Deleted. We no longer need to manage
1379 (WebCore::RenderMathMLFraction::styleDidChange): We no longer need to manage style of
1381 (WebCore::RenderMathMLFraction::layout): Deleted.
1382 * rendering/mathml/RenderMathMLFraction.h: Replace lineThickness with relativeLineThickness,
1383 as needed by the accessibility code. Update function and members declarations.
1385 2016-04-11 Commit Queue <commit-queue@webkit.org>
1387 Unreviewed, rolling out r199290.
1388 https://bugs.webkit.org/show_bug.cgi?id=156465
1390 broke 300 tests (Requested by mcatanzaro on #webkit).
1394 "Merge CG ImageSource and non CG ImageSource implementation in
1396 https://bugs.webkit.org/show_bug.cgi?id=155456
1397 http://trac.webkit.org/changeset/199290
1399 2016-04-11 Frederic Wang <fwang@igalia.com>
1401 Refactor RenderMathMLUnderOver layout functions to avoid using flexbox
1402 https://bugs.webkit.org/show_bug.cgi?id=153742
1404 Reviewed by Sergio Villar Senin.
1406 Based on a patch by Javier Fernandez <jfernandez@igalia.com>
1408 Refactor the UnderOver renderer to use its own layoutBlock method that
1409 does all the layout calculations without considering the flexbox
1413 (mo, mfrac, munder, mover, munderover): Delete the underover elements from the line defining
1414 the column direction.
1415 (munder, mover, munderover): Deleted. This flexbox property is no longer needed.
1416 (mover > :last-child, munderover > :last-child): Deleted. This flexbox property is no longer
1418 * rendering/mathml/RenderMathMLUnderOver.cpp:
1419 (WebCore::RenderMathMLUnderOver::firstLineBaseline): Use ascentForChild.
1420 (WebCore::RenderMathMLUnderOver::computeOperatorsHorizontalStretch): Avoid stretching
1421 operators that are not stretchy.
1422 (WebCore::RenderMathMLUnderOver::isValid): Helper function to ensure that the child list is
1423 valid with respect to the MathML specification.
1424 (WebCore::RenderMathMLUnderOver::base): Added. Helper function.
1425 (WebCore::RenderMathMLUnderOver::under): Added. Helper function.
1426 (WebCore::RenderMathMLUnderOver::over): Added. Helper function.
1427 (WebCore::RenderMathMLUnderOver::computePreferredLogicalWidths): Added.
1428 The preferred width is the maximum preferred width of the base, under and over scripts.
1429 (WebCore::RenderMathMLUnderOver::horizontalOffset): Added, helper to calculate the
1430 horizontal position of children (horizontally centered).
1431 (WebCore::RenderMathMLUnderOver::layoutBlock): Added, it lays out the base, underscript and
1432 overscript. It calculates the exact logical width, which may differ from the preferred width when
1433 one child contains stretchy operators. It later sets the locations of children accordingly
1434 and sets the heigth of the render element.
1435 (WebCore::RenderMathMLUnderOver::paintChildren): Added, we have to use the usual traverse
1436 instead of the one that comes from the flexbox. This will be removed in a follow-up patch.
1437 (WebCore::RenderMathMLUnderOver::layout): Deleted.
1438 * rendering/mathml/RenderMathMLUnderOver.h: Added new functions definitions.
1440 2016-04-07 Carlos Garcia Campos <cgarcia@igalia.com>
1442 [GTK] Rework the theming code for GTK+ 3.20
1443 https://bugs.webkit.org/show_bug.cgi?id=156333
1445 Reviewed by Michael Catanzaro.
1447 During the 3.19 GTK+ release cycle, the GTK+ css system was reworked, making themes and programs rendering
1448 themed widgets, incompatible with the new system. We were trying to fix our rendering every time GTK+ broke
1449 something, but we were just changing whatever it was needed to make our rendering look like current GTK+ with
1450 the default theme Adwaita. This means that our rendering will be broken for other themes or that changes in
1451 Adwaita can break our rendering. This solution was good enough to ensure WebKitGTK+ 2.12 looked good with GTK+
1452 3.20, but it doesn't work in the long term. We need to ensure that our theming code honors the new GTK+ CSS
1453 properties (max-width, min-width, margin, padding, border, ...) in all the cases, not only the cases where
1454 Adwaita uses them like we currently do.
1455 This patch splits all rendering methods to keep the current code for previous GTK+ versions and adds new code
1456 for GTK+ >= 3.20 using the new RenderThemeGadget classes. This makes the code easier to read, since there aren't
1457 ifdef blocks in the functions, and we ensure we don't break previous rendering.
1459 * PlatformGTK.cmake: Add new files to compilation.
1460 * html/shadow/SpinButtonElement.cpp:
1461 (WebCore::SpinButtonElement::defaultEventHandler): Check the button layout used by the theme to decide the
1462 current buttons state.
1463 * platform/gtk/RenderThemeGadget.cpp: Added.
1464 (WebCore::RenderThemeGadget::create):
1465 (WebCore::createStyleContext):
1466 (WebCore::appendElementToPath):
1467 (WebCore::RenderThemeGadget::RenderThemeGadget):
1468 (WebCore::RenderThemeGadget::~RenderThemeGadget):
1469 (WebCore::RenderThemeGadget::marginBox):
1470 (WebCore::RenderThemeGadget::borderBox):
1471 (WebCore::RenderThemeGadget::paddingBox):
1472 (WebCore::RenderThemeGadget::contentsBox):
1473 (WebCore::RenderThemeGadget::color):
1474 (WebCore::RenderThemeGadget::backgroundColor):
1475 (WebCore::RenderThemeGadget::minimumSize):
1476 (WebCore::RenderThemeGadget::preferredSize):
1477 (WebCore::RenderThemeGadget::render):
1478 (WebCore::RenderThemeGadget::renderFocus):
1479 (WebCore::RenderThemeBoxGadget::RenderThemeBoxGadget):
1480 (WebCore::RenderThemeTextFieldGadget::RenderThemeTextFieldGadget):
1481 (WebCore::RenderThemeTextFieldGadget::minimumSize):
1482 (WebCore::RenderThemeToggleGadget::RenderThemeToggleGadget):
1483 (WebCore::RenderThemeToggleGadget::render):
1484 (WebCore::RenderThemeArrowGadget::RenderThemeArrowGadget):
1485 (WebCore::RenderThemeArrowGadget::render):
1486 (WebCore::RenderThemeIconGadget::RenderThemeIconGadget):
1487 (WebCore::RenderThemeIconGadget::gtkIconSizeForPixelSize):
1488 (WebCore::RenderThemeIconGadget::render):
1489 (WebCore::RenderThemeIconGadget::minimumSize):
1490 * platform/gtk/RenderThemeGadget.h: Added.
1491 (WebCore::RenderThemeGadget::context):
1492 * rendering/RenderTheme.h:
1493 (WebCore::RenderTheme::innerSpinButtonLayout): Added this method to allow themes use a different layout for the
1495 * rendering/RenderThemeGtk.cpp:
1496 (WebCore::themeChangedCallback): Just moved this code to a common place.
1497 (WebCore::RenderThemeGtk::RenderThemeGtk): Initialize the theme monitor in the constructor.
1498 (WebCore::createStyleContext): Remove the render parts that are specific to GTK+ 3.20.
1499 (WebCore::RenderThemeGtk::adjustRepaintRect): Moved inside a GTK+ < 3.20 ifdef block.
1500 (WebCore::themePartStateFlags): Helper function to get the GtkStateFlags of a theme part for a given RenderObject.
1501 (WebCore::shrinkToMinimumSizeAndCenterRectangle): Move this common code to a helper function.
1502 (WebCore::setToggleSize):
1503 (WebCore::paintToggle):
1504 (WebCore::RenderThemeGtk::paintButton):
1505 (WebCore::RenderThemeGtk::popupInternalPaddingBox):
1506 (WebCore::RenderThemeGtk::paintMenuList):
1507 (WebCore::RenderThemeGtk::adjustTextFieldStyle): For GTK+ 3.20 we need to ensure a minimum size for spin buttons,
1508 so if the text field is for a spin button, we adjust the desired size here.
1509 (WebCore::RenderThemeGtk::paintTextField): In GTK+ 3.20 the CSS gadgets used to render spin buttons are
1510 different, so we check here if this is the entry of a spin button to use the right gadgets.
1511 (WebCore::adjustSearchFieldIconStyle):
1512 (WebCore::RenderThemeGtk::paintTextArea):
1513 (WebCore::RenderThemeGtk::adjustSearchFieldResultsButtonStyle):
1514 (WebCore::RenderThemeGtk::paintSearchFieldResultsButton):
1515 (WebCore::RenderThemeGtk::adjustSearchFieldResultsDecorationPartStyle):
1516 (WebCore::RenderThemeGtk::adjustSearchFieldCancelButtonStyle):
1517 (WebCore::paintSearchFieldIcon):
1518 (WebCore::RenderThemeGtk::paintSearchFieldResultsDecorationPart):
1519 (WebCore::RenderThemeGtk::paintSearchFieldCancelButton):
1520 (WebCore::centerRectVerticallyInParentInputElement): Moved inside a GTK+ < 3.20 ifdef block.
1521 (WebCore::RenderThemeGtk::paintSliderTrack):
1522 (WebCore::RenderThemeGtk::adjustSliderThumbSize):
1523 (WebCore::RenderThemeGtk::paintSliderThumb):
1524 (WebCore::RenderThemeGtk::progressBarRectForBounds): Ensure a minimum size of progress bars in GTK+ 3.20.
1525 (WebCore::RenderThemeGtk::paintProgressBar):
1526 (WebCore::RenderThemeGtk::innerSpinButtonLayout): Use an horizontal layout for spin buttons.
1527 (WebCore::RenderThemeGtk::adjustInnerSpinButtonStyle):
1528 (WebCore::RenderThemeGtk::paintInnerSpinButton):
1529 (WebCore::styleColor):
1530 (WebCore::RenderThemeGtk::paintMediaButton):
1531 * rendering/RenderThemeGtk.h:
1533 2016-04-11 Antti Koivisto <antti@apple.com>
1535 Implement functional :host() pseudo class
1536 https://bugs.webkit.org/show_bug.cgi?id=156397
1537 <rdar://problem/25621445>
1539 Reviewed by Darin Adler.
1541 We already support :host. Add functional syntax too.
1543 * css/CSSGrammar.y.in:
1545 Parse functional :host().
1547 * css/CSSParser.cpp:
1548 (WebCore::CSSParser::detectFunctionTypeToken):
1549 * css/CSSParserValues.cpp:
1550 (WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector):
1551 * css/CSSParserValues.h:
1552 * css/ElementRuleCollector.cpp:
1553 (WebCore::ElementRuleCollector::matchedRuleList):
1554 (WebCore::ElementRuleCollector::addMatchedRule):
1556 Factor some shared code here.
1558 (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
1560 Instead of using the generic paths use a :host specific code path for matching.
1561 This makes it easier to avoid :host matching when it shouldn't.
1563 (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1564 * css/ElementRuleCollector.h:
1566 (WebCore::computeMatchBasedOnRuleHash):
1568 :host is always handled by the special matching path.
1570 * css/SelectorChecker.cpp:
1571 (WebCore::SelectorChecker::match):
1572 (WebCore::SelectorChecker::matchHostPseudoClass):
1574 Add a function specifically for checking :host. In always fails on the normal code paths.
1575 Check the argument selector if provided.
1577 (WebCore::hasScrollbarPseudoElement):
1578 * css/SelectorChecker.h:
1580 2016-04-11 Said Abou-Hallawa <sabouhallawa@apple,com>
1582 Merge CG ImageSource and non CG ImageSource implementation in one file
1583 https://bugs.webkit.org/show_bug.cgi?id=155456
1585 Reviewed by Darin Adler.
1587 ImageSource for CG and CG code paths look very similar. All the platform
1588 specific code can be moved to ImageDecoder classes for CG and non CG. And
1589 we can have the ImageSource be platform independent and we get rid of
1592 Test: fast/images/image-subsampling.html
1595 * PlatformAppleWin.cmake:
1596 * PlatformMac.cmake:
1597 * WebCore.xcodeproj/project.pbxproj:
1598 Delete ImageSourceCG.cpp form all make files and add ImageSource.cpp to
1601 * platform/Cursor.cpp:
1602 (WebCore::determineHotSpot):
1603 * platform/graphics/BitmapImage.cpp:
1604 (WebCore::BitmapImage::hotSpot):
1605 (WebCore::BitmapImage::getHotSpot): Deleted.
1606 * platform/graphics/BitmapImage.h:
1607 * platform/graphics/Image.h:
1608 (WebCore::Image::hotSpot):
1609 (WebCore::Image::getHotSpot): Deleted.
1610 Rename getHotSpot() to hotSpot() and change it to return Optional<IntPoint>.
1612 * platform/graphics/ImageSource.cpp:
1613 (WebCore::ImageSource::~ImageSource): Remove clear(true) call. It does nothing.
1614 (WebCore::ImageSource::clearFrameBufferCache): A wrapper which calls ImageDecoder::clearFrameBufferCache().
1615 (WebCore::ImageSource::clear): Calls clearFrameBufferCache() which will do nothing for CG.
1617 (WebCore::ImageSource::ensureDecoderIsCreated): Change SharedBuffer* to
1618 const SharedBuffer& and remove the call to ImageDecoder::setMaxNumPixels().
1619 The value of const static int CG ImageDecoder::m_maxNumPixels will be set
1620 based on IMAGE_DECODER_DOWN_SAMPLING.
1622 (WebCore::ImageSource::setData): Pass SharedBuffer& to the underlying functions.
1624 (WebCore::ImageSource::calculateMaximumSubsamplingLevel): Returns the maximum
1625 subsampling level allowed for an image.
1627 (WebCore::ImageSource::subsamplingLevelForScale): Converts from a scale to
1628 SubsamplingLevel taking into consideration the maximumSubsamplingLevel for
1631 (WebCore::ImageSource::bytesDecodedToDetermineProperties): Returns the number
1632 of encoded bytes which can determine the image properties. For non CG it's
1633 zero. For CG it is a maximum value which can be corrected later.
1635 (WebCore::ImageSource::isSizeAvailable):
1636 (WebCore::ImageSource::sizeRespectingOrientation):
1637 (WebCore::ImageSource::frameCount):
1638 (WebCore::ImageSource::repetitionCount):
1639 (WebCore::ImageSource::filenameExtension):
1640 (WebCore::ImageSource::getHotSpot):
1641 (WebCore::ImageSource::frameIsCompleteAtIndex):
1642 (WebCore::ImageSource::frameHasAlphaAtIndex):
1643 (WebCore::ImageSource::allowSubsamplingOfFrameAtIndex):
1644 (WebCore::ImageSource::frameSizeAtIndex):
1645 (WebCore::ImageSource::frameBytesAtIndex):
1646 (WebCore::ImageSource::frameDurationAtIndex):
1647 (WebCore::ImageSource::orientationAtIndex):
1648 (WebCore::ImageSource::createFrameImageAtIndex):
1649 These are wrappers for the ImageDecoder APIs. The purpose of these functions
1650 is to ensure the ImageDecoder is created.
1652 (WebCore::ImageSource::dump): Called from BitmapImage::dump().
1654 (WebCore::ImageSource::getHotSpot): Deleted.
1656 * platform/graphics/ImageSource.h:
1657 (WebCore::ImageSource::setAllowSubsampling): Called from BitmapImage::setAllowSubsampling().
1659 (WebCore::ImageSource::maxPixelsPerDecodedImage): Deleted.
1660 (WebCore::ImageSource::setMaxPixelsPerDecodedImage): Deleted.
1661 Setting maxPixelsPerDecodedImage was moved to the non CG ImageDecoder.
1663 * platform/graphics/cg/ImageDecoderCG.cpp:
1664 (WebCore::ImageDecoder::setData): Change SharedBuffer* to SharedBuffer&.
1666 (WebCore::ImageDecoder::subsamplingLevelForScale): Deleted.
1667 The code was moved to ImageSource::subsamplingLevelForScale().
1669 * platform/graphics/cg/ImageDecoderCG.h:
1670 (WebCore::ImageDecoder::create): Make the prototype of this function
1671 suitable for CG and non CG cases.
1672 (WebCore::ImageDecoder::clearFrameBufferCache): Empty functions for CG.
1674 * platform/graphics/cg/ImageSourceCG.cpp: Removed.
1676 * platform/image-decoders/ImageDecoder.cpp:
1677 (WebCore::ImageDecoder::frameIsCompleteAtIndex): A mew function to return
1678 whether the frame decoding is complete or not.
1680 (WebCore::ImageDecoder::frameHasAlphaAtIndex): Simplify the logic.
1682 (WebCore::ImageDecoder::frameDurationAtIndex): The code was moved from
1683 ImageSource::frameDurationAtIndex() in ImageSource.cpp.
1685 (WebCore::ImageDecoder::createFrameImageAtIndex): The code was moved from
1686 ImageSource::createFrameImageAtIndex() in ImageSource.cpp.
1688 * platform/image-decoders/ImageDecoder.h:
1689 (WebCore::ImageDecoder::ImageDecoder): Initialize the members in class.
1690 (WebCore::ImageDecoder::~ImageDecoder): Fix the braces style.
1691 (WebCore::ImageDecoder::setData): Change the type of the argument from
1692 SharedBuffer* to SharedBuffer&.
1693 (WebCore::ImageDecoder::frameSizeAtIndex): Add the argument SubsamplingLevel
1694 so it can have the same prototype as CG.
1695 (WebCore::ImageDecoder::orientationAtIndex): Rename it to the same of CG.
1697 (WebCore::ImageDecoder::allowSubsamplingOfFrameAtIndex):
1698 (WebCore::ImageDecoder::bytesDecodedToDetermineProperties):
1699 (WebCore::ImageDecoder::subsamplingLevelForScale): Add these functions
1700 and return the default values so we do not have to add directive compiled
1701 non CG blocks in ImageSource.cpp.
1703 (WebCore::ImageDecoder::hotSpot): Return Optional<IntPoint>.
1705 (WebCore::ImageDecoder::orientation): Deleted.
1706 (WebCore::ImageDecoder::setMaxNumPixels): Deleted.
1708 * platform/image-decoders/bmp/BMPImageDecoder.cpp:
1709 (WebCore::BMPImageDecoder::setData):
1710 * platform/image-decoders/bmp/BMPImageDecoder.h:
1711 * platform/image-decoders/gif/GIFImageDecoder.cpp:
1712 (WebCore::GIFImageDecoder::setData):
1713 (WebCore::GIFImageDecoder::decode):
1714 * platform/image-decoders/gif/GIFImageDecoder.h:
1715 * platform/image-decoders/gif/GIFImageReader.h:
1716 (GIFImageReader::setData):
1717 * platform/image-decoders/ico/ICOImageDecoder.cpp:
1718 (WebCore::ICOImageDecoder::setData):
1719 Use reference SharedBuffer instead of pointer SharedBuffer.
1721 (WebCore::ICOImageDecoder::hotSpot):
1722 (WebCore::ICOImageDecoder::hotSpotAtIndex):
1723 Change hotSpot() to return Optional<IntPoint>.
1724 * platform/image-decoders/ico/ICOImageDecoder.h:
1726 (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex):
1727 Pass reference SharedBuffer instead of pointer SharedBuffer.
1729 2016-04-11 Fujii Hironori <Hironori.Fujii@jp.sony.com>
1731 [CMake] Make FOLDER property INHERITED
1732 https://bugs.webkit.org/show_bug.cgi?id=156460
1734 Reviewed by Brent Fulgham.
1737 Set FOLDER property as a directory property not a target property
1739 2016-04-10 Sam Weinig <sam@webkit.org>
1743 * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1744 (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
1746 2016-04-08 Sam Weinig <sam@webkit.org>
1748 Remove support for custom target picker actions
1749 <rdar://problem/24987783>
1750 https://bugs.webkit.org/show_bug.cgi?id=156434
1752 Reviewed by Eric Carlson.
1754 This mostly entailed rolling out r197429 and r197569.
1756 * Modules/mediasession/WebMediaSessionManager.cpp:
1757 (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients):
1758 (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
1759 (WebCore::WebMediaSessionManager::clientStateDidChange):
1760 (WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange):
1761 (WebCore::WebMediaSessionManager::configureNewClients):
1762 (WebCore::WebMediaSessionManager::customPlaybackActionSelected): Deleted.
1763 * Modules/mediasession/WebMediaSessionManager.h:
1764 * Modules/mediasession/WebMediaSessionManagerClient.h:
1766 (WebCore::Document::removePlaybackTargetPickerClient):
1767 (WebCore::Document::showPlaybackTargetPicker):
1768 (WebCore::Document::playbackTargetPickerClientStateDidChange):
1769 (WebCore::Document::setShouldPlayToPlaybackTarget):
1770 (WebCore::Document::customPlaybackActionSelected): Deleted.
1772 * html/HTMLMediaElement.cpp:
1773 (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent):
1774 (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
1775 (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless):
1776 (WebCore::HTMLMediaElement::customPlaybackActionSelected): Deleted.
1777 (WebCore::HTMLMediaElement::playbackTargetPickerCustomActionName): Deleted.
1778 * html/HTMLMediaElement.h:
1779 * html/MediaElementSession.cpp:
1780 (WebCore::MediaElementSession::showPlaybackTargetPicker):
1781 (WebCore::MediaElementSession::hasWirelessPlaybackTargets):
1782 (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
1783 (WebCore::MediaElementSession::mediaStateDidChange):
1784 (WebCore::MediaElementSession::customPlaybackActionSelected): Deleted.
1785 * html/MediaElementSession.h:
1786 * page/ChromeClient.h:
1788 (WebCore::Page::removePlaybackTargetPickerClient):
1789 (WebCore::Page::showPlaybackTargetPicker):
1790 (WebCore::Page::setShouldPlayToPlaybackTarget):
1791 (WebCore::Page::ensureTestTrigger):
1792 (WebCore::Page::customPlaybackActionSelected): Deleted.
1794 (WebCore::Page::testTrigger):
1795 * platform/audio/PlatformMediaSession.h:
1796 (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
1797 (WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
1798 (WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
1799 (WebCore::PlatformMediaSessionClient::customPlaybackActionSelected): Deleted.
1800 * platform/graphics/MediaPlaybackTargetClient.h:
1801 * platform/graphics/MediaPlaybackTargetPicker.cpp:
1802 (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
1803 (WebCore::MediaPlaybackTargetPicker::addPendingAction):
1804 (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
1805 * platform/graphics/MediaPlaybackTargetPicker.h:
1806 (WebCore::MediaPlaybackTargetPicker::availableDevicesDidChange):
1807 (WebCore::MediaPlaybackTargetPicker::currentDeviceDidChange):
1808 (WebCore::MediaPlaybackTargetPicker::Client::customPlaybackActionSelected): Deleted.
1809 (WebCore::MediaPlaybackTargetPicker::customPlaybackActionSelected): Deleted.
1810 * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
1811 * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
1812 (WebCore::MediaPlaybackTargetPickerMac::devicePicker):
1813 (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
1814 * platform/mac/WebVideoFullscreenInterfaceMac.h:
1815 * platform/mac/WebVideoFullscreenInterfaceMac.mm:
1816 (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):
1817 (WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions):
1818 (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback): Deleted.
1819 * platform/mock/MediaPlaybackTargetPickerMock.cpp:
1820 (WebCore::MediaPlaybackTargetPickerMock::timerFired):
1821 (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
1822 * platform/mock/MediaPlaybackTargetPickerMock.h:
1823 * platform/spi/cocoa/AVKitSPI.h:
1825 2016-04-09 Konstantin Tokarev <annulen@yandex.ru>
1827 Fixed compilation of JPEGImageDecoder with libjpeg v9.
1828 https://bugs.webkit.org/show_bug.cgi?id=156445
1830 Reviewed by Michael Catanzaro.
1832 ICU defines TRUE and FALSE macros, breaking libjpeg v9 headers.
1834 No new tests needed.
1836 * platform/image-decoders/jpeg/JPEGImageDecoder.h:
1838 2016-04-09 Commit Queue <commit-queue@webkit.org>
1840 Unreviewed, rolling out r199242.
1841 https://bugs.webkit.org/show_bug.cgi?id=156442
1843 Caused many many leaks (Requested by ap on #webkit).
1847 "Web Inspector: get rid of InspectorBasicValue and
1848 InspectorString subclasses"
1849 https://bugs.webkit.org/show_bug.cgi?id=156407
1850 http://trac.webkit.org/changeset/199242
1852 2016-04-09 Commit Queue <commit-queue@webkit.org>
1854 Unreviewed, rolling out r199268.
1855 https://bugs.webkit.org/show_bug.cgi?id=156440
1857 Broke Windows build (Requested by ap on #webkit).
1861 "Implement functional :host() pseudo class"
1862 https://bugs.webkit.org/show_bug.cgi?id=156397
1863 http://trac.webkit.org/changeset/199268
1865 2016-04-09 Antti Koivisto <antti@apple.com>
1867 Implement functional :host() pseudo class
1868 https://bugs.webkit.org/show_bug.cgi?id=156397
1869 <rdar://problem/25621445>
1871 Reviewed by Darin Adler.
1873 We already support :host. Add functional syntax too.
1875 * css/CSSGrammar.y.in:
1877 Parse functional :host().
1879 * css/CSSParser.cpp:
1880 (WebCore::CSSParser::detectFunctionTypeToken):
1881 * css/CSSParserValues.cpp:
1882 (WebCore::CSSParserSelector::parsePseudoClassHostFunctionSelector):
1883 * css/CSSParserValues.h:
1884 * css/ElementRuleCollector.cpp:
1885 (WebCore::ElementRuleCollector::matchedRuleList):
1886 (WebCore::ElementRuleCollector::addMatchedRule):
1888 Factor some shared code here.
1890 (WebCore::ElementRuleCollector::matchHostPseudoClassRules):
1892 Instead of using the generic paths use a :host specific code path for matching.
1893 This makes it easier to avoid :host matching when it shouldn't.
1895 (WebCore::ElementRuleCollector::collectMatchingRulesForList):
1896 * css/ElementRuleCollector.h:
1898 (WebCore::computeMatchBasedOnRuleHash):
1900 :host is always handled by the special matching path.
1902 * css/SelectorChecker.cpp:
1903 (WebCore::SelectorChecker::match):
1904 (WebCore::SelectorChecker::matchHostPseudoClass):
1906 Add a function specifically for checking :host. In always fails on the normal code paths.
1907 Check the argument selector if provided.
1909 (WebCore::hasScrollbarPseudoElement):
1910 * css/SelectorChecker.h:
1912 2016-04-07 Darin Adler <darin@apple.com>
1914 Improve IDL support for object arguments that are neither optional nor nullable
1915 https://bugs.webkit.org/show_bug.cgi?id=156149
1917 Reviewed by Chris Dumez.
1919 After this patch, we are almost ready to change some more DOM functions to
1920 use references instead of pointers. Remaining blocking issue is lack of support
1921 for ShouldPassWrapperByReference in the gobject bindings.
1923 * bindings/objc/ExceptionHandlers.h: Add NO_RETURN to raiseDOMException.
1924 Added a new raiseTypeErrorException. Re-indented header and removed unneeded
1925 include and forward declarations.
1927 * bindings/objc/ExceptionHandlers.mm:
1928 (WebCore::raiseDOMException): Added RELEASE_ASSERT_NOT_REACHED so the compiler
1929 will understand this is NO_RETURN. Also updated FIXME comment.
1930 (WebCore::raiseTypeErrorException): Added.
1932 * bindings/scripts/CodeGenerator.pm: Removed unneeded code that allows the type
1933 "AtomicString" in IDL files.
1934 (ShouldPassWrapperByReference): Added. Contains the logic from the function in
1935 the JavaScript code generator that was named IsPointerParameterPassedByReference,
1936 minus a couple checks that are unneeded. For use in other code generators so they
1937 are all consistent about how they call the DOM implementation.
1939 * bindings/scripts/CodeGeneratorGObject.pm:
1940 (SkipFunction): Removed support for unused CustomBinding extended attribute.
1942 * bindings/scripts/CodeGeneratorJS.pm:
1943 (GenerateHeader): Removed support for unused CustomBinding extended attribute.
1944 (GenerateImplementation): Ditto. Also changed type checking code to throw a
1945 type error in a more efficient way, using throwVMTypeError directly.
1946 (GenerateParametersCheck): Rearranged code a bit so that arguments that need to
1947 be passed in unusual ways are handled all in one place. Use WTFMove for newly
1948 created NodeFilter objects. Simplified the reference logic so it doesn't need
1949 to do an additional check to see if a type is a callback. Also changed type
1950 checking code to throw a type error in a more efficient way, using throwVMTypeError
1951 directly. Also corrected mistake where null checking code was throwing
1952 TYPE_MISMATCH_ERR instead of a type error.
1953 (GetNativeType): Coding style tweak.
1954 (ShouldPassWrapperByReference): Renamed from IsPointerParameterPassedByReference.
1955 Changed to call underlying ShouldPassWrapperByReference function in the language-
1956 independent code generator.
1957 (GenerateConstructorDefinition): Updated for name change.
1959 * bindings/scripts/CodeGeneratorObjC.pm:
1960 (SkipFunction): Removed support for unused CustomBinding extended attribute.
1961 (GenerateImplementation): Added code to null check and pass a reference when
1962 ShouldPassWrapperByReference returns true.
1964 * bindings/scripts/IDLAttributes.txt: Sorted in the AppleCopyright and
1965 UsePointersEvenForNonNullableObjectArguments arguments. Removed the unused
1966 CPPPureInterface and CustomBinding attributes.
1968 * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: Regenerated test results.
1969 * bindings/scripts/test/JS/JSTestInterface.cpp: Ditto.
1970 * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
1971 * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
1972 * bindings/scripts/test/JS/JSTestObj.h: Ditto.
1973 * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: Ditto.
1974 * bindings/scripts/test/JS/JSTestTypedefs.cpp: Ditto.
1975 * bindings/scripts/test/ObjC/DOMTestActiveDOMObject.mm: Ditto.
1976 * bindings/scripts/test/ObjC/DOMTestCallback.mm: Ditto.
1977 * bindings/scripts/test/ObjC/DOMTestCallbackFunction.mm: Ditto.
1978 * bindings/scripts/test/ObjC/DOMTestInterface.mm: Ditto.
1979 * bindings/scripts/test/ObjC/DOMTestMediaQueryListListener.mm: Ditto.
1980 * bindings/scripts/test/ObjC/DOMTestObj.mm: Ditto.
1982 * bindings/scripts/test/TestObj.idl: Removed test for CustomBinding.
1984 * dom/DOMImplementation.idl: Fixed #if so that only the return type is different
1985 between JavaScript and the other bindings. Without this change, the different
1986 bindings got different results for ShouldPassWrapperByReference. Also formatted
1987 functions all on a single line.
1989 * dom/EventListener.idl: Removed CPPPureInterface, since it had no effect.
1990 * dom/EventTarget.idl: Ditto.
1992 2016-04-08 Chris Dumez <cdumez@apple.com>
1994 [WebIDL] Add support for [ExportMacro=XXX] IDL extended attribute
1995 https://bugs.webkit.org/show_bug.cgi?id=156428
1997 Reviewed by Ryosuke Niwa.
1999 Add support for [ExportMacro=XXX] IDL extended attribute (e.g. [ExportMacro=WEBCORE_EXPORT])
2000 so developers can indicate in the IDL which macro to use to export the generated JS bindings
2003 We previously supported this by hard-coding JS class names in the bindings generator which
2006 * Modules/mediasession/MediaSession.idl:
2007 * Modules/mediasource/SourceBuffer.idl:
2008 * Modules/notifications/Notification.idl:
2009 * Modules/webaudio/AudioContext.idl:
2010 * bindings/scripts/CodeGeneratorJS.pm:
2011 (GetExportMacroForJSClass):
2013 (AddIncludesForType): Deleted.
2014 (AddToImplIncludes): Deleted.
2015 * bindings/scripts/IDLAttributes.txt:
2016 * bindings/scripts/test/TestInterface.idl:
2017 * bindings/scripts/test/TestNode.idl:
2018 * css/CSSStyleDeclaration.idl:
2019 * dom/ClientRect.idl:
2020 * dom/ClientRectList.idl:
2027 * html/HTMLElement.idl:
2028 * html/HTMLMediaElement.idl:
2029 * html/TimeRanges.idl:
2030 * html/canvas/DOMPath.idl:
2031 * inspector/ScriptProfile.idl:
2032 * inspector/ScriptProfileNode.idl:
2033 * page/DOMWindow.idl:
2034 * page/make_settings.pl:
2035 (generateInternalSettingsIdlFile):
2036 * testing/InternalSettings.idl:
2037 * testing/Internals.idl:
2038 * testing/MallocStatistics.idl:
2039 * testing/MemoryInfo.idl:
2040 * testing/TypeConversions.idl:
2041 * xml/XMLHttpRequest.idl:
2043 2016-04-08 Joseph Pecoraro <pecoraro@apple.com>
2045 Web Inspector: XHRs and Web Worker scripts are not searchable
2046 https://bugs.webkit.org/show_bug.cgi?id=154214
2047 <rdar://problem/24643587>
2049 Reviewed by Timothy Hatcher.
2051 Test: inspector/page/searchInResources.html
2053 * inspector/InspectorPageAgent.h:
2054 * inspector/InspectorPageAgent.cpp:
2055 (WebCore::InspectorPageAgent::searchInResource):
2056 (WebCore::InspectorPageAgent::searchInResources):
2057 Let the NetworkAgent handle individual search requests
2058 with a requestId. And provide global search results for
2059 "other" resources and will include requestId properties.
2061 * inspector/InspectorNetworkAgent.h:
2062 * inspector/InspectorNetworkAgent.cpp:
2063 (WebCore::InspectorNetworkAgent::didFinishXHRLoading):
2064 (WebCore::buildObjectForSearchResult):
2065 (WebCore::InspectorNetworkAgent::searchOtherRequests):
2066 (WebCore::InspectorNetworkAgent::searchInRequest):
2067 Search saved "other" resource data content.
2069 * inspector/NetworkResourcesData.h:
2070 * inspector/NetworkResourcesData.cpp:
2071 (WebCore::NetworkResourcesData::resources):
2072 Expose the resources for iteration by the NetworkAgent.
2074 2016-04-08 Joanmarie Diggs <jdiggs@igalia.com>
2076 AX: "AXLandmarkApplication" is an inappropriate subrole for ARIA "application" since it's no longer a landmark
2077 https://bugs.webkit.org/show_bug.cgi?id=155403
2079 Reviewed by Chris Fleizach.
2081 The new subrole is AXWebApplication and the new role description is "web application".
2082 As part of the fix, the WebCore AccessibilityRole for ARIA's "application" role was
2083 renamed from LandmarkApplicationRole to WebApplicationRole.
2085 The roles-exposed.html and aria-grouping-roles.html test expectations were also updated.
2087 * English.lproj/Localizable.strings:
2088 * accessibility/AccessibilityObject.cpp:
2089 (WebCore::AccessibilityObject::accessibleNameDerivesFromContent):
2090 (WebCore::AccessibilityObject::isLandmark):
2091 (WebCore::initializeRoleMap):
2092 * accessibility/AccessibilityObject.h:
2093 * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2095 * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
2096 (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
2097 (-[WebAccessibilityObjectWrapper _accessibilityIsLandmarkRole:]):
2098 * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
2099 (-[WebAccessibilityObjectWrapperBase ariaLandmarkRoleDescription]):
2100 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2101 (createAccessibilityRoleMap):
2102 (-[WebAccessibilityObjectWrapper subrole]):
2103 * platform/LocalizedStrings.cpp:
2104 (WebCore::AXARIAContentGroupText):
2106 2016-04-08 Simon Fraser <simon.fraser@apple.com>
2108 [iOS WK2] WKWebViews should consult ancestor UIScrollViews to determine tiling area
2109 https://bugs.webkit.org/show_bug.cgi?id=156429
2110 rdar://problem/25455111
2112 Reviewed by Tim Horton.
2114 When a WKWebView is expanded to full size, then embedded in UIScrollView, it would
2115 create huge tiles that cover the entire view area (since it considered itself non-scrollable).
2117 Fix to always use 512x512 tiles in this configuration, and to adjust the tile coverage
2118 for the area exposed through the enclosing UIScrollView.
2120 * loader/HistoryController.cpp:
2121 (WebCore::HistoryController::saveScrollPositionAndViewStateToItem): setObscuredInset()
2122 moved from FrameView to Page.
2123 * page/FrameView.cpp:
2124 (WebCore::FrameView::adjustTiledBackingScrollability): If we're clipped by an ancestor scrollView,
2125 just assume we're scrollable on both axes.
2127 (WebCore::Page::obscuredInset):
2128 (WebCore::Page::setObscuredInset):
2129 (WebCore::Page::enclosedInScrollView):
2130 (WebCore::Page::setEnclosedInScrollView):
2131 * platform/ScrollView.h:
2132 (WebCore::ScrollView::platformObscuredInset): Deleted.
2133 (WebCore::ScrollView::platformSetObscuredInset): Deleted.
2135 2016-04-08 Joseph Pecoraro <pecoraro@apple.com>
2137 [iOS Simulator] Build failure (property 'contentsFormat' not found on object of type 'LegacyTileLayer *')
2138 https://bugs.webkit.org/show_bug.cgi?id=156415
2140 Reviewed by Simon Fraser.
2142 * platform/spi/cocoa/QuartzCoreSPI.h:
2143 Provide SPI forward declaration of the CALayer contentsFormat property.
2145 2016-04-08 Alex Christensen <achristensen@webkit.org>
2147 Progress towards running CMake WebKit2 on Mac
2148 https://bugs.webkit.org/show_bug.cgi?id=156426
2150 Reviewed by Tim Horton.
2153 * PlatformGTK.cmake:
2154 * PlatformMac.cmake:
2155 * PlatformWin.cmake:
2156 On Mac, WTF is a static library that is linked only with JavaScriptCore.
2158 2016-04-08 Jer Noble <jer.noble@apple.com>
2160 Unreviewed 32-bit build fix; make type of std::min<> explicit.
2162 * platform/audio/ios/AudioDestinationIOS.cpp:
2163 (WebCore::AudioDestinationIOS::render):
2165 2016-04-08 Jer Noble <jer.noble@apple.com>
2167 CRASH in AudioDestinationNode::render()
2168 https://bugs.webkit.org/show_bug.cgi?id=156308
2170 Reviewed by Eric Carlson.
2172 Yet another math error in AudioDestinationIOS::render(). It is possible for the difference between
2173 m_startSpareFrame and m_endSpareFrame to be greater than the numberOfFrames to be rendered. Protect
2174 against this case by taking the min() of those two values and only advancing m_startSpareFrame by
2175 that amount. This guarantees that framesThisTime will never underflow, and that data will not be
2176 written past the end of the ioData parameter.
2178 * platform/audio/ios/AudioDestinationIOS.cpp:
2179 (WebCore::AudioDestinationIOS::render):
2181 2016-04-08 Brady Eidson <beidson@apple.com>
2183 Modern IDB: Use more IDBValue and IDBGetResult in IDBBackingStore.
2184 https://bugs.webkit.org/show_bug.cgi?id=156418
2186 Reviewed by Alex Christensen.
2188 No new tests (Refactor, no change in behavior).
2190 * Modules/indexeddb/IDBValue.cpp:
2191 (WebCore::IDBValue::IDBValue):
2192 * Modules/indexeddb/IDBValue.h:
2194 * Modules/indexeddb/server/IDBBackingStore.h:
2196 * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp:
2197 (WebCore::IDBServer::MemoryBackingStoreTransaction::abort):
2199 * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
2200 (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
2201 (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
2202 * Modules/indexeddb/server/MemoryIDBBackingStore.h:
2204 * Modules/indexeddb/server/MemoryObjectStore.cpp:
2205 (WebCore::IDBServer::MemoryObjectStore::addRecord):
2206 * Modules/indexeddb/server/MemoryObjectStore.h:
2208 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2209 (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2210 (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
2211 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2213 * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
2214 (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
2215 (WebCore::IDBServer::UniqueIDBDatabase::performGetRecord):
2217 2016-04-08 Brady Eidson <beidson@apple.com>
2219 Modern IDB: Make IDBGetResult contain an IDBValue instead of a buffer, and remove unused methods.
2220 https://bugs.webkit.org/show_bug.cgi?id=156416
2222 Reviewed by Alex Christensen.
2224 No new tests (Refactor, no change in behavior).
2226 * Modules/indexeddb/IDBCursor.cpp:
2227 (WebCore::IDBCursor::setGetResult):
2229 * Modules/indexeddb/IDBGetResult.cpp:
2230 (WebCore::IDBGetResult::dataFromBuffer):
2231 (WebCore::IDBGetResult::isolatedCopy):
2232 * Modules/indexeddb/IDBGetResult.h:
2233 (WebCore::IDBGetResult::IDBGetResult):
2234 (WebCore::IDBGetResult::value):
2235 (WebCore::IDBGetResult::encode):
2236 (WebCore::IDBGetResult::decode):
2237 (WebCore::IDBGetResult::valueBuffer): Deleted.
2238 (WebCore::IDBGetResult::setValueBuffer): Deleted.
2239 (WebCore::IDBGetResult::setKeyData): Deleted.
2240 (WebCore::IDBGetResult::setPrimaryKeyData): Deleted.
2241 (WebCore::IDBGetResult::setKeyPath): Deleted.
2243 * Modules/indexeddb/IDBTransaction.cpp:
2244 (WebCore::IDBTransaction::didGetRecordOnServer):
2246 * Modules/indexeddb/IDBValue.cpp:
2247 (WebCore::IDBValue::IDBValue):
2248 * Modules/indexeddb/IDBValue.h:
2250 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2251 (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
2253 2016-04-08 Zalan Bujtas <zalan@apple.com>
2255 Focus ring drawn at incorrect location on image map with CSS transform.
2256 https://bugs.webkit.org/show_bug.cgi?id=143527
2257 <rdar://problem/21908735>
2259 Reviewed by Simon Fraser.
2261 Implement pathForFocusRing for HTMLAreaElement. It follows the logic of RenderObject::addFocusRingRects().
2263 Tests: fast/images/image-map-outline-in-positioned-container.html
2264 fast/images/image-map-outline-with-paint-root-offset.html
2265 fast/images/image-map-outline-with-scale-transform.html
2266 fast/images/image-map-outline.html
2268 * html/HTMLAreaElement.cpp:
2269 (WebCore::HTMLAreaElement::pathForFocusRing):
2270 * html/HTMLAreaElement.h:
2271 * rendering/RenderElement.cpp:
2272 (WebCore::RenderElement::paintFocusRing): Move addFocusRingRects() out of focus ring painting.
2273 (WebCore::RenderElement::paintOutline):
2274 * rendering/RenderElement.h:
2275 * rendering/RenderImage.cpp:
2276 (WebCore::RenderImage::paint):
2277 (WebCore::RenderImage::paintAreaElementFocusRing):
2278 * rendering/RenderImage.h:
2279 * rendering/RenderInline.cpp:
2280 (WebCore::RenderInline::paintOutline):
2282 2016-04-08 Brent Fulgham <bfulgham@apple.com>
2284 [WK1] Wheel event callback removing the window causes crash in WebCore
2285 https://bugs.webkit.org/show_bug.cgi?id=156409
2286 <rdar://problem/25631267>
2288 Reviewed by Simon Fraser.
2290 Null check the Widget before using it, since the iframe may have been removed
2291 from its parent document inside the event handler.
2293 This is the WK1 fix for https://bugs.webkit.org/show_bug.cgi?id=150871.
2295 Tested by fast/events/wheel-event-destroys-frame.html
2297 * page/EventHandler.cpp:
2298 (WebCore::widgetForElement): Added.
2299 (WebCore::EventHandler::handleWheelEvent): Use new helper function to
2300 clean up the code, and allow us to check that the Widget has not been
2301 destroyed during the event handler.
2303 2016-04-08 Said Abou-Hallawa <sabouhallawa@apple,com>
2305 Timing attack on SVG feComposite filter circumvents same-origin policy
2306 https://bugs.webkit.org/show_bug.cgi?id=154338
2308 Reviewed by Oliver Hunt.
2310 Ensure the FEComposite arithmetic filter is clamping the resulted color
2311 components in a constant time.
2313 * platform/graphics/filters/FEComposite.cpp:
2314 (WebCore::clampByte):
2315 (WebCore::computeArithmeticPixels):
2317 2016-04-08 Brian Burg <bburg@apple.com>
2319 Web Inspector: get rid of InspectorBasicValue and InspectorString subclasses
2320 https://bugs.webkit.org/show_bug.cgi?id=156407
2321 <rdar://problem/25627659>
2323 Reviewed by Timothy Hatcher.
2325 * inspector/InspectorDatabaseAgent.cpp: Don't use deleted subclasses.
2327 2016-04-08 Beth Dakin <bdakin@apple.com>
2329 Fix leaks in WebAVMediaSelectionOptionMac and WebPlaybackControlsManager
2330 https://bugs.webkit.org/show_bug.cgi?id=156379
2332 Reviewed by Tim Horton.
2334 These classes should use RetainPtrs.
2335 * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2336 (-[WebAVMediaSelectionOptionMac localizedDisplayName]):
2337 (-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]):
2338 (-[WebPlaybackControlsManager timing]):
2339 (-[WebPlaybackControlsManager setTiming:]):
2340 (-[WebPlaybackControlsManager seekableTimeRanges]):
2341 (-[WebPlaybackControlsManager setSeekableTimeRanges:]):
2342 (-[WebPlaybackControlsManager audioMediaSelectionOptions]):
2343 (-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]):
2344 (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
2345 (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
2346 (-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
2347 (-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]):
2348 (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
2349 (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
2351 2016-04-08 Fujii Hironori <Hironori.Fujii@jp.sony.com>
2353 Touching any IDL files rebuilds all bindings in CMake Ninja build
2354 https://bugs.webkit.org/show_bug.cgi?id=156400
2356 Reviewed by Brent Fulgham.
2358 * bindings/scripts/preprocess-idls.pl:
2359 (GenerateConstructorAttribute):
2360 WriteFileIfChanged does not work due to flaky results of 'keys'.
2361 Sort results of 'keys'.
2363 2016-04-07 Simon Fraser <simon.fraser@apple.com>
2365 [iOS WK2] Stop using exposedContentRect for history scroll state restoration
2366 https://bugs.webkit.org/show_bug.cgi?id=156392
2368 Reviewed by Tim Horton.
2370 A future commit will alter the meaning of exposedContentRect on iOS to take into
2371 account clipped out parts of the WKWebView. To achieve this, wean history restoration
2372 off of using exposedContentRect for scroll state restoration. It did this to restore
2373 the page to the same position relative to the view's top-left (to avoid jiggles caused
2374 by changing obscured insets).
2376 Do this by pushing the left/top obscured insets down with visible content rects updates,
2377 storing them on ScrollView, and adding them to HistoryItem. Those insets are then used
2378 for scroll state restoration in WKWebView.
2380 * history/HistoryItem.cpp:
2381 (WebCore::HistoryItem::HistoryItem):
2382 * history/HistoryItem.h:
2383 (WebCore::HistoryItem::obscuredInset):
2384 (WebCore::HistoryItem::setObscuredInset):
2385 * loader/HistoryController.cpp:
2386 (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
2387 * platform/ScrollView.h:
2388 (WebCore::ScrollView::platformObscuredInset):
2389 (WebCore::ScrollView::platformSetObscuredInset):
2391 2016-04-08 Brady Eidson <beidson@apple.com>
2393 Build fix followup to http://trac.webkit.org/changeset/199230
2397 * platform/posix/FileSystemPOSIX.cpp:
2398 (WebCore::hardLinkOrCopyFile): Stricter POSIX systems require a umask for O_CREAT opens,
2399 so let's provide one.
2401 2016-04-08 Darin Adler <darin@apple.com>
2403 Remove 14 more unnecessary uses of UsePointersEvenForNonNullableObjectArguments
2404 https://bugs.webkit.org/show_bug.cgi?id=156405
2406 Reviewed by Chris Dumez.
2408 * Modules/encryptedmedia/MediaKeySession.idl:
2409 * Modules/encryptedmedia/MediaKeys.idl:
2411 * dom/NamedNodeMap.idl:
2412 * html/HTMLElement.idl:
2413 * html/canvas/OESVertexArrayObject.idl:
2414 * html/canvas/WebGLRenderingContext.idl:
2415 * page/DOMSelection.idl:
2416 * storage/StorageEvent.idl:
2417 * svg/SVGSVGElement.idl:
2418 * xml/XMLSerializer.idl:
2419 * xml/XPathEvaluator.idl:
2420 * xml/XPathExpression.idl:
2421 * xml/XSLTProcessor.idl:
2422 Removed UsePointersEvenForNonNullableObjectArguments, which was having no effect
2423 in any of these classes. Also tweaked formatting of some of the IDL, merging things
2424 onto single lines, changing paragraphing and indenting a bit, and fixing some typos.
2426 2016-04-08 Brady Eidson <beidson@apple.com>
2428 Modern IDB (Blob support): Write blobs to temporary files and move them to the correct location when storing them.
2429 https://bugs.webkit.org/show_bug.cgi?id=156321
2431 Reviewed by Alex Christensen, Andy Estes, and Darin Adler.
2433 No new tests (No testable change in behavior yet, current tests pass).
2435 When asked to store a Blob (including Files) in IndexedDB, the Blob is written out to a temporary file.
2437 Then when the putOrAdd request is received by IDBServer it includes a list of blobURLs and their mappings
2440 Finally, as part of storing the Blob value in the database, those temporary files are moved in to place
2441 under the IndexedDB directory for storage and later retrieval.
2443 * Modules/indexeddb/IDBValue.cpp:
2444 (WebCore::IDBValue::IDBValue):
2446 * Modules/indexeddb/server/IDBBackingStore.h:
2447 (WebCore::IDBServer::IDBBackingStoreTemporaryFileHandler::~IDBBackingStoreTemporaryFileHandler):
2449 * Modules/indexeddb/server/IDBServer.cpp:
2450 (WebCore::IDBServer::IDBServer::create):
2451 (WebCore::IDBServer::IDBServer::IDBServer):
2452 (WebCore::IDBServer::IDBServer::createBackingStore):
2453 * Modules/indexeddb/server/IDBServer.h:
2455 * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
2456 (WebCore::IDBServer::blobRecordsTableSchema):
2457 (WebCore::IDBServer::blobRecordsTableSchemaAlternate):
2458 (WebCore::IDBServer::blobFilesTableSchema):
2459 (WebCore::IDBServer::blobFilesTableSchemaAlternate):
2460 (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore):
2461 (WebCore::IDBServer::SQLiteIDBBackingStore::ensureValidBlobTables):
2462 (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
2463 (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
2464 * Modules/indexeddb/server/SQLiteIDBBackingStore.h:
2465 (WebCore::IDBServer::SQLiteIDBBackingStore::temporaryFileHandler):
2467 * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
2468 (WebCore::IDBServer::SQLiteIDBTransaction::commit):
2469 (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary):
2470 (WebCore::IDBServer::SQLiteIDBTransaction::abort):
2471 (WebCore::IDBServer::SQLiteIDBTransaction::reset):
2472 (WebCore::IDBServer::SQLiteIDBTransaction::addBlobFile):
2473 * Modules/indexeddb/server/SQLiteIDBTransaction.h:
2475 * Modules/indexeddb/shared/InProcessIDBServer.cpp:
2476 (WebCore::InProcessIDBServer::InProcessIDBServer):
2477 (WebCore::InProcessIDBServer::accessToTemporaryFileComplete):
2478 * Modules/indexeddb/shared/InProcessIDBServer.h:
2480 * bindings/js/SerializedScriptValue.cpp:
2481 (WebCore::SerializedScriptValue::blobURLsIsolatedCopy):
2482 * bindings/js/SerializedScriptValue.h:
2484 * platform/FileSystem.h:
2485 * platform/gtk/FileSystemGtk.cpp:
2486 (WebCore::hardLinkOrCopyFile):
2487 * platform/posix/FileSystemPOSIX.cpp:
2488 (WebCore::hardLinkOrCopyFile):
2490 2016-04-08 Joanmarie Diggs <jdiggs@igalia.com>
2492 AX: [ATK] Crash getting text under element in CSS table
2493 https://bugs.webkit.org/show_bug.cgi?id=156328
2495 Reviewed by Chris Fleizach.
2497 AccessibilityRenderObject::textUnderElement() assumes (and asserts) that
2498 the first and last child of an anonymous block will each have nodes with
2499 which to define positions. This is not the case for CSS Tables and their
2500 anonymous descendants. AccessibilityNodeObject:textUnderElement() is our
2501 fallback for the instances where a text range cannot be created based on
2502 positions, so let it handle anonymous RenderTable parts.
2504 Test: accessibility/generated-content-with-display-table-crash.html
2506 * accessibility/AccessibilityRenderObject.cpp:
2507 (WebCore::AccessibilityRenderObject::textUnderElement):
2508 (WebCore::AccessibilityRenderObject::shouldGetTextFromNode):
2509 * accessibility/AccessibilityRenderObject.h:
2511 2016-04-08 Darin Adler <darin@apple.com>
2513 Remove unneeded UsePointersEvenForNonNullableObjectArguments from event classes
2514 https://bugs.webkit.org/show_bug.cgi?id=156396
2516 Reviewed by Youenn Fablet.
2518 * dom/CompositionEvent.idl:
2519 * dom/KeyboardEvent.idl:
2520 * dom/MouseEvent.idl:
2521 * dom/MutationEvent.idl:
2522 * dom/TextEvent.idl:
2523 * dom/TouchEvent.idl:
2525 * dom/WheelEvent.idl:
2526 Removed UsePointersEvenForNonNullableObjectArguments, which was having no effect.
2528 2016-04-08 Manuel Rego Casasnovas <rego@igalia.com>
2530 [css-grid] Fix positioned items with grid gaps
2531 https://bugs.webkit.org/show_bug.cgi?id=156288
2533 Reviewed by Darin Adler.
2535 When we place a positioned items in a grid with gaps,
2536 we were not taking into accounts the gutter size.
2537 We've to use that size to properly place and size the item.
2539 Tests: fast/css-grid-layout/grid-positioned-items-gaps-rtl.html
2540 fast/css-grid-layout/grid-positioned-items-gaps.html
2542 * rendering/RenderGrid.cpp:
2543 (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
2545 2016-04-08 Javier Fernandez <jfernandez@igalia.com>
2547 [css-grid] Remove unnecessary iteration in populateGridPositions loop
2548 https://bugs.webkit.org/show_bug.cgi?id=156376
2550 Reviewed by Darin Adler.
2552 The populateGridPositions loop limit was set to 'lastLine'. However, the
2553 the position of last track's start line is updated after the loop, since
2554 it does not follow the same pattern; it does not have a content
2555 distribution offset.
2557 So, since we are essentially overwriting the value stored in the last
2558 iteration, we can just lower the loop limit.
2560 No new tests added, because there is no change in the functionality.
2562 * rendering/RenderGrid.cpp:
2563 (WebCore::RenderGrid::populateGridPositions):
2565 2016-04-08 John Wilander <wilander@apple.com>
2567 CSP: Block XHR when calling XMLHttpRequest.send() and throw network error.
2568 https://bugs.webkit.org/show_bug.cgi?id=153598
2569 <rdar://problem/24391483>
2571 Reviewed by Darin Adler.
2573 No new tests. Changes to existing tests are sufficient.
2575 * xml/XMLHttpRequest.cpp:
2576 (WebCore::XMLHttpRequest::open):
2577 (WebCore::XMLHttpRequest::initSend):
2578 Moved the CSP check from XMLHttpRequest::open() to XMLHttpRequest::initSend().
2579 Changed the thrown error type from Security to Network for synchronous requests.
2580 Changed from throwing an error to firing an error event for asynchronous requests.
2581 These changes are in conformance with connect-src of Content Security Policy Level 2.
2582 https://www.w3.org/TR/CSP2/#directive-connect-src (W3C Candidate Recommendation, 21 July 2015)
2584 2016-04-07 Darin Adler <darin@apple.com>
2586 FontFaceSet binding does not handle null correctly
2587 https://bugs.webkit.org/show_bug.cgi?id=156141
2589 Reviewed by Youenn Fablet.
2591 * css/FontFaceSet.cpp:
2592 (WebCore::FontFaceSet::FontFaceSet): Pass a reference to add rather than a pointer.
2593 (WebCore::FontFaceSet::has): Take a reference rather than a pointer.
2594 (WebCore::FontFaceSet::add): Ditto.
2595 (WebCore::FontFaceSet::remove): Ditto.
2596 (WebCore::FontFaceSet::load): Initialize ec since we check it. Caller is not required
2597 to do this, nor is the matchingFaces function. Rearranged function to avoid needless
2598 creation/destruction of PendingPromise for the immediate failure case. Removed some
2599 unneeded type casts and local variables.
2600 (WebCore::FontFaceSet::status): Use ASCIILiteral instead of ConstructFromLiteral.
2601 No reason to use the more aggressive optimization.
2602 (WebCore::FontFaceSet::faceFinished): Factored out a common hasReachedTerminalState
2603 check to streamline the logic a bit.
2604 (WebCore::FontFaceSet::load): Moved overload without a string in here; not critical
2606 (WebCore::FontFaceSet::check): Ditto.
2608 * css/FontFaceSet.h: Removed many unneeded includes and forward declarations.
2609 Changed functions to take FontFace& instead of RefPtr<FontFace>. Removed unneeded
2610 WebCore namespace prefixes. Use final instead of override for virtual functions.
2612 * css/FontFaceSet.idl: Removed UsePointersEvenForNonNullableObjectArguments, which
2613 was preserving incorrect behavior for null as demonstrated by the test cases.
2615 2016-04-07 Joseph Pecoraro <pecoraro@apple.com>
2617 Remove ENABLE(ENABLE_ES6_CLASS_SYNTAX) guards
2618 https://bugs.webkit.org/show_bug.cgi?id=156384
2620 Reviewed by Ryosuke Niwa.
2622 * Configurations/FeatureDefines.xcconfig:
2624 2016-04-07 Dean Jackson <dino@apple.com>
2626 [iOS] Media playback button should use appearance
2627 https://bugs.webkit.org/show_bug.cgi?id=156388
2628 <rdar://problem/25618352>
2630 Reviewed by Simon Fraser.
2632 With the recent change in backdrop appearance, we can
2633 now use the system style directly for the play button.
2635 While I was here I also updated the artwork to the
2636 latest style (slightly rounded corners on the triangle).
2638 Covered by the test in ManualTests/ios/start-playback-button-appearance.html.
2640 * Modules/mediacontrols/mediaControlsiOS.css: Move the clip onto the backdrop
2641 element. Use an appearance insted.
2642 * Modules/mediacontrols/mediaControlsiOS.js: Remove the tint element, and
2643 set the highlight on the glyph instead.
2645 2016-04-07 Ada Chan <adachan@apple.com>
2647 Roll out the css change in mediaControlsApple.css that has been causing assertions in layout for multiple tests
2648 https://bugs.webkit.org/show_bug.cgi?id=156381
2650 Rubber-stamped by Alexey Proskuryakov.
2652 * Modules/mediacontrols/mediaControlsApple.css:
2653 (::-webkit-media-controls):
2654 Remove overflow: hidden.
2656 2016-04-07 Jiewen Tan <jiewen_tan@apple.com>
2658 Unreviewed, rolling out r199199.
2660 Revision breaks layout tests
2664 "fast/loader/opaque-base-url.html crashing during mac and ios
2666 https://bugs.webkit.org/show_bug.cgi?id=156179
2667 http://trac.webkit.org/changeset/199199
2669 2016-04-07 Simon Fraser <simon.fraser@apple.com>
2671 Make it possible to test effect of view exposed rect on tiled backing
2672 https://bugs.webkit.org/show_bug.cgi?id=156365
2674 Reviewed by Tim Horton.
2676 Implement Internals::setViewExposedRect().
2678 When the viewExposedRect is non-null, assume that we're scrollable on both axes
2679 to avoid creation of huge tiles in this scenario.
2681 We also need to call adjustTiledBackingScrollability() when setViewExposedRect()
2684 Tests: tiled-drawing/tile-coverage-view-exposed-rect.html
2685 tiled-drawing/tile-size-view-exposed-rect.html
2687 * page/FrameView.cpp:
2688 (WebCore::FrameView::adjustTiledBackingScrollability):
2689 (WebCore::FrameView::setViewExposedRect):
2690 * testing/Internals.cpp:
2691 (WebCore::Internals::setViewExposedRect):
2692 * testing/Internals.h:
2693 * testing/Internals.idl:
2695 2016-04-07 Jiewen Tan <jiewen_tan@apple.com>
2697 fast/loader/opaque-base-url.html crashing during mac and ios debug tests
2698 https://bugs.webkit.org/show_bug.cgi?id=156179
2699 <rdar://problem/25507719>
2701 Reviewed by Andy Estes.
2703 A relative URL other than "#" with a non-hierarchical base is invalid, but prior to this
2704 change the URL's string would still contain the invalid relative URL. To avoid mistakes
2705 where we might later treat this URL string as a parsed URL string, set the string to
2706 "about:blank" instead.
2708 Test: fast/url/data-uri-based-urls.html
2711 (WebCore::URL::init):
2713 2016-04-07 Brian Burg <bburg@apple.com>
2715 Web Automation: implement Automation.addSingleCookie
2716 https://bugs.webkit.org/show_bug.cgi?id=156319
2717 <rdar://problem/25589605>
2719 Reviewed by Timothy Hatcher.
2721 * platform/Cookie.h: Document the units used by the 'expires' field.
2723 2016-04-07 Jon Davis <jond@apple.com>
2725 Add ImageBitmap as under consideration on Feature Status page
2726 https://bugs.webkit.org/show_bug.cgi?id=156362
2728 Reviewed by Timothy Hatcher.
2732 2016-04-07 Jon Davis <jond@apple.com>
2734 Include Conical Gradients on the Feature Status page.
2735 https://bugs.webkit.org/show_bug.cgi?id=156363
2737 Reviewed by Timothy Hatcher.
2741 2016-04-07 Beth Dakin <bdakin@apple.com>
2745 * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2747 2016-04-07 Jeremy Jones <jeremyj@apple.com>
2749 In WK1 WebVideoFullscreen interface may be accessed from WK1 main thread instead of UI thread.
2750 https://bugs.webkit.org/show_bug.cgi?id=154252
2751 rdar://problem/22460539
2753 Reviewed by Eric Carlson.
2755 In WebKit1, Javascript can cause enter fullscreen to happen on the main thead, which is not
2756 necessarily the UI thread. This can cause autolayout errors. Move this code to the UI thread.
2758 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
2759 (WebVideoFullscreenControllerContext::setUpFullscreen): Move setup to the UI thread.
2760 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2761 (-[WebAVPlayerLayer layoutSublayers]): Move call to resolveBounds to the UI thread.
2763 2016-04-07 Beth Dakin <bdakin@apple.com>
2767 * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2769 2016-04-07 Chris Dumez <cdumez@apple.com>
2771 [WebIDL] Add support for [EnabledAtRuntime] attributes on non-global objects
2772 https://bugs.webkit.org/show_bug.cgi?id=156346
2774 Reviewed by Ryosuke Niwa.
2776 Add support for [EnabledAtRuntime] attributes on non-global objects by
2777 using the same approach as for [EnabledAtRuntime] operations. This means
2778 we add these attributes to the static property table but they get removed
2779 at runtime in JS*Prototype::finishCreation(), if the feature is disabled,
2780 after the eager reification of the prototype.
2782 * bindings/scripts/CodeGeneratorJS.pm:
2783 (GeneratePropertiesHashTable):
2784 (GenerateImplementation):
2785 * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
2786 (webkit_dom_test_obj_set_property):
2787 (webkit_dom_test_obj_get_property):
2788 (webkit_dom_test_obj_class_init):
2789 (webkit_dom_test_obj_enabled_at_runtime_operation):
2790 (webkit_dom_test_obj_get_enabled_at_runtime_attribute):
2791 (webkit_dom_test_obj_set_enabled_at_runtime_attribute):
2792 * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
2793 * bindings/scripts/test/JS/JSTestObj.cpp:
2794 (WebCore::JSTestObjPrototype::finishCreation):
2795 (WebCore::jsTestObjEnabledAtRuntimeAttribute):
2796 (WebCore::setJSTestObjEnabledAtRuntimeAttribute):
2797 (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation1):
2798 (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation2):
2799 (WebCore::jsTestObjPrototypeFunctionEnabledAtRuntimeOperation):
2800 * bindings/scripts/test/ObjC/DOMTestObj.h:
2801 * bindings/scripts/test/ObjC/DOMTestObj.mm:
2802 (-[DOMTestObj enabledAtRuntimeAttribute]):
2803 (-[DOMTestObj setEnabledAtRuntimeAttribute:]):
2804 (-[DOMTestObj enabledAtRuntimeOperation:]):
2805 * bindings/scripts/test/TestObj.idl:
2807 2016-04-07 Beth Dakin <bdakin@apple.com>
2809 Attempted build fix.
2811 * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2812 (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
2813 (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
2814 (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
2815 (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]): Deleted.
2816 (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]): Deleted.
2818 2016-04-07 Ada Chan <adachan@apple.com>
2820 Add WebKitAdditions extension point in HTMLVideoElement::supportsFullscreen()
2821 https://bugs.webkit.org/show_bug.cgi?id=156366
2823 Reviewed by Alex Christensen.
2825 * html/HTMLVideoElement.cpp:
2826 (WebCore::HTMLVideoElement::supportsFullscreen):
2828 2016-04-07 Jon Davis <jond@apple.com>
2830 Add WOFF2 to the Feature Status page
2831 https://bugs.webkit.org/show_bug.cgi?id=156361
2833 Reviewed by Timothy Hatcher.
2837 2016-04-07 Beth Dakin <bdakin@apple.com>
2839 WebPlaybackControlsManager should support mediaSelectionOptions
2840 https://bugs.webkit.org/show_bug.cgi?id=156358
2842 rdar://problem/25048743
2844 Reviewed by Jer Noble.
2846 This patch just implements
2847 WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions and
2848 WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions and passes that
2849 information on to WebPlaybackControlsManager. If selection options are set via
2850 the WebPlaybackControlsManager, then it gets the webVideoFullscreenModel() to
2853 * platform/mac/WebVideoFullscreenInterfaceMac.h:
2854 * platform/mac/WebVideoFullscreenInterfaceMac.mm:
2855 (-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
2856 (-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
2857 (-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
2858 (-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
2859 (WebCore::mediaSelectionOptions):
2860 (WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
2861 (WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
2862 (-[WebPlaybackControlsManager audioMediaSelectionOptions]): Deleted.
2863 (-[WebPlaybackControlsManager legibleMediaSelectionOptions]): Deleted.
2865 2016-04-07 Brent Fulgham <bfulgham@apple.com>
2867 Wheel event callback removing the window causes crash in WebCore.
2868 https://bugs.webkit.org/show_bug.cgi?id=150871
2869 <rdar://problem/23418283>
2871 Reviewed by Simon Fraser.
2873 Null check the FrameView before using it, since the iframe may have been removed
2874 from its parent document inside the event handler.
2876 The new test triggered a cross-load side-effect, where wheel event filtering wasn't
2877 reset between page loads. Fix by calling clearLatchedState() in EventHandler::clear(),
2878 which resets the filtering.
2880 Since the Frame destructor invokes EventHandler::clear, which invokes MainFrame methods,
2881 we run the risk of attempting to dereference destroyed MainFrame elements of the current
2882 Frame object. Instead, clear the EventHandler in the MainFrame destructor.
2884 Finally, confirm that the mainFrame member is not being destroyed in the handful of
2885 places that might attempt to access the mainFrame during object destruction (essentially
2888 Test: fast/events/wheel-event-destroys-frame.html
2890 * loader/FrameLoader.cpp:
2891 (WebCore::FrameLoader::clear): Protect against accessing mainFrame content during destruction.
2892 * page/EventHandler.cpp:
2893 (WebCore::EventHandler::clear): Call 'clearLatchedState' instead of endFilteringDeltas.
2894 (WebCore::EventHandler::clearLatchedState): Null-check the filter before calling it.
2896 (WebCore::Frame::~Frame): Do not call 'setView' in the destructor for a MainFrame.
2897 (WebCore::Frame::setView): Check for a null event handler before invoking it.
2898 (WebCore::Frame::setMainFrameWasDestroyed): Added. Mark that the MainFrame
2899 member of the Frame is being destroyed (if the current Frame is a MainFrame) and clear
2900 the EventHandler member so that it doesn't attempt to access mainFrame content.
2901 (WebCore::Frame::mainFrame): When accessing the mainFrame member, assert that the
2902 mainFrame is not being destroyed.
2903 * page/MainFrame.cpp:
2904 (WebCore::MainFrame::~MainFrame): Set the m_recentWheelEventDeltaFilter to nullptr to
2905 prevent attempts to access it during object destruction. Call the new 'setMainFrameWasDestroyed'
2906 method to reset eventHandler and mark the MainFrame as being in the process of destruction.
2907 * page/WheelEventDeltaFilter.cpp:
2908 (WebCore::WheelEventDeltaFilter::filteredDelta): Add logging.
2909 * page/mac/EventHandlerMac.mm:
2910 (WebCore::EventHandler::platformCompleteWheelEvent): Add null check.
2911 * rendering/RenderLayer.cpp:
2912 (WebCore::RenderLayer::scrollTo): Add logging.
2914 2016-04-05 Ada Chan <adachan@apple.com>
2916 Rename TextTrackRepresentationiOS to TextTrackRepresentationCocoa and enable on Mac
2917 https://bugs.webkit.org/show_bug.cgi?id=156245
2919 Reviewed by Eric Carlson.
2921 * Modules/mediacontrols/mediaControlsApple.css:
2922 (::-webkit-media-controls):
2923 Match iOS and specify overflow: hidden on the -webkit-media-controls container.
2924 (video::-webkit-media-text-track-container):
2925 Match iOS and specify z-index: 0 on the text track container.
2927 * WebCore.xcodeproj/project.pbxproj:
2928 TextTrackRepresentationiOS.h/mm have been renamed to TextTrackRepresentationCocoa.h/mm.
2930 * platform/graphics/TextTrackRepresentation.cpp:
2931 * platform/graphics/cocoa/TextTrackRepresentationCocoa.h: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.h.
2932 * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: Renamed from Source/WebCore/platform/graphics/ios/TextTrackRepresentationIOS.mm.
2933 (-[WebCoreTextTrackRepresentationCocoaHelper initWithParent:]):
2934 (-[WebCoreTextTrackRepresentationCocoaHelper dealloc]):
2935 (-[WebCoreTextTrackRepresentationCocoaHelper setParent:]):
2936 (-[WebCoreTextTrackRepresentationCocoaHelper parent]):
2937 (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]):
2938 (-[WebCoreTextTrackRepresentationCocoaHelper actionForLayer:forKey:]):
2939 (TextTrackRepresentation::create):
2940 (TextTrackRepresentationCocoa::TextTrackRepresentationCocoa):
2941 (TextTrackRepresentationCocoa::~TextTrackRepresentationCocoa):
2942 (TextTrackRepresentationCocoa::update):
2943 (TextTrackRepresentationCocoa::setContentScale):
2944 (TextTrackRepresentationCocoa::bounds):
2946 2016-04-07 Brian Burg <bburg@apple.com>
2948 CookieJar should support adding synthetic cookies for developer tools
2949 https://bugs.webkit.org/show_bug.cgi?id=156091
2950 <rdar://problem/25581340>
2952 Reviewed by Timothy Hatcher.
2954 This patch adds an API that can set an arbitrary cookie in cookie storage
2955 in order to support developer tools and automated testing. It delegates storing
2956 the cookie to a platform implementation.
2958 No new tests because the code isn't used by any clients yet.
2960 * loader/CookieJar.cpp:
2961 (WebCore::addCookie): Added.
2962 * loader/CookieJar.h:
2964 * platform/Cookie.h:
2965 Remove an outdated comment. This struct is used in many places.
2967 * platform/CookiesStrategy.h: Add new method.
2968 * platform/network/PlatformCookieJar.h: Add new method.
2969 * platform/network/cf/CookieJarCFNet.cpp:
2970 (WebCore::addCookie): Add a stub.
2971 * platform/network/curl/CookieJarCurl.cpp:
2972 (WebCore::addCookie): Add a stub.
2973 * platform/network/mac/CookieJarMac.mm:
2974 (WebCore::addCookie): Add an implementation that turns the WebCore::Cookie into
2975 an NSHTTPCookie and converts it again to CFHTTPCookie if necessary.
2977 * platform/network/soup/CookieJarSoup.cpp:
2978 (WebCore::addCookie): Add a stub.
2980 * platform/spi/cf/CFNetworkSPI.h:
2981 Add -[NSHTTPCookie _CFHTTPCookie] SPI.
2983 2016-04-07 Commit Queue <commit-queue@webkit.org>
2985 Unreviewed, rolling out r199128 and r199141.
2986 https://bugs.webkit.org/show_bug.cgi?id=156348
2988 Causes crashes on multiple webpages (Requested by keith_mi_ on
2991 Reverted changesets:
2993 "[ES6] Add support for Symbol.isConcatSpreadable."
2994 https://bugs.webkit.org/show_bug.cgi?id=155351
2995 http://trac.webkit.org/changeset/199128
2997 "Unreviewed, uncomment accidentally commented line in test."
2998 http://trac.webkit.org/changeset/199141
3000 2016-04-07 Daniel Bates <dabates@apple.com>
3002 CSP: Should only honor CSP policy delivered in meta tag that is a descendent of <head>
3003 https://bugs.webkit.org/show_bug.cgi?id=59858
3004 <rdar://problem/25603538>
3006 Reviewed by Brent Fulgham.
3008 Ignore the Content Security Policy meta tag if it is not a descendent of <head> as per
3009 section HTML meta Element of the Content Security Policy Level 2 spec., <https://w3c.github.io/webappsec-csp/2/>
3010 (Editor's Draft, 29 August 2015).
3012 Tests: http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head.html
3013 http/tests/security/contentSecurityPolicy/meta-tag-ignored-if-not-in-head2.html
3014 http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head.html
3015 http/tests/security/contentSecurityPolicy/report-only-meta-tag-ignored-if-not-in-head2.html
3018 (WebCore::Document::processHttpEquiv): Modified to take a boolean argument whether the http-equiv
3019 meta tag is a descendent of <head> and to parse the value of a Content Security Policy http-equiv
3020 only if the http-equiv meta tag is a descendent of <head>.
3021 * dom/Document.h: Add parameter isInDocument to processHttpEquiv(). Remove javadoc-style parameters
3022 from processHttpEquiv() comment as we do not document parameters for non-API functions using such style.
3023 Also write the comment for processHttpEquiv() using C++ style comments instead of a C-style comment.
3024 * html/HTMLMetaElement.cpp:
3025 (WebCore::HTMLMetaElement::process): Pass whether this element is a descendent of <head>. Additionally
3026 update stale comment and move it closer to the code it refers to.
3028 2016-04-07 Brent Fulgham <bfulgham@apple.com>
3030 [Win] Output WebCore.pdb to the same location as WebCore.lib
3031 https://bugs.webkit.org/show_bug.cgi?id=156256
3032 <rdar://problem/19416363>
3034 Reviewed by Alex Christensen.
3036 Add a rule to WebCore's CMake generator to tell Visual Studio to output
3037 the PDB file for the WebCore.lib in the same location as the resulting
3038 library, rather than in the build intermediary location).
3042 2016-04-06 Sam Weinig <sam@webkit.org>
3044 window.Crypto is missing
3045 <rdar://problem/25584034>
3046 https://bugs.webkit.org/show_bug.cgi?id=156307
3048 Reviewed by Joseph Pecoraro.
3050 Expose the Crypto constructor on the window object.
3054 2016-04-07 Fujii Hironori <Hironori.Fujii@jp.sony.com>
3056 [CMake][Win] WEBKIT_WRAP_SOURCELIST is not applied in WebCore project
3057 https://bugs.webkit.org/show_bug.cgi?id=156336
3059 Reviewed by Csaba Osztrogonác.
3061 * CMakeLists.txt: Do WEBKIT_WRAP_SOURCELIST for WebCore_SOURCES.
3063 2016-04-07 Zalan Bujtas <zalan@apple.com>
3065 REGRESSION (197987): Ingredient lists on smittenkitchen.com are full justified instead of left justified.
3066 https://bugs.webkit.org/show_bug.cgi?id=156326
3067 <rdar://problem/25519393>
3069 Reviewed by Antti Koivisto.
3071 According to the spec (https://drafts.csswg.org/css-text-3/#text-align-property)
3072 unless otherwise specified by text-align-last, the last line before
3073 a forced break or the end of the block is start-aligned.
3075 In this patch we check if a forced break is present and we apply text alignment accordingly.
3077 Test: fast/css3-text/css3-text-justify/text-justify-last-line-simple-line-layout.html
3079 * rendering/SimpleLineLayout.cpp:
3080 (WebCore::SimpleLineLayout::LineState::lastFragment): Make it optional so that we don't just check against a default fragment.
3081 (WebCore::SimpleLineLayout::createLineRuns):
3082 (WebCore::SimpleLineLayout::justifyRuns): Do not compute first run index on the current line twice.
3083 (WebCore::SimpleLineLayout::textAlignForLine):
3084 (WebCore::SimpleLineLayout::closeLineEndingAndAdjustRuns):
3086 2016-04-07 Antti Koivisto <antti@apple.com>
3088 FrameView::qualifiesAsVisuallyNonEmpty() returns false when loading a Google search results page before search results are loaded, even though the header is visible
3089 https://bugs.webkit.org/show_bug.cgi?id=156339
3090 <rdar://problem/24491381>
3092 Reviewed by Andreas Kling.
3094 Patch by Jeff Miller.
3096 Jeff's testing indicates lowering the document height threshold improves things visually during page loading.
3098 * page/FrameView.cpp:
3099 (WebCore::FrameView::qualifiesAsVisuallyNonEmpty):
3101 Lower document height threshold to from 200 to 48 pixels.
3103 2016-04-07 Antti Koivisto <antti@apple.com>
3105 Shadow DOM: Implement display: contents for slots
3106 https://bugs.webkit.org/show_bug.cgi?id=149439
3107 <rdar://problem/22731922>
3109 Reviewed by Ryosuke Niwa.
3111 This patch adds support for value 'contents' of the 'display' property for <slot> elements only. The value is ignored
3112 for other elements for now. With this display value the element does not generate a box for itself but its descendants
3113 generate them normally.
3115 Slots already have implicit "display: contents". With this patch the value comes from the user agent stylesheet and can
3116 be overriden by the author.
3118 * css/CSSParser.cpp:
3119 (WebCore::isValidKeywordPropertyAndValue):
3120 * css/CSSPrimitiveValueMappings.h:
3121 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3122 * css/CSSValueKeywords.in:
3124 Suport parsing display: contents.
3126 * css/StyleResolver.cpp:
3127 (WebCore::equivalentBlockDisplay):
3128 (WebCore::StyleResolver::adjustRenderStyle):
3130 Disallow for non-slots for now.
3135 Add "slot { display: contents }" to the UA sheet.
3138 (WebCore::Element::resolveStyle):
3139 (WebCore::Element::hasDisplayContents):
3140 (WebCore::Element::setHasDisplayContents):
3142 Add a rare data bit for elements with display:contents (as we don't save the RenderStyle for them).
3144 (WebCore::Element::rendererIsNeeded):
3146 Don't need renderer for display:contents.
3148 (WebCore::Element::createElementRenderer):
3150 (WebCore::Element::isVisibleInViewportChanged):
3151 * dom/ElementAndTextDescendantIterator.h:
3152 (WebCore::ElementAndTextDescendantIterator::operator!):
3153 (WebCore::ElementAndTextDescendantIterator::operator bool):
3154 (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator):
3155 (WebCore::ElementAndTextDescendantIterator::operator==):
3156 (WebCore::ElementAndTextDescendantIterator::operator!=):
3158 Support initializing ElementAndTextDescendantIterator with root==current so that m_current is not nulled.
3159 This is needed for ComposedTreeIterator to be initialized correctly when root is a slot and the current node
3160 is a slotted node. The case happens in RenderTreePosition::previousSiblingRenderer when slot display is overriden
3161 to something else than 'contents'.
3163 * dom/ElementRareData.h:
3164 (WebCore::ElementRareData::hasDisplayContents):
3165 (WebCore::ElementRareData::setHasDisplayContents):
3166 (WebCore::ElementRareData::ElementRareData):
3167 * rendering/RenderElement.cpp:
3168 (WebCore::RenderElement::createFor):
3169 * rendering/style/RenderStyleConstants.h:
3170 * style/RenderTreePosition.cpp:
3171 (WebCore::RenderTreePosition::nextSiblingRenderer):
3173 Test for dynamic display:contents.
3175 * style/RenderTreeUpdater.cpp:
3176 (WebCore::findRenderingRoot):
3177 (WebCore::RenderTreeUpdater::updateRenderTree):
3178 (WebCore::RenderTreeUpdater::updateElementRenderer):
3180 Test for dynamic display:contents.
3182 * style/StyleTreeResolver.cpp:
3183 (WebCore::Style::affectsRenderedSubtree):
3185 No need for special case.
3187 (WebCore::Style::TreeResolver::resolveComposedTree):
3189 Test for dynamic display:contents.
3191 2016-04-07 Sergio Villar Senin <svillar@igalia.com>
3193 [css-grid] Content box incorrectly used as non-auto min-height
3194 https://bugs.webkit.org/show_bug.cgi?id=155946
3196 Reviewed by Antti Koivisto.
3198 When computing the minimum height value of grid items with
3199 non-auto min-height we used to return the size of the content
3200 box meaning that borders and paddings were incorrectly
3203 Note that we're also ignoring margins, but as that is a
3204 problem also for widths it'll be fixed in a follow up patch.
3206 Test: fast/css-grid-layout/min-height-border-box.html
3208 * rendering/RenderGrid.cpp:
3209 (WebCore::RenderGrid::minSizeForChild):
3211 2016-04-07 Antti Koivisto <antti@apple.com>
3213 Reverting previous due to bad LayoutTest ChangeLog.
3215 2016-04-06 Antti Koivisto <antti@apple.com>
3217 Shadow DOM: Implement display: contents for slots
3218 https://bugs.webkit.org/show_bug.cgi?id=149439
3219 <rdar://problem/22731922>
3221 Reviewed by Ryosuke Niwa.
3223 This patch adds support for value 'contents' of the 'display' property for <slot> elements only. The value is ignored
3224 for other elements for now. With this display value the element does not generate a box for itself but its descendants
3225 generate them normally.
3227 Slots already have implicit "display: contents". With this patch the value comes from the user agent stylesheet and can
3228 be overriden by the author.
3230 * css/CSSParser.cpp:
3231 (WebCore::isValidKeywordPropertyAndValue):
3232 * css/CSSPrimitiveValueMappings.h:
3233 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
3234 * css/CSSValueKeywords.in:
3236 Suport parsing display: contents.
3238 * css/StyleResolver.cpp:
3239 (WebCore::equivalentBlockDisplay):
3240 (WebCore::StyleResolver::adjustRenderStyle):
3242 Disallow for non-slots for now.
3247 Add "slot { display: contents }" to the UA sheet.
3250 (WebCore::Element::resolveStyle):
3251 (WebCore::Element::hasDisplayContents):
3252 (WebCore::Element::setHasDisplayContents):
3254 Add a rare data bit for elements with display:contents (as we don't save the RenderStyle for them).
3256 (WebCore::Element::rendererIsNeeded):
3258 Don't need renderer for display:contents.
3260 (WebCore::Element::createElementRenderer):
3262 (WebCore::Element::isVisibleInViewportChanged):
3263 * dom/ElementAndTextDescendantIterator.h:
3264 (WebCore::ElementAndTextDescendantIterator::operator!):
3265 (WebCore::ElementAndTextDescendantIterator::operator bool):
3266 (WebCore::ElementAndTextDescendantIterator::ElementAndTextDescendantIterator):
3267 (WebCore::ElementAndTextDescendantIterator::operator==):
3268 (WebCore::ElementAndTextDescendantIterator::operator!=):
3270 Support initializing ElementAndTextDescendantIterator with root==current so that m_current is not nulled.
3271 This is needed for ComposedTreeIterator to be initialized correctly when root is a slot and the current node
3272 is a slotted node. The case happens in RenderTreePosition::previousSiblingRenderer when slot display is overriden
3273 to something else than 'contents'.
3275 * dom/ElementRareData.h:
3276 (WebCore::ElementRareData::hasDisplayContents):
3277 (WebCore::ElementRareData::setHasDisplayContents):
3278 (WebCore::ElementRareData::ElementRareData):
3279 * rendering/RenderElement.cpp:
3280 (WebCore::RenderElement::createFor):
3281 * rendering/style/RenderStyleConstants.h:
3282 * style/RenderTreePosition.cpp:
3283 (WebCore::RenderTreePosition::nextSiblingRenderer):
3285 Test for dynamic display:contents.
3287 * style/RenderTreeUpdater.cpp:
3288 (WebCore::findRenderingRoot):
3289 (WebCore::RenderTreeUpdater::updateRenderTree):
3290 (WebCore::RenderTreeUpdater::updateElementRenderer):
3292 Test for dynamic display:contents.
3294 * style/StyleTreeResolver.cpp:
3295 (WebCore::Style::affectsRenderedSubtree):
3297 No need for special case.
3299 (WebCore::Style::TreeResolver::resolveComposedTree):
3301 Test for dynamic display:contents.
3303 2016-04-06 Myles C. Maxfield <mmaxfield@apple.com>
3305 REGRESSION (r188591): thingiverse.com direct messaging UI is not rendered properly
3306 https://bugs.webkit.org/show_bug.cgi?id=156241
3307 <rdar://problem/25262213>
3309 Reviewed by Simon Fraser.
3311 When creating a CoreText font with a size of 0, the CoreText docs say that it will
3312 interpret this as a missing argument, and create a font of size 12 instead. However,
3313 this doesn't cause a problem (at least on this particular website) because we will
3314 use CGFontGetGlyphAdvancesForStyle(), which gets scaled by the supplied font
3315 size (which is 0). However, if you turn on text-rendering: optimizeLegibility, we
3316 will use CTFontGetAdvancesForGlyphs() instead, which does not scale by the font size.
3317 The solution is to detect this case, and force the advance to 0.
3319 Test: fast/text/zero-sized-fonts.html
3321 * platform/graphics/cocoa/FontCocoa.mm:
3322 (WebCore::Font::platformWidthForGlyph):
3324 2016-04-06 Myles C. Maxfield <mmaxfield@apple.com>
3326 Rename MidpointState to WhitespaceCollapsingState
3327 https://bugs.webkit.org/show_bug.cgi?id=156304
3329 Reviewed by David Hyatt.
3331 MidpointState has nothing to do with midpoints.
3333 An individual midpoint is now known as a "whitespace collapsing transition."
3335 No new tests because there is no behavior change.
3337 * platform/text/BidiResolver.h:
3338 (WebCore::WhitespaceCollapsingState::reset): (See addMidpoint() below.)
3339 Previously, we were using operator= to destroy old Iterators when their
3340 storage inside the Vector was reused. Now that we are elliminating
3341 m_numMidpoints, we can push destruction earlier to this reset() function.
3342 Because the same amount of destruction happens in both cases, this doesn't
3343 add additional work. (Vector can destroy its contents without shrinking
3344 its storage overcommitment.)
3345 (WebCore::WhitespaceCollapsingState::startIgnoringSpaces):
3346 (WebCore::WhitespaceCollapsingState::stopIgnoringSpaces):
3347 (WebCore::WhitespaceCollapsingState::ensureLineBoxInsideIgnoredSpaces):
3348 (WebCore::WhitespaceCollapsingState::decrementTransitionAt):
3349 (WebCore::WhitespaceCollapsingState::thresholds): Make the return value
3350 const. The only clients of this function which needed mutation were
3351 migrated to using decrementTransitionAt().
3352 (WebCore::WhitespaceCollapsingState::numTransitions):
3353 (WebCore::WhitespaceCollapsingState::currentTransition):
3354 (WebCore::WhitespaceCollapsingState::setCurrentTransition):
3355 (WebCore::WhitespaceCollapsingState::incrementCurrentTransition):
3356 (WebCore::WhitespaceCollapsingState::decrementNumTransitions):
3357 (WebCore::WhitespaceCollapsingState::betweenTransitions):
3358 (WebCore::BidiResolverBase::whitespaceCollapsingState):
3359 (WebCore::Subclass>::setWhitespaceCollapsingTransitionForIsolatedRun):
3360 (WebCore::Subclass>::whitespaceCollapsingTransitionForIsolatedRun):
3361 (WebCore::MidpointState::MidpointState): Deleted.
3362 (WebCore::MidpointState::reset): Deleted.
3363 (WebCore::MidpointState::startIgnoringSpaces): Deleted.
3364 (WebCore::MidpointState::stopIgnoringSpaces): Deleted.
3365 (WebCore::MidpointState::ensureLineBoxInsideIgnoredSpaces): Deleted.
3366 (WebCore::MidpointState::midpoints): Deleted.
3367 (WebCore::MidpointState::numMidpoints): Deleted.
3368 (WebCore::MidpointState::currentMidpoint): Deleted.
3369 (WebCore::MidpointState::setCurrentMidpoint): Deleted.
3370 (WebCore::MidpointState::incrementCurrentMidpoint): Deleted.
3371 (WebCore::MidpointState::decrementNumMidpoints): Deleted.
3372 (WebCore::MidpointState::betweenMidpoints): Deleted.
3373 (WebCore::MidpointState::addMidpoint): Deleted. This code has been around for 13
3374 years (since r3672) where it was using QMemArray. That class doesn't have an
3375 append() class, so it was implemented inside this function. Luckily, Vector
3376 already overcommits its allocation, so we can elliminate m_numMidpoints entirely.
3377 (WebCore::BidiResolverBase::midpointState): Deleted.
3378 (WebCore::Subclass>::setMidpointForIsolatedRun): Deleted.
3379 (WebCore::Subclass>::midpointForIsolatedRun): Deleted.
3380 * rendering/InlineIterator.h:
3381 (WebCore::addPlaceholderRunForIsolatedInline):
3382 * rendering/RenderBlockLineLayout.cpp:
3383 (WebCore::RenderBlockFlow::appendRunsForObject):
3384 (WebCore::setUpResolverToResumeInIsolate):
3385 (WebCore::constructBidiRunsForSegment):
3386 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
3387 * rendering/line/BreakingContext.h:
3388 (WebCore::BreakingContext::BreakingContext):
3389 (WebCore::BreakingContext::handleBR):
3390 (WebCore::BreakingContext::handleOutOfFlowPositioned):
3391 (WebCore::shouldSkipWhitespaceAfterStartObject):
3392 (WebCore::BreakingContext::handleEmptyInline):
3393 (WebCore::BreakingContext::handleReplaced):
3394 (WebCore::ensureCharacterGetsLineBox):
3395 (WebCore::BreakingContext::handleText):
3396 (WebCore::checkWhitespaceCollapsingTransitions):
3397 (WebCore::BreakingContext::handleEndOfLine):
3398 (WebCore::checkMidpoints): Deleted.
3399 * rendering/line/TrailingObjects.cpp:
3400 (WebCore::TrailingObjects::updateWhitespaceCollapsingTransitionsForTrailingBoxes):
3401 (WebCore::TrailingObjects::updateMidpointsForTrailingBoxes): Deleted.
3402 * rendering/line/TrailingObjects.h:
3403 (WebCore::TrailingObjects::appendBoxIfNeeded):
3405 2016-04-06 Gyuyoung Kim <gyuyoung.kim@webkit.org>
3407 Remove duplicated parsePortFromStringPosition()
3408 https://bugs.webkit.org/show_bug.cgi?id=156289
3410 Reviewed by Simon Fraser.
3412 Same parsePortFromStringPosition() functions have been defined in both URLUtils.h and HTMLAnchorElement.cpp.