1 2015-06-04 Brent Fulgham <bfulgham@apple.com>
3 Latching algorithm in findEnclosingOverflowScroll is broken
4 https://bugs.webkit.org/show_bug.cgi?id=145642
5 <rdar://problem/21242308>
7 Reviewed by Simon Fraser.
9 Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
11 * page/mac/EventHandlerMac.mm:
12 (WebCore::scrollableAreaForBox): Added helper function.
13 (WebCore::findEnclosingScrollableContainer): Renamed from findEnclosingOverflowScroll.
14 Only identify something as our scroll element if it can be scrolled in either
15 axis of the gesture's motion.
16 (WebCore::scrollableAreaForContainerNode): Use new helper function.
17 (WebCore::EventHandler::platformPrepareForWheelEvents): Use new function
18 name, and pass horizontal and vertical deltas.
19 (WebCore::findEnclosingOverflowScroll): Deleted.
21 2015-06-04 Gyuyoung Kim <gyuyoung.kim@webkit.org>
23 REGRESSION(r185091): Crash happens on indexdb tests
24 https://bugs.webkit.org/show_bug.cgi?id=145549
26 Reviewed by Darin Adler.
28 * Modules/indexeddb/IDBDatabaseError.h:
29 (WebCore::IDBDatabaseError::create): Revert Ref usage of IDBDatabaseError::create().
31 2015-06-04 Simon Fraser <simon.fraser@apple.com>
33 Crash in EventDispatcher::dispatchEvent entering a location on Google Maps
34 https://bugs.webkit.org/show_bug.cgi?id=145677
35 rdar://problem/20698280
37 Reviewed by Dean Jackson.
39 If a transition is running on a pseudo-element, and the host element is removed
40 from the DOM just as the transition ends, and there is a transition event listener,
41 then we'd crash with a null dereference in event dispatch code.
43 AnimationController tries to clean up running animations when renderers are destroyed,
44 but omitted to remove the element from two vectors that store element references.
45 Elements are only added to these vectors briefly on animation end, before firing
46 events, but failure to remove the vector entries could result in attempting
47 to fire an event on a pseudo-element with no host element.
49 Also convert EventDispatcher code to be more robust to potentially null event
50 targets, since it's not clear that eventTargetRespectingTargetRules() can always
51 manage to return a non-null node.
53 Hard to make a test because this is timing sensitive.
55 * dom/EventDispatcher.cpp:
56 (WebCore::eventTargetRespectingTargetRules):
57 (WebCore::EventDispatcher::dispatchScopedEvent):
58 (WebCore::EventDispatcher::dispatchEvent):
59 (WebCore::EventPath::EventPath):
60 * page/animation/AnimationController.cpp:
61 (WebCore::AnimationControllerPrivate::clear):
63 2015-06-04 Hunseop Jeong <hs85.jeong@samsung.com>
65 Replace 0 with nullptr in WebCore/Page.
66 https://bugs.webkit.org/show_bug.cgi?id=145631
68 Reviewed by Darin Adler.
70 No new tests, no behavior changes.
72 * page/AutoscrollController.cpp:
73 (WebCore::AutoscrollController::AutoscrollController):
74 (WebCore::AutoscrollController::stopAutoscrollTimer):
75 * page/ContentSecurityPolicy.cpp:
76 (WebCore::CSPSourceList::parseSource):
77 * page/ContentSecurityPolicy.h:
78 * page/ContextMenuController.cpp:
79 (WebCore::ContextMenuController::clearContextMenu):
80 * page/DOMSelection.cpp:
81 (WebCore::DOMSelection::clearTreeScope):
83 (WebCore::DOMWindow::resetDOMWindowProperties):
84 (WebCore::DOMWindow::localStorage):
85 (WebCore::DOMWindow::focus):
87 * page/DOMWindowExtension.cpp:
88 (WebCore::DOMWindowExtension::reconnectFrameFromPageCache):
89 (WebCore::DOMWindowExtension::willDestroyGlobalObjectInCachedFrame):
90 * page/DOMWindowProperty.cpp:
91 (WebCore::DOMWindowProperty::DOMWindowProperty):
92 (WebCore::DOMWindowProperty::~DOMWindowProperty):
93 (WebCore::DOMWindowProperty::disconnectFrameForPageCache):
94 (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame):
95 (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame):
96 * page/DragController.cpp:
97 (WebCore::DragController::dragEnded):
98 (WebCore::DragController::performDragOperation):
99 (WebCore::DragController::tryDocumentDrag):
100 (WebCore::DragController::concludeEditDrag):
101 (WebCore::DragController::startDrag):
102 * page/EventHandler.cpp:
103 (WebCore::EventHandler::EventHandler):
104 (WebCore::EventHandler::resizeLayerDestroyed):
105 (WebCore::EventHandler::freeDataTransfer):
106 (WebCore::EventHandler::dragSourceEndedAt):
107 (WebCore::EventHandler::handleDrag):
108 * page/EventHandler.h:
109 * page/FocusController.cpp:
110 (WebCore::FocusController::advanceFocusInDocumentOrder):
112 (WebCore::Frame::~Frame):
113 (WebCore::Frame::searchForLabelsBeforeElement):
114 (WebCore::Frame::willDetachPage):
115 (WebCore::Frame::createView):
117 (WebCore::Frame::detachFromPage):
118 * page/FrameDestructionObserver.cpp:
119 (WebCore::FrameDestructionObserver::FrameDestructionObserver):
120 (WebCore::FrameDestructionObserver::~FrameDestructionObserver):
121 (WebCore::FrameDestructionObserver::frameDestroyed):
122 * page/FrameTree.cpp:
123 (WebCore::FrameTree::~FrameTree):
124 (WebCore::FrameTree::removeChild):
126 (WebCore::FrameTree::FrameTree):
127 (WebCore::FrameTree::detachFromParent):
129 (WebCore::History::History):
131 (WebCore::Page::Page):
132 (WebCore::Page::~Page):
133 (WebCore::Page::findStringMatchingRanges):
134 * page/PageGroup.cpp:
135 * page/Performance.cpp:
136 (WebCore::Performance::Performance):
137 * page/PointerLockController.cpp:
138 (WebCore::PointerLockController::didLosePointerLock):
139 (WebCore::PointerLockController::clearElement):
140 * page/SecurityOrigin.h:
141 (WebCore::SecurityOrigin::canAccessDatabase):
143 (WebCore::Settings::Settings):
144 * page/SpatialNavigation.cpp:
145 (WebCore::FocusCandidate::FocusCandidate):
146 * page/SpatialNavigation.h:
147 (WebCore::FocusCandidate::FocusCandidate):
148 * page/scrolling/ScrollingTreeNode.cpp:
149 (WebCore::ScrollingTreeNode::ScrollingTreeNode):
150 * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
151 (WebCore::ScrollingCoordinatorCoordinatedGraphics::willDestroyScrollableArea):
153 2015-06-04 Benjamin Poulain <bpoulain@apple.com>
155 Combine tiny DFAs into slightly larger ones
156 https://bugs.webkit.org/show_bug.cgi?id=145572
158 Reviewed by Alex Christensen.
160 This patch changes the ContentExtensions compiler to combine tiny DFA
161 until they reach a minimum size.
163 The main tool introduced here is DFAMerger. It combines 2 DFAs into
164 a single DFA that represent the union of the two machines.
165 That is done by a simple subset construction on the "name" of the nodes
168 Since we only merge 2 machines, and they are both deterministic, we know that
169 we can only be in one state of each machine, or a state in one machine without
170 equivalent in the other machine.
171 We exploit that to identify the mapping between nodes. To identify a node in
172 the new machine from nodes in the original machines, we just concatenate the node
173 IDs into a single 64 bits number. If there is no node in one of the machine, we
176 The current algorithm does not have any subgraph pruning, machines grow very very
177 quickly. Because of that, we only merge very small DFAs at the moment.
179 Test: http/tests/contentextensions/filters-with-quantifiers-combined.html
181 * WebCore.xcodeproj/project.pbxproj:
182 * contentextensions/ContentExtensionCompiler.cpp:
183 (WebCore::ContentExtensions::compileRuleList):
184 * contentextensions/ContentExtensionsDebugging.h:
185 * contentextensions/DFA.cpp:
186 (WebCore::ContentExtensions::DFA::graphSize):
187 (WebCore::ContentExtensions::DFA::debugPrintDot):
188 * contentextensions/DFA.h:
189 * contentextensions/DFACombiner.cpp: Added.
190 (WebCore::ContentExtensions::DFAMerger::DFAMerger):
191 (WebCore::ContentExtensions::DFAMerger::merge):
192 (WebCore::ContentExtensions::DFAMerger::signatureForIndices):
193 (WebCore::ContentExtensions::DFAMerger::extractIndexA):
194 (WebCore::ContentExtensions::DFAMerger::extractIndexB):
195 (WebCore::ContentExtensions::DFAMerger::getOrCreateCombinedNode):
196 (WebCore::ContentExtensions::DFAMerger::setHalfSignature):
197 (WebCore::ContentExtensions::DFAMerger::populateTransitions):
198 (WebCore::ContentExtensions::DFAMerger::populateFromFallbackTransitions):
199 (WebCore::ContentExtensions::DFAMerger::createTransitions):
200 (WebCore::ContentExtensions::DFAMerger::createFallbackTransitionIfNeeded):
201 (WebCore::ContentExtensions::DFACombiner::combineDFAs):
202 * contentextensions/DFACombiner.h: Copied from Source/WebCore/contentextensions/DFA.h.
203 (WebCore::ContentExtensions::DFACombiner::addDFA):
205 2015-06-04 Matt Rajca <mrajca@apple.com>
207 Rename MediaSessionManager to PlatformMediaSessionManager for consistency with PlatformMediaSession.
208 https://bugs.webkit.org/show_bug.cgi?id=145648
210 Reviewed by Eric Carlson.
212 * WebCore.vcxproj/WebCore.vcxproj:
213 * WebCore.vcxproj/WebCore.vcxproj.filters:
214 * WebCore.xcodeproj/project.pbxproj:
215 * html/HTMLMediaElement.cpp:
216 * html/MediaElementSession.cpp:
217 (WebCore::MediaElementSession::effectivePreloadForElement):
218 (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
219 * platform/audio/PlatformMediaSession.cpp:
220 (WebCore::PlatformMediaSession::PlatformMediaSession):
221 (WebCore::PlatformMediaSession::~PlatformMediaSession):
222 (WebCore::PlatformMediaSession::clientWillBeginPlayback):
223 (WebCore::PlatformMediaSession::clientWillPausePlayback):
224 (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
225 (WebCore::PlatformMediaSession::updateClientDataBuffering):
226 * platform/audio/PlatformMediaSessionManager.cpp: Renamed from Source/WebCore/platform/audio/MediaSessionManager.cpp.
227 (WebCore::PlatformMediaSessionManager::sharedManager):
228 (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
229 (WebCore::PlatformMediaSessionManager::resetRestrictions):
230 (WebCore::PlatformMediaSessionManager::has):
231 (WebCore::PlatformMediaSessionManager::activeAudioSessionRequired):
232 (WebCore::PlatformMediaSessionManager::count):
233 (WebCore::PlatformMediaSessionManager::beginInterruption):
234 (WebCore::PlatformMediaSessionManager::endInterruption):
235 (WebCore::PlatformMediaSessionManager::addSession):
236 (WebCore::PlatformMediaSessionManager::removeSession):
237 (WebCore::PlatformMediaSessionManager::addRestriction):
238 (WebCore::PlatformMediaSessionManager::removeRestriction):
239 (WebCore::PlatformMediaSessionManager::restrictions):
240 (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
241 (WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
242 (WebCore::PlatformMediaSessionManager::setCurrentSession):
243 (WebCore::PlatformMediaSessionManager::currentSession):
244 (WebCore::PlatformMediaSessionManager::sessionRestrictsInlineVideoPlayback):
245 (WebCore::PlatformMediaSessionManager::sessionCanLoadMedia):
246 (WebCore::PlatformMediaSessionManager::applicationWillEnterBackground):
247 (WebCore::PlatformMediaSessionManager::applicationWillEnterForeground):
248 (WebCore::PlatformMediaSessionManager::updateSessionState):
249 (WebCore::PlatformMediaSessionManager::didReceiveRemoteControlCommand):
250 (WebCore::PlatformMediaSessionManager::systemWillSleep):
251 (WebCore::PlatformMediaSessionManager::systemDidWake):
252 (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged):
253 * platform/audio/PlatformMediaSessionManager.h: Renamed from Source/WebCore/platform/audio/MediaSessionManager.h.
254 (WebCore::PlatformMediaSessionManager::~PlatformMediaSessionManager):
255 (WebCore::PlatformMediaSessionManager::configureWireLessTargetMonitoring):
256 (WebCore::PlatformMediaSessionManager::hasWirelessTargetsAvailable):
257 (WebCore::PlatformMediaSessionManager::sessions):
258 * platform/audio/mac/AudioDestinationMac.cpp:
259 * platform/audio/mac/MediaSessionManagerMac.cpp:
260 (PlatformMediaSessionManager::updateSessionState):
261 (MediaSessionManager::updateSessionState): Deleted.
262 * testing/Internals.cpp:
264 2015-06-04 Eric Carlson <eric.carlson@apple.com>
266 [Mac] Don't show default controls after playing to wireless target, again
267 https://bugs.webkit.org/show_bug.cgi?id=145620
268 <rdar://problem/21145806>
270 Reviewed by Dean Jackson.
272 Follow up to fix two tests broken by r185207.
274 * Modules/mediacontrols/mediaControlsApple.js:
275 (Controller.prototype.updateControls): Always show controls when the video element
276 is the fullscreen element because custom controls aren't possible.
278 2015-06-04 Myles C. Maxfield <mmaxfield@apple.com>
280 [Cocoa] Add ASSERT to FontPlatformData::ctFont()
281 https://bugs.webkit.org/show_bug.cgi?id=145659
283 Reviewed by Dean Jackson.
285 The new ASSERT needs to be guarded with CORETEXT_WEB_FONTS, which is defined in FontCustomPlatformData.h,
286 and is not accessible to FontPlatformData. Therefore, I've moved the definition into TextFlags.h, which
289 No new tests because there is no behavior change.
291 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
292 (WebCore::FontPlatformData::ctFont): Add the ASSERT.
293 * platform/graphics/mac/FontCustomPlatformData.h: Move the CORETEXT_WEB_FONTS preprocessor
295 * platform/text/TextFlags.h: ... to here.
297 2015-06-04 Commit Queue <commit-queue@webkit.org>
299 Unreviewed, rolling out r185208.
300 https://bugs.webkit.org/show_bug.cgi?id=145655
302 platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-
303 latched-select.html (Requested by shallawa on #webkit).
307 "Latching algorithm in findEnclosingOverflowScroll is broken"
308 https://bugs.webkit.org/show_bug.cgi?id=145642
309 http://trac.webkit.org/changeset/185208
311 2015-06-04 Myles C. Maxfield <mmaxfield@apple.com>
313 [Cocoa] Remove unnecessary code from FontPlatformData::ctFont()
314 https://bugs.webkit.org/show_bug.cgi?id=145652
316 Hoefler Text Italic no longer has initial and final swashes by default, so there
317 is no reason to explicitly disable them.
319 Reviewed by Andreas Kling.
321 No new tests because there is no behavior change.
323 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
324 (WebCore::FontPlatformData::ctFont):
325 (WebCore::createFeatureSettingDictionary): Deleted.
326 (WebCore::cascadeToLastResortAndDisableSwashesFontDescriptor): Deleted.
328 2015-06-04 Brent Fulgham <bfulgham@apple.com>
330 Latching algorithm in findEnclosingOverflowScroll is broken
331 https://bugs.webkit.org/show_bug.cgi?id=145642
332 <rdar://problem/21242308>
334 Reviewed by Simon Fraser.
336 Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
338 * page/mac/EventHandlerMac.mm:
339 (WebCore::findEnclosingOverflowScrollForDominantDirection): Renamed from
340 'findEnclosingOverflowScroll'. Only identify element as our overflow
341 scroll element if it can be scrolled in either axis of the gesture's
343 (WebCore::scrolledToEdgeInDominantDirection): Renamed.
344 (WebCore::EventHandler::platformPrepareForWheelEvents): Use new function
345 name, and pass horizontal and vertical deltas.
346 (WebCore::findEnclosingOverflowScroll): Deleted.
348 2015-06-04 Eric Carlson <eric.carlson@apple.com>
350 [Mac] Don't show default controls after playing to wireless target, again
351 https://bugs.webkit.org/show_bug.cgi?id=145620
352 <rdar://problem/21145806>
354 Reviewed by Dean Jackson.
356 * Modules/mediacontrols/mediaControlsApple.js:
357 (Controller.prototype.updateControls): Show or hide the panel as appropriate.
358 (Controller.prototype.handleWrapperMouseMove): Early return if !video.controls.
359 (Controller.prototype.addControls): Call updateControls instead of this.setNeedsTimelineMetricsUpdate
360 so all needed setup is done.
361 (Controller.prototype.resetHideControlsTimer): Only start the hide timer if playing.
363 2015-06-04 Chris Dumez <cdumez@apple.com>
365 [WK2] Prune more resources from the MemoryCache before process suspension
366 https://bugs.webkit.org/show_bug.cgi?id=145633
368 Reviewed by Andreas Kling.
370 Prune more resources from the MemoryCache before process suspension or
371 on simulated memory warning by doing a synchronous JS garbage collection
372 and sweep *before* pruning dead resources from the memory cache.
373 Previously, we would do the garbage collection after pruning the
374 MemoryCache which meant that a lot of resources became dead after we
377 At the end a basic browsing on apple.com, we are able to remove ~17%
378 more resources from the MemoryCache on simulated memory warning with this
381 Pruning as much as we can from the memory cache on critical memory
382 pressure or before process suspension is not only useful to free up
383 memory but also to make room in the vnode table as a lot of
384 CachedResources are mmmap'd from the network disk cache.
386 * platform/MemoryPressureHandler.cpp:
387 (WebCore::MemoryPressureHandler::MemoryPressureHandler):
388 (WebCore::MemoryPressureHandler::releaseCriticalMemory):
390 - Pass 'synchronous' argument so that we know if we need to do a
391 synchronous JS garbage collection.
392 - Move here code from in the Cocoa handler that is doing a JS garbage
393 collection as well as a sweep, and make this code cross-platform.
394 This code used to be iOS specific but I see no reason we shouldn't
397 (WebCore::MemoryPressureHandler::releaseMemory):
398 * platform/MemoryPressureHandler.h:
400 Use enum class arguments for critical / synchronous. The 'synchronous'
401 argument is new so that the call site can let us know if memory needs
402 to be freed synchronously (e.g. in case of imminent process suspension).
404 * platform/cocoa/MemoryPressureHandlerCocoa.mm:
405 (WebCore::MemoryPressureHandler::platformReleaseMemory):
407 Remove iOS-specific code that was doing a JS garbage collection and
408 sweep as this code is now in the generic memory pressure handler.
410 (WebCore::MemoryPressureHandler::install):
412 On simulated memory pressure, set 'synchronous' argument to Yes so that
413 a synchronous GC is done by the generic memory pressure handler. This
414 way, we no longer need to do a sync GC after calling the memory pressure
415 handler. This avoids code duplication and makes sure the GC is done
416 before pruning the memory cache.
419 2015-06-04 Myles C. Maxfield <mmaxfield@apple.com>
421 [Cocoa] Clean up m_isEmoji in FontPlatformData
422 https://bugs.webkit.org/show_bug.cgi?id=145644
424 Reviewed by Andreas Kling.
426 m_isEmoji used to be a public member variable only defined on iOS. This
427 means that, whenever it was consulted, the sites were surrounded by
428 PLATFORM(IOS) guards. A cleaner design is to use a getter and setter,
429 which on non-iOS platforms, always return false / do nothing. Then, the
430 use sites can just use these functions without having ugly guards.
432 No new tests because there is no behavior change.
434 * platform/graphics/FontPlatformData.h:
435 (WebCore::FontPlatformData::hash): Simplify isEmoji use site.
436 (WebCore::FontPlatformData::isEmoji): Getter. Returns false on Mac.
437 (WebCore::FontPlatformData::setIsEmoji): Setter. Does nothing on Mac.
438 * platform/graphics/cocoa/FontCascadeCocoa.mm:
439 (WebCore::pointAdjustedForEmoji): Simplify isEmoji use site.
440 (WebCore::FontCascade::drawGlyphs): Ditto.
441 * platform/graphics/cocoa/FontCocoa.mm:
442 (WebCore::Font::platformInit): Ditto.
443 (WebCore::canUseFastGlyphAdvanceGetter): Ditto.
444 (WebCore::isEmoji): Deleted.
445 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
446 (WebCore::FontPlatformData::platformDataInit): Simplify isEmoji use
448 (WebCore::FontPlatformData::platformDataAssign): Ditto.
449 (WebCore::FontPlatformData::platformIsEqual): Ditto.
450 (WebCore::FontPlatformData::ctFontSize): Ditto.
451 * platform/graphics/ios/FontCacheIOS.mm:
452 (WebCore::FontCache::getSystemFontFallbackForCharacters): Ditto.
453 (WebCore::FontCache::createFontPlatformData): Ditto.
454 * platform/graphics/mac/ComplexTextController.cpp:
455 (WebCore::ComplexTextController::adjustGlyphsAndAdvances): Ditto.
457 2015-06-03 Brent Fulgham <bfulgham@apple.com>
459 REGRESSION (r181879): Scrolling order on pages with focused iframe is broken.
460 https://bugs.webkit.org/show_bug.cgi?id=145637
461 <rdar://problem/20635581>
463 Reviewed by Zalan Bujtas.
465 Test: platform/mac-wk2/tiled-drawing/scrolling/iframe_in_iframe.html
467 This page revealed a bug in our RenderBox code caused by the mismatch between
468 our scrolling units, which are all integrally snapped, with our client height
469 and widths, which are not snapped at all.
471 In certain cases, the client height would have a small subpixel difference compared
472 to the scroll height, which would cause WebKit to believe it was scrollable. When
473 this happened, it would get stuck latched to this element and block scrolling events.
476 (WebCore::Frame::scrollOverflowLayer): Use roundToInt for clientWidth and clientHeight,
477 rather than integer truncation.
478 * rendering/RenderBox.cpp:
479 (WebCore::RenderBox::canBeScrolledAndHasScrollableArea): Need to round clientWidth
480 and clientHeight to compare with scrollWidth/scrollHeight.
481 * rendering/RenderBox.h:
482 (WebCore::RenderBox::hasScrollableOverflowX): Ditto.
483 (WebCore::RenderBox::hasScrollableOverflowY): Ditto.
484 * rendering/RenderMarquee.cpp:
485 (WebCore::RenderMarquee::computePosition): Use roundToInt for clientWidth and
486 clientHeight, rather than integer truncation.
488 2015-06-04 Myles C. Maxfield <mmaxfield@apple.com>
490 [Cocoa] Clean up m_font inside FontPlatformData
491 https://bugs.webkit.org/show_bug.cgi?id=145634
493 Reviewed by Andreas Kling.
495 FontPlatformDatas are used as keys in a HashMap. This means that they need
496 to be able to represent a "deleted" value. Previously, this "deleted" value
497 was represented as setting the pointer value of m_font to -1, and guarding
498 all uses of m_font to make sure it wasn't -1 before dereferencing it.
500 This patch simplifies FontPlatformData to represent a "deleted" value using
501 a separate boolean member variable. This class is already big enough that
502 the increased space is negligable (the class already contains two CoreText
503 fonts in addition to a CoreGraphics font). Because of this simplification,
504 m_font can now be a RetainPtr, instead of being manually retained and
507 There is still a long way to go before FontPlatformData is acceptably
508 clean and understandable. This patch improves one aspect of it, and more
509 improvements will eventually follow.
511 No new tests because there is no behavior change.
513 * platform/graphics/FontCache.cpp: Remove unused variable.
514 * platform/graphics/FontPlatformData.cpp:
515 (WebCore::FontPlatformData::FontPlatformData): Clean up all the PLATFORM
516 macros in favor of a single bool. Also, update to include new state.
517 (WebCore::FontPlatformData::operator=): Update to include new state.
518 * platform/graphics/FontPlatformData.h:
519 (WebCore::FontPlatformData::font): Update to account for RetainPtr.
520 (WebCore::FontPlatformData::nsFont): Ditto.
521 (WebCore::FontPlatformData::setNSFont): Ditto.
522 (WebCore::FontPlatformData::hash): Update to include new state.
523 (WebCore::FontPlatformData::operator==): Ditto.
524 (WebCore::FontPlatformData::isHashTableDeletedValue): Use new state.
525 (WebCore::FontPlatformData::hashTableDeletedFontValue): Deleted.
526 (WebCore::FontPlatformData::isValidCTFontRef): Deleted.
527 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
528 (WebCore::FontPlatformData::platformDataInit): No need for manual retain
530 (WebCore::FontPlatformData::platformDataAssign): Ditto.
531 (WebCore::FontPlatformData::platformIsEqual): Update to account for
533 (WebCore::FontPlatformData::setFont): No need for manual retain and
535 (WebCore::FontPlatformData::FontPlatformData): Deleted.
536 (WebCore::FontPlatformData::~FontPlatformData): Deleted.
537 * platform/graphics/win/FontPlatformDataCairoWin.cpp:
538 (WebCore::FontPlatformData::~FontPlatformData): m_scaledFont is always
540 (WebCore::FontPlatformData::platformDataAssign): Ditto.
542 2015-06-03 Carlos Alberto Lopez Perez <clopez@igalia.com>
544 [GTK] [Wayland] Build is broken on trunk
545 https://bugs.webkit.org/show_bug.cgi?id=142879
547 Reviewed by Carlos Garcia Campos.
549 No new tests, no behavior changes.
551 Patch on GLContext.h picked from bug 136831 by
552 Iago Toral <itoral@igalia.com> and Zan Dobersek <zdobersek@igalia.com>
554 * platform/graphics/GLContext.h: Include wayland-egl.h before eglplatform.h
555 to use the Wayland platform when building for Wayland.
556 * platform/graphics/PlatformDisplay.cpp: Fix the include of GDK
557 headers for the different targets.
558 * platform/graphics/wayland/WaylandSurface.cpp: Fix build after r183731.
559 (WebCore::WaylandSurface::~WaylandSurface):
561 2015-06-04 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
563 [Streams API] Implement ReadableStreamController enqueue
564 https://bugs.webkit.org/show_bug.cgi?id=145210
566 Reviewed by Darin Adler.
568 Added possibility to enqueue any JSValue within ReadableJSStream.
569 They are stored in a Vector of strongified JSValue.
571 Added support for streams that contain data but are asked to close.
572 This is done through m_closeRequested boolean and splitting actual closing of the stream from changeStateToClosed().
574 Chunk size and backpressure mechanism is not yet implemented.
575 Neither is pulling once enqueued data is processed.
577 Covered by rebased tests.
579 * Modules/streams/ReadableStream.cpp:
580 (WebCore::ReadableStream::changeStateToClosed): Split method with newly added close().
581 (WebCore::ReadableStream::close): Does the actual closing of stream once stream has no more values.
582 (WebCore::ReadableStream::read): Close the stream when stream is emptied and close is requested.
583 (WebCore::ReadableStream::resolveReadCallback): Added to enable ReadableJSStream to resolve read callbacks immediatly at enqueue time.
584 * Modules/streams/ReadableStream.h:
585 (WebCore::ReadableStream::isErrored): Getter added for the custom binding code.
586 (WebCore::ReadableStream::isCloseRequested): Ditto.
587 * bindings/js/JSReadableStreamControllerCustom.cpp:
588 (WebCore::JSReadableStreamController::enqueue): binding code for enqueue, taking care of raising exception if readable stream cannot enqueue.
589 * bindings/js/ReadableJSStream.cpp:
590 (WebCore::ReadableJSStream::hasValue):
591 (WebCore::ReadableJSStream::read):
592 (WebCore::ReadableJSStream::enqueue):
593 * bindings/js/ReadableJSStream.h:
595 2015-06-04 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
597 [Streams API] ReadableJSStream does not need a ReadableStreamSource
598 https://bugs.webkit.org/show_bug.cgi?id=145601
600 Reviewed by Darin Adler.
602 Covered by existing tests.
604 * Modules/streams/ReadableStream.cpp:
605 (WebCore::ReadableStream::ReadableStream): Remoed m_source.
606 * Modules/streams/ReadableStream.h: Ditto
607 * Modules/streams/ReadableStreamSource.h: Deleted.
608 * WebCore.vcxproj/WebCore.vcxproj: Removing Modules/streams/ReadableStreamSource.h.
609 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
610 * WebCore.xcodeproj/project.pbxproj: Ditto.
611 * bindings/js/ReadableJSStream.cpp:
612 (WebCore::ReadableJSStream::globalObject):
613 (WebCore::ReadableJSStream::doStart): Equivalent of ReadableJSStream::Source::start().
614 (WebCore::ReadableJSStream::create): Updated according new constructor.
615 (WebCore::ReadableJSStream::ReadableJSStream):
616 (WebCore::startReadableStreamAsync): Deleted.
617 (WebCore::ReadableJSStream::jsController): Deleted.
618 (WebCore::ReadableJSStream::storeError): Deleted.
619 * bindings/js/ReadableJSStream.h: Added m_source member to store the JS source as a JS object.
621 2015-06-04 Zan Dobersek <zdobersek@igalia.com>
623 Shrink the ArabicCharShapingMode enum in SVGGlyph.cpp
624 https://bugs.webkit.org/show_bug.cgi?id=145564
626 Reviewed by Darin Adler.
628 Shrink the ArabicCharShapingMode enum to just one byte.
629 This drops the size of the static s_arabicCharShapingMode
630 array of ArabicCharShapingMode values from 888 bytes to 222.
632 * platform/graphics/SVGGlyph.cpp:
633 (WebCore::processArabicFormDetection):
635 2015-06-03 Zalan Bujtas <zalan@apple.com>
637 Use borderBoxRect instead of contentBoxRect for backdrop filter.
638 https://bugs.webkit.org/show_bug.cgi?id=145606
640 Reviewed by Simon Fraser.
642 Backdrop filter should use border box rect. It also needs to take css clip into account.
644 Tests: css3/filters/backdrop/backdrop-filter-with-cliprect.html
645 css3/filters/backdrop/backdrop-filter-with-mask.html
647 * rendering/RenderLayerBacking.cpp:
648 (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
650 2015-06-03 Youenn Fablet <youenn.fablet@crf.canon.fr>
652 MediaDevices.getUserMedia should put promises in resolve/reject state synchronously
653 https://bugs.webkit.org/show_bug.cgi?id=145308
655 Reviewed by Darin Adler.
657 Removed the calls to callToMainThread in which were resolved and rejected promises.
658 Cleaned up the code to remove unneeded callback copies.
660 Covered by existing tests.
662 * Modules/mediastream/UserMediaRequest.cpp:
663 (WebCore::UserMediaRequest::create):
664 (WebCore::UserMediaRequest::UserMediaRequest):
665 (WebCore::UserMediaRequest::didCreateStream):
666 (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
667 (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
668 * Modules/mediastream/UserMediaRequest.h:
670 2015-06-03 Simon Fraser <simon.fraser@apple.com>
672 REGRESSION (r184968): missing media player buttons (control bar exists, but no buttons)
673 https://bugs.webkit.org/show_bug.cgi?id=145630
675 Reviewed by Zalan Bujtas.
677 r184968 changed the initial value of m_intersectsCoverageRect to false. However,
678 this triggered a bug with mask layers, whose value of m_intersectsCoverageRect was never
681 Fix by copying the value of m_intersectsCoverageRect from the main layer to its
682 mask layer, just as we do for m_visibleRect and m_coverageRect.
684 Test: compositing/visible-rect/mask-layer-coverage.html
686 * platform/graphics/ca/GraphicsLayerCA.cpp:
687 (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects):
689 2015-06-03 Simon Fraser <simon.fraser@apple.com>
691 Layer tree dumps should include mask layers
692 https://bugs.webkit.org/show_bug.cgi?id=145629
694 Reviewed by Zalan Bujtas.
696 Dumping the layer tree omitted to dump the mask layer, so fix
697 GraphicsLayer::dumpProperties() to dump this layer.
699 * platform/graphics/GraphicsLayer.cpp:
700 (WebCore::GraphicsLayer::dumpProperties):
702 2015-06-03 Greg Hughes <ghughes@apple.com>
704 AX: Expose field sets to accessibility clients
705 https://bugs.webkit.org/show_bug.cgi?id=145585
707 Expose fieldsets to the accessibility API via a subrole of AXFieldset.
709 Reviewed by Chris Fleizach.
711 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
712 (-[WebAccessibilityObjectWrapper subrole]):
714 2015-06-03 Myles C. Maxfield <mmaxfield@apple.com>
716 Remove dead code FontPlatformData::roundsGlyphAdvances()
717 https://bugs.webkit.org/show_bug.cgi?id=145628
719 Reviewed by Simon Fraser.
721 No new tests because there is no behavior change.
724 * platform/graphics/FontPlatformData.h:
725 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
726 (WebCore::FontPlatformData::roundsGlyphAdvances): Deleted.
728 2015-06-03 Ryuan Choi <ryuan.choi@navercorp.com>
730 [CoordinatedGraphics] Merge CoordinatedTile into Tile
731 https://bugs.webkit.org/show_bug.cgi?id=145602
733 Reviewed by Darin Adler.
735 CoordinatedTile only implements Tile since Qt and WebKit1/Efl were dropped.
736 So, there is no reason that CoordinatedTile inherits Tile interface.
738 No new tests, no behavior changes.
742 * WebCore.vcxproj/WebCore.vcxproj:
743 * WebCore.vcxproj/WebCore.vcxproj.filters:
744 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
745 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
746 * platform/graphics/texmap/coordinated/CoordinatedTile.cpp: Renamed to Tile.cpp
747 * platform/graphics/texmap/coordinated/CoordinatedTile.h: Merged into Tile.h
748 (WebCore::CoordinatedTile::coordinate): Deleted.
749 (WebCore::CoordinatedTile::rect): Deleted.
750 * platform/graphics/texmap/coordinated/Tile.cpp: Renamed from CoordinatedTile.cpp.
751 * platform/graphics/texmap/coordinated/Tile.h:
752 * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
753 (WebCore::TiledBackingStore::createTiles):
755 2015-06-03 Matt Rajca <mrajca@apple.com>
757 Add basic Media Session support to HTMLMediaElement.
758 https://bugs.webkit.org/show_bug.cgi?id=145581
760 Reviewed by Eric Carlson.
762 HTMLMediaElements now have:
764 - a 'kind' attribute representing the intrinsic media category
765 - a 'session' attribute representing the current media session, if any
767 * CMakeLists.txt: Include the new HTMLMediaElementMediaSession sources.
768 * DerivedSources.make: Include the new IDL file.
769 * Modules/mediasession/HTMLMediaElementMediaSession.cpp: Added.
770 (WebCore::HTMLMediaElementMediaSession::session):
771 * Modules/mediasession/HTMLMediaElementMediaSession.h: Added basic translation of the IDL file.
772 (WebCore::HTMLMediaElementMediaSession::kind):
773 (WebCore::HTMLMediaElementMediaSession::setKind):
774 (WebCore::HTMLMediaElementMediaSession::setSession):
775 * Modules/mediasession/HTMLMediaElementMediaSession.idl: Added from the Media Session spec.
776 * PlatformMac.cmake: Include DOMHTMLMediaElementMediaSession.cpp.
777 * WebCore.xcodeproj/project.pbxproj: Include the new HTMLMediaElementMediaSession sources.
778 * html/HTMLMediaElement.h: Added accessors for 'kind' and 'session'.
779 (WebCore::HTMLMediaElement::kind):
780 (WebCore::HTMLMediaElement::setKind):
781 (WebCore::HTMLMediaElement::session):
782 (WebCore::HTMLMediaElement::setSession):
784 2015-06-03 Myles C. Maxfield <mmaxfield@apple.com>
786 Cleanup after r185175.
787 https://bugs.webkit.org/show_bug.cgi?id=145569
788 <rdar://problem/20671711>
792 No new tests because there is no behavior change.
794 * platform/graphics/WidthIterator.h:
796 2015-06-02 Myles C. Maxfield <mmaxfield@apple.com>
798 SoftBank Emoji are not transformed by shaping when in a run of their own
799 https://bugs.webkit.org/show_bug.cgi?id=145569
800 <rdar://problem/20671711>
802 Reviewed by Dean Jackson.
804 Normally, we don't perform shaping on single glyphs. However, these particular codepoints
805 need to have shaping run on them, even if they are alone.
807 Test: fast/text/softbank-emoji.html Note that this test may fail in different locales on
808 different platforms. This patch disables the test on iOS.
810 * Source/WebCore/platform/graphics/WidthIterator.cpp:
811 (WebCore::applyFontTransforms): Move the length-of-1 check into shouldApplyFontTransforms()
812 (WebCore::shouldApplyFontTransforms): Return true if we have one of these emoji characters in
814 (WebCore::advanceInternal): Keep track of the previous character, and use it to call
815 shouldApplyFontTransforms.
816 * Source/WebCore/platform/graphics/WidthIterator.h: shouldApplyFontTransforms() needs
817 some more information to perform its duties.
819 2015-06-03 Daniel Bates <dabates@apple.com>
821 Caps lock indicator should not be shown in read-only or disabled field
822 https://bugs.webkit.org/show_bug.cgi?id=145612
823 <rdar://problem/21227454>
825 Reviewed by Darin Adler.
827 * html/TextFieldInputType.cpp:
828 (WebCore::TextFieldInputType::disabledAttributeChanged): Update caps lock indicator state.
829 (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
830 (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator): Do not draw the caps lock indicator
831 when the field is read-only or disabled.
833 2015-06-03 Dean Jackson <dino@apple.com>
835 Crash in GraphicsContext3D::getInternalFramebufferSize
836 https://bugs.webkit.org/show_bug.cgi?id=145479
837 <rdar://problem/16461048>
839 Reviewed by Eric Carlson.
841 If we are in an unitialized or lost state, don't try to access the context.
843 In order to test this, I added an Internal setting that always
844 forces WebGL into a pending state.
846 Test: fast/canvas/webgl/useWhilePending.html
848 * html/canvas/WebGLRenderingContextBase.cpp:
849 (WebCore::WebGLRenderingContextBase::create): Check internal settings for
850 a forced pending state.
851 (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
852 (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
853 * page/Settings.cpp: New Internal setting for forcing a pending policy.
854 (WebCore::Settings::Settings):
855 (WebCore::Settings::setForcePendingWebGLPolicy):
857 (WebCore::Settings::isForcePendingWebGLPolicy):
858 * testing/InternalSettings.cpp:
859 (WebCore::InternalSettings::Backup::Backup):
860 (WebCore::InternalSettings::Backup::restoreTo):
861 (WebCore::InternalSettings::setForcePendingWebGLPolicy):
862 * testing/InternalSettings.h:
863 * testing/InternalSettings.idl:
865 2015-06-03 Hunseop Jeong <hs85.jeong@samsung.com>
867 Use modern for-loops in WebCore/page.
868 https://bugs.webkit.org/show_bug.cgi?id=145455
870 Reviewed by Darin Adler.
872 No new tests, no behavior changes.
875 (WebCore::Chrome::notifyPopupOpeningObservers):
876 * page/ContentSecurityPolicy.cpp:
877 (WebCore::CSPSourceList::matches):
878 (WebCore::CSPDirectiveList::gatherReportURIs):
879 (WebCore::ContentSecurityPolicy::copyStateFrom):
880 (WebCore::isAllowedByAll):
881 (WebCore::isAllowedByAllWithState):
882 (WebCore::isAllowedByAllWithContext):
883 (WebCore::isAllowedByAllWithURL):
884 (WebCore::ContentSecurityPolicy::evalDisabledErrorMessage):
885 (WebCore::ContentSecurityPolicy::allowPluginType):
886 (WebCore::ContentSecurityPolicy::reflectedXSSDisposition):
887 (WebCore::ContentSecurityPolicy::gatherReportURIs):
888 * page/ContextMenuController.cpp:
889 (WebCore::ContextMenuController::populate):
890 * page/DOMWindow.cpp:
891 (WebCore::DOMWindow::dispatchAllPendingBeforeUnloadEvents):
892 (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
893 (WebCore::DOMWindow::willDestroyCachedFrame):
894 (WebCore::DOMWindow::willDestroyDocumentInFrame):
895 (WebCore::DOMWindow::willDetachDocumentFromFrame):
896 (WebCore::DOMWindow::disconnectDOMWindowProperties):
897 (WebCore::DOMWindow::reconnectDOMWindowProperties):
898 (WebCore::DOMWindow::getMatchedCSSRules):
899 * page/DeviceController.cpp:
900 (WebCore::DeviceController::dispatchDeviceEvent):
901 (WebCore::DeviceController::fireDeviceEvent):
902 * page/EventHandler.cpp:
903 (WebCore::EventHandler::updateMouseEventTargetNode):
904 (WebCore::EventHandler::handleTouchEvent):
905 * page/FocusController.cpp:
906 (WebCore::FocusController::setIsVisibleAndActiveInternal):
908 (WebCore::Frame::orientationChanged):
909 (WebCore::Frame::injectUserScriptsForWorld):
910 * page/FrameView.cpp:
911 (WebCore::FrameView::scrollContentsFastPath):
912 (WebCore::FrameView::serviceScriptedAnimations):
913 (WebCore::FrameView::trackedRepaintRectsAsText):
914 (WebCore::FrameView::updateWidgetPositions):
915 (WebCore::FrameView::notifyWidgets):
917 (WebCore::networkStateChanged):
918 (WebCore::Page::stringToViewMode):
919 (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment):
920 (WebCore::Page::refreshPlugins):
921 (WebCore::Page::lockAllOverlayScrollbarsToHidden):
922 (WebCore::Page::pluginViews):
923 (WebCore::Page::storageBlockingStateChanged):
924 (WebCore::Page::setIsVisibleInternal):
925 * page/PageGroup.cpp:
926 (WebCore::PageGroup::captionPreferencesChanged):
927 * page/PageGroupLoadDeferrer.cpp:
928 (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
929 (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
930 * page/PageSerializer.cpp:
931 (WebCore::PageSerializer::serializeFrame):
932 * page/Performance.cpp:
933 (WebCore::Performance::webkitGetEntriesByType):
934 (WebCore::Performance::webkitGetEntriesByName):
935 * page/PerformanceResourceTiming.cpp:
936 (WebCore::passesTimingAllowCheck):
937 * page/PerformanceUserTiming.cpp:
938 (WebCore::convertToEntrySequence):
939 * page/SecurityPolicy.cpp:
940 (WebCore::SecurityPolicy::isAccessWhiteListed):
941 * page/UserContentURLPattern.cpp:
942 (WebCore::UserContentURLPattern::matchesPatterns):
943 * page/WindowFeatures.cpp:
944 (WebCore::WindowFeatures::parseDialogFeatures):
945 * page/animation/AnimationController.cpp:
946 (WebCore::AnimationControllerPrivate::updateAnimations):
947 (WebCore::AnimationControllerPrivate::fireEventsAndUpdateStyle):
948 (WebCore::AnimationControllerPrivate::suspendAnimationsForDocument):
949 (WebCore::AnimationControllerPrivate::resumeAnimationsForDocument):
950 (WebCore::AnimationControllerPrivate::numberOfActiveAnimations):
951 * page/animation/CSSPropertyAnimation.cpp:
952 (WebCore::ShorthandPropertyWrapper::equals):
953 (WebCore::ShorthandPropertyWrapper::blend):
954 * page/scrolling/AsyncScrollingCoordinator.cpp:
955 (WebCore::setStateScrollingNodeSnapOffsetsAsFloat):
956 * page/scrolling/ScrollingCoordinator.cpp:
957 (WebCore::ScrollingCoordinator::absoluteNonFastScrollableRegionForFrame):
958 (WebCore::ScrollingCoordinator::hasVisibleSlowRepaintViewportConstrainedObjects):
960 2015-06-03 Daniel Bates <dabates@apple.com>
962 AutoFill button should not be shown in read-only or disabled field
963 https://bugs.webkit.org/show_bug.cgi?id=145579
964 <rdar://problem/21212494>
966 Reviewed by Darin Adler.
968 Fixes an issue where the AutoFill button is shown in a read-only or disabled
969 field. We should not show the AutoFill button in such cases.
971 Tests: fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-disabled.html
972 fast/forms/auto-fill-button/hide-auto-fill-button-when-input-becomes-readonly.html
973 fast/forms/auto-fill-button/input-auto-fill-button.html
974 fast/forms/auto-fill-button/input-disabled-auto-fill-button.html
975 fast/forms/auto-fill-button/input-readonly-auto-fill-button.html
976 fast/forms/auto-fill-button/input-readonly-non-empty-auto-fill-button.html
978 * html/TextFieldInputType.cpp:
979 (WebCore::TextFieldInputType::disabledAttributeChanged): Update AutoFill button state.
980 (WebCore::TextFieldInputType::readonlyAttributeChanged): Ditto.
981 (WebCore::TextFieldInputType::shouldDrawAutoFillButton): Do not draw AutoFill button
982 when the field is disabled or read-only.
984 2015-06-03 Brent Fulgham <bfulgham@apple.com>
986 REGRESSION: (r181879): Scrolling in select/option region in iFrame scrolls both select and iframe
987 https://bugs.webkit.org/show_bug.cgi?id=145574
988 <rdar://problem/20966828>
990 Reviewed by Simon Fraser.
992 Tested by platform/mac-wk2/tiled-drawing/scrolling/fast-scroll-iframe-latched-select.html
994 When the scroll gesture is started when the latched scrollable container is not at the limit of its
995 scroll region, we are NOT supposed to propagate the scroll event to the enclosing region. However,
996 we were doing two things wrong:
997 (1) When we recognized we were latching, we were using the right wheel event target, but not using
998 the latched scrollable container.
999 (2) Likewise, we were not using latched ScrollableArea when handling wheel events.
1001 Instead, we were using the current scrollable container and ScrollableArea under the mouse pointer,
1002 which could be different from the point we started latching as the content scrolled.
1004 The fix was to properly track the scrollable container and scrollable area during latching.
1006 I attempted to store the latched ScrollableArea in the latchingState object, like we already do for the
1007 scrollable container, but found that this did not work properly. I think the life cycle of the
1008 ScrollableArea may not match the scrollable container, and since they are not reference counted I
1009 simply retrieve the ScrollableArea when needed.
1011 * page/mac/EventHandlerMac.mm:
1012 (WebCore::scrollableAreaForContainerNode): Helper function to return the correct ScrollableArea
1013 for the two types of RenderBox elements.
1014 (WebCore::latchedToFrameOrBody): Helper predicate to identify Frame and Body elements.
1015 (WebCore::EventHandler::platformPrepareForWheelEvents): Use the correct ScrollableArea for the given
1016 ContainerNode. When latching, make sure to use the ScrollableArea that is related to the latched scrollable
1017 container, not the area currently underneath the mouse pointer.
1019 2015-06-03 Brady Eidson <beidson@apple.com>
1021 REGRESSION (r183498): Certain types of frame loads in iframes with <base target="_blank"> can open urls in new window/tabs
1022 https://bugs.webkit.org/show_bug.cgi?id=145580
1024 Reviewed by Mark Lam.
1026 Tests: fast/loader/fragment-navigation-base-blank.html
1027 fast/loader/iframe-meta-refresh-base-blank.html
1028 fast/loader/iframe-set-location-base-blank.html
1029 fast/loader/refresh-iframe-base-blank.html
1031 Before 183498, callers of FrameLoader::changeLocation() got automatically assigned a frame name of "_self".
1032 After 183498, many remained without a frame name.
1034 Later on, FrameLoader applies the <base> target as their frame name if they don't already have one.
1036 When the <base> target is "_blank", that causes a new window/tab.
1038 Restoring "_self" to these call sites fixes this.
1040 * inspector/InspectorFrontendClientLocal.cpp:
1041 (WebCore::InspectorFrontendClientLocal::openInNewTab):
1043 * inspector/InspectorPageAgent.cpp:
1044 (WebCore::InspectorPageAgent::navigate):
1046 * loader/FrameLoadRequest.h:
1047 (WebCore::FrameLoadRequest::FrameLoadRequest):
1049 * loader/NavigationScheduler.cpp:
1050 (WebCore::NavigationScheduler::scheduleLocationChange):
1052 * page/DOMWindow.cpp:
1053 (WebCore::DOMWindow::createWindow):
1055 2015-06-03 Alexey Proskuryakov <ap@apple.com>
1057 More iOS build fixing.
1059 * platform/spi/mac/AVFoundationSPI.h:
1061 2015-06-03 Zalan Bujtas <zalan@apple.com>
1063 Subpixel rendering: Composited layer with subpixel gap does not get painted properly when its position changes.
1064 https://bugs.webkit.org/show_bug.cgi?id=145587
1066 Reviewed by Simon Fraser.
1068 The composited layer always snaps to an enclosing device pixel (floors) while the renderer rounds.
1069 At certain positions (for example 0.5px on a 1x display), a gap is formed between the layer(0px) and its renderer(1px).
1070 In such cases, when the the renderer moves to a position (1.1px) where the gap is closed, we need to issue repaint on the layer
1071 in order to get the renderering right.
1073 Test: compositing/child-layer-with-subpixel-gap-needs-repaint-when-parent-moves.html
1075 * rendering/RenderLayerBacking.cpp:
1076 (WebCore::RenderLayerBacking::updateAfterLayout):
1077 (WebCore::devicePixelFractionGapFromRendererChanged):
1078 (WebCore::RenderLayerBacking::updateGeometry):
1079 * rendering/RenderLayerBacking.h:
1081 2015-06-03 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1083 [Streams API] ReadableStreamReader::closed() should be called once by binding code
1084 https://bugs.webkit.org/show_bug.cgi?id=145551
1086 Reviewed by Darin Adler.
1088 Covered by existing tests.
1090 * bindings/js/JSReadableStreamReaderCustom.cpp:
1091 (WebCore::JSReadableStreamReader::closed): Calling ReadableStreamReader::closed only at creation of the promise.
1093 2015-06-02 Gyuyoung Kim <gyuyoung.kim@webkit.org>
1095 [EFL][GTK] Fix build error since r185137
1096 https://bugs.webkit.org/show_bug.cgi?id=145596
1098 Unreviewed, fix build break on EFL and GTK port.
1101 (WebCore::Text::formatForDebugger): Use strncpy() instead of strlcpy().
1103 2015-06-02 Sergio Villar Senin <svillar@igalia.com>
1105 [CSS Grid Layout] Switch from parenthesis to brackets for grid line names
1106 https://bugs.webkit.org/show_bug.cgi?id=144996
1108 Reviewed by Darin Adler.
1110 Grid line names are now enclosed by brackets instead of parentheses
1111 as mentioned in the latest version of the spec. Appartently the CSS
1112 code is now more readable and avoids issues with tools like SASS.
1114 * css/CSSGrammar.y.in:
1115 * css/CSSGridLineNamesValue.cpp:
1116 (WebCore::CSSGridLineNamesValue::customCSSText):
1118 2015-06-02 Alexey Proskuryakov <ap@apple.com>
1122 * platform/spi/mac/AVFoundationSPI.h:
1124 2015-06-02 Commit Queue <commit-queue@webkit.org>
1126 Unreviewed, rolling out r185128 and r185132.
1127 https://bugs.webkit.org/show_bug.cgi?id=145597
1129 The new test hits a bad assertion (Requested by ap on
1132 Reverted changesets:
1134 "Crash in GraphicsContext3D::getInternalFramebufferSize"
1135 https://bugs.webkit.org/show_bug.cgi?id=145479
1136 http://trac.webkit.org/changeset/185128
1138 "Skip webgl/useWhilePending.html on WebKit 1."
1139 http://trac.webkit.org/changeset/185132
1141 2015-06-02 Ryuan Choi <ryuan.choi@navercorp.com>
1143 [CoordinatedGraphics] Refactor TiledBackingStoreClient
1144 https://bugs.webkit.org/show_bug.cgi?id=145577
1146 Reviewed by Gyuyoung Kim.
1148 This patch removes and simplifies unnecessary virtual methods of TiledBackingStoreClient.
1150 No new tests, no behavior changes.
1152 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
1153 (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers): Renamed from tiledBackingStorePaintEnd.
1154 (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintBegin): Deleted.
1155 (WebCore::CoordinatedGraphicsLayer::tiledBackingStorePaintEnd): Deleted.
1156 (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreBackgroundColor):
1157 Deleted because tiledBackingStoreBackgroundColor() is not used anywhere.
1158 * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
1159 * platform/graphics/texmap/coordinated/CoordinatedTile.cpp:
1160 (WebCore::CoordinatedTile::updateBackBuffer):
1161 Simplified not to call unnecessary methods. In addition, used modern for loop.
1162 (WebCore::CoordinatedTile::swapBackBufferToFront): Deleted.
1163 * platform/graphics/texmap/coordinated/CoordinatedTile.h:
1164 * platform/graphics/texmap/coordinated/Tile.h:
1165 * platform/graphics/texmap/coordinated/TiledBackingStore.cpp:
1166 (WebCore::TiledBackingStore::updateTileBuffers):
1167 * platform/graphics/texmap/coordinated/TiledBackingStoreClient.h:
1169 2015-06-02 Doug Russell <d_russell@apple.com>
1171 AX: debugging attributes for text markers
1172 https://bugs.webkit.org/show_bug.cgi?id=145283
1174 Reviewed by Chris Fleizach.
1176 AXTextMarkerDebugDescription: returns the result of
1177 VisiblePosition::formatForDebugger() for the visible position that a text marker
1179 AXTextMarkerNodeDebugDescription: calls Node::showNode() and
1180 Node::showNodePathForThis() for the visible position that a text marker
1182 AXTextMarkerNodeTreeDebugDescription: calls Node::showTreeForThis() for the
1183 visible position that a text marker represents.
1184 AXTextMarkerRangeDebugDescription: returns the result of
1185 formatForDebugger(VisiblePositionRange) for the visible position range that a text
1186 marker range represents.
1188 This is debug only tooling. Tests would be flakey and not very helpful.
1190 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
1191 (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarker:]):
1192 (-[WebAccessibilityObjectWrapper debugDescriptionForTextMarkerRange:]):
1193 (-[WebAccessibilityObjectWrapper showNodeForTextMarker:]):
1194 (-[WebAccessibilityObjectWrapper showNodeTreeForTextMarker:]):
1195 (formatForDebugger):
1196 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:forParameter:]):
1198 (WebCore::Text::formatForDebugger):
1200 2015-06-02 Matt Rajca <mrajca@apple.com>
1202 MediaSessions should keep track of their current state.
1203 https://bugs.webkit.org/show_bug.cgi?id=145575
1205 Reviewed by Alex Christensen.
1207 * Modules/mediasession/MediaSession.h: Per the Media Session spec, the state can be 'Idle', 'Active', or
1208 'Interrupted'. Sessions are created in an 'Idle' state.
1210 2015-06-02 Jon Lee <jonlee@apple.com>
1212 Build fix when building with internal SDKs
1213 https://bugs.webkit.org/show_bug.cgi?id=145576
1214 rdar://problem/21089476
1216 Reviewed by Alexey Proskuryakov.
1218 * platform/spi/mac/AVFoundationSPI.h: Include the right header.
1220 2015-06-02 Dean Jackson <dino@apple.com>
1222 No need to guard the sizes attribute against PICTURE_SIZES in preload scanner.
1223 https://bugs.webkit.org/show_bug.cgi?id=145573
1224 <rdar://problem/21210038>
1226 Reviewed by Myles Maxfield.
1228 The PICTURE_SIZES feature flag doesn't need to be used to
1229 guard preloading of the sizes attribute.
1231 * html/parser/HTMLPreloadScanner.cpp:
1232 (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): Deleted.
1233 (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Deleted.
1235 2015-06-02 Anders Carlsson <andersca@apple.com>
1237 Use UUIDs for WebSQL database filenames instead of a sequential number
1238 https://bugs.webkit.org/show_bug.cgi?id=145571
1240 Reviewed by Dan Bernstein.
1242 This is a first step towards getting rid of the iOS specific code path where we truncate
1243 database files instead of deleting them (in order to avoid file corruption).
1245 * Modules/webdatabase/DatabaseTracker.cpp:
1246 (WebCore::generateDatabaseFileName):
1247 (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
1248 * platform/sql/SQLiteFileSystem.cpp:
1249 (WebCore::SQLiteFileSystem::getFileNameForNewDatabase): Deleted.
1250 * platform/sql/SQLiteFileSystem.h:
1252 2015-06-02 Dean Jackson <dino@apple.com>
1254 Crash in GraphicsContext3D::getInternalFramebufferSize
1255 https://bugs.webkit.org/show_bug.cgi?id=145479
1256 <rdar://problem/16461048>
1258 Reviewed by Eric Carlson.
1260 If we are in an unitialized or lost state, don't try to access the context.
1262 In order to test this, I added an Internal setting that always
1263 forces WebGL into a pending state.
1265 Test: fast/canvas/webgl/useWhilePending.html
1267 * html/canvas/WebGLRenderingContextBase.cpp:
1268 (WebCore::WebGLRenderingContextBase::create): Check internal settings for
1269 a forced pending state.
1270 (WebCore::WebGLRenderingContextBase::drawingBufferWidth): Guard against a pending state.
1271 (WebCore::WebGLRenderingContextBase::drawingBufferHeight): Ditto.
1272 * page/Settings.cpp: New Internal setting for forcing a pending policy.
1273 (WebCore::Settings::Settings):
1274 (WebCore::Settings::setForcePendingWebGLPolicy):
1276 (WebCore::Settings::isForcePendingWebGLPolicy):
1277 * testing/InternalSettings.cpp:
1278 (WebCore::InternalSettings::Backup::Backup):
1279 (WebCore::InternalSettings::Backup::restoreTo):
1280 (WebCore::InternalSettings::setForcePendingWebGLPolicy):
1281 * testing/InternalSettings.h:
1282 * testing/InternalSettings.idl:
1284 2015-06-02 Matt Rajca <mrajca@apple.com>
1286 Added a stub implementation of MediaSession, part of the Media Session spec.
1287 https://bugs.webkit.org/show_bug.cgi?id=145530
1289 Reviewed by Eric Carlson.
1291 * CMakeLists.txt: Added new MediaSession sources.
1292 * DerivedSources.make:
1293 * Modules/mediasession/MediaSession.cpp: Added stub implementation.
1294 (WebCore::MediaSession::MediaSession): Per the Media Session spec, a Media Remote Controls object should only be
1295 set for 'content' sessions; it is null otherwise.
1296 (WebCore::MediaSession::~MediaSession):
1297 (WebCore::MediaSession::controls):
1298 (WebCore::MediaSession::releaseSession):
1299 * Modules/mediasession/MediaSession.h: Added basic translation of IDL file.
1300 * Modules/mediasession/MediaSession.idl: Added from the Media Session spec.
1301 * WebCore.xcodeproj/project.pbxproj: Added new MediaSession sources.
1303 2015-06-02 Zalan Bujtas <zalan@apple.com>
1305 Backdrop filter is pulling in content from behind the window.
1306 https://bugs.webkit.org/show_bug.cgi?id=145561
1307 rdar://problem/20909309
1309 Reviewed by Simon Fraser.
1311 This patch ensures that the backdrop filter layer is positioned and sized properly.
1313 The backdrop filter layer should take its size and position from its renderer and not
1314 directly from the composited layer.
1315 In certain cases the composited layer's size is expanded to cover items like box shadow or an absolute positioned descendant.
1316 In such cases, we ended up applying the backdrop filter to those areas as well.
1318 Tests: css3/filters/backdrop/backdrop-filter-does-not-size-properly-absolute.html
1319 css3/filters/backdrop/backdrop-filter-does-not-size-properly-border-and-padding.html
1321 * platform/graphics/GraphicsLayer.h:
1322 (WebCore::GraphicsLayer::setBackdropFiltersRect):
1323 (WebCore::GraphicsLayer::backdropFiltersRect):
1324 * platform/graphics/ca/GraphicsLayerCA.cpp:
1325 (WebCore::GraphicsLayerCA::setBackdropFiltersRect):
1326 (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
1327 (WebCore::GraphicsLayerCA::updateBackdropFilters):
1328 (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
1329 (WebCore::GraphicsLayerCA::updateContentsRects):
1330 (WebCore::GraphicsLayerCA::updateGeometry): Deleted.
1331 * platform/graphics/ca/GraphicsLayerCA.h:
1332 * rendering/RenderLayerBacking.cpp:
1333 (WebCore::RenderLayerBacking::updateBackdropFiltersGeometry):
1334 (WebCore::RenderLayerBacking::updateGeometry):
1335 * rendering/RenderLayerBacking.h:
1337 2015-06-02 Eric Carlson <eric.carlson@apple.com>
1339 [Mac] occasional crash in Document::playbackTargetAvailabilityDidChange
1340 https://bugs.webkit.org/show_bug.cgi?id=145559
1342 Reviewed by Darin Adler.
1344 No new tests, covered by existing tests.
1346 * html/HTMLMediaElement.cpp:
1347 (WebCore::HTMLMediaElement::registerWithDocument): Pass document to m_mediaSession->registerWithDocument.
1348 (WebCore::HTMLMediaElement::unregisterWithDocument): Pass document to m_mediaSession->unRegisterWithDocument.
1349 (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): Ditto.
1350 (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): Ditto.
1352 * html/MediaElementSession.cpp:
1353 (WebCore::MediaElementSession::registerWithDocument): Take a document.
1354 (WebCore::MediaElementSession::unregisterWithDocument): Ditto.
1355 * html/MediaElementSession.h:
1357 2015-06-02 Chris Dumez <cdumez@apple.com>
1359 Calling FrameView::viewportContentsChanged() after style recalcs is too expensive
1360 https://bugs.webkit.org/show_bug.cgi?id=145554
1361 <rdar://problem/21189478>
1363 Reviewed by Darin Adler and Simon Fraser.
1365 Only call FrameView::viewportContentsChanged() after a style recalc if
1366 composited layers have been updated (and there is no pending layout).
1368 We already viewportContentsChanged() after layout so we only need to
1369 call viewportContentsChanged() after a style recalc if it did not cause
1370 a layout but may have caused an element to become visible. In
1371 particular, this can happen in the case of composited animations (e.g.
1372 using -webkit-transform to move an element inside the viewport).
1373 Therefore, we now only call viewportContentsChanged() after a style
1374 recalc if it caused composited layers to be updated. This avoids a lot
1375 of unnecessary calls to viewportContentsChanged(), which is expensive.
1377 No new tests, already covered by:
1378 fast/images/animated-gif-webkit-transform.html
1381 (WebCore::Document::recalcStyle):
1382 * page/FrameView.cpp:
1383 (WebCore::FrameView::updateCompositingLayersAfterStyleChange):
1385 * rendering/RenderLayerCompositor.cpp:
1386 (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
1387 (WebCore::RenderLayerCompositor::updateCompositingLayers):
1388 * rendering/RenderLayerCompositor.h:
1390 2015-06-02 Myles C. Maxfield <mmaxfield@apple.com>
1392 Remove use of CTFontSetRenderingParameters()
1393 https://bugs.webkit.org/show_bug.cgi?id=145560
1395 Reviewed by Simon Fraser.
1397 Instead, always use CTFontSetRenderingStyle().
1399 No new tests because there is no behavior change.
1401 * platform/graphics/cocoa/FontCascadeCocoa.mm:
1402 (WebCore::RenderingStyleSaver::RenderingStyleSaver): Deleted.
1403 (WebCore::RenderingStyleSaver::~RenderingStyleSaver): Deleted.
1405 2015-06-02 Anders Carlsson <andersca@apple.com>
1407 Move WKFontAntialiasingStateSaver to its own file
1408 https://bugs.webkit.org/show_bug.cgi?id=145557
1409 rdar://problem/21134776
1411 Reviewed by Dan Bernstein.
1413 Also rename it to FontAntialiasingStateSaver. Also, change it to use the CoreGraphicsSPI.h header for its
1414 CGFontAntialiasingStyle definition instead of using an explicit typedef.
1416 * WebCore.xcodeproj/project.pbxproj:
1417 * platform/graphics/ca/mac/PlatformCALayerMac.mm:
1418 (PlatformCALayer::drawLayerContents):
1419 * platform/graphics/ios/FontAntialiasingStateSaver.h: Copied from Source/WebCore/platform/ios/wak/WKGraphics.h.
1420 (WebCore::FontAntialiasingStateSaver::FontAntialiasingStateSaver):
1421 (WebCore::FontAntialiasingStateSaver::setup):
1422 (WebCore::FontAntialiasingStateSaver::restore):
1423 * platform/ios/LegacyTileCache.mm:
1424 (WebCore::LegacyTileCache::drawWindowContent):
1425 * platform/ios/wak/WKGraphics.h:
1426 (WKFontAntialiasingStateSaver::WKFontAntialiasingStateSaver): Deleted.
1427 * platform/ios/wak/WKGraphics.mm:
1428 (WKFontAntialiasingStateSaver::setup): Deleted.
1429 (WKFontAntialiasingStateSaver::restore): Deleted.
1431 2015-06-02 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1433 [Streams API] Implement ReadableStreamReader read method in closed and errored state
1434 https://bugs.webkit.org/show_bug.cgi?id=144790
1436 Reviewed by Darin Adler.
1438 Reader delegates read() promise handling to its stream except if reader is no longer locking the stream and stream is readable.
1439 Storing of reader read() promise callbacks as a Vector in ReadableStream.
1440 Added resolution/rejection of read() promises in case of errored/closed streams.
1442 Test: streams/readable-stream-reader-read.html
1444 * ForwardingHeaders/runtime/IteratorOperations.h: Added.
1445 * Modules/streams/ReadableStream.cpp:
1446 (WebCore::ReadableStream::cleanCallbacks): Clean the read requests.
1447 (WebCore::ReadableStream::changeStateToClosed): Run success callbacks with undefined for read requests.
1448 (WebCore::ReadableStream::changeStateToErrored): Run failure callbacks with the errors for read requests.
1449 (WebCore::ReadableStream::closed): Parameter name changed.
1450 (WebCore::ReadableStream::read): Added. Succeeds with empty when closed, fails with error when errored, reads a
1451 value if there is one and pushes the callbacks to the queue otherwise.
1452 * Modules/streams/ReadableStream.h:
1453 (WebCore::ReadableStream::ReadCallbacks::ReadCallbacks): Struct containing success and failure callbacks.
1454 * Modules/streams/ReadableStreamReader.cpp:
1455 (WebCore::ReadableStreamReader::closed): Parameter name changed.
1456 (WebCore::ReadableStreamReader::read): Invoke success with empty if we streams if we don't have the right reader
1457 and call the stream otherwise to read.
1458 * Modules/streams/ReadableStreamReader.h:
1459 * bindings/js/JSReadableStreamReaderCustom.cpp:
1460 (WebCore::JSReadableStreamReader::read): Create the callback lambdas and invoke read. Failure rejects the
1461 promise and success creates the result from the read value.
1462 * bindings/js/ReadableJSStream.cpp:
1463 (WebCore::ReadableJSStream::hasValue):
1464 (WebCore::ReadableJSStream::read): Not implemented yet.
1465 * bindings/js/ReadableJSStream.h:
1467 2015-06-01 Myles C. Maxfield <mmaxfield@apple.com>
1469 [Cocoa] FontPlatformData's equality check should always use reference URLs
1470 https://bugs.webkit.org/show_bug.cgi?id=144168
1472 Reviewed by Tim Horton.
1474 <rdar://problem/18985642> is not fixed, so we need to continue using the older
1475 objectForEqualityCheck().
1477 No new tests because there is no behavior change.
1479 * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
1480 (WebCore::FontPlatformData::objectForEqualityCheck):
1482 2015-06-02 Andy Estes <aestes@apple.com>
1484 [Mac] REGRESSION (r175941): Max.app crashes when adding a sound file to a patch due to removing cursor resources from WebCore.framework
1485 https://bugs.webkit.org/show_bug.cgi?id=145555
1487 Reviewed by Darin Adler.
1489 Re-added the cursor resources used by Max.app and ran sort-Xcode-project-file.
1491 * Resources/copyCursor.png: Added.
1492 * Resources/moveCursor.png: Added.
1493 * Resources/northEastSouthWestResizeCursor.png: Added.
1494 * Resources/northSouthResizeCursor.png: Added.
1495 * Resources/northWestSouthEastResizeCursor.png: Added.
1496 * WebCore.xcodeproj/project.pbxproj:
1498 2015-06-02 Brady Eidson <beidson@apple.com>
1500 WebKit policy delegate should suggest if a navigation should be allowed to open URLs externally.
1501 rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145280
1503 Reviewed by Alex Christensen.
1505 Tests: loader/navigation-policy/should-open-external-urls/main-frame-click.html
1506 loader/navigation-policy/should-open-external-urls/main-frame-navigated-programatically-by-subframe.html
1507 loader/navigation-policy/should-open-external-urls/main-frame-with-flag-progamatic.html
1508 loader/navigation-policy/should-open-external-urls/main-frame-without-flag-programatic.html
1509 loader/navigation-policy/should-open-external-urls/subframe-click-target-self.html
1510 loader/navigation-policy/should-open-external-urls/subframe-click-target-top.html
1511 loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag-from-subframe.html
1512 loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-with-flag.html
1513 loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag-from-subframe.html
1514 loader/navigation-policy/should-open-external-urls/user-gesture-target-blank-without-flag.html
1515 loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag-from-subframe.html
1516 loader/navigation-policy/should-open-external-urls/user-gesture-window-open-with-flag.html
1517 loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag-from-subframe.html
1518 loader/navigation-policy/should-open-external-urls/user-gesture-window-open-without-flag.html
1519 loader/navigation-policy/should-open-external-urls/window-open-with-flag-from-subframe.html
1520 loader/navigation-policy/should-open-external-urls/window-open-with-flag.html
1521 loader/navigation-policy/should-open-external-urls/window-open-without-flag-from-subframe.html
1522 loader/navigation-policy/should-open-external-urls/window-open-without-flag.html
1524 The "should open external URLs" flag is only for main frames.
1525 It doesn't enforce any sort of policy internal to WebKit, but rather is for notifications to the policy delegate.
1527 It is set from one of two places:
1528 1 - A main frame is navigated by any frame as the result of a user gesture.
1529 2 - WebKit2 API explicitly states the flag is true.
1531 The flag value propagates when:
1532 1 - When a main frame document is navigated to a new main frame document.
1533 2 - When a new window is opened from a page whose main frame had the flag set.
1534 3 - When a new window is opened as the result of a user gesture.
1536 The flag resets to false when:
1537 1 - A subframe navigates a main frame without a user gesture.
1539 This patch is large, but does little more than the following:
1540 1 - Adds a ShouldOpenExternalURLs flag to both FrameLoadRequest and NavigationAction.
1541 2 - Makes sure anybody who creates either of those objects sets a sensible for that flag.
1542 3 - When FrameLoader creates a new DocumentLoader, it sets its flag based on whether or not the load is in a main frame,
1543 whether or not the load is from a user gesture, and based on the initiator's value of the flag.
1546 (WebCore::Document::processHttpEquiv):
1547 (WebCore::Document::shouldOpenExternalURLsPolicyToPropagate):
1550 * html/HTMLAnchorElement.cpp:
1551 (WebCore::HTMLAnchorElement::handleClick):
1553 * html/HTMLLinkElement.cpp:
1554 (WebCore::HTMLLinkElement::handleClick):
1556 * html/parser/XSSAuditorDelegate.cpp:
1557 (WebCore::XSSAuditorDelegate::didBlockScript):
1559 * inspector/InspectorFrontendClientLocal.cpp:
1560 (WebCore::InspectorFrontendClientLocal::openInNewTab):
1562 * inspector/InspectorPageAgent.cpp:
1563 (WebCore::InspectorPageAgent::navigate):
1565 * loader/DocumentLoader.cpp:
1566 (WebCore::DocumentLoader::setTriggeringAction):
1567 (WebCore::DocumentLoader::shouldOpenExternalURLsPolicyToPropagate):
1568 * loader/DocumentLoader.h:
1569 (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy): Deleted.
1571 * loader/FrameLoadRequest.cpp:
1572 (WebCore::FrameLoadRequest::FrameLoadRequest):
1573 * loader/FrameLoadRequest.h:
1574 (WebCore::FrameLoadRequest::FrameLoadRequest):
1576 * loader/FrameLoader.cpp:
1577 (WebCore::FrameLoader::urlSelected):
1578 (WebCore::FrameLoader::receivedFirstData):
1579 (WebCore::FrameLoader::loadURLIntoChildFrame):
1580 (WebCore::FrameLoader::loadURL):
1581 (WebCore::FrameLoader::load):
1582 (WebCore::FrameLoader::loadWithNavigationAction):
1583 (WebCore::FrameLoader::reloadWithOverrideEncoding):
1584 (WebCore::FrameLoader::reload):
1585 (WebCore::FrameLoader::loadPostRequest):
1586 (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
1587 (WebCore::FrameLoader::applyShouldOpenExternalURLsPolicyToNewDocumentLoader):
1588 * loader/FrameLoader.h:
1590 * loader/NavigationAction.cpp:
1591 (WebCore::NavigationAction::NavigationAction):
1592 (WebCore::NavigationAction::copyWithShouldOpenExternalURLsPolicy):
1593 * loader/NavigationAction.h:
1594 (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy): Deleted.
1596 * loader/NavigationScheduler.cpp:
1597 (WebCore::ScheduledURLNavigation::ScheduledURLNavigation):
1598 (WebCore::ScheduledRedirect::ScheduledRedirect):
1599 (WebCore::ScheduledLocationChange::ScheduledLocationChange):
1600 (WebCore::ScheduledRefresh::ScheduledRefresh):
1601 (WebCore::ScheduledFormSubmission::ScheduledFormSubmission):
1602 (WebCore::NavigationScheduler::scheduleRedirect):
1603 (WebCore::NavigationScheduler::scheduleLocationChange):
1604 (WebCore::NavigationScheduler::scheduleRefresh):
1605 * loader/NavigationScheduler.h:
1607 * loader/PolicyChecker.cpp:
1608 (WebCore::PolicyChecker::checkNavigationPolicy):
1610 * loader/SubframeLoader.cpp:
1611 (WebCore::SubframeLoader::loadOrRedirectSubframe):
1613 * loader/appcache/ApplicationCacheGroup.cpp:
1614 (WebCore::ApplicationCacheGroup::selectCache):
1616 * page/ContextMenuController.cpp:
1617 (WebCore::openNewWindow):
1618 (WebCore::ContextMenuController::contextMenuItemSelected):
1620 * page/DOMWindow.cpp:
1621 (WebCore::DOMWindow::setLocation):
1622 (WebCore::DOMWindow::createWindow):
1623 (WebCore::DOMWindow::open):
1625 * page/DragController.cpp:
1626 (WebCore::DragController::performDragOperation):
1628 * page/Location.cpp:
1629 (WebCore::Location::reload):
1631 * replay/ReplayInputDispatchMethods.cpp:
1632 (WebCore::InitialNavigation::dispatch):
1634 * svg/SVGAElement.cpp:
1635 (WebCore::SVGAElement::defaultEventHandler):
1637 2015-06-02 Yusuke Suzuki <utatane.tea@gmail.com>
1639 Heap-use-after-free read of size 4 in JavaScriptCore: WTF::StringImpl::isSymbol() (StringImpl.h:496)
1640 https://bugs.webkit.org/show_bug.cgi?id=145532
1642 Reviewed by Geoffrey Garen.
1644 Hold the ownership of AtomicStringImpl*.
1646 * bindings/scripts/CodeGeneratorJS.pm:
1647 (GenerateParametersCheck):
1648 * dom/TreeScope.cpp:
1649 (WebCore::TreeScope::getElementById):
1651 2015-06-02 Youenn Fablet <youenn.fablet@crf.canon.fr>
1653 SharedBuffer::copy should return a Ref<SharedBuffer>
1654 https://bugs.webkit.org/show_bug.cgi?id=145499
1656 Reviewed by Andreas Kling.
1658 Changing SharedBuffer::copy to return a Ref<> and adapting some code accordingly.
1660 Covered by existing tests.
1662 * loader/SubresourceLoader.cpp:
1663 (WebCore::SubresourceLoader::didReceiveResponse):
1664 * loader/appcache/ApplicationCacheResource.cpp:
1665 (WebCore::ApplicationCacheResource::deliver):
1666 * platform/SharedBuffer.cpp:
1667 (WebCore::SharedBuffer::copy):
1668 * platform/SharedBuffer.h:
1670 2015-06-01 Hunseop Jeong <hs85.jeong@samsung.com>
1672 Use modern for-loops in WebCore/Modules - 1
1673 https://bugs.webkit.org/show_bug.cgi?id=145507
1675 Reviewed by Darin Adler.
1677 No new tests, no behavior changes.
1679 * Modules/battery/BatteryController.cpp:
1680 (WebCore::BatteryController::~BatteryController):
1681 (WebCore::BatteryController::updateBatteryStatus):
1682 (WebCore::BatteryController::didChangeBatteryStatus):
1683 * Modules/encryptedmedia/CDM.cpp:
1684 (WebCore::CDMFactoryForKeySystem):
1685 * Modules/encryptedmedia/MediaKeys.cpp:
1686 (WebCore::MediaKeys::~MediaKeys):
1687 * Modules/geolocation/Geolocation.cpp:
1688 (WebCore::Geolocation::resumeTimerFired):
1689 (WebCore::Geolocation::resetAllGeolocationPermission):
1690 (WebCore::Geolocation::makeCachedPositionCallbacks):
1691 (WebCore::Geolocation::sendError):
1692 (WebCore::Geolocation::sendPosition):
1693 (WebCore::Geolocation::stopTimer):
1694 (WebCore::Geolocation::cancelRequests):
1695 (WebCore::Geolocation::extractNotifiersWithCachedPosition):
1696 (WebCore::Geolocation::copyToSet):
1697 (WebCore::Geolocation::handlePendingPermissionNotifiers):
1698 * Modules/geolocation/GeolocationController.cpp:
1699 (WebCore::GeolocationController::positionChanged):
1700 (WebCore::GeolocationController::errorOccurred):
1701 * Modules/indexeddb/IDBDatabase.cpp:
1702 (WebCore::IDBDatabase::objectStoreNames):
1703 (WebCore::IDBDatabase::transaction):
1704 (WebCore::IDBDatabase::forceClose):
1705 (WebCore::IDBDatabase::closeConnection):
1706 (WebCore::IDBDatabase::findObjectStoreId):
1707 * Modules/indexeddb/IDBDatabaseBackend.cpp:
1708 (WebCore::IDBDatabaseBackend::runIntVersionChangeTransaction):
1709 (WebCore::IDBDatabaseBackend::deleteDatabase):
1710 (WebCore::IDBDatabaseBackend::close):
1711 * Modules/indexeddb/IDBDatabaseMetadata.cpp:
1712 (WebCore::IDBDatabaseMetadata::isolatedCopy):
1713 (WebCore::IDBObjectStoreMetadata::isolatedCopy):
1714 * Modules/indexeddb/IDBKey.cpp:
1715 (WebCore::IDBKey::isValid):
1716 * Modules/indexeddb/IDBKey.h:
1717 (WebCore::IDBKey::createMultiEntryArray):
1718 (WebCore::IDBKey::createArray):
1719 * Modules/indexeddb/IDBKeyPath.cpp:
1720 (WebCore::IDBKeyPath::IDBKeyPath):
1721 (WebCore::IDBKeyPath::isValid):
1722 (WebCore::IDBKeyPath::isolatedCopy):
1723 * Modules/indexeddb/IDBObjectStore.cpp:
1724 (WebCore::IDBObjectStore::indexNames):
1725 (WebCore::IDBObjectStore::put):
1726 Rename the two 'i's to 'keyData' and 'indexKeyData'.
1727 (WebCore::IDBObjectStore::index):
1728 (WebCore::IDBObjectStore::findIndexId):
1729 * Modules/indexeddb/IDBPendingTransactionMonitor.cpp:
1730 (WebCore::IDBPendingTransactionMonitor::deactivateNewTransactions):
1731 * Modules/indexeddb/IDBRequest.cpp:
1732 (WebCore::IDBRequest::abort):
1733 * Modules/indexeddb/IDBTransaction.cpp:
1734 (WebCore::IDBTransaction::closeOpenCursors):
1735 (WebCore::IDBTransaction::onAbort):
1736 (WebCore::IDBTransaction::dispatchEvent):
1737 * Modules/indexeddb/IDBTransactionBackend.cpp:
1738 (WebCore::IDBTransactionBackend::create):
1739 (WebCore::IDBTransactionBackend::closeOpenCursors):
1740 * Modules/mediasource/MediaSource.cpp:
1741 (WebCore::MediaSource::onReadyStateChange):
1742 * Modules/mediastream/MediaConstraintsImpl.cpp:
1743 (WebCore::MediaConstraintsImpl::initialize):
1744 (WebCore::MediaConstraintsImpl::getMandatoryConstraints):
1745 (WebCore::MediaConstraintsImpl::getOptionalConstraintValue):
1746 * Modules/mediastream/MediaStream.cpp:
1747 (WebCore::MediaStream::create):
1748 (WebCore::MediaStream::cloneMediaStreamTrackVector):
1749 (WebCore::MediaStream::addTrack):
1750 (WebCore::MediaStream::removeTrack):
1751 (WebCore::MediaStream::haveTrackWithSource):
1752 (WebCore::MediaStream::getTrackById):
1753 (WebCore::MediaStream::getTracks):
1754 (WebCore::MediaStream::trackDidEnd):
1755 (WebCore::MediaStream::scheduledEventTimerFired):
1756 * Modules/mediastream/MediaStreamCapabilities.cpp:
1757 (WebCore::MediaStreamCapabilities::sourceType):
1758 (WebCore::MediaStreamCapabilities::sourceId):
1759 (WebCore::MediaStreamCapabilities::facingMode):
1760 * Modules/mediastream/MediaStreamTrack.cpp:
1761 (WebCore::MediaStreamTrack::trackDidEnd):
1762 * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
1763 (WebCore::MediaStreamTrackSourcesRequest::didCompleteRequest):
1765 2015-06-01 Myles C. Maxfield <mmaxfield@apple.com>
1767 [SVG -> OTF Converter] Remove unnecessary hacks
1768 https://bugs.webkit.org/show_bug.cgi?id=145088
1770 Reviewed by Simon Fraser.
1774 Test: svg/text/offset-square-svg-font.html
1776 * svg/SVGToOTFFontConversion.cpp:
1777 (WebCore::SVGToOTFFontConverter::appendKERNTable):
1778 (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
1780 2015-06-01 Andreas Kling <akling@apple.com>
1782 CSS animations in filling-forwards state shouldn't force compositing.
1783 <https://webkit.org/b/145389>
1784 <rdar://problem/17923642>
1786 Reviewed by Simon Fraser.
1788 Stop checking if a CSS animation is filling forwards when computing
1789 compositing requirements.
1791 This prevents finished animations from pinning elements in composited
1792 state, and frees up a bunch of IOSurface memory on some content.
1794 * page/animation/AnimationBase.h:
1795 (WebCore::AnimationBase::isAnimatingProperty): Deleted.
1796 * rendering/RenderLayerBacking.cpp:
1797 (WebCore::RenderLayerBacking::updateGeometry):
1798 * rendering/RenderLayerCompositor.cpp:
1799 (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
1801 2015-06-01 Myles C. Maxfield <mmaxfield@apple.com>
1803 Out of bounds read in WebCore::ComplexTextController::adjustGlyphsAndAdvances
1804 https://bugs.webkit.org/show_bug.cgi?id=145537
1805 <rdar://problem/20959267>
1807 Reviewed by Darin Adler.
1809 U16_IS_SURROGATE_LEAD(ch) assumes U16_IS_SURROGATE(ch). In this case, that isn't true.
1811 Test: fast/text/crash-complex-text-surrogate.html
1813 * platform/graphics/mac/ComplexTextController.cpp:
1814 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1816 2015-05-30 Zalan Bujtas <zalan@apple.com>
1818 REGRESSION (179771): zooming on facebook images covers image
1819 https://bugs.webkit.org/show_bug.cgi?id=145485
1821 Reviewed by Simon Fraser.
1823 Scaling an infinite rect should always produce an infinite rect.
1824 (Based on Simon Fraser's patch)
1826 Test: compositing/layer-creation/zoomed-clip-intersection.html
1828 * platform/graphics/LayoutRect.cpp:
1829 (WebCore::LayoutRect::scale):
1831 2015-06-01 Gyuyoung Kim <gyuyoung.kim@webkit.org>
1833 Purge PassRefPtr in WebCore/Modules - 3
1834 https://bugs.webkit.org/show_bug.cgi?id=145508
1836 Reviewed by Darin Adler.
1838 As a step to purge PassRefPtr, this patch removes PassRefPtr, then use Ref or RefPtr.
1840 * Modules/indexeddb/IDBCursor.cpp:
1841 (WebCore::IDBCursor::create):
1842 * Modules/indexeddb/IDBCursor.h:
1843 * Modules/indexeddb/IDBCursorBackend.h:
1844 (WebCore::IDBCursorBackend::create):
1845 * Modules/indexeddb/IDBCursorBackendOperations.h:
1846 (WebCore::CursorIterationOperation::create):
1847 (WebCore::CursorAdvanceOperation::create):
1848 * Modules/indexeddb/IDBDatabase.cpp:
1849 (WebCore::IDBDatabase::create):
1850 * Modules/indexeddb/IDBDatabase.h:
1851 * Modules/indexeddb/IDBDatabaseBackend.cpp:
1852 (WebCore::IDBDatabaseBackend::create):
1853 * Modules/indexeddb/IDBDatabaseBackend.h:
1854 * Modules/indexeddb/IDBDatabaseCallbacksImpl.cpp:
1855 (WebCore::IDBDatabaseCallbacksImpl::create):
1856 * Modules/indexeddb/IDBDatabaseCallbacksImpl.h:
1857 * Modules/indexeddb/IDBDatabaseError.h:
1858 (WebCore::IDBDatabaseError::create):
1859 * Modules/indexeddb/IDBIndex.h:
1860 (WebCore::IDBIndex::create):
1861 * Modules/indexeddb/IDBKey.h:
1862 (WebCore::IDBKey::createInvalid):
1863 (WebCore::IDBKey::createNumber):
1864 (WebCore::IDBKey::createString):
1865 (WebCore::IDBKey::createDate):
1866 (WebCore::IDBKey::createArray):
1867 * Modules/indexeddb/IDBKeyRange.cpp:
1868 (WebCore::IDBKeyRange::create):
1869 * Modules/indexeddb/IDBKeyRange.h:
1870 (WebCore::IDBKeyRange::create):
1871 * Modules/indexeddb/IDBObjectStore.cpp:
1872 * Modules/indexeddb/IDBObjectStore.h:
1873 (WebCore::IDBObjectStore::create):
1874 * Modules/indexeddb/IDBOpenDBRequest.cpp:
1875 (WebCore::IDBOpenDBRequest::create):
1876 * Modules/indexeddb/IDBOpenDBRequest.h:
1877 * Modules/indexeddb/IDBRecordIdentifier.h:
1878 (WebCore::IDBRecordIdentifier::create):
1879 * Modules/indexeddb/IDBRequest.cpp:
1880 (WebCore::IDBRequest::create):
1881 (WebCore::IDBRequest::getResultCursor):
1882 * Modules/indexeddb/IDBRequest.h:
1883 * Modules/indexeddb/IDBTransaction.cpp:
1884 (WebCore::IDBTransaction::create):
1885 * Modules/indexeddb/IDBTransaction.h:
1886 * Modules/indexeddb/IDBTransactionBackend.cpp:
1887 (WebCore::IDBTransactionBackend::create):
1888 * Modules/indexeddb/IDBTransactionBackend.h:
1889 * Modules/indexeddb/IDBTransactionBackendOperations.h:
1890 (WebCore::CreateObjectStoreOperation::create):
1891 (WebCore::DeleteObjectStoreOperation::create):
1892 (WebCore::IDBDatabaseBackend::VersionChangeOperation::create):
1893 (WebCore::CreateObjectStoreAbortOperation::create):
1894 (WebCore::DeleteObjectStoreAbortOperation::create):
1895 (WebCore::IDBDatabaseBackend::VersionChangeAbortOperation::create):
1896 (WebCore::CreateIndexOperation::create):
1897 (WebCore::CreateIndexAbortOperation::create):
1898 (WebCore::DeleteIndexOperation::create):
1899 (WebCore::DeleteIndexAbortOperation::create):
1900 (WebCore::GetOperation::create):
1901 (WebCore::PutOperation::create):
1902 (WebCore::SetIndexesReadyOperation::create):
1903 (WebCore::OpenCursorOperation::create):
1904 (WebCore::CountOperation::create):
1905 (WebCore::DeleteRangeOperation::create):
1906 (WebCore::ClearObjectStoreOperation::create):
1907 * Modules/mediasource/VideoPlaybackQuality.cpp:
1908 (WebCore::VideoPlaybackQuality::create):
1909 * Modules/mediasource/VideoPlaybackQuality.h:
1910 * Modules/mediastream/MediaConstraintsImpl.cpp:
1911 (WebCore::MediaConstraintsImpl::create):
1912 * Modules/mediastream/MediaConstraintsImpl.h:
1913 * Modules/mediastream/MediaStream.cpp:
1914 (WebCore::MediaStream::create):
1915 * Modules/mediastream/MediaStream.h:
1916 * Modules/mediastream/RTCDTMFSender.cpp:
1917 (WebCore::RTCDTMFSender::create):
1918 * Modules/mediastream/RTCDTMFSender.h:
1919 * Modules/mediastream/RTCOfferAnswerOptions.cpp:
1920 (WebCore::RTCOfferAnswerOptions::create):
1921 (WebCore::RTCOfferOptions::create):
1922 * Modules/mediastream/RTCOfferAnswerOptions.h:
1923 * Modules/mediastream/RTCPeerConnection.cpp:
1924 (WebCore::RTCPeerConnection::parseConfiguration):
1925 (WebCore::RTCPeerConnection::create):
1926 * Modules/mediastream/RTCPeerConnection.h:
1927 * Modules/webaudio/AudioContext.cpp:
1928 (WebCore::AudioContext::create):
1929 * Modules/webdatabase/AbstractDatabaseServer.h:
1930 * Modules/webdatabase/DOMWindowWebDatabase.cpp:
1931 (WebCore::DOMWindowWebDatabase::openDatabase):
1932 * Modules/webdatabase/DOMWindowWebDatabase.h:
1933 * Modules/webdatabase/DatabaseManager.cpp:
1934 (WebCore::DatabaseManager::existingDatabaseContextFor):
1935 (WebCore::DatabaseManager::databaseContextFor):
1936 (WebCore::DatabaseManager::openDatabase):
1937 * Modules/webdatabase/DatabaseManager.h:
1938 * Modules/webdatabase/DatabaseServer.cpp:
1939 (WebCore::DatabaseServer::openDatabase):
1940 (WebCore::DatabaseServer::createDatabase):
1941 * Modules/webdatabase/DatabaseServer.h:
1943 2015-06-01 Daniel Bates <dabates@apple.com>
1945 Notify client that we began editing when text field is focused
1946 https://bugs.webkit.org/show_bug.cgi?id=145439
1947 <rdar://problem/21142108>
1949 Reviewed by Anders Carlsson.
1951 Inform the editor client that we began editing when a text field is focused either
1952 by being explicitly focused (programmatically or by user interaction) or implicitly
1953 focused when the window became active.
1955 Currently we only notify the editor client that we began editing a text field when
1956 when a person actually changes the value of the field. And we always notify the
1957 client that we ended editing when a text field is defocused regardless of whether
1958 we executed a began editing callback. Moreover we notify a client that we
1959 ended editing when the field is defocused (either explicitly or implicitly when the
1960 window becomes inactive). Instead we should always notify the client that we began
1961 editing when the field is focused so that this callback is symmetric with the end
1964 * html/SearchInputType.cpp:
1965 (WebCore::SearchInputType::didSetValueByUserEdit): Remove parameter for ValueChangeState,
1966 which was used to determine whether we should notify the client that we began editing, because
1967 we we will notify the client that editing began when the text field is focused as opposed to
1968 when the value of text field first changes.
1969 * html/SearchInputType.h: Ditto.
1970 * html/TextFieldInputType.cpp:
1971 (WebCore::TextFieldInputType::forwardEvent): Notify the client that we began editing when
1972 the text field is focused.
1973 (WebCore::TextFieldInputType::subtreeHasChanged): Update call site of didSetValueByUserEdit()
1974 following the removal of its parameter.
1975 (WebCore::TextFieldInputType::didSetValueByUserEdit): Ditto.
1976 * html/TextFieldInputType.h:
1978 2015-06-01 Anders Carlsson <andersca@apple.com>
1980 WAKScrollView.h cannot be imported standalone
1981 https://bugs.webkit.org/show_bug.cgi?id=145529
1983 Reviewed by Dan Bernstein.
1985 * page/mac/WebCoreFrameView.h:
1986 Remove the __cplusplus #ifdefs since WebCoreFrameView.h is only used by Objective-C++ code.
1987 (The different non-C++ method declarations were wrong anyway!)
1989 * platform/ScrollTypes.h:
1990 Remove the #ifdef __cplusplus surrounding the code, add header includes to make the file self-contained,
1991 and reformat the enum definitions.
1993 2015-06-01 Alex Christensen <achristensen@webkit.org>
1995 [Content Extensions] resource-type and load-type should be independent.
1996 https://bugs.webkit.org/show_bug.cgi?id=145528
1997 rdar://problem/21190765
1999 Reviewed by Benjamin Poulain.
2001 Covered by existing tests and a new API test.
2003 Right now we use the same uint16_t to store all the load-type and resource-type flags,
2004 then we just do a bitwise and to check both at the same time. This results in a trigger
2005 with load-type and resource-type firing if either condition is met, not both conditions.
2006 A trigger with both resource-type and load-type conditions should only fire if both conditions are met.
2008 * contentextensions/DFABytecodeInterpreter.cpp:
2009 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2010 Check and correctly handle rules with both resource-type and load-type flags.
2011 * loader/ResourceLoadInfo.h:
2012 Add masks to separate flags from resource-type and load-type.
2014 2015-06-01 Alex Christensen <achristensen@webkit.org>
2016 [Content Extensions] Reduce DFA memory usage.
2017 https://bugs.webkit.org/show_bug.cgi?id=145526
2019 Reviewed by Benjamin Poulain.
2021 * contentextensions/DFA.cpp:
2022 (WebCore::ContentExtensions::DFA::memoryUsed):
2023 (WebCore::ContentExtensions::DFANode::transitions):
2024 (WebCore::ContentExtensions::DFANode::fallbackTransitionDestination):
2025 (WebCore::ContentExtensions::DFANode::changeFallbackTransition):
2026 (WebCore::ContentExtensions::DFANode::addFallbackTransition):
2027 (WebCore::ContentExtensions::DFANode::containsTransition):
2028 (WebCore::ContentExtensions::DFANode::kill):
2029 * contentextensions/DFA.h:
2030 * contentextensions/DFAMinimizer.cpp:
2031 (WebCore::ContentExtensions::DFAMinimizer::minimize):
2032 * contentextensions/NFAToDFA.cpp:
2033 (WebCore::ContentExtensions::NFAToDFA::convert):
2034 Use separate Vectors for the transition characters and destinations to avoid wasting memory to padding a std::pair.
2036 2015-06-01 Matt Rajca <mrajca@apple.com>
2038 Implemented the `eventTargetInterface` and `scriptExecutionContext` methods required by EventTarget, as well as
2039 some required infrastructure.
2040 https://bugs.webkit.org/show_bug.cgi?id=145523
2042 Reviewed by Eric Carlson.
2044 * Modules/mediasession/MediaRemoteControls.cpp:
2045 (WebCore::MediaRemoteControls::MediaRemoteControls): Initialize all instance variables.
2046 * Modules/mediasession/MediaRemoteControls.h: MediaRemoteControl's constructor now takes a script execution
2047 context, which we provide to EventTarget. The required eventTargetInterface method has also been implemented.
2048 (WebCore::MediaRemoteControls::create):
2049 * Modules/mediasession/MediaRemoteControls.idl: Indicate MediaRemoteControls now takes a constructor that is
2050 passed in a script execution context. To prevent build errors, event handlers have been removed until they are
2052 * WebCore.xcodeproj/project.pbxproj: We should be building the derived JSMediaRemoteControls class with WebCore.
2053 * dom/EventTargetFactory.in: Ensure a MediaRemoteControlsEventTargetInterfaceType is generated.
2055 2015-06-01 Benjamin Poulain <bpoulain@apple.com>
2057 [CSS JIT] Fail to compile when we are out of executable memory
2058 https://bugs.webkit.org/show_bug.cgi?id=145483
2059 rdar://problem/21166612
2061 Reviewed by Andreas Kling.
2063 We should use a soft failure when the Linker fails to allocate
2064 executable memory for the CSS JIT. We will just fallback to slow
2065 code when that happen, better slow CSS than crashing.
2067 Credit to Chris for finding this problem.
2069 * cssjit/SelectorCompiler.cpp:
2070 (WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
2072 2015-06-01 Chris Dumez <cdumez@apple.com>
2074 ASSERT(revalidatingResource.inCache()) in MemoryCache when reloading tumblr.com
2075 https://bugs.webkit.org/show_bug.cgi?id=145518
2076 <rdar://problem/21168573>
2078 Reviewed by Darin Adler.
2080 There was an assertion in MemoryCache::revalidationSucceeded() making
2081 sure that the resource that was revalidated is still in the memory
2082 cache. However, nothing prevents this resource from being pruned while
2083 it is being revalidated. We do make sure that the resource in question
2084 cannot be destroyed though (see CachedResource::canDelete()).
2086 This patch gets rid of this assertion as it is incorrect. Also, the
2087 fact that the resource is no longer in the memory cache is not an
2088 issue. We are merely going to call MemoryCache::remove() to remove
2089 it from the memory cache before re-adding it and updating its
2090 HTTP response. The call to MemoryCache::remove() will simply be a
2091 no-op in this case and we will not have any problem adding the
2092 resource back to the memory cache because the resource is kept alive.
2094 Test: http/tests/cache/memory-cache-pruning-during-revalidation.html
2096 * loader/cache/MemoryCache.cpp:
2097 (WebCore::MemoryCache::revalidationSucceeded): Deleted.
2099 2015-06-01 Matt Rajca <mrajca@apple.com>
2101 Add stub implementation of MediaRemoteControls, part of the Media Session spec.
2102 https://bugs.webkit.org/show_bug.cgi?id=145462
2104 Reviewed by Eric Carlson.
2106 * CMakeLists.txt: Added IDL file as well as the corresponding implementation file.
2107 * DerivedSources.make: Included the new IDL file.
2108 * Modules/mediasession/MediaRemoteControls.cpp: Added an empty implementation file.
2109 (MediaRemoteControls::~MediaRemoteControls):
2110 * Modules/mediasession/MediaRemoteControls.h: Added a stubbed header file with accessors for the four attributes declared in the IDL file.
2111 (WebCore::MediaRemoteControls::previousTrackEnabled):
2112 (WebCore::MediaRemoteControls::setPreviousTrackEnabled):
2113 (WebCore::MediaRemoteControls::nextTrackEnabled):
2114 (WebCore::MediaRemoteControls::setNextTrackEnabled):
2115 (WebCore::MediaRemoteControls::seekForwardEnabled):
2116 (WebCore::MediaRemoteControls::setSeekForwardEnabled):
2117 (WebCore::MediaRemoteControls::seekBackwardEnabled):
2118 (WebCore::MediaRemoteControls::setSeekBackwardEnabled):
2119 * Modules/mediasession/MediaRemoteControls.idl: Added from the Media Session spec.
2120 * WebCore.xcodeproj/project.pbxproj: Included the new IDL file and MediaRemoteControls.cpp/.h sources.
2122 2015-06-01 Sergio Villar Senin <svillar@igalia.com>
2124 [CSS Grid Layout] Simplify the interface of GridResolvedPosition
2125 https://bugs.webkit.org/show_bug.cgi?id=139077
2127 Reviewed by Darin Adler.
2129 The interface of GridResolvedPosition is full of static methods
2130 that are used only internally, we should not expose them.
2132 Apart from that resolveGridPositionsFromStyle() do always return
2133 a valid GridSpan from now on meaning that the caller has to ensure
2134 that the resolution does not require running the auto-placement
2135 algorithm. A new class called GridUnresolvedSpan was added for
2138 No new tests as this is a refactoring.
2140 * rendering/RenderGrid.cpp:
2141 (WebCore::RenderGrid::placeItemsOnGrid):
2142 (WebCore::RenderGrid::populateExplicitGridAndOrderIterator):
2143 (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid):
2144 (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid):
2145 * rendering/style/GridPosition.h:
2146 * rendering/style/GridResolvedPosition.cpp:
2147 (WebCore::gridLinesForSide):
2148 (WebCore::implicitNamedGridLineForSide):
2149 (WebCore::isNonExistentNamedLineOrArea):
2150 (WebCore::GridUnresolvedSpan::requiresAutoPlacement):
2151 (WebCore::GridUnresolvedSpan::adjustGridPositionsFromStyle):
2152 (WebCore::adjustGridPositionForRowEndColumnEndSide):
2153 (WebCore::adjustGridPositionForSide):
2154 (WebCore::resolveNamedGridLinePositionFromStyle):
2155 (WebCore::firstNamedGridLineBeforePosition):
2156 (WebCore::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition):
2157 (WebCore::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition):
2158 (WebCore::resolveNamedGridLinePositionAgainstOppositePosition):
2159 (WebCore::resolveGridPositionAgainstOppositePosition):
2160 (WebCore::GridResolvedPosition::resolveGridPositionsFromAutoPlacementPosition):
2161 (WebCore::resolveGridPositionFromStyle):
2162 (WebCore::GridResolvedPosition::GridResolvedPosition):
2163 (WebCore::GridResolvedPosition::unresolvedSpanFromStyle):
2164 (WebCore::GridResolvedPosition::resolveGridPositionsFromStyle):
2165 (WebCore::GridResolvedPosition::adjustGridPositionsFromStyle): Deleted.
2166 (WebCore::GridResolvedPosition::resolveNamedGridLinePositionFromStyle): Deleted.
2167 (WebCore::GridResolvedPosition::resolveGridPositionFromStyle): Deleted.
2168 (WebCore::GridResolvedPosition::resolveGridPositionAgainstOppositePosition): Deleted.
2169 (WebCore::GridResolvedPosition::resolveNamedGridLinePositionAgainstOppositePosition): Deleted.
2170 (WebCore::GridResolvedPosition::resolveRowStartColumnStartNamedGridLinePositionAgainstOppositePosition): Deleted.
2171 (WebCore::GridResolvedPosition::resolveRowEndColumnEndNamedGridLinePositionAgainstOppositePosition): Deleted.
2172 * rendering/style/GridResolvedPosition.h:
2173 (WebCore::GridUnresolvedSpan::GridUnresolvedSpan): New class.
2174 (WebCore::GridUnresolvedSpan::initialPosition):
2175 (WebCore::GridUnresolvedSpan::finalPosition):
2176 (WebCore::GridUnresolvedSpan::initialPositionSide):
2177 (WebCore::GridUnresolvedSpan::finalPositionSide):
2178 (WebCore::GridResolvedPosition::adjustGridPositionForRowEndColumnEndSide): Deleted.
2179 (WebCore::GridResolvedPosition::adjustGridPositionForSide): Deleted.
2180 (WebCore::GridResolvedPosition::GridResolvedPosition): Deleted.
2182 2015-06-01 Csaba Osztrogonác <ossy@webkit.org>
2184 Fix the !ENABLE(VIDEO_TRACK) build after r184799
2185 https://bugs.webkit.org/show_bug.cgi?id=145510
2187 Reviewed by Eric Carlson.
2189 * testing/Internals.cpp:
2190 (WebCore::Internals::userPreferredAudioCharacteristics):
2191 (WebCore::Internals::setUserPreferredAudioCharacteristic):
2193 2015-06-01 Csaba Osztrogonác <ossy@webkit.org>
2195 Fix logical-not-parentheses warning in CachedScript.cpp
2196 https://bugs.webkit.org/show_bug.cgi?id=145254
2198 Reviewed by Sam Weinig.
2200 * loader/cache/CachedScript.cpp:
2201 (WebCore::CachedScript::mimeTypeAllowedByNosniff): "!X==Y" should be "X!=Y" here.
2203 2015-05-31 Dan Bernstein <mitz@apple.com>
2205 Remove Panther support
2206 https://bugs.webkit.org/show_bug.cgi?id=145506
2208 Reviewed by Sam Weinig.
2210 * platform/ios/wak/WAKAppKitStubs.h: Don't check for pre-Tiger SDKs.
2212 2015-05-31 Carlos Alberto Lopez Perez <clopez@igalia.com>
2214 Remove unused variable kZoomTicks.
2215 https://bugs.webkit.org/show_bug.cgi?id=145504
2217 Reviewed by Sam Weinig.
2219 No new tests, no behavior changes.
2221 * platform/ScrollAnimatorNone.cpp:
2223 2015-05-31 Youenn Fablet <youenn.fablet@crf.canon.fr>
2225 Async XMLHttpRequest should get access to AppCache resources stored as flat files
2226 https://bugs.webkit.org/show_bug.cgi?id=138506
2228 Reviewed by Darin Adler.
2230 This patch reads flat file data when DocumentLoader substituteResource delivery timer is fired.
2231 Refactoring to remove ApplicationCacheHost/DocumentLoader friend link.
2232 Added ResourceLoader::deliverResponseAndData helper function, taking a SharedBuffer as input to remove an unneeded copy for flat files (no change for other files).
2234 Test: http/tests/appcache/simple-video-async.html
2236 * loader/DocumentLoader.cpp:
2237 (WebCore::DocumentLoader::substituteResourceDeliveryTimerFired):
2238 (WebCore::DocumentLoader::scheduleArchiveLoad):
2239 (WebCore::DocumentLoader::scheduleSubstituteResourceLoad): Helper function to remove ApplicationCacheHost friend link.
2240 * loader/DocumentLoader.h:
2241 * loader/ResourceLoader.cpp:
2242 (WebCore::ResourceLoader::deliverResponseAndData): Helper function, code mostly moved from DocumentLoader::substituteResourceDeliveryTimerFired.
2243 * loader/ResourceLoader.h:
2244 * loader/SubstituteResource.h:
2245 (WebCore::SubstituteResource::deliver): Introduced to be overriden by ApplicationCacheResource to take care of flat file case.
2246 * loader/appcache/ApplicationCacheHost.cpp:
2247 (WebCore::ApplicationCacheHost::maybeLoadResource):
2248 (WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
2249 * loader/appcache/ApplicationCacheResource.cpp:
2250 (WebCore::ApplicationCacheResource::deliver): Use SharedBuffer::createWithContentsOfFile to load data stored in flat file.
2251 * loader/appcache/ApplicationCacheResource.h:
2253 2015-05-31 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2255 [Streams API] Implement ReadableStreamController constructor
2256 https://bugs.webkit.org/show_bug.cgi?id=143752
2258 Reviewed by Darin Adler.
2260 Covered by rebased test and expectation.
2262 * Modules/streams/ReadableStreamController.idl: Adding CustomConstructor.
2263 * bindings/js/JSReadableStreamControllerCustom.cpp:
2264 (WebCore::constructJSReadableStreamController): Throws an exception whenever called.
2266 2015-05-30 Brady Eidson <beidson@apple.com>
2268 Make FrameLoader methods that take PassRefPtr<Event> take raw pointers instead.
2269 https://bugs.webkit.org/show_bug.cgi?id=145495
2271 Reviewed by Alexey Proskuryakov.
2273 No new tests (No change in behavior).
2275 In most cases ownership of the Event is not actually being transferred, and these functions are all rarely called anyways.
2277 * html/HTMLLinkElement.cpp:
2278 (WebCore::HTMLLinkElement::handleClick):
2280 * loader/FrameLoader.cpp:
2281 (WebCore::FrameLoader::urlSelected):
2282 (WebCore::FrameLoader::loadFrameRequest):
2283 (WebCore::FrameLoader::loadURL):
2284 (WebCore::FrameLoader::loadPostRequest):
2285 * loader/FrameLoader.h:
2287 2015-05-30 Andreas Kling <akling@apple.com>
2289 [iOS] Tiling coverage sometimes inflated by outdated scale factor.
2290 <https://webkit.org/b/145494>
2291 <rdar://problem/20989389>
2293 Reviewed by Benjamin Poulain.
2295 Have GraphicsLayerCA plumb the current contents scale through to TileController::adjustCoverageRect()
2296 instead of TileController getting it from TileGrid.
2298 This avoids a situation where adjustCoverageRect() could cause temporarily oversized tiling coverage
2299 if called while TileGrid's content scale is outdated, and we're neither zooming or pinching, following
2300 a pinch zoom that increased the scale factor.
2302 Specifically, if all the velocity data is zero, we pad the coverage rect by a horizontal and vertical
2303 margin computed like so:
2305 margin = defaultTileSize / tileGrid.scale
2307 If the actual scale is 5, but the TileGrid's outdated scale is e.g 0.8, you'll get a much larger
2308 margin than you really wanted. Then the whole thing gets scaled up by 5x later on, and we explode
2309 in a fiery feast of IOSurface allocations.
2311 * platform/graphics/TiledBacking.h:
2312 * platform/graphics/ca/GraphicsLayerCA.cpp:
2313 (WebCore::GraphicsLayerCA::adjustCoverageRect):
2314 * platform/graphics/ca/TileController.cpp:
2315 (WebCore::TileController::computeTileCoverageRect):
2316 * platform/graphics/ca/TileController.h:
2318 2015-05-30 Brady Eidson <beidson@apple.com>
2320 Fix Windows tests broken by r185007.
2321 https://bugs.webkit.org/show_bug.cgi?id=145472
2323 Unreviewed. Discussed with Alexey Proskuryakov.
2325 No new tests (Fixing the four broken ones should suffice).
2327 The bug was that evaluating arguments in a method/constructor call has no guaranteed sequencing.
2329 Clang seems to always do LTR, allowing the PassRefPtr to be evaluated as a bool in the call to
2330 navigationType() before it is "consumed" by the PassRefPtr argument.
2332 In Visual Studio the PassRefPtr consumption happened before the bool evaluation, meaning `false`
2333 was always passed in to navigationType(), breaking the four tests.
2335 The fix? Using PassRefPtr here was silly in the first place.
2336 No ownership is being transferred.
2339 * loader/FrameLoader.cpp:
2340 (WebCore::FrameLoader::loadURL):
2341 (WebCore::FrameLoader::loadPostRequest):
2342 * loader/NavigationAction.cpp:
2344 (WebCore::NavigationAction::NavigationAction):
2345 * loader/NavigationAction.h: Nobody is actually transferring ownership of these Events.
2346 Raw pointers will work just fine, thanks.
2348 2015-05-29 Joseph Pecoraro <pecoraro@apple.com>
2350 Unreviewed bindings test rebaseline after r185023.
2352 * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
2353 (WebCore::isObservable): Deleted.
2354 (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): Deleted.
2356 2015-05-29 Andreas Kling <akling@apple.com>
2358 [iOS] Reduce tiling coverage when doing a pure pinch zoom with no panning.
2359 <https://webkit.org/b/145481>
2360 <rdar://problem/20989389>
2362 Reviewed by Benjamin Poulain.
2364 When we're zooming in with a pinch gesture but not panning the page
2365 at the same time, make the coverage rect be the visible rect.
2367 This reduces memory pressure during zooming, especially on slower
2368 devices that struggle to keep up with the current viewport.
2370 * platform/graphics/ca/TileController.cpp:
2371 (WebCore::TileController::computeTileCoverageRect):
2373 2015-05-29 Keith Miller <keith_miller@apple.com>
2375 WeakMap reference w/ DOM element as key does not survive long enough.
2376 https://bugs.webkit.org/show_bug.cgi?id=137651
2378 Reviewed by Geoffrey Garen.
2380 Remove isObservable functions as an "unobservable wrappers"
2381 optimization is invalid with WeakMaps. Performance testing
2382 will be done after the code is commited. If major
2383 performance issues occur the patch will be rolled out.
2385 Test: js/dom/weakmap-gc-unobservable-dom-nodes.html
2387 * bindings/js/JSNodeCustom.cpp:
2388 (WebCore::isReachableFromDOM):
2389 (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
2390 (WebCore::JSNode::insertBefore):
2391 (WebCore::isObservable): Deleted.
2392 * bindings/scripts/CodeGeneratorJS.pm:
2393 (GenerateImplementation):
2395 2015-05-29 Anders Carlsson <andersca@apple.com>
2397 Get rid of WAKViewPrivate.h
2398 https://bugs.webkit.org/show_bug.cgi?id=145482
2399 rdar://problem/21162149
2401 Reviewed by Dan Bernstein.
2403 Merge WAKViewPrivate.h into WAKViewInternal.h and move the NSView sizing enum
2404 to WAKView.h since that was the only thing WebKit used (indirectly) from WAKViewPrivate.h.
2406 * WebCore.xcodeproj/project.pbxproj:
2407 * platform/WAKViewInternal.h:
2408 (WAKViewForWKViewRef):
2409 * platform/ios/ScrollViewIOS.mm:
2410 * platform/ios/wak/WAKResponder.m:
2411 * platform/ios/wak/WAKView.h:
2412 * platform/ios/wak/WAKView.mm:
2413 * platform/ios/wak/WAKViewPrivate.h: Removed.
2414 (WAKViewForWKViewRef): Deleted.
2415 * platform/ios/wak/WAKWindow.mm:
2416 * platform/ios/wak/WKView.h:
2417 * platform/ios/wak/WKView.mm:
2419 2015-05-29 Daniel Bates <dabates@apple.com>
2421 Clean up logic for updating caps lock indicator state
2422 https://bugs.webkit.org/show_bug.cgi?id=145329
2424 Reviewed by Sam Weinig.
2426 Remove logic to explicitly update the state of the caps lock indicator, which was used
2427 when the caps logic indicator was implemented as part of RenderTextControl. Currently,
2428 the caps logic indicator is implemented as part of a shadow DOM and we have existing
2429 logic to forward DOM focus and blur events to it so that it may update its state.
2431 No change in behavior.
2433 * editing/FrameSelection.cpp:
2434 (WebCore::FrameSelection::focusedOrActiveStateChanged): Deleted.
2435 * editing/FrameSelection.h:
2436 * page/EventHandler.cpp:
2437 (WebCore::EventHandler::keyEvent): Inline the code from EventHandler::capsLockStateMayHaveChanged()
2438 into this function because it is the only caller of EventHandler::capsLockStateMayHaveChanged() after
2439 we removed the call site in FrameSelection::focusedOrActiveStateChanged().
2440 (WebCore::EventHandler::capsLockStateMayHaveChanged): Deleted.
2441 * page/EventHandler.h:
2443 2015-05-29 Zalan Bujtas <zalan@apple.com>
2445 Text disappears shortly after page load on Nexus 7 site.
2446 https://bugs.webkit.org/show_bug.cgi?id=145467
2447 rdar://problem/18327239
2449 Reviewed by Simon Fraser.
2451 This patch ensures that overlap testing for composited layers works properly when the sibling
2452 layer gets composited through its child.
2454 When a layer gets composited through its child content, the recursive overlap testing should build up the
2455 overlapmap stack so that sibling content is intersected both against the child and its parent bounds.
2457 Tests: compositing/sibling-layer-does-not-get-composited-overflow-hidden-case.html
2458 compositing/sibling-layer-does-not-get-composited-transform-case.html
2460 * rendering/RenderLayerCompositor.cpp:
2461 (WebCore::RenderLayerCompositor::addToOverlapMapRecursive):
2462 (WebCore::RenderLayerCompositor::OverlapMap::contains): Deleted.
2464 2015-05-29 Brady Eidson <beidson@apple.com>
2466 Review feedback followup for r185003.
2467 https://bugs.webkit.org/show_bug.cgi?id=145463
2469 Reviewed by Darin Adler.
2471 * platform/sql/SQLiteDatabase.cpp:
2472 (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): `static const` one thing, c++-style cast another.
2474 2015-05-29 Chris Dumez <cdumez@apple.com>
2476 WebContent crash in WebCore::Page::sessionID() const + 0 (Page.cpp:1660)
2477 https://bugs.webkit.org/show_bug.cgi?id=145422
2478 <rdar://problem/20613631>
2480 Reviewed by Brady Eidson.
2482 We sometimes crash when destroying a PageCache CachedFrame because its
2483 DocumentLoader is still loading. This should never happen as we are not
2484 supposed to let pages are still have pending loads into the PageCache.
2486 However, we were using DocumentLoader::isLoadingInAPISense() as check
2487 in PageCache::canCachePageContainingThisFrame() which is not exactly
2488 what we want. isLoadingInAPISense() no longer considers subresource
2489 loads once the frame as loaded. This means if the JS triggers a new
2490 load in a subframe after it has been loaded, then isLoadingInAPISense()
2491 will return false, despite the pending load.
2493 This patch replaces the isLoadingInAPISense() check with isLoading()
2494 as this will consider all pending loads, even after the frame is
2497 In most cases, using isLoadingInAPISense() was not an issue because
2498 we call DocumentLoader::stopLoading() in all subframes before starting
2499 a provisional load. However, nothing seems to prevent JS from
2500 triggering a new load after that and before the new load gets committed
2501 (which is when we save the page into PageCache).
2503 No new test as we don't have a reliable reproduction case and the
2504 issue is timing related.
2506 * history/PageCache.cpp:
2507 (WebCore::logCanCacheFrameDecision):
2508 (WebCore::PageCache::canCachePageContainingThisFrame):
2509 * page/DiagnosticLoggingKeys.cpp:
2510 (WebCore::DiagnosticLoggingKeys::isLoading):
2511 (WebCore::DiagnosticLoggingKeys::loadingAPISenseKey): Deleted.
2512 * page/DiagnosticLoggingKeys.h:
2514 2015-05-29 Chris Dumez <cdumez@apple.com>
2516 Consider throttling DOM timers in iframes outside the viewport
2517 https://bugs.webkit.org/show_bug.cgi?id=145465
2518 <rdar://problem/20768957>
2520 Reviewed by Darin Adler.
2522 Throttle DOM timers in iframes that are outside the viewport to decrease
2523 CPU usage, improve performance and reduce power use.
2525 The approach is similar to what we already did for requestAnimationFrame
2528 We already has support for throttling DOM timers at:
2529 - Page level: for backgound pages
2530 - DOM timer level: for timers changing the style of an element outside
2531 the viewport or drawing on a canvas outside the viewport.
2533 This patch adds support for throttling DOM timers at Document level so
2534 we can throttle all timers inside a specific iframe / Document. It relies
2535 on the same timerAlignmentInterval that is used for throttling at Page
2536 level with tweaks so that different Documents inside the same Page can
2537 have a different timerAlignmentInterval.
2539 Test: fast/dom/timer-throttling-subframe.html
2542 (WebCore::Document::setTimerThrottlingEnabled):
2543 (WebCore::Document::timerAlignmentInterval):
2545 (WebCore::Document::isTimerThrottlingEnabled):
2546 * page/DOMTimer.cpp:
2547 (WebCore::DOMTimer::alignedFireTime):
2548 The previous code was not throttling the timer if its fireTime was in
2549 the past. This was causing some aggressive timers on mashable.com to
2550 not be throttled so I got rid of this behavior. I don't see any reason
2551 why we would not throttle a timer simply because it is supposed to have
2554 * page/FrameView.cpp:
2555 (WebCore::FrameView::viewportContentsChanged):
2556 (WebCore::FrameView::updateScriptedAnimationsAndTimersThrottlingState):
2559 * testing/Internals.cpp:
2560 (WebCore::Internals::areTimersThrottled):
2561 * testing/Internals.h:
2562 * testing/Internals.idl:
2563 Add API to facilitate layout testing of this functionality.
2565 2015-05-29 Brady Eidson <beidson@apple.com>
2567 NavigationAction constructor cleanup.
2568 https://bugs.webkit.org/show_bug.cgi?id=145472
2570 Reviewed by Alex Christensen.
2572 No new tests (Refactor, no change in behavior).
2574 * loader/NavigationAction.cpp:
2575 (WebCore::NavigationAction::NavigationAction): Delegate many of the various constructors
2576 to a single full-featured constructor.
2577 * loader/NavigationAction.h:
2579 2015-05-29 Matt Rajca <mrajca@apple.com>
2581 Rename MediaSession and MediaSessionClient to PlatformMediaSession and PlatformMediaSessionClient so we can use MediaSession for the formal implementation of the Media Session spec.
2582 https://bugs.webkit.org/show_bug.cgi?id=145447
2584 Reviewed by Eric Carlson.
2586 * Modules/webaudio/AudioContext.cpp:
2587 (WebCore::AudioContext::AudioContext):
2588 (WebCore::AudioContext::suspendPlayback):
2589 * Modules/webaudio/AudioContext.h:
2590 * WebCore.vcxproj/WebCore.vcxproj:
2591 * WebCore.vcxproj/WebCore.vcxproj.filters:
2592 * WebCore.xcodeproj/project.pbxproj:
2593 * html/HTMLAudioElement.h:
2594 * html/HTMLMediaElement.cpp:
2595 (WebCore::HTMLMediaElement::pausedForUserInteraction):
2596 (WebCore::HTMLMediaElement::mediaType):
2597 (WebCore::HTMLMediaElement::presentationType):
2598 (WebCore::HTMLMediaElement::displayType):
2599 (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand):
2600 * html/HTMLMediaElement.h:
2601 * html/HTMLMediaSession.cpp:
2602 (WebCore::HTMLMediaSession::HTMLMediaSession):
2603 (WebCore::HTMLMediaSession::requiresFullscreenForVideoPlayback):
2604 * html/HTMLMediaSession.h:
2605 * html/HTMLVideoElement.h:
2606 * platform/RemoteCommandListener.h:
2607 * platform/audio/MediaSessionManager.cpp:
2608 (WebCore::MediaSessionManager::resetRestrictions):
2609 (WebCore::MediaSessionManager::has):
2610 (WebCore::MediaSessionManager::activeAudioSessionRequired):
2611 (WebCore::MediaSessionManager::count):
2612 (WebCore::MediaSessionManager::beginInterruption):
2613 (WebCore::MediaSessionManager::endInterruption):
2614 (WebCore::MediaSessionManager::addSession):
2615 (WebCore::MediaSessionManager::removeSession):
2616 (WebCore::MediaSessionManager::addRestriction):
2617 (WebCore::MediaSessionManager::removeRestriction):
2618 (WebCore::MediaSessionManager::restrictions):
2619 (WebCore::MediaSessionManager::sessionWillBeginPlayback):
2620 (WebCore::MediaSessionManager::sessionWillEndPlayback):
2621 (WebCore::MediaSessionManager::setCurrentSession):
2622 (WebCore::MediaSessionManager::currentSession):
2623 (WebCore::MediaSessionManager::sessionRestrictsInlineVideoPlayback):
2624 (WebCore::MediaSessionManager::sessionCanLoadMedia):
2625 (WebCore::MediaSessionManager::applicationWillEnterBackground):
2626 (WebCore::MediaSessionManager::applicationWillEnterForeground):
2627 (WebCore::MediaSessionManager::didReceiveRemoteControlCommand):
2628 (WebCore::MediaSessionManager::systemWillSleep):
2629 (WebCore::MediaSessionManager::systemDidWake):
2630 * platform/audio/MediaSessionManager.h:
2631 (WebCore::MediaSessionManager::sessions):
2632 * platform/audio/PlatformMediaSession.cpp: Renamed from Source/WebCore/platform/audio/MediaSession.cpp.
2633 (WebCore::stateName):
2634 (WebCore::PlatformMediaSession::create):
2635 (WebCore::PlatformMediaSession::PlatformMediaSession):
2636 (WebCore::PlatformMediaSession::~PlatformMediaSession):
2637 (WebCore::PlatformMediaSession::setState):
2638 (WebCore::PlatformMediaSession::beginInterruption):
2639 (WebCore::PlatformMediaSession::endInterruption):
2640 (WebCore::PlatformMediaSession::clientWillBeginPlayback):
2641 (WebCore::PlatformMediaSession::clientWillPausePlayback):
2642 (WebCore::PlatformMediaSession::pauseSession):
2643 (WebCore::PlatformMediaSession::mediaType):
2644 (WebCore::PlatformMediaSession::presentationType):
2645 (WebCore::PlatformMediaSession::title):
2646 (WebCore::PlatformMediaSession::duration):
2647 (WebCore::PlatformMediaSession::currentTime):
2648 (WebCore::PlatformMediaSession::canReceiveRemoteControlCommands):
2649 (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand):
2650 (WebCore::PlatformMediaSession::visibilityChanged):
2651 (WebCore::PlatformMediaSession::clientDataBufferingTimerFired):
2652 (WebCore::PlatformMediaSession::updateClientDataBuffering):
2653 (WebCore::PlatformMediaSession::isHidden):
2654 (WebCore::PlatformMediaSession::displayType):
2655 (WebCore::PlatformMediaSessionClient::mediaSessionTitle):
2656 (WebCore::PlatformMediaSessionClient::mediaSessionDuration):
2657 (WebCore::PlatformMediaSessionClient::mediaSessionCurrentTime):
2658 * platform/audio/PlatformMediaSession.h: Renamed from Source/WebCore/platform/audio/MediaSession.h.
2659 (WebCore::PlatformMediaSession::state):
2660 (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget):
2661 (WebCore::PlatformMediaSession::isPlayingToWirelessPlaybackTarget):
2662 (WebCore::PlatformMediaSession::requiresPlaybackTargetRouteMonitoring):
2663 (WebCore::PlatformMediaSession::client):
2664 (WebCore::PlatformMediaSessionClient::PlatformMediaSessionClient):
2665 (WebCore::PlatformMediaSessionClient::displayType):
2666 (WebCore::PlatformMediaSessionClient::setShouldBufferData):
2667 (WebCore::PlatformMediaSessionClient::elementIsHidden):
2668 (WebCore::PlatformMediaSessionClient::wirelessRoutesAvailableDidChange):
2669 (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
2670 (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget):
2671 (WebCore::PlatformMediaSessionClient::isPlayingToWirelessPlaybackTarget):
2672 (WebCore::PlatformMediaSessionClient::setShouldPlayToPlaybackTarget):
2673 (WebCore::PlatformMediaSessionClient::~PlatformMediaSessionClient):
2674 * platform/audio/ios/MediaSessionManagerIOS.h:
2675 * platform/audio/ios/MediaSessionManagerIOS.mm:
2676 (WebCore::MediaSessionManageriOS::resetRestrictions):
2677 (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback):
2678 (WebCore::MediaSessionManageriOS::sessionWillEndPlayback):
2679 (WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
2680 (WebCore::MediaSessionManageriOS::sessionCanLoadMedia):
2681 (-[WebMediaSessionHelper interruption:]):
2682 * platform/audio/mac/MediaSessionManagerMac.cpp:
2683 (MediaSessionManager::updateSessionState):
2684 * platform/graphics/MediaPlayer.cpp:
2685 (WebCore::MediaPlayer::handlePlaybackCommand):
2686 * platform/graphics/MediaPlayer.h:
2687 (WebCore::MediaPlayerClient::mediaPlayerHandlePlaybackCommand):
2688 * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
2689 (WebCore::MediaPlayerPrivateAVFoundation::rateChanged):
2690 * platform/ios/RemoteCommandListenerIOS.mm:
2691 (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
2692 * testing/Internals.cpp:
2693 (WebCore::Internals::beginMediaSessionInterruption):
2694 (WebCore::Internals::endMediaSessionInterruption):
2695 (WebCore::Internals::setMediaSessionRestrictions):
2696 (WebCore::Internals::postRemoteControlCommand):
2698 2015-05-29 Alex Christensen <achristensen@webkit.org>
2700 [Content Extensions] Decrease maxNFASize
2701 https://bugs.webkit.org/show_bug.cgi?id=145461
2703 Reviewed by Gavin Barraclough.
2705 * contentextensions/ContentExtensionCompiler.cpp:
2706 (WebCore::ContentExtensions::compileRuleList):
2707 Decrease maxNFASize based on analysis of memory usage and compiling and interpreting time.
2709 2015-05-29 Brady Eidson <beidson@apple.com>
2711 WebSQL default functions can bypass authorizer.
2712 <rdar://problem/21048994> and https://bugs.webkit.org/show_bug.cgi?id=145463
2714 Reviewed by Sam Weinig and Alexey Proskuryakov.
2718 * platform/sql/SQLiteDatabase.cpp:
2719 (WebCore::unauthorizedSQLFunction): Function to install into SQLite to override some built-in functions.
2720 (WebCore::SQLiteDatabase::open):
2721 (WebCore::SQLiteDatabase::overrideUnauthorizedFunctions): Install function overrides for functions that
2722 take arbitrary input that are also meant to be disabled by virtue of them not being whitelisted.
2723 * platform/sql/SQLiteDatabase.h:
2725 2015-05-29 Roger Fong <roger_fong@apple.com>
2727 Unreviewed. Shift fullscreen controls down 20px.
2728 <rdar://problem/21161523>
2730 * Modules/mediacontrols/mediaControlsApple.css:
2731 (video:-webkit-full-screen::-webkit-media-controls-panel):
2732 Fullscreen control panel is too high and overlaps with caption menu.
2735 2015-05-28 Simon Fraser <simon.fraser@apple.com>
2737 Some assertion failures in compositing code after r183820
2738 https://bugs.webkit.org/show_bug.cgi?id=144630
2740 Reviewed by Alexey Proskuryakov.
2742 Reinstate the assertion commented out in r183843. Fixed by having blending no longer
2743 escape the media elements, which was fixed via bug 145420.
2745 * rendering/RenderLayerCompositor.cpp:
2746 (WebCore::RenderLayerCompositor::computeCompositingRequirements):
2748 2015-05-29 Hunseop Jeong <hs85.jeong@samsung.com>
2750 Use modern for-loops in WebCore/plugins, storage, style, testing and workers.
2751 https://bugs.webkit.org/show_bug.cgi?id=145425
2753 Reviewed by Darin Adler.
2755 No new tests, no behavior changes.
2757 * plugins/DOMMimeTypeArray.cpp:
2758 (WebCore::DOMMimeTypeArray::canGetItemsForName):
2759 * plugins/DOMPlugin.cpp:
2760 (WebCore::DOMPlugin::canGetItemsForName):
2761 * plugins/DOMPluginArray.cpp:
2762 (WebCore::DOMPluginArray::canGetItemsForName):
2763 * plugins/PluginData.cpp:
2764 (WebCore::PluginData::getWebVisibleMimesAndPluginIndices):
2765 * plugins/PluginMainThreadScheduler.cpp:
2766 (WebCore::PluginMainThreadScheduler::dispatchCallsForPlugin):
2767 (WebCore::PluginMainThreadScheduler::dispatchCalls):
2768 * storage/StorageEventDispatcher.cpp:
2769 (WebCore::StorageEventDispatcher::dispatchLocalStorageEvents):
2770 (WebCore::StorageEventDispatcher::dispatchSessionStorageEventsToFrames):
2771 (WebCore::StorageEventDispatcher::dispatchLocalStorageEventsToFrames):
2772 * storage/StorageMap.cpp:
2773 (WebCore::StorageMap::importItems):
2774 * style/StyleResolveTree.cpp:
2775 (WebCore::Style::pseudoStyleCacheIsInvalid):
2776 * testing/Internals.cpp:
2777 (WebCore::Internals::nodesFromRect):
2778 * workers/Worker.cpp:
2779 (WebCore::networkStateChanged):
2780 * workers/WorkerGlobalScope.cpp:
2781 (WebCore::WorkerGlobalScope::importScripts):
2783 2015-05-29 Alex Christensen <achristensen@webkit.org>
2785 Unreviewed build fix when using content extensions debugging.
2787 * contentextensions/ContentExtensionCompiler.cpp:
2788 (WebCore::ContentExtensions::compileRuleList):
2789 Update variable name.
2791 2015-05-29 Brady Eidson <beidson@apple.com>
2793 Typo followup to r184987
2797 * loader/FrameLoader.cpp:
2798 (WebCore::FrameLoader::loadURLIntoChildFrame): Misplaced brace.
2800 2015-05-29 Brady Eidson <beidson@apple.com>
2802 Small FrameLoader refactoring.
2803 https://bugs.webkit.org/show_bug.cgi?id=145459
2805 Reviewed by Alex Christensen.
2807 No new tests (No behavior change).
2809 * loader/FrameLoader.cpp:
2810 (WebCore::FrameLoader::loadURLIntoChildFrame):
2811 (WebCore::FrameLoader::loadFrameRequest):
2812 (WebCore::FrameLoader::loadURL):
2813 (WebCore::FrameLoader::loadPostRequest):
2814 * loader/FrameLoader.h:
2816 2015-05-29 Youenn Fablet <youenn.fablet@crf.canon.fr>
2818 MediaDevices.getUserMedia should reject promise instead of throwing exceptions
2819 https://bugs.webkit.org/show_bug.cgi?id=145282
2821 Reviewed by Darin Adler.
2823 Ensuring at the custom binding level that all potential errors are used to reject promise.
2824 Cleaned up the wrappers by removing unneeded RefPtr.
2826 Covered by modified test.
2828 * Modules/mediastream/MediaDevices.cpp:
2829 (WebCore::MediaDevices::getUserMedia):
2830 * Modules/mediastream/MediaDevices.h:
2831 * Modules/mediastream/UserMediaRequest.cpp:
2832 (WebCore::UserMediaRequest::create):
2833 * bindings/js/JSMediaDevicesCustom.cpp:
2834 (WebCore::JSMediaDevices::getUserMedia):
2836 2015-05-28 Hunseop Jeong <hs85.jeong@samsung.com>
2838 Replaced 0 with nullptr in WebCore/accessibility.
2839 https://bugs.webkit.org/show_bug.cgi?id=145309
2841 Reviewed by Chris Fleizach.
2843 No new tests, no behavior change.
2845 * accessibility/AccessibilityRenderObject.cpp:
2846 (WebCore::AccessibilityRenderObject::mathPrescripts):
2847 (WebCore::AccessibilityRenderObject::mathPostscripts):
2848 * accessibility/AccessibilityScrollView.cpp:
2849 (WebCore::AccessibilityScrollView::scrollBar):
2850 * accessibility/atk/AXObjectCacheAtk.cpp:
2851 (WebCore::notifyChildrenSelectionChange):
2852 * accessibility/atk/WebKitAccessibleHyperlink.cpp:
2853 (webkitAccessibleHyperlinkInit):
2854 * accessibility/atk/WebKitAccessibleInterfaceDocument.cpp:
2855 (webkitAccessibleDocumentGetAttributes):
2856 * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
2857 (getAttributeSetForAccessibilityObject):
2858 (attributeSetDifference):
2859 * accessibility/atk/WebKitAccessibleUtil.h:
2860 * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
2861 (webkitAccessibleRefChild):
2862 (webkitAccessibleGetAttributes):
2863 (webkitAccessibleGetObjectLocale):
2864 (getInterfaceMaskFromObject):
2865 (objectFocusedAndCaretOffsetUnignored):
2866 (cacheAndReturnAtkProperty):
2868 2015-05-28 Zalan Bujtas <zalan@apple.com>
2870 Subpixel rendering: Pixel crack in text selection of simple text in <textarea>.
2871 https://bugs.webkit.org/show_bug.cgi?id=145393
2872 rdar://problem/19918941
2874 Reviewed by Darin Adler.
2876 Float to LayoutUnit conversion is lossy. To ensure that selection
2877 painting always lines up (snaps) properly, the calculated width needs to
2878 be adjusted by ceiling the float to the next LayoutUnit value.
2880 Test: fast/text/hidpi-text-selection-gap-between-words.html
2882 * platform/graphics/FontCascade.cpp:
2883 (WebCore::FontCascade::adjustSelectionRectForSimpleText):
2884 * platform/graphics/cocoa/FontCascadeCocoa.mm:
2885 (WebCore::FontCascade::adjustSelectionRectForComplexText):
2887 2015-05-28 Andreas Kling <akling@apple.com>
2889 GraphicsLayerCA should start out with m_intersectsCoverageRect=false
2890 <https://webkit.org/b/145443>
2891 <rdar://problem/19685798>
2893 Reviewed by Simon Fraser.
2895 Since the coverage rect of a newly-constructed GraphicsLayerCA is always empty,
2896 there's no way that the layer's own bounding box can intersect with it.
2897 Hence the m_intersectsCoverageRect flag should be false after construction.
2899 This fixes an issue where compositing layers in subframes would be marked as
2900 non-volatile, despite being far outside the viewport and coverage rect.
2902 Test: compositing/visible-rect/iframe-with-layers-outside-viewport.html
2904 * platform/graphics/ca/GraphicsLayerCA.cpp:
2905 (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2907 2015-05-28 Commit Queue <commit-queue@webkit.org>
2909 Unreviewed, rolling out r184796 and r184832.
2910 https://bugs.webkit.org/show_bug.cgi?id=145449
2912 2% performance regression (Requested by litherum on #webkit).
2914 Reverted changesets:
2916 "[Cocoa] Use CTFontDrawGlyphs() instead of
2917 CGContextShowGlyphsWithAdvances()/CGContextShowGlyphsAtPositions()"
2918 https://bugs.webkit.org/show_bug.cgi?id=145234
2919 http://trac.webkit.org/changeset/184796
2921 "Cleanup after r184796"
2922 https://bugs.webkit.org/show_bug.cgi?id=145333
2923 http://trac.webkit.org/changeset/184832
2925 2015-05-28 Matt Rajca <mrajca@apple.com>
2927 Rename HTMLMediaSession to MediaElementSession to reserve "media session" for the Media Session API.
2928 https://bugs.webkit.org/show_bug.cgi?id=145440
2930 Reviewed by Eric Carlson.
2933 * WebCore.vcxproj/WebCore.vcxproj:
2934 * WebCore.vcxproj/WebCore.vcxproj.filters:
2935 * WebCore.xcodeproj/project.pbxproj:
2936 * html/HTMLMediaElement.cpp:
2937 (WebCore::HTMLMediaElement::HTMLMediaElement):
2938 (WebCore::HTMLMediaElement::loadInternal):
2939 (WebCore::HTMLMediaElement::loadResource):
2940 (WebCore::HTMLMediaElement::suspend):
2941 (WebCore::HTMLMediaElement::resume):
2942 (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture):
2943 (WebCore::HTMLMediaElement::mediaState):
2944 * html/HTMLMediaElement.h:
2945 (WebCore::HTMLMediaElement::mediaSession):
2946 * html/MediaElementSession.cpp: Renamed from Source/WebCore/html/HTMLMediaSession.cpp.
2947 (WebCore::restrictionName):
2948 (WebCore::MediaElementSession::MediaElementSession):
2949 (WebCore::MediaElementSession::registerWithDocument):
2950 (WebCore::MediaElementSession::unregisterWithDocument):
2951 (WebCore::MediaElementSession::addBehaviorRestriction):
2952 (WebCore::MediaElementSession::removeBehaviorRestriction):
2953 (WebCore::MediaElementSession::playbackPermitted):
2954 (WebCore::MediaElementSession::dataLoadingPermitted):
2955 (WebCore::MediaElementSession::fullscreenPermitted):
2956 (WebCore::MediaElementSession::pageAllowsDataLoading):
2957 (WebCore::MediaElementSession::pageAllowsPlaybackAfterResuming):
2958 (WebCore::MediaElementSession::showPlaybackTargetPicker):
2959 (WebCore::MediaElementSession::hasWirelessPlaybackTargets):
2960 (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled):
2961 (WebCore::MediaElementSession::setWirelessVideoPlaybackDisabled):
2962 (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners):
2963 (WebCore::MediaElementSession::setPlaybackTarget):
2964 (WebCore::MediaElementSession::targetAvailabilityChangedTimerFired):
2965 (WebCore::MediaElementSession::externalOutputDeviceAvailableDidChange):
2966 (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget):
2967 (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget):
2968 (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget):
2969 (WebCore::MediaElementSession::mediaStateDidChange):
2970 (WebCore::MediaElementSession::effectivePreloadForElement):
2971 (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):
2972 (WebCore::MediaElementSession::mediaEngineUpdated):
2973 (WebCore::MediaElementSession::allowsAlternateFullscreen):
2974 (WebCore::MediaElementSession::maximumMediaSourceBufferSize):
2975 * html/MediaElementSession.h: Renamed from Source/WebCore/html/HTMLMediaSession.h.
2976 * testing/Internals.cpp:
2977 (WebCore::Internals::setMediaElementRestrictions):
2978 (WebCore::Internals::setAudioContextRestrictions):
2980 2015-05-28 Myles C. Maxfield <mmaxfield@apple.com>
2982 Crash under ICU with ASAN during editing/selection/move-by-word-visually-crash-test-5.html
2983 https://bugs.webkit.org/show_bug.cgi?id=145429
2984 <rdar://problem/20992218>
2986 Reviewed by Alexey Proskuryakov.
2988 WebKit uses some strings which contain the lower 8-bits of UTF-16 (thereby saving space). However,
2989 ICU doesn't understand this encoding. When we want to use ICU functions with strings in this encoding,
2990 we create a UTextProvider which converts our encoded strings to UTF-16 for ICU, one chunk at a time.
2991 This object contains a vtable which we populate to perform the conversion.
2993 The WebKit function which actually returns the UTF-16 chunks has two relevant arguments: an index into
2994 the encoded string which ICU is requesting, and a direction from that index which ICU is interested
2995 in. This function populates a "chunk" which is characterized by a pointer to a buffer, the length of
2996 the populated data in the buffer, and an offset into the chunk which represents the index that the
2997 requested character was put into.
2999 When ICU requests data going backward, we fill in the chunk accordingly, with the requested character
3000 all the way at the end. We then set the offset equal to the length of the buffer. However, this length
3001 value is stale from the previous time the function ran. Therefore, ICU was reading the wrong index in
3002 the chunk when expecting the requested character.
3004 Covered by editing/selection/move-by-word-visually-crash-test-5.html.
3006 * platform/text/icu/UTextProviderLatin1.cpp:
3007 (WebCore::uTextLatin1Access):
3009 2015-05-28 Eric Carlson <eric.carlson@apple.com>
3011 [iOS] Fix controls bug caused by r184794
3012 https://bugs.webkit.org/show_bug.cgi?id=145445
3014 Reviewed by Dean Jackson.
3016 * Modules/mediacontrols/mediaControlsiOS.js:
3017 (ControllerIOS.prototype.showControls): Check video.controls instead of trying to call
3018 showInlinePlaybackPlaceholderOnly, which doesn't exist.
3020 2015-05-28 Said Abou-Hallawa <sabouhallawa@apple.com>
3022 Code clean up for extracting information from the mix of WritingMode and TextDirection
3023 https://bugs.webkit.org/show_bug.cgi?id=143399
3025 Reviewed by Darin Adler.
3027 There should be eight TextFlows. A TextFlow consists of two directions.
3028 The first one controls the inline growing direction and the second one
3029 controls the block growing direction. We are going to use the cardinal
3030 directions to define these combinations.
3032 We need to extract the following information easily from the TextFlow
3034 -- isTextFlowReversed() // RTL
3035 -- isTextFlowFlipped() // the opposite direction to normal
3036 -- isTextFlowVertical() // The line grows vertically
3038 Mixing WritingMode and TextDirection into TextFlow and choosing their values
3039 carefully to ease implementing the above functions can make things clearer.
3041 * Modules/notifications/Notification.h:
3042 * platform/graphics/TextRun.h:
3043 * platform/ios/SelectionRect.h:
3044 * platform/text/BidiResolver.h:
3045 * platform/text/StringWithDirection.h:
3046 * platform/text/TextFlags.h:
3047 (WebCore::isLeftToRightDirection): Deleted.
3048 enum TextDirection is moved from TextFlags.h to WritingMode.h. So include
3049 WritingMode.h instead of including TextFlags.h.
3051 * css/CSSProperty.cpp:
3052 (WebCore::resolveToPhysicalProperty): Instead of handling the eight possible
3053 cases of the text flows one by one, we can map from a LogicalSide to a
3054 PhysicalSide using the TextFlow value.
3056 * platform/LengthBox.h:
3057 (WebCore::BoxExtent::before):
3058 (WebCore::BoxExtent::after):
3059 (WebCore::BoxExtent::start):
3060 (WebCore::BoxExtent::end):
3061 Use mapLogicalSideToPhysicalSide() to convert from a LogicalSide to a PhysicalSide.
3063 * platform/text/WritingMode.h:
3064 (WebCore::isLeftToRightDirection): Usually the default enum is defined
3065 first. And usually the default value is equal to zero. Since LTR is the
3066 default for the text direction, it should be defined before RTL.
3068 (WebCore::makeTextFlow): Returns a TextFlow given a WritingMode and a
3071 (WebCore::isReversedTextFlow): Returns true if the text direction is RTL.
3073 (WebCore::isFlippedTextFlow):
3074 (WebCore::isFlippedWritingMode): Returns true if the block growing direction
3075 is in the opposite direction of normal.
3077 (WebCore::isVerticalTextFlow):
3078 (WebCore::isVerticalWritingMode): Returns true if the line grows vertically.
3080 (WebCore::isHorizontalWritingMode):
3081 (WebCore::isFlippedLinesWritingMode): Use isVerticalWritingMode() and
3082 isFlippedWritingMode() to answer these questions.
3084 (WebCore::isHorizontalPhysicalSide):
3085 (WebCore::mirrorPhysicalSide): top <-> bottom and left <-> right conversion.
3086 (WebCore::rotatePhysicalSide): top <-> left and right <-> bottom conversion.
3088 (WebCore::mapLogicalSideToPhysicalSide): Maps a LogicalSide to a PhysicalSide
3089 using either the TextFlow or the WritingMode.
3091 (WebCore::isFlippedBlocksWritingMode): Deleted.
3092 * rendering/RenderMultiColumnSet.cpp:
3093 (WebCore::RenderMultiColumnSet::collectLayerFragments):
3094 (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
3095 * rendering/shapes/Shape.cpp:
3096 (WebCore::physicalRectToLogical):
3097 (WebCore::physicalPointToLogical):
3098 * rendering/style/RenderStyle.h:
3099 Rename isFlippedBlocksWritingMode() to be isFlippedWritingMode() so we can
3100 be consistent with other WritingMode query functions.
3102 2015-05-28 Matt Rajca <mrajca@apple.com>
3104 Add ENABLE_MEDIA_SESSION feature flag (which is off by default).
3105 https://bugs.webkit.org/show_bug.cgi?id=145415
3107 Reviewed by Eric Carlson.
3109 * Configurations/FeatureDefines.xcconfig:
3111 2015-05-28 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
3113 [Streams API] ReadableStreamReader should not be exposed
3114 https://bugs.webkit.org/show_bug.cgi?id=143564
3116 Reviewed by Darin Adler.
3118 Covered by rebased tests.
3120 * Modules/streams/ReadableStreamReader.idl: Adding NoInterfaceObject to ReadableStreamReader.idl.
3122 2015-05-28 Carlos Alberto Lopez Perez <clopez@igalia.com>
3124 [CMake] Improve detection and usage of GL/GLES/EGL libraries.
3125 https://bugs.webkit.org/show_bug.cgi?id=145408
3127 Reviewed by Carlos Garcia Campos.
3129 No new tests, no behavior changes.
3131 * CMakeLists.txt: Ensure that we include the libraries and includes
3132 for the GL/GLESv2/EGL libraries before including the ANGLE directories.
3133 Define also any CFLAG that the system GL/GLESv2/EGL libraries may need.
3134 * PlatformEfl.cmake: Remove some includes that are now unneeded,
3135 because we are including now the EGL libraries on CMakeLists.txt
3136 * PlatformGTK.cmake: Remove unneeded include (We are including the EGL
3137 libraries now on CMakeLists.txt)
3139 2015-05-28 Youenn Fablet <youenn.fablet@crf.canon.fr>
3141 Binding generator should support interfaces with CustomConstructor and NoInterfaceObject
3142 https://bugs.webkit.org/show_bug.cgi?id=145016
3144 Reviewed by Darin Adler.
3146 Updated code generator to generate the necessary declarations (constructor property in the prototype, the constructor class).
3147 In the case of CustomConstructor with NoInterfaceObject, the implementation of the constructor property related JS function is changed as follow:
3148 It creates a constructor object and shadows the constructor property JS function with this object.
3149 This ensures that only one constructor object is created per prototype.
3150 The constructor is not exposed as it is not added to the global object constructor map.
3152 NoInterfaceObject is asking to not make the interface visible, which is contradictory with having a visible constructor of the interface.
3153 The case for having NoInterfaceObject and CustomConstructor is the following:
3154 We do not want to expose the interface but we still want to have a constructor property on the prototype of objects implementing the interface.
3155 One such case is https://streams.spec.whatwg.org/#globals
3157 Added TestCustomConstructorWithNoInterfaceObject.idl to check that case.
3159 * bindings/scripts/CodeGeneratorJS.pm:
3161 (GenerateAttributesHashTable):
3162 (GenerateImplementation):
3163 (HasConstructorProperty):
3164 * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.cpp: Added.
3167 (WebKit::wrapTestCustomConstructorWithNoInterfaceObject):
3168 (webkit_dom_test_custom_constructor_with_no_interface_object_finalize):
3169 (webkit_dom_test_custom_constructor_with_no_interface_object_constructor):
3170 (webkit_dom_test_custom_constructor_with_no_interface_object_class_init):
3171 (webkit_dom_test_custom_constructor_with_no_interface_object_init):
3172 * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObject.h: Added.
3173 * bindings/scripts/test/GObject/WebKitDOMTestCustomConstructorWithNoInterfaceObjectPrivate.h: Added.
3174 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Added.
3175 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::create):
3176 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::createStructure):
3177 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::JSTestCustomConstructorWithNoInterfaceObjectPrototype):
3178 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::create):
3179 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::createStructure):
3180 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::JSTestCustomConstructorWithNoInterfaceObjectConstructor):
3181 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::finishCreation):
3182 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::getConstructData):
3183 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectPrototype::finishCreation):
3184 (WebCore::JSTestCustomConstructorWithNoInterfaceObject::JSTestCustomConstructorWithNoInterfaceObject):
3185 (WebCore::JSTestCustomConstructorWithNoInterfaceObject::createPrototype):
3186 (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getPrototype):
3187 (WebCore::JSTestCustomConstructorWithNoInterfaceObject::destroy):
3188 (WebCore::JSTestCustomConstructorWithNoInterfaceObject::~JSTestCustomConstructorWithNoInterfaceObject):
3189 (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor):
3190 (WebCore::JSTestCustomConstructorWithNoInterfaceObject::getConstructor):
3191 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
3192 (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::finalize):
3194 (WebCore::JSTestCustomConstructorWithNoInterfaceObject::toWrapped):
3195 * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Added.
3196 (WebCore::wrapperOwner):
3198 * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.h: Added.
3199 * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObject.mm: Added.
3200 (-[DOMTestCustomConstructorWithNoInterfaceObject dealloc]):
3201 (-[DOMTestCustomConstructorWithNoInterfaceObject finalize]):
3204 * bindings/scripts/test/ObjC/DOMTestCustomConstructorWithNoInterfaceObjectInternal.h: Added.
3205 * bindings/scripts/test/TestCustomConstructor.idl: Added.
3207 2015-05-19 Jon Honeycutt <jhoneycutt@apple.com>
3209 [iOS] When viewing an MJPEG stream as the main resource, only the first
3212 <https://bugs.webkit.org/show_bug.cgi?id=145185>
3213 <rdar://problem/20124694>
3215 This bug is caused by state not being restored between successive loads
3216 of multipart/x-mixed-replace content. Each part of the stream is not
3217 treated as a wholly new load, so if state is cleared as part of the
3218 previous page being destroyed, it may not be restored when loading
3219 the next stream part.
3221 On WK1, tile cache updates are disabled in FrameView::clear(), which is
3222 called as the previous page is destroyed, but were not being
3223 reenabled when loading new replacement content from the stream.
3225 On WK2, the exposed content rect was being reset to an empty rect as
3226 the previous page was destroyed, but it was not being reset by loading
3227 replacement content.
3229 To fix these issues, I added two WebFrameLoaderClient callbacks;
3230 willReplaceMultipartContent() and didReplaceMultipartContent(). These
3231 are used to save and restore state between successive loads.
3233 Reviewed by Darin Adler.
3235 * loader/DocumentLoader.cpp:
3236 Call the new client callbacks.
3237 (WebCore::DocumentLoader::commitLoad):
3238 If replacing content in a multipart/x-mixed-replace stream, call the
3239 WebFrameLoaderClient's didReplaceMultipartContent().
3241 (WebCore::DocumentLoader::setupForReplace):
3242 Call the WebFrameLoaderClient's willReplaceMultipartContent().
3244 * loader/EmptyClients.h:
3246 * loader/FrameLoaderClient.h:
3248 * page/FrameView.cpp:
3249 (WebCore::FrameView::didReplaceMultipartContent):
3250 Re-enable tile cache updates that were disabled in FrameView::clear().
3251 This fixes the issue for WK1.
3254 Declare an exported function, didReplaceMultipartContent(), that WebKit
3257 2015-05-27 Brady Eidson <beidson@apple.com>
3259 Remove unused ResourceRequest "user initiated" flag.
3260 https://bugs.webkit.org/show_bug.cgi?id=145428
3262 Reviewed by Alexey Proskuryakov.
3264 No new tests (No change in behavior).
3266 * platform/ios/WebCoreSystemInterfaceIOS.mm:
3267 * platform/mac/WebCoreSystemInterface.mm:
3269 * platform/network/ResourceRequestBase.h:
3270 (WebCore::ResourceRequestBase::initiatedByUserGesture): Deleted.
3271 (WebCore::ResourceRequestBase::setInitiatedByUserGesture): Deleted.
3272 (WebCore::ResourceRequestBase::encodeWithoutPlatformData): Deleted.
3273 (WebCore::ResourceRequestBase::decodeWithoutPlatformData): Deleted.
3275 * platform/network/cf/ResourceRequestCFNet.cpp:
3276 (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
3277 (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
3279 * platform/network/cocoa/ResourceRequestCocoa.mm:
3280 (WebCore::ResourceRequest::doUpdateResourceRequest): Deleted.
3281 (WebCore::ResourceRequest::doUpdatePlatformRequest): Deleted.
3283 2015-05-27 Brady Eidson <beidson@apple.com>
3285 Add a "should open urls externally" flag to DocumentLoader.
3286 rdar://problem/21025301 and https://bugs.webkit.org/show_bug.cgi?id=145417
3288 Reviewed by Geoff Garen.
3290 No new tests (No change in behavior, testable at API level with a followup patch)
3292 * loader/DocumentLoader.cpp:
3293 (WebCore::DocumentLoader::setTriggeringAction): Apply the current flag value to the
3294 new NavigationAction so it can be used later.
3295 * loader/DocumentLoader.h:
3296 (WebCore::DocumentLoader::setShouldOpenExternalURLsPolicy):
3297 (WebCore::DocumentLoader::shouldOpenExternalURLsPolicy):
3298 (WebCore::DocumentLoader::setTriggeringAction): Deleted.
3300 FrameLoadRequest should hold the new flag to pass into FrameLoader machinery:
3301 * loader/FrameLoadRequest.h:
3302 (WebCore::FrameLoadRequest::setShouldOpenExternalURLsPolicy):
3303 (WebCore::FrameLoadRequest::shouldOpenExternalURLsPolicy):
3305 * loader/FrameLoader.cpp:
3306 (WebCore::FrameLoader::load): Set the flag on the newly created DocumentLoader but
3307 only if it is for the main frame.
3309 * loader/FrameLoaderTypes.h: Add a new enum for the flag.
3311 Navigation action should hold the new flag to pass to the policy delegate:
3312 * loader/NavigationAction.cpp:
3313 (WebCore::NavigationAction::NavigationAction):
3314 * loader/NavigationAction.h:
3315 (WebCore::NavigationAction::shouldOpenExternalURLsPolicy):
3316 (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy):
3318 * loader/PolicyChecker.cpp:
3319 (WebCore::PolicyChecker::checkNavigationPolicy): Include the flag from the DocumentLoader
3320 in the NavigationAction.
3322 2015-05-27 Gyuyoung Kim <gyuyoung.kim@webkit.org>
3324 Purge PassRefPtr in WebCore/Modules - 2
3325 https://bugs.webkit.org/show_bug.cgi?id=145304
3327 Reviewed by Darin Adler.
3329 As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr.
3331 No new tests, no behavior changes
3333 * Modules/mediasource/SourceBufferList.h:
3334 * Modules/mediastream/AllAudioCapabilities.h:
3335 (WebCore::AllAudioCapabilities::create):
3336 * Modules/mediastream/AllVideoCapabilities.h:
3337 (WebCore::AllVideoCapabilities::create):
3338 * Modules/mediastream/CapabilityRange.cpp:
3339 (WebCore::CapabilityRange::create):
3340 * Modules/mediastream/CapabilityRange.h:
3341 * Modules/mediastream/MediaSourceStates.cpp:
3342 (WebCore::MediaSourceStates::create):
3343 * Modules/mediastream/MediaStream.cpp:
3344 (WebCore::MediaStream::create):
3345 * Modules/mediastream/MediaStreamTrack.cpp:
3346 (WebCore::MediaStreamTrack::create):
3347 * Modules/mediastream/MediaStreamTrackSourcesRequest.cpp:
3348 (WebCore::MediaStreamTrackSourcesRequest::create):
3349 * Modules/mediastream/MediaTrackConstraint.cpp:
3350 (WebCore::MediaTrackConstraint::create):
3351 * Modules/mediastream/MediaTrackConstraint.h:
3352 * Modules/mediastream/RTCConfiguration.h:
3353 (WebCore::RTCConfiguration::create):
3354 * Modules/mediastream/RTCIceServer.h:
3355 (WebCore::RTCIceServer::create):
3356 * Modules/mediastream/RTCSessionDescription.cpp:
3357 (WebCore::RTCSessionDescription::create):
3358 * Modules/mediastream/RTCSessionDescription.h:
3359 * Modules/mediastream/RTCSessionDescriptionRequestImpl.cpp:
3360 (WebCore::RTCSessionDescriptionRequestImpl::create):
3361 * Modules/mediastream/RTCStatsReport.cpp:
3362 (WebCore::RTCStatsReport::create):
3363 * Modules/mediastream/RTCStatsReport.h:
3364 * Modules/mediastream/RTCStatsRequestImpl.cpp:
3365 (WebCore::RTCStatsRequestImpl::create):
3366 * Modules/mediastream/RTCStatsRequestImpl.h:
3367 * Modules/mediastream/RTCStatsResponse.cpp:
3368 (WebCore::RTCStatsResponse::create):
3369 * Modules/mediastream/RTCStatsResponse.h:
3370 * Modules/mediastream/RTCVoidRequestImpl.cpp:
3371 (WebCore::RTCVoidRequestImpl::create):
3372 * Modules/mediastream/RTCVoidRequestImpl.h:
3373 * Modules/mediastream/SourceInfo.cpp:
3374 (WebCore::SourceInfo::create):
3375 * Modules/mediastream/SourceInfo.h:
3376 * Modules/mediastream/UserMediaRequest.cpp:
3377 (WebCore::UserMediaRequest::create):
3378 * Modules/mediastream/UserMediaRequest.h:
3379 * Modules/quota/StorageInfo.h:
3380 (WebCore::StorageInfo::create):
3381 * Modules/quota/StorageQuota.h:
3382 (WebCore::StorageQuota::create):
3383 * Modules/speech/SpeechSynthesis.cpp:
3384 (WebCore::SpeechSynthesis::create):
3385 * Modules/speech/SpeechSynthesis.h:
3386 * Modules/speech/SpeechSynthesisUtterance.cpp:
3387 (WebCore::SpeechSynthesisUtterance::create):
3388 * Modules/speech/SpeechSynthesisUtterance.h:
3389 * Modules/speech/SpeechSynthesisVoice.cpp:
3390 (WebCore::SpeechSynthesisVoice::create):
3391 * Modules/speech/SpeechSynthesisVoice.h:
3392 * Modules/webaudio/ChannelMergerNode.cpp:
3393 (WebCore::ChannelMergerNode::create):
3394 * Modules/webaudio/ChannelMergerNode.h:
3395 * Modules/webaudio/ChannelSplitterNode.cpp:
3396 (WebCore::ChannelSplitterNode::create):
3397 * Modules/webaudio/ChannelSplitterNode.h:
3398 * Modules/webaudio/DefaultAudioDestinationNode.h:
3399 (WebCore::DefaultAudioDestinationNode::create):
3400 * Modules/webaudio/GainNode.h:
3401 (WebCore::GainNode::create):
3402 * Modules/webaudio/MediaElementAudioSourceNode.cpp:
3403 (WebCore::MediaElementAudioSourceNode::create):
3404 * Modules/webaudio/MediaElementAudioSourceNode.h:
3405 * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
3406 (WebCore::MediaStreamAudioDestinationNode::create):
3407 * Modules/webaudio/MediaStreamAudioDestinationNode.h:
3408 * Modules/webaudio/MediaStreamAudioSource.cpp:
3409 (WebCore::MediaStreamAudioSource::create):
3410 * Modules/webaudio/MediaStreamAudioSource.h:
3411 * Modules/webaudio/MediaStreamAudioSourceNode.cpp:
3412 (WebCore::MediaStreamAudioSourceNode::create):
3413 * Modules/webaudio/MediaStreamAudioSourceNode.h:
3414 * Modules/webaudio/OscillatorNode.cpp:
3415 (WebCore::OscillatorNode::setType):
3416 * Modules/webaudio/PannerNode.h:
3417 (WebCore::PannerNode::create):
3418 * Modules/webaudio/PeriodicWave.cpp:
3419 (WebCore::PeriodicWave::create):
3420 (WebCore::PeriodicWave::createSine):
3421 (WebCore::PeriodicWave::createSquare):
3422 (WebCore::PeriodicWave::createSawtooth):
3423 (WebCore::PeriodicWave::createTriangle):
3424 * Modules/webaudio/PeriodicWave.h:
3425 * Modules/webaudio/ScriptProcessorNode.cpp:
3426 (WebCore::ScriptProcessorNode::create):
3427 * Modules/webaudio/ScriptProcessorNode.h:
3428 * Modules/webaudio/WaveShaperNode.h:
3429 (WebCore::WaveShaperNode::create):
3431 2015-05-27 Simon Fraser <simon.fraser@apple.com>
3433 REGRESSION (r183820): webkit.org/blog/ background painting issue on reload, when the page contains videos
3434 https://bugs.webkit.org/show_bug.cgi?id=145420
3436 Reviewed by Dean Jackson.
3438 After r183820, the media controls no longer had a wrapper that created CSS stacking context.
3439 The media controls on Mac use mix-blend-mode, which causes the compositing code to look for
3440 a stacking context ancestor and make it composited. After this change, it would walk up
3441 to a layer outside of the media element (e.g. the document element's layer), and make
3442 that composited. This triggered bugs with root background painting.
3444 Prevent mix-blend-mode affecting content outside the media elements by having the media element's
3445 layer act as a stacking context.
3447 Test: media/controls-layers.html
3449 * rendering/RenderLayer.cpp:
3450 (WebCore::RenderLayer::RenderLayer):
3451 * rendering/RenderLayer.h:
3453 2015-05-27 Andreas Kling <akling@apple.com>
3455 [WK2] Local storage areas should get torn down when they have no remaining references.
3456 <https://webkit.org/b/143339>
3457 <rdar://problem/20156436>
3459 Reviewed by Darin Adler.
3461 Add StorageArea::securityOrigin() implementations.
3463 * loader/EmptyClients.cpp:
3464 * storage/StorageArea.h:
3466 2015-05-27 Dean Jackson <dino@apple.com>
3468 img.currentSrc problem in strict mode with old picturefill
3469 https://bugs.webkit.org/show_bug.cgi?id=144095
3470 <rdar://problem/21087013>
3472 Reviewed by Simon Fraser.
3474 Add a PICTURE_SIZES flag. This allows us to easily remove the currentSrc
3475 attribute on HTMLImageElement, which is causing some issues with
3476 <picture> polyfills.
3478 * Configurations/FeatureDefines.xcconfig:
3479 * html/HTMLImageElement.cpp:
3480 (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate): Add guard around use of m_currentSrc.
3481 * html/HTMLImageElement.h:
3482 * html/HTMLImageElement.idl: Guard the currentSrc attribute.
3483 * html/parser/HTMLPreloadScanner.cpp:
3484 (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3485 (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
3487 2015-05-27 Daniel Bates <dabates@apple.com>
3489 Attempt to fix internal build following <http://trac.webkit.org/changeset/184760>
3490 (https://bugs.webkit.org/show_bug.cgi?id=145289)
3492 Reviewed by Jer Noble.
3494 * platform/spi/mac/AVFoundationSPI.h:
3496 2015-05-27 Jeremy Jones <jeremyj@apple.com>
3498 Refactor WebKit1 specific threading code out of WebVideoFullscreen code that is shared with WebKit2.
3499 https://bugs.webkit.org/show_bug.cgi?id=143954
3501 Reviewed by Darin Adler.
3503 WebVideoFullscreenInterfaceAVKit is used in both WebKit1 and WebKit2. In WebKit1, the model runs in the WebThread, while
3504 the interface is on the main thread. So there is code to dispatch between these two thread when communicating between the
3505 interface and the model. In WebKit2, this is handled automatically by the IPC mechanism. As a result, the threading code
3506 in WebVideoFullscreenbInterfaceAVKit and in WebVideoFullscreenModelVideoElement is redundant in WebKit2 and relies on
3507 WebThreadRun being a no-op in WebKit2.
3509 This change clarifies this and simplifies the WebKit2 path by moving the WebKit1 specific threading code into
3510 WebVideoFullscreenControllerContext, which is the WebKit1 specific controller.
3512 * platform/ios/WebVideoFullscreenControllerAVKit.mm:
3513 (WebVideoFullscreenControllerContext::WebVideoFullscreenControllerContext):
3514 (WebVideoFullscreenControllerContext::setController):
3515 (WebVideoFullscreenControllerContext::didSetupFullscreen):
3516 (WebVideoFullscreenControllerContext::didExitFullscreen):
3517 (WebVideoFullscreenControllerContext::didCleanupFullscreen):
3518 (WebVideoFullscreenControllerContext::fullscreenMayReturnToInline):
3519 (WebVideoFullscreenControllerContext::resetMediaState):
3520 (WebVideoFullscreenControllerContext::setDuration):
3521 (WebVideoFullscreenControllerContext::setCurrentTime):
3522 (WebVideoFullscreenControllerContext::setBufferedTime):
3523 (WebVideoFullscreenControllerContext::setRate):
3524 (WebVideoFullscreenControllerContext::setVideoDimensions):
3525 (WebVideoFullscreenControllerContext::setSeekableRanges):
3526 (WebVideoFullscreenControllerContext::setCanPlayFastReverse):
3527 (WebVideoFullscreenControllerContext::setAudioMediaSelectionOptions):
3528 (WebVideoFullscreenControllerContext::setLegibleMediaSelectionOptions):
3529 (WebVideoFullscreenControllerContext::setExternalPlayback):
3530 (WebVideoFullscreenControllerContext::play):
3531 (WebVideoFullscreenControllerContext::pause):
3532 (WebVideoFullscreenControllerContext::togglePlayState):
3533 (WebVideoFullscreenControllerContext::beginScrubbing):
3534 (WebVideoFullscreenControllerContext::endScrubbing):
3535 (WebVideoFullscreenControllerContext::seekToTime):
3536 (WebVideoFullscreenControllerContext::fastSeek):
3537 (WebVideoFullscreenControllerContext::beginScanningForward):
3538 (WebVideoFullscreenControllerContext::beginScanningBackward):
3539 (WebVideoFullscreenControllerContext::endScanning):
3540 (WebVideoFullscreenControllerContext::requestExitFullscreen):
3541 (WebVideoFullscreenControllerContext::setVideoLayerFrame):
3542 (WebVideoFullscreenControllerContext::setVideoLayerGravity):
3543 (WebVideoFullscreenControllerContext::selectAudioMediaOption):
3544 (WebVideoFullscreenControllerContext::selectLegibleMediaOption):
3545 (WebVideoFullscreenControllerContext::fullscreenModeChanged):
3546 (WebVideoFullscreenControllerContext::setupFullscreen):
3547 (WebVideoFullscreenControllerContext::exitFullscreen):
3548 (WebVideoFullscreenControllerContext::requestHideAndExitFullscreen):
3549 (-[WebVideoFullscreenController init]):
3550 (-[WebVideoFullscreenController dealloc]):
3551 (-[WebVideoFullscreenController enterFullscreen:mode:]):
3552 (-[WebVideoFullscreenController exitFullscreen]):
3553 (-[WebVideoFullscreenController requestHideAndExitFullscreen]):
3554 (-[WebVideoFullscreenController didFinishFullscreen:]):
3555 (WebVideoFullscreenControllerChangeObserver::setTarget): Deleted.
3556 (-[WebVideoFullscreenController didSetupFullscreen]): Deleted.
3557 (-[WebVideoFullscreenController didEnterFullscreen]): Deleted.
3558 (-[WebVideoFullscreenController didExitFullscreen]): Deleted.
3559 (-[WebVideoFullscreenController didCleanupFullscreen]): Deleted.
3560 (-[WebVideoFullscreenController fullscreenMayReturnToInline]): Deleted.
3561 * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
3562 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3563 (-[WebAVVideoLayer setBounds:]):
3564 (-[WebAVVideoLayer resolveBounds]):
3565 (WebVideoFullscreenInterfaceAVKit::resetMediaState):
3566 (WebVideoFullscreenInterfaceAVKit::setDuration):
3567 (WebVideoFullscreenInterfaceAVKit::setCurrentTime):
3568 (WebVideoFullscreenInterfaceAVKit::setBufferedTime):
3569 (WebVideoFullscreenInterfaceAVKit::setRate):
3570 (WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
3571 (WebVideoFullscreenInterfaceAVKit::setSeekableRanges):
3572 (WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse):
3573 (WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
3574 (WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
3575 (WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
3576 (WebVideoFullscreenInterfaceAVKit::setupFullscreen):
3577 (WebVideoFullscreenInterfaceAVKit::enterFullscreen):
3578 (WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard):
3579 (WebVideoFullscreenInterfaceAVKit::exitFullscreen):
3580 (WebVideoFullscreenInterfaceAVKit::exitFullscreenInternal):
3581 (WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
3582 (WebVideoFullscreenInterfaceAVKit::cleanupFullscreenInternal):
3583 (WebVideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen):
3584 (WebVideoFullscreenInterfaceAVKit::preparedToReturnToInline):
3585 (WebVideoFullscreenInterfaceAVKit::willStartOptimizedFullscreen):
3586 (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen):
3587 (WebVideoFullscreenInterfaceAVKit::willStopOptimizedFullscreen):
3588 (WebVideoFullscreenInterfaceAVKit::didStopOptimizedFullscreen):
3589 (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen):
3590 (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen):
3591 (WebVideoFullscreenInterfaceAVKit::setVideoLayerFrame):
3592 (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Deleted.
3593 * platform/ios/WebVideoFullscreenModel.h:
3594 * platform/ios/WebVideoFullscreenModelVideoElement.h:
3595 * platform/ios/WebVideoFullscreenModelVideoElement.mm:
3596 (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
3597 (WebVideoFullscreenModelVideoElement::play):
3598 (WebVideoFullscreenModelVideoElement::pause):
3599 (WebVideoFullscreenModelVideoElement::togglePlayState):
3600 (WebVideoFullscreenModelVideoElement::beginScrubbing):
3601 (WebVideoFullscreenModelVideoElement::endScrubbing):
3602 (WebVideoFullscreenModelVideoElement::seekToTime):
3603 (WebVideoFullscreenModelVideoElement::fastSeek):
3604 (WebVideoFullscreenModelVideoElement::beginScanningForward):
3605 (WebVideoFullscreenModelVideoElement::beginScanningBackward):
3606 (WebVideoFullscreenModelVideoElement::endScanning):
3607 (WebVideoFullscreenModelVideoElement::requestExitFullscreen):
3608 (WebVideoFullscreenModelVideoElement::fullscreenModeChanged):
3609 (WebVideoFullscreenModelVideoElement::videoLayerFrame): Deleted.
3610 (WebVideoFullscreenModelVideoElement::videoLayerGravity): Deleted.
3612 2015-05-27 Eric Carlson <eric.carlson@apple.com>
3614 [Mac] short-circuit MIME type lookup when possible
3615 https://bugs.webkit.org/show_bug.cgi?id=145362
3617 Reviewed by Jer Noble.
3619 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3620 (WebCore::isUnsupportedMIMEType): Renamed from unsupportedMIMEType. Convert type to lower case
3621 once instead of calling equalIgnoringCase many times.
3622 (WebCore::staticMIMETypeList): Renamed from staticMimeTypeCache. Initialize static set in a lambda,
3623 using an array of C strings in a loop.
3624 (WebCore::avfMIMETypes): Renamed from avfMimeTypeCache. Initialize static set in a lambda.
3625 (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): avfMimeTypeCache -> avfMIMETypes.
3626 (WebCore::keySystemIsSupported): equalIgnoringCase -> equalIgnoringASCIICase.
3627 (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Ditto.
3628 (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): unsupportedMIMEType ->
3629 isUnsupportedMIMEType, equalIgnoringCase -> equalIgnoringASCIICase, staticMimeTypeCache ->
3630 staticMIMETypeList, avfMimeTypeCache -> avfMIMETypes.
3631 (WebCore::unsupportedMIMEType): Deleted.
3632 (WebCore::staticMimeTypeCache): Deleted.
3633 (WebCore::avfMimeTypeCache): Deleted.
3635 2015-05-27 Eric Carlson <eric.carlson@apple.com>
3637 [Mac] short-circuit MIME type lookup when possible
3638 https://bugs.webkit.org/show_bug.cgi?id=145362
3640 Reviewed by Dean Jackson.
3642 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3643 (WebCore::unsupportedMIMEType): New, reject types known to not be supported.
3644 (WebCore::staticMimeTypeCache): Accept MIME types known to be supported.
3645 (WebCore::avfMimeTypeCache): Renamed from mimeTypeCache.
3646 (WebCore::MediaPlayerPrivateAVFoundationObjC::getSupportedTypes): mimeTypeCache -> staticMimeTypeCache.
3647 (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType): Return immediately if
3648 unsupportedMIMEType returns true, don't call AVFoundation if staticMimeTypeCache returns true.
3649 (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem): Ditto.
3650 (WebCore::mimeTypeCache): Deleted.
3652 2015-05-27 Eric Carlson <eric.carlson@apple.com>
3654 [Mac] occasional crash in MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest
3655 https://bugs.webkit.org/show_bug.cgi?id=145409
3657 Reviewed by Dean Jackson.
3659 * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
3660 (WebCore::WebCoreAVFResourceLoader::stopLoading): NULL-check m_avRequest.
3662 2015-05-26 Dean Jackson <dino@apple.com>
3664 Backdrop filters don't animate
3665 https://bugs.webkit.org/show_bug.cgi?id=145386
3666 <rdar://problem/21110037>
3668 Reviewed by Simon Fraser.
3670 Add support for animation of backdrop filters.
3672 Note that, at the moment, we can only animate/transition
3673 backdrop-filter if it is already present on the element. See
3674 https://bugs.webkit.org/show_bug.cgi?id=145107
3676 Test: css3/filters/backdrop/animation.html
3678 * page/animation/AnimationBase.h: Add m_backdropFilterFunctionListsMatch and backdropFilterFunctionListsMatch.
3679 (WebCore::AnimationBase::backdropFilterFunctionListsMatch):
3681 * page/animation/CSSPropertyAnimation.cpp:
3682 (WebCore::blendFunc): backdrop-filter is also supported.
3683 (WebCore::PropertyWrapperAcceleratedBackdropFilter::PropertyWrapperAcceleratedBackdropFilter): Added. Works
3684 similarly to the PropertyWrapperAcceleratedFilter.
3685 (WebCore::PropertyWrapperAcceleratedBackdropFilter::animationIsAccelerated):
3686 (WebCore::PropertyWrapperAcceleratedBackdropFilter::blend):
3687 (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Construct the
3688 PropertyWrapperAcceleratedBackdropFilter.
3690 * page/animation/ImplicitAnimation.cpp:
3691 (WebCore::ImplicitAnimation::reset): Call checkForMatchingBackdropFilterFunctionLists.
3692 (WebCore::ImplicitAnimation::validateTransformFunctionList): Fix typo.
3693 (WebCore::ImplicitAnimation::checkForMatchingFilterFunctionLists): Remove whitespace.
3694 (WebCore::ImplicitAnimation::checkForMatchingBackdropFilterFunctionLists): New method that
3695 checks if the individual filters in a filter list match.
3696 * page/animation/ImplicitAnimation.h: Add checkForMatchingBackdropFilterFunctionLists.
3698 * page/animation/KeyframeAnimation.cpp:
3699 (WebCore::KeyframeAnimation::KeyframeAnimation): Call checkForMatchingBackdropFilterFunctionLists.
3700 (WebCore::KeyframeAnimation::checkForMatchingBackdropFilterFunctionLists): Copied from
3701 checkForMatchingFilterFunctionLists, but calls backdropFilter() instead of filter().
3702 (WebCore::KeyframeAnimation::checkForMatchingFilterFunctionLists): This was accidentally checking
3703 for backdrop filters as well, but it wouldn't have worked.
3704 * page/animation/KeyframeAnimation.h: Add checkForMatchingBackdropFilterFunctionLists.
3706 * platform/graphics/GraphicsLayer.cpp:
3707 (WebCore::GraphicsLayer::validateFilterOperations): Modify the ASSERT to allow AnimatedPropertyWebkitBackdropFilter.
3708 * platform/graphics/GraphicsLayerClient.h: Add AnimatedPropertyWebkitBackdropFilter to the enum.
3710 * platform/graphics/ca/GraphicsLayerCA.cpp:
3711 (WebCore::propertyIdToString): Support new enum.
3712 (WebCore::GraphicsLayerCA::addAnimation): Support AnimatedPropertyWebkitBackdropFilter.
3713 (WebCore::GraphicsLayerCA::createFilterAnimationsFromKeyframes): Ditto.
3714 (WebCore::GraphicsLayerCA::animatedLayer): Use a switch statement now that we have more than
3715 two options, and handle AnimatedPropertyWebkitBackdropFilter.
3716 (WebCore::GraphicsLayerCA::updateAnimations): Deleted a blank line.
3718 * rendering/RenderLayerBacking.cpp:
3719 (WebCore::RenderLayerBacking::startAnimation): Support animation of backdrop-filter.
3720 (WebCore::RenderLayerBacking::startTransition): Ditto. Copied the code from the filter transition.
3721 (WebCore::RenderLayerBacking::graphicsLayerToCSSProperty):
3722 (WebCore::RenderLayerBacking::cssToGraphicsLayerProperty):
3723 * rendering/RenderLayerCompositor.cpp:
3724 (WebCore::RenderLayerCompositor::requiresCompositingForAnimation):
3726 2015-05-27 Jeremy Jones <jeremyj@apple.com>
3728 Handle case where -startOptimizedFullscreen fails.
3729 https://bugs.webkit.org/show_bug.cgi?id=145340
3731 Reviewed by Eric Carlson.
3733 Add new AVPlayerViewController delegate methods and remove old ones.
3734 -startOptimizedFullscreen can either fail silently because it is not allowed or it will call a delegate.
3735 We prevent silent failure by testing preconditions in enterFullscreenOptimized, and add the
3736 delegate -playerViewControllerFailedToStartOptimizedFullscreen to handle explicitly failure.
3738 * platform/ios/WebVideoFullscreenInterfaceAVKit.h: added/removed method declarations.
3739 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
3740 (-[WebAVPlayerController playerViewControllerFailedToStartOptimizedFullscreen:withError:]): Added.
3741 (WebVideoFullscreenInterfaceAVKit::enterFullscreenOptimized): Handle silent failure.
3742 (WebVideoFullscreenInterfaceAVKit::didStartOptimizedFullscreen): Hide window on main thread.
3743 (WebVideoFullscreenInterfaceAVKit::failedToStartOptimizedFullscreen): Added
3744 (-[WebAVPlayerController playerViewControllerWillCancelOptimizedFullscreen:]): Deleted.
3745 (-[WebAVPlayerController playerViewControllerDidCancelOptimizedFullscreen:]): Deleted.
3746 (WebVideoFullscreenInterfaceAVKit::willCancelOptimizedFullscreen): Deleted.
3747 (WebVideoFullscreenInterfaceAVKit::didCancelOptimizedFullscreen): Deleted.
3748 * platform/spi/cocoa/AVKitSPI.h: Remove dead SPI. Add isOptimizedFullscreenPossible.
3750 2015-05-27 Myles C. Maxfield <mmaxfield@apple.com>
3752 [iOS] Arabic ligatures are broken in Google Maps
3753 https://bugs.webkit.org/show_bug.cgi?id=145336
3754 <rdar://problem/20689607>
3756 Reviewed by Darin Adler.
3758 When we fall off the end of the font fallback list, we ask the platform for which particular font we should use
3759 to display a particular codepoint. When we do this, we supply the font which is first in the fallback list so
3760 that the platform can try to match it as best it can. However, web fonts' FontPlatformData have a null m_font
3761 property, which means that we were passing nullptr to this platform fallback function.
3763 The solution is something I've wanted to do for a while, which is migrate webfonts from using
3764 CGDataProviderCreateWithCFData() to using CTFontManagerCreateFontDescriptorFromData(). This call creates a
3765 CoreText font for an in-memory buffer (the old call was creating a CoreGraphics front from the same thing).
3766 This means that we can use the FontPlatformData constructor which accepts a CoreText font, thereby making web
3767 fonts not have a null m_font property. Note that not all platforms can use this call, which means that this
3768 new codepath is gated to only certain OSes (which is okay because only certain OSes use the
3769 CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage() call inside FontCache). Because web fonts are the
3770 only user of the constructor which just takes a CG font, we can make the constructor private to the
3771 FontPlatformData class (as soon as all platforms can use this new codepath).
3773 Test: platform/ios-simulator/fast/text/arabic-with-no-supporting-webfont.html
3775 * platform/graphics/FontPlatformData.h: Make the FontPlatformData constructor which takes a CGFontRef private.
3776 * platform/graphics/mac/FontCustomPlatformData.cpp:
3777 (WebCore::FontCustomPlatformData::fontPlatformData): Use the CoreText type instead of the CoreGraphics type.
3778 (WebCore::createFontCustomPlatformData): Migrate to CTFontManagerCreateFontDescriptorFromData().
3779 * platform/graphics/mac/FontCustomPlatformData.h:
3780 (WebCore::FontCustomPlatformData::FontCustomPlatformData): Store a CTFontDescriptorRef instead of a CGFontRef.
3782 2015-05-26 Said Abou-Hallawa <sabouhallawa@apple.com>
3784 An SVG with no intrinsic size does not draw correct slices when used as a border-image for an HTML element.
3785 https://bugs.webkit.org/show_bug.cgi?id=139405
3787 Reviewed by Darin Adler.
3789 When using a non-intrinsic-sized image as an image-border, all the source
3790 slices have to be extracted from the top-left corner of the source image.
3791 This is because the right and bottom sides of the image can not be known.
3792 Also all the slices should not be stretched. In other words, the sizes of
3793 source slices for a non-intrinsic-sized image should be equal to the sizes
3794 of the destination container slices.
3796 This is not compliant with the css3 w3c specs. I think the specs makes it
3797 harder to predict what exactly will be drawn for the image-border in this
3798 case. See http://www.w3.org/TR/css3-background/#border-image-slice. This
3799 approach is implemented by FireFox. And I think it gives a more predictable
3800 rendering for image-border in the case of non-intrinsic-sized images.
3802 Test: fast/borders/border-image-fill-no-intrinsic-size.html
3805 * WebCore.vcxproj/WebCore.vcxproj:
3806 * WebCore.vcxproj/WebCore.vcxproj.filters:
3807 * WebCore.xcodeproj/project.pbxproj:
3808 * platform/LengthBox.cpp: Removed.
3809 * platform/graphics/LayoutBoxExtent.cpp: Removed.
3810 * platform/graphics/LayoutBoxExtent.h: Removed.
3811 * platform/graphics/LayoutRect.h:
3812 Delete LengthBox.cpp and move all the functionalities to LengthBox.h.
3813 Delete LayoutBoxExtent.cpp since it is the same class as LengthBox.
3815 * css/CSSProperty.cpp:
3816 * platform/text/WritingMode.h:
3817 Move the enums LogicalBoxSide and PhysicalBoxSide
3818 from CSSProperty.cpp to WritingMode.h so it can be used by other classes.
3820 * css/CSSToStyleMap.cpp:
3821 (WebCore::CSSToStyleMap::mapNinePieceImageSlice):
3822 (WebCore::CSSToStyleMap::mapNinePieceImageQuad):
3823 * css/CSSToStyleMap.h:
3824 * inspector/InspectorOverlay.cpp:
3825 (WebCore::buildRendererHighlight):
3826 * rendering/InlineFlowBox.cpp:
3827 (WebCore::InlineFlowBox::addBorderOutsetVisualOverflow):
3828 * rendering/RenderBox.h:
3829 (WebCore::RenderBox::marginLogicalLeft):
3830 (WebCore::RenderBox::marginLogicalRight):
3831 (WebCore::RenderBox::setMarginBefore):
3832 (WebCore::RenderBox::setMarginAfter):
3833 (WebCore::RenderBox::setMarginStart):
3834 (WebCore::RenderBox::setMarginEnd):
3835 * rendering/style/RenderStyle.cpp:
3836 (WebCore::RenderStyle::setClip):
3837 (WebCore::RenderStyle::noneDashboardRegions):
3838 * rendering/style/RenderStyle.h:
3839 Use the new BoxExtent access methods for getting and settings the sides of
3840 LengthBox and LayoutBoxExtent.
3842 * platform/LengthBox.h:
3843 (WebCore::BoxExtent::BoxExtent):
3844 (WebCore::BoxExtent::at):
3845 (WebCore::BoxExtent::top):
3846 (WebCore::BoxExtent::right):
3847 (WebCore::BoxExtent::bottom):
3848 (WebCore::BoxExtent::left):
3849 (WebCore::BoxExtent::setAt):
3850 (WebCore::BoxExtent::setTop):
3851 (WebCore::BoxExtent::setRight):
3852 (WebCore::BoxExtent::setBottom):
3853 (WebCore::BoxExtent::setLeft):
3854 (WebCore::BoxExtent::before):
3855 (WebCore::BoxExtent::end):
3856 (WebCore::BoxExtent::after):
3857 (WebCore::BoxExtent::start):
3858 (WebCore::BoxExtent::setBefore):
3859 (WebCore::BoxExtent::setEnd):
3860 (WebCore::BoxExtent::setAfter):
3861 (WebCore::BoxExtent::setStart):
3862 (WebCore::BoxExtent::operator==):
3863 (WebCore::BoxExtent::operator!=):
3864 (WebCore::LengthBox::LengthBox):
3865 (WebCore::LengthBox::isZero):
3866 (WebCore::LengthBox::left): Deleted.
3867 (WebCore::LengthBox::right): Deleted.
3868 (WebCore::LengthBox::top): Deleted.
3869 (WebCore::LengthBox::bottom): Deleted.
3870 (WebCore::LengthBox::operator==): Deleted.
3871 (WebCore::LengthBox::operator!=): Deleted.
3872 (WebCore::LengthBox::nonZero): Deleted.
3873 Define a new template class for 'BoxExtent'. A 'BoxExtent' represents the
3874 extent of four sides of a box. Use this class template to define the exiting
3875 classes 'LengthBox' and 'LayoutBoxExtent'. Use it also to and define the
3876 new class FloatBoxExtent
3878 * rendering/RenderBoxModelObject.cpp:
3879 (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
3880 * rendering/RenderBoxModelObject.h:
3881 (WebCore::RenderBoxModelObject::calculateFillTileSize):
3882 * rendering/RenderListMarker.cpp:
3883 (WebCore::RenderListMarker::updateContent):
3884 * rendering/shapes/ShapeOutsideInfo.cpp:
3885 (WebCore::ShapeOutsideInfo::createShapeForImage):
3886 Change the return value of calculateImageIntrinsicDimensions() to be a
3887 bool which indicates whether the image has an intrinsic size or not. Add
3888 a new reference argument to this function receive the resolved image size.
3890 (WebCore::RenderBoxModelObject::paintNinePieceImage): Move all the painting
3891 code of this function to NinePieceImage::paint()
3893 (WebCore::computeBorderImageSide): Deleted.
3894 Renamed to be NinePieceImage::computeSlice().
3896 * rendering/style/BorderData.h:
3897 (WebCore::BorderData::borderWidth): Add a new method to return the extents
3898 of the border in a FloatBoxExtent.
3900 * rendering/style/NinePieceImage.cpp:
3901 (WebCore::NinePieceImage::computeSlice): Moved from NinePieceImage::computeSlice().
3903 (WebCore::NinePieceImage::computeSlices): The first version of this function
3904 computes the slices given their lengths. The slices have to be clamped to
3905 the container size. The second version of this function computes the slices
3906 given their lengths, their actual extents and their source slices.
3908 (WebCore::NinePieceImage::scaleSlicesIfNeeded): Reduce the slices if they
3911 (WebCore::NinePieceImage::isEmptyPieceRect): Returns true if an ImagePiece
3912 should not be drawn.
3914 (WebCore::NinePieceImage::horizontalTileRules):
3915 (WebCore::NinePieceImage::verticalTileRules):
3916 Fill vectors of tiling rules to be passed to GraphicsContext::drawTiledImage()
3918 (WebCore::NinePieceImage::computeIntrinsicRects): Computes the nine pieces
3919 rectangles for an intrinsic-sized container.
3921 (WebCore::NinePieceImage::computeNonIntrinsicRects): Computes the nine
3922 pieces rectangles for an non-intrinsic-sized source image. The computed
3923 rectangles have to start at (0, 0) and their sizes should be equal to
3924 the sizes of the nine pieces rectangles of the destination container.
3926 (WebCore::NinePieceImage::computeIntrinsicSideTileScale):
3927 (WebCore::NinePieceImage::computeIntrinsicMiddleTileScale):
3928 (WebCore::NinePieceImage::computeIntrinsicTileScales):
3929 (WebCore::NinePieceImage::computeNonIntrinsicTileScales):
3930 Computes the scaling factors for drawing the tiles. For non-intrinsic source
3931 images, there should not be any scaling factors.
3933 (WebCore::NinePieceImage::paint): Moved from RenderBoxModelObject::paintNinePieceImage()
3934 but simplified and restructured.
3936 (WebCore::NinePieceImageData::NinePieceImageData): Use nullptr instead of 0.
3938 * rendering/style/NinePieceImage.h:
3939 (WebCore::operator++):
3940 (WebCore::isCornerPiece):
3941 (WebCore::isMiddlePiece):
3942 (WebCore::imagePieceHorizontalSide):
3943 (WebCore::imagePieceVerticalSide):
3944 Add helper functions for the enum ImagePiece.
3946 2015-05-26 Andreas Kling <akling@apple.com>
3948 <font face> doesn't support plus character in font family names.
3949 <https://webkit.org/b/145400>
3950 <rdar://problem/21097484>
3952 Reviewed by Darin Adler.
3954 Turn CSSParser::parseFontFaceValue() into a fast-path parser for
3955 <font face> attributes.
3956 Going through the full CSS parser was hurting us here, as it would
3957 misunderstand unquoted family names and choke on e.g '+'.
3959 Test: fast/dom/HTMLFontElement/face-attribute.html
3961 * css/CSSParser.cpp:
3962 (WebCore::CSSParser::parseFontFaceValue):
3964 2015-05-26 Chris Fleizach <cfleizach@apple.com>
3966 AX: display:none content exposed to accessibility when aria-hidden is toggled on ancestor element