1 2015-04-08 Bem Jones-Bey <bjonesbe@adobe.com>
3 [CSS Shapes] Properly handle negative reference box widths and center coordinates
4 https://bugs.webkit.org/show_bug.cgi?id=142610
8 Fix a few cases where values that should not be negative end up that
11 This patch is based on a couple of Blink patches by Rob Buis.
13 Tests: fast/shapes/shape-outside-floats/shape-outside-floats-circle-negative-radius-crash.html
14 fast/shapes/shape-outside-floats/shape-outside-floats-ellipse-negative-width-crash.html
16 * rendering/shapes/ShapeOutsideInfo.cpp:
17 (WebCore::ShapeOutsideInfo::computeDeltasForContainingBlockLine): A
18 negative margin box width means that the shape has no extent, so
20 * rendering/style/BasicShapes.cpp:
21 (WebCore::BasicShapeCircle::floatValueForRadiusInBox): When computing
22 the radii, take the absolute value, since the radii is based on
23 the distance, which is always positive.
24 (WebCore::BasicShapeEllipse::floatValueForRadiusInBox): Ditto.
26 2015-04-08 Commit Queue <commit-queue@webkit.org>
28 Unreviewed, rolling out r182522.
29 https://bugs.webkit.org/show_bug.cgi?id=143529
31 Not needed any more (Requested by ap on #webkit).
36 http://trac.webkit.org/changeset/182522
38 2015-04-08 Beth Dakin <bdakin@apple.com>
40 Force events should not require preventDefault in order to fire
41 https://bugs.webkit.org/show_bug.cgi?id=143503
43 rdar://problem/20458916
45 Reviewed by Tim Horton.
47 Since these events will fire whether or not preventDefault was set on the
48 willBegin event, we should make sure we only send them when there are registered
49 event listeners. These are new events, so we don’t want to spam the vast majority
50 of web content that doesn’t use them yet.
52 (WebCore::Document::addListenerTypeIfNeeded):
55 (WebCore::Element::dispatchMouseForceWillBegin):
56 (WebCore::Element::dispatchMouseForceChanged):
57 (WebCore::Element::dispatchMouseForceDown):
58 (WebCore::Element::dispatchMouseForceUp):
59 (WebCore::Element::dispatchMouseForceClick):
60 (WebCore::Element::dispatchMouseForceCancelled):
62 2015-04-08 Jer Noble <jer.noble@apple.com>
64 [Mac][WebAudio] Update the AVAudioMix in the AudioSourceProviderAVFObjC when the list of enabled audio tracks change.
65 https://bugs.webkit.org/show_bug.cgi?id=143332
67 Reviewed by Eric Carlson.
69 Some media assets (notably, mp3s) will not have an enabled audio track when the AVAsset is
70 first loaded, so the AVAudioMix will have no trackID in it's parameters. Whenever the list
71 of enabled tracks change, recreate the AVAudioMix with the new first enabled audio trackID.
73 To facilitate this, add a new setter to AudioSourceProviderAVFObjC taking an AVAssetTrack to
74 use with the AVAudioMix. Whenever this parameter changes, the AVAudioMix is destroyed and
77 * html/HTMLMediaElement.cpp:
78 (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): Drive-by fix: when the media
79 player switches engines, re-associate the audio source node with its provider.
80 * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h:
81 * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm:
82 (WebCore::AudioSourceProviderAVFObjC::setPlayerItem): Only create the mix if there is a valid AVPlayerItem and AVAssetTrack
83 (WebCore::AudioSourceProviderAVFObjC::setAudioTrack): Ditto.
84 (WebCore::AudioSourceProviderAVFObjC::createMix): Don't iterate over the AVPlayerItem's tracks,
85 just use the one passed in through setAudioTrack().
86 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
87 (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Clear the provider's track.
88 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Set the provider's track.
89 (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Ditto.
90 (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider): Ditto.
92 2015-04-08 Anders Carlsson <andersca@apple.com>
94 Move some ApplicationCache static member functions to ApplicationCacheStorage
95 https://bugs.webkit.org/show_bug.cgi?id=143524
97 Reviewed by Antti Koivisto.
99 This is yet another step towards eliminating ApplicationCacheStorage::singleton() and making the storage be per page instead.
101 * loader/appcache/ApplicationCache.cpp:
102 (WebCore::ApplicationCache::deleteCacheForOrigin):
103 (WebCore::ApplicationCache::deleteAllCaches):
104 (WebCore::ApplicationCache::diskUsageForOrigin):
105 * loader/appcache/ApplicationCacheStorage.cpp:
106 (WebCore::ApplicationCacheStorage::deleteAllCaches):
107 (WebCore::ApplicationCacheStorage::deleteCacheForOrigin):
108 (WebCore::ApplicationCacheStorage::diskUsageForOrigin):
109 * loader/appcache/ApplicationCacheStorage.h:
111 2015-04-08 ChangSeok Oh <changseok.oh@collabora.com>
113 Fill list style background with same color with that of list background.
114 https://bugs.webkit.org/show_bug.cgi?id=143483
116 Reviewed by Simon Fraser.
118 LayoutListMarker does not have a node so its selectionBackgroundColor alway returns
119 the default theme color for selection. We can make it more natural by filling
120 the same color with that of LayoutListItem into it.
122 Tests: fast/backgrounds/selection-background-color-of-image-list-style.html
123 fast/backgrounds/selection-background-color-of-list-style.html
125 * rendering/RenderListMarker.cpp:
126 (WebCore::RenderListMarker::paint):
128 2015-04-08 Alex Christensen <achristensen@webkit.org> and Patrick Gansterer <paroga@webkit.org>
130 Add CMake build system for WinCairo port.
131 https://bugs.webkit.org/show_bug.cgi?id=115944
133 Reviewed by Chris Dumez.
137 * PlatformWinCairo.cmake:
138 * platform/graphics/texmap/TextureMapperGL.cpp:
139 (WebCore::TextureMapperGL::TextureMapperGL):
141 2015-04-08 Chris Dumez <cdumez@apple.com>
143 Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for clarity
144 https://bugs.webkit.org/show_bug.cgi?id=143513
146 Reviewed by Andreas Kling.
148 Rename ActiveDOMObject::canSuspend() to canSuspendForPageCache() for
149 clarity as it is only used for the page cache. Also rename the
150 'DocumentWillBecomeInactive' value of the ReasonForSuspension enum to
151 'PageCache' as it is only used by CachedFrame for the page cache and it
152 is a lot more understandable.
154 2015-04-08 Commit Queue <commit-queue@webkit.org>
156 Unreviewed, rolling out r182536.
157 https://bugs.webkit.org/show_bug.cgi?id=143523
159 Made accessibility/table-sections.html time out on debug bots
160 (Requested by ap on #webkit).
164 "Simple line layout: Add <br> support."
165 https://bugs.webkit.org/show_bug.cgi?id=139012
166 http://trac.webkit.org/changeset/182536
168 2015-04-08 Carlos Garcia Campos <cgarcia@igalia.com>
170 [GTK] Crash in DOMObjectCache when a wrapped object owned by the cache is unreffed by the user
171 https://bugs.webkit.org/show_bug.cgi?id=143521
173 Reviewed by Martin Robinson.
175 This is a case we claim to support, but it only works if the
176 object has only one reference. In that case, when the user unrefs
177 it, the weak ref notify callback removes the object from the
178 cache. However, if the object has more than one ref, the cache
179 doesn't know the user unreffed it, and when clearing the cache we
180 try to remove more references than what the object actually has,
181 causing a crash in g_object_unref.
183 * bindings/gobject/DOMObjectCache.cpp:
184 (WebKit::DOMObjectCacheData::clearObject):
186 2015-04-08 Zalan Bujtas <zalan@apple.com>
188 Simple line layout: Add <br> support.
189 https://bugs.webkit.org/show_bug.cgi?id=139012
191 This patch enables RenderBlockFlows to use simple line layout on text content when <br> is present.
192 Simple text with <br> is a fairly common pattern on discussion(forum)-like web pages. This patch reduces memory usage
193 and speeds up layout for such content.
195 PerformanceTest/layout/line-layout-simple.html shows more than 2x speedup, when each paragraph is modified by appending <br> to the end.
196 With <br> support enabled:
197 mean: 70.02391461289068 runs/s
198 median: 70.47986488932318 runs/s
200 While with <br> support disabled:
201 mean: 30.417295049468184 runs/s
202 median: 30.36517778760357 runs/s
204 Reviewed by Antti Koivisto.
206 Test: fast/text/simple-line-with-br.html
208 * editing/TextIterator.cpp:
209 (WebCore::TextIterator::handleTextNode):
210 * rendering/RenderBlock.h:
211 * rendering/RenderBlockFlow.cpp:
212 (WebCore::RenderBlockFlow::setSelectionState):
213 (WebCore::RenderBlockFlow::deleteLineBoxesBeforeSimpleLineLayout):
214 * rendering/RenderBlockFlow.h:
215 * rendering/RenderLineBreak.cpp:
216 (WebCore::simpleLineLayout):
217 (WebCore::ensureLineBoxes):
218 (WebCore::RenderLineBreak::deleteLineBoxesBeforeSimpleLineLayout):
219 (WebCore::RenderLineBreak::positionForPoint):
220 (WebCore::RenderLineBreak::setSelectionState):
221 (WebCore::RenderLineBreak::linesBoundingBox):
222 (WebCore::RenderLineBreak::absoluteRects):
223 (WebCore::RenderLineBreak::absoluteQuads):
224 (WebCore::RenderLineBreak::collectSelectionRects):
225 * rendering/RenderLineBreak.h:
226 * rendering/SimpleLineLayout.cpp:
227 (WebCore::SimpleLineLayout::canUseFor):
228 (WebCore::SimpleLineLayout::LineState::removeTrailingWhitespace):
229 (WebCore::SimpleLineLayout::removeTrailingWhitespace):
230 (WebCore::SimpleLineLayout::consumeLineBreakIfNeeded):
231 (WebCore::SimpleLineLayout::skipWhitespaceIfNeeded):
232 (WebCore::SimpleLineLayout::firstFragment):
233 (WebCore::SimpleLineLayout::forceFragmentToLine):
234 (WebCore::SimpleLineLayout::createLineRuns):
235 (WebCore::SimpleLineLayout::create):
236 * rendering/SimpleLineLayoutFlowContents.cpp:
237 (WebCore::SimpleLineLayout::initializeSegments):
238 (WebCore::SimpleLineLayout::FlowContents::segmentForRenderer): Deleted.
239 * rendering/SimpleLineLayoutFlowContents.h:
240 * rendering/SimpleLineLayoutFunctions.cpp:
241 (WebCore::SimpleLineLayout::paintFlow):
242 (WebCore::SimpleLineLayout::hitTestFlow):
243 (WebCore::SimpleLineLayout::showLineLayoutForFlow):
244 * rendering/SimpleLineLayoutResolver.cpp:
245 (WebCore::SimpleLineLayout::RunResolver::Run::rect):
246 (WebCore::SimpleLineLayout::RunResolver::RunResolver):
247 (WebCore::SimpleLineLayout::RunResolver::rangeForRenderer):
248 * rendering/SimpleLineLayoutResolver.h:
249 (WebCore::SimpleLineLayout::RunResolver::Iterator::inQuirksMode):
250 (WebCore::SimpleLineLayout::RunResolver::Iterator::operator--):
251 * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
252 (WebCore::SimpleLineLayout::EndOfSegmentSetter::EndOfSegmentSetter):
253 (WebCore::SimpleLineLayout::EndOfSegmentSetter::~EndOfSegmentSetter):
254 (WebCore::SimpleLineLayout::TextFragmentIterator::nextTextFragment):
255 (WebCore::SimpleLineLayout::TextFragmentIterator::revertToFragment):
256 (WebCore::SimpleLineLayout::TextFragmentIterator::skipToNextPosition):
257 * rendering/SimpleLineLayoutTextFragmentIterator.h:
258 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLastInRenderer):
259 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isLineBreak):
260 (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragment::isEmpty):
261 (WebCore::SimpleLineLayout::TextFragmentIterator::isSoftLineBreak):
262 (WebCore::SimpleLineLayout::TextFragmentIterator::isHardLineBreak):
263 (WebCore::SimpleLineLayout::TextFragmentIterator::isLineBreak): Deleted.
265 2015-04-08 Philippe Normand <pnormand@igalia.com>
267 [GStreamer] compress property for the HTTP source element
268 https://bugs.webkit.org/show_bug.cgi?id=143518
270 Reviewed by Carlos Garcia Campos.
272 Added a compress property so the default behavior or not
273 requesting content encoded to the server can be overridden if
274 needed. This is useful for adaptive streaming playback.
276 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
277 (webKitWebSrcSetProperty):
278 (webKitWebSrcGetProperty):
281 2015-04-08 Joonghun Park <jh718.park@samsung.com>
283 Remove CSS functions min() and max() which had been dropped from specification
284 https://bugs.webkit.org/show_bug.cgi?id=143440
286 Reviewed by Darin Adler.
288 No new tests, No Behavior changes.
290 * css/CSSCalculationValue.cpp:
291 (WebCore::CSSCalcValue::create):
293 (WebCore::CSSParser::isCalculation):
295 2015-04-07 Philippe Normand <pnormand@igalia.com>
297 [GStreamer] extra-headers and keep-alive properties for HTTP source element
298 https://bugs.webkit.org/show_bug.cgi?id=143480
300 Reviewed by Carlos Garcia Campos.
302 Keep the resource loader around when persistent HTTP connection
303 support is enabled. The keep-alive property is set to false by
304 default. Also before sending the HTTP request we now check the
305 contents of the extra-headers GstStructure and set additional
306 headers based on the structure contents.
308 Patch inspired by GStreamer's souphttpsrc element.
310 * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
311 (webkit_web_src_init):
312 (webKitWebSrcFinalize):
313 (webKitWebSrcSetProperty):
314 (webKitWebSrcGetProperty):
315 (webKitWebSrcStop): Clear resource loader only for non-persistent connections.
316 (webKitWebSrcSetExtraHeader): Utility function to append headers
317 to an existing request based on a GValue contents.
318 (webKitWebSrcProcessExtraHeaders): Parse a GValue and set headers
319 based on its contents.
320 (webKitWebSrcStart): Extra headers and persistent connection
321 support. The resource loader is now lazily initialized here.
323 2015-04-07 Simon Fraser <simon.fraser@apple.com>
327 * platform/graphics/cocoa/FontCascadeCocoa.mm:
328 (WebCore::FontCascade::drawGlyphs):
329 * platform/spi/cg/CoreGraphicsSPI.h:
331 2015-04-07 Chris Dumez <cdumez@apple.com>
333 Unreviewed, another iOS build fix after r182516.
335 I missed another use of __MAC_OS_X_VERSION_MIN_REQUIRED without a
338 * platform/graphics/cocoa/FontCascadeCocoa.mm:
340 2015-04-07 Michael Peechatt <mpeechatt@gmail.com>
342 Bug 142887 - role progress bar does not support indeterminate state
343 https://bugs.webkit.org/show_bug.cgi?id=142887
345 Reviewed by Chris Fleizach.
347 Test: platform/mac/accessibility/progressbar-indeterminate.html
349 * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
350 (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
351 When getting min or max value of an indeterminate progress indicator, return 0.
352 This is so VoiceOver will recognize it as indeterminate.
354 2015-04-07 Chris Dumez <cdumez@apple.com>
356 Unreviewed, speculative iOS build fix after r182516.
358 Add #if PLATFORM(MAC) checks.
360 * platform/spi/cg/CoreGraphicsSPI.h:
362 2015-04-07 Simon Fraser <simon.fraser@apple.com>
364 Try to fix incremental builds by forcing *InternalSettings* to get
367 * testing/InternalSettings.idl:
369 2015-04-07 Chris Dumez <cdumez@apple.com>
371 Open WebSockets should not prevent a page from entering PageCache
372 https://bugs.webkit.org/show_bug.cgi?id=143505
373 <rdar://problem/19923085>
375 Reviewed by Alexey Proskuryakov.
377 Open WebSockets should not prevent a page from entering PageCache. This
378 is currently causing mobile.nytimes.com to not be page-cacheable.
380 In this patch, We close open WebSockets when entering the page cache
381 and fire the "close" events after resuming, similarly to what we did
382 for XMLHttpRequest in r181480. This gives a chance for the content to
383 handle the 'close' event (with wasClean being false and code being
384 1006) in order to reopen the connection if necessary.
386 Test: http/tests/websocket/tests/hybi/closed-when-entering-page-cache.html
388 * Modules/websockets/WebSocket.cpp:
389 (WebCore::WebSocket::WebSocket):
390 (WebCore::WebSocket::canSuspend):
391 (WebCore::WebSocket::suspend):
392 (WebCore::WebSocket::resume):
393 (WebCore::WebSocket::resumeTimerFired):
394 (WebCore::WebSocket::didClose):
395 * Modules/websockets/WebSocket.h:
397 2015-04-07 Simon Fraser <simon.fraser@apple.com>
399 Add experimental code to use custom font dilation when rendering into non-opaque contexts
400 https://bugs.webkit.org/show_bug.cgi?id=143508
402 Reviewed by Sam Weinig.
404 Add GraphicsContext::setAntialiasedFontDilationEnabled(), and set it to true
405 when rendering into a compositing layer which is not opaque (at the same location
406 where we disable font smoothing).
408 If Settings::antialiasedFontDilationEnabled() is true, when rendering non-smoothed
409 text (and if CSS hasn't opted into antialiased mode), use custom font dilation
410 parameters, chosen using a light/medium/dark heuristic, to make this text
411 match more closely with LCD-smoothed text.
414 (WebCore::Settings::Settings):
415 (WebCore::Settings::setAntialiasedFontDilationEnabled): Set global state
416 in FontCascade (which can't easily get at Settings). This it not ideal,
419 (WebCore::Settings::antialiasedFontDilationEnabled):
420 * page/Settings.in: Can't autogenerate this setting any more.
421 * platform/graphics/FontCascade.cpp:
422 (WebCore::FontCascade::setAntialiasedFontDilationEnabled): Set the global.
423 (WebCore::FontCascade::antialiasedFontDilationEnabled):
424 * platform/graphics/FontCascade.h:
425 * platform/graphics/GraphicsContext.cpp:
426 (WebCore::GraphicsContext::setAntialiasedFontDilationEnabled): Set graphics state
427 to say that we should do dilation of antialiased text.
428 * platform/graphics/GraphicsContext.h:
429 (WebCore::GraphicsContextState::GraphicsContextState):
430 (WebCore::GraphicsContext::antialiasedFontDilationEnabled):
431 * platform/graphics/ca/mac/PlatformCALayerMac.mm:
432 (PlatformCALayer::drawLayerContents): If the layer is not opaque, enable the
433 dilated text code path.
434 * platform/graphics/cocoa/FontCascadeCocoa.mm:
435 (WebCore::dilationSizeForTextColor): Heuristic (values chosen empirically) to
436 computed custom dilation based on foreground color.
437 (WebCore::FontCascade::drawGlyphs): Set the custom dilation parameters, and the
438 antialiasing state if we're not doing smoothing, and CSS hasn't opted into the
440 * platform/spi/cg/CoreGraphicsSPI.h: New SPI.
442 2015-04-07 Commit Queue <commit-queue@webkit.org>
444 Unreviewed, rolling out r182511.
445 https://bugs.webkit.org/show_bug.cgi?id=143507
447 caused debug test failures (Requested by alexchristensen on
452 "Block popups from content extensions."
453 https://bugs.webkit.org/show_bug.cgi?id=143497
454 http://trac.webkit.org/changeset/182511
456 2015-04-07 Myles C. Maxfield <mmaxfield@apple.com>
458 [Cocoa] System fonts do not get correct tracking
459 https://bugs.webkit.org/show_bug.cgi?id=143395
461 Reviewed by Ryosuke Niwa.
463 Inside FontPlatformData, we have two CTFonts. If the user has specified
464 -webkit-system-font, we will pass in a CTFont, and the FontPlatformData
465 will wrap it. However, we will then roundtrip through CGFont in order
466 to create a second CTFont. We were basing our tracking and system
467 font knowledge off of this round-tripped font instead of the original font.
469 Note that this design is terrible and needs to be overhauled.
470 FontPlatformData should only have a single platform font inside it.
472 This patch also caches whether or not a font is a system font.
474 No new tests because it is impossible to test the tracking of the
475 system font in a robust way.
477 * platform/graphics/Font.cpp:
478 (WebCore::Font::Font): Rearrange member variables.
479 * platform/graphics/Font.h: Move member variables around for better
480 packing, and cache whether or not the font is a system font.
481 * platform/graphics/FontData.h: Add comment
482 * platform/graphics/cocoa/FontCocoa.mm:
483 (WebCore::Font::platformInit): Cache whether or not the font is a system
485 (WebCore::hasCustomTracking): Use cached value.
486 (WebCore::canUseFastGlyphAdvanceGetter):
487 (WebCore::Font::platformWidthForGlyph):
489 2015-04-07 Alex Christensen <achristensen@webkit.org>
491 Block popups from content extensions.
492 https://bugs.webkit.org/show_bug.cgi?id=143497
494 Reviewed by Brady Eidson.
496 Test: http/tests/contentextensions/popups.html
498 * loader/ResourceLoadInfo.cpp:
499 (WebCore::readResourceType):
500 * loader/ResourceLoadInfo.h:
501 * page/DOMWindow.cpp:
502 (WebCore::DOMWindow::open):
503 * page/UserContentController.cpp:
504 (WebCore::UserContentController::actionsForResourceLoad):
505 * page/UserContentController.h:
506 Check content extensions before opening a window.
508 2015-04-07 Benjamin Poulain <benjamin@webkit.org>
510 Get the features.json files ready for open contributions
511 https://bugs.webkit.org/show_bug.cgi?id=143436
513 Reviewed by Darin Adler.
517 2015-04-07 Alex Christensen <achristensen@webkit.org>
519 More unreviewed fixing API tests.
521 * contentextensions/ContentExtensionsBackend.cpp:
522 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
523 Don't check for javascript protocol.
525 2015-04-07 Eric Carlson <eric.carlson@apple.com>
527 [Mac] never update caption user style sheet during parsing
528 https://bugs.webkit.org/show_bug.cgi?id=143499
530 Reviewed by Jer Noble.
532 * page/CaptionUserPreferencesMediaAF.cpp:
533 (WebCore::CaptionUserPreferencesMediaAF::setInterestedInCaptionPreferenceChanges):
534 (WebCore::CaptionUserPreferencesMediaAF::captionPreferencesChanged): Ignore a
535 "preferences changed" notification fired while registering for said notification, we
536 already create and insert the style sheet after a brief delay anyway.
537 * page/CaptionUserPreferencesMediaAF.h:
539 2015-04-07 Alex Christensen <achristensen@webkit.org>
541 [Win] Unreviewed build fix after r182494.
543 * platform/win/ContextMenuItemWin.cpp:
544 (WebCore::ContextMenuItem::ContextMenuItem): Deleted.
546 2015-04-07 Alex Christensen <achristensen@webkit.org>
548 Unreviewed fixing API tests.
550 * contentextensions/ContentExtensionsBackend.cpp:
551 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
553 (WebCore::URL::init):
555 (WebCore::URL::protocolIsData):
556 (WebCore::URL::protocolIsJavaScript): Deleted.
557 Revert part of r182492 that changed URL.h.
559 2015-04-07 Anders Carlsson <andersca@apple.com>
561 More work on making the application cache storage be per page
562 https://bugs.webkit.org/show_bug.cgi?id=143498
564 Reviewed by Andreas Kling.
566 * loader/appcache/ApplicationCacheStorage.cpp:
567 (WebCore::ApplicationCacheStorage::create):
568 (WebCore::ApplicationCacheStorage::singleton):
569 * loader/appcache/ApplicationCacheStorage.h:
571 (WebCore::Page::Page):
573 (WebCore::Page::applicationCacheStorage):
574 * page/PageConfiguration.cpp:
575 (WebCore::PageConfiguration::PageConfiguration): Deleted.
576 * page/PageConfiguration.h:
578 2015-04-07 Matthew Mirman <mmirman@apple.com>
580 Source and stack information should get appended only to native errors
581 and should be added directly after construction rather than when thrown.
582 This fixes frozen objects being unfrozen when thrown while conforming to
583 ecma script standard and other browser behavior.
584 rdar://problem/19927293
585 https://bugs.webkit.org/show_bug.cgi?id=141871
587 Reviewed by Geoffrey Garen.
589 Covered by existing tests.
591 Sets line, column, source and stack information for DOMExceptions as
592 expected by the webinspector for native errors.
594 * bindings/js/JSDOMBinding.cpp:
595 (WebCore::setDOMException):
597 2015-04-07 Brady Eidson <beidson@apple.com>
599 ContextMenuItem refactoring
600 https://bugs.webkit.org/show_bug.cgi?id=143485
602 Reviewed by Beth Dakin.
604 * platform/ContextMenuItem.h:
605 (WebCore::ContextMenuItem::isNull):
607 * platform/gtk/ContextMenuItemGtk.cpp:
608 (WebCore::ContextMenuItem::ContextMenuItem):
610 * platform/mac/ContextMenuItemMac.mm:
611 (WebCore::ContextMenuItem::ContextMenuItem):
612 (WebCore::ContextMenuItem::platformDescription):
613 (WebCore::ContextMenuItem::setSubMenu):
614 (WebCore::ContextMenuItem::releasePlatformDescription): Deleted.
615 (WebCore::ContextMenuItem::getPlatformDescription): Deleted.
617 * platform/mac/ContextMenuMac.mm:
618 (WebCore::ContextMenu::appendItem):
619 (WebCore::ContextMenu::insertItem):
620 (WebCore::platformMenuDescription):
622 * platform/win/ContextMenuItemWin.cpp:
623 (WebCore::ContextMenuItem::ContextMenuItem):
625 2015-04-07 Alex Christensen <achristensen@webkit.org>
627 Optimize content extensions interpreting speed.
628 https://bugs.webkit.org/show_bug.cgi?id=143490
630 Reviewed by Brady Eidson.
632 * contentextensions/ContentExtensionCompiler.cpp:
633 (WebCore::ContentExtensions::compileRuleList):
634 * contentextensions/ContentExtensionsBackend.cpp:
635 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
636 Measure total time added by content extensions.
637 * contentextensions/DFABytecodeCompiler.cpp:
638 (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
639 (WebCore::ContentExtensions::DFABytecodeCompiler::compile):
640 When jumping to the root, don't re-add all the actions.
641 * contentextensions/DFABytecodeCompiler.h:
643 (WebCore::URL::init):
645 (WebCore::URL::protocolIsJavaScript): Added.
647 2015-04-07 Simon Fraser <simon.fraser@apple.com>
649 Add a new setting, AntialiasedFontDilationEnabled, exposed via WK2.
650 https://bugs.webkit.org/show_bug.cgi?id=143495
652 Reviewed by Tim Horton.
654 Add a new Setting, antialiasedFontDilationEnabled, which defaults to true. This
655 will be used in an upcoming patch.
659 2015-04-07 Andy Estes <aestes@apple.com>
661 [Content Filtering] Add logging
662 https://bugs.webkit.org/show_bug.cgi?id=143470
664 Reviewed by Daniel Bates.
666 Added a new ContentFiltering logging channel, and started logging some useful diagnostic messages.
668 * loader/ContentFilter.cpp:
669 (WebCore::ContentFilter::~ContentFilter):
670 (WebCore::ContentFilter::willSendRequest):
671 (WebCore::ContentFilter::startFilteringMainResource):
672 (WebCore::ContentFilter::responseReceived):
673 (WebCore::ContentFilter::dataReceived):
674 (WebCore::ContentFilter::notifyFinished):
675 (WebCore::ContentFilter::didDecide):
676 * platform/Logging.h:
677 * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
678 (WebCore::ContentFilterUnblockHandler::canHandleRequest):
679 (WebCore::ContentFilterUnblockHandler::requestUnblockAsync):
680 * platform/cocoa/NetworkExtensionContentFilter.mm:
681 (WebCore::NetworkExtensionContentFilter::enabled):
682 (WebCore::NetworkExtensionContentFilter::unblockHandler):
683 (WebCore::NetworkExtensionContentFilter::handleDecision):
684 * platform/cocoa/ParentalControlsContentFilter.mm:
685 (WebCore::ParentalControlsContentFilter::enabled):
686 (WebCore::ParentalControlsContentFilter::updateFilterState):
687 * testing/MockContentFilter.cpp:
688 (WebCore::MockContentFilter::enabled):
689 (WebCore::MockContentFilter::unblockHandler):
690 (WebCore::MockContentFilter::maybeDetermineStatus):
692 2015-04-07 Eric Carlson <eric.carlson@apple.com>
694 [Mac] video playing to external device should not be interrupted
695 https://bugs.webkit.org/show_bug.cgi?id=143492
697 Reviewed by Jer Noble.
699 * Modules/mediacontrols/mediaControlsApple.js:
700 (Controller.prototype.handlePanelTransitionEnd): Drive-by fix to make sure the controls are
701 not hidden if the opacity timer is primed before they go into a state where they should
704 * html/HTMLMediaElement.cpp:
705 (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Make it const.
706 (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget): New.
707 * html/HTMLMediaElement.h:
709 * html/HTMLMediaSession.cpp:
710 (WebCore::HTMLMediaSession::canPlayToWirelessPlaybackTarget): New. Short-circuit call to
711 client when we already know the answer.
712 (WebCore::HTMLMediaSession::isPlayingToWirelessPlaybackTarget): Ditto.
713 (WebCore::HTMLMediaSession::startPlayingToPlaybackTarget): Ditto.
714 (WebCore::HTMLMediaSession::stopPlayingToPlaybackTarget): Ditto.
715 * html/HTMLMediaSession.h:
717 * platform/audio/MediaSession.cpp:
718 (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): Deleted, moved inline and neutered
719 because only HTMLMediaSession needs to use them.
720 (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
721 (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
722 * platform/audio/MediaSession.h:
723 (WebCore::MediaSession::canPlayToWirelessPlaybackTarget):
724 (WebCore::MediaSession::isPlayingToWirelessPlaybackTarget):
725 (WebCore::MediaSession::startPlayingToPlaybackTarget):
726 (WebCore::MediaSession::stopPlayingToPlaybackTarget):
727 (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
728 (WebCore::MediaSessionClient::isPlayingToWirelessPlaybackTarget):
730 * platform/audio/MediaSessionManager.cpp:
731 (WebCore::MediaSessionManager::MediaSessionManager):
732 (WebCore::MediaSessionManager::sessionShouldBeginPlayingToWirelessPlaybackTarget): New.
733 (WebCore::MediaSessionManager::sessionWillBeginPlayback): Don't interrupt an active session
734 playing to a target device.
735 * platform/audio/MediaSessionManager.h:
737 * platform/graphics/MediaPlayer.cpp:
738 (WebCore::MediaPlayer::isPlayingToWirelessPlaybackTarget): New, passthrough.
739 * platform/graphics/MediaPlayer.h:
740 * platform/graphics/MediaPlayerPrivate.h:
741 (WebCore::MediaPlayerPrivateInterface::isPlayingToWirelessPlaybackTarget):
743 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
744 (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
745 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
746 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Explicitly call
747 when passed a nil or inactive target context.
748 (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): Add logging.
749 (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): Ditto.
750 (WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): New. Return
751 true when playing with an active context.
752 (WebCore::playerKVOProperties): "outputContext" is not observable.
754 2015-04-07 Sam Weinig <sam@webkit.org>
756 Re-add JSReadableStream and JSReadableStreamReader the Xcode project to
759 * WebCore.xcodeproj/project.pbxproj:
761 2015-02-25 Sergio Villar Senin <svillar@igalia.com>
763 [CSS Grid Layout] Update track sizes after distributing extra space
764 https://bugs.webkit.org/show_bug.cgi?id=141422
766 Reviewed by Antti Koivisto.
768 Both old and new tracks sizing algorithms instruct us to update
769 the sizes of the content sized tracks only after distributing the
770 extra space for all the items in the same span group. So far we
771 were doing it inside distributeSpaceToTracks(), i.e., once for
772 every single item. That is wrong because it makes the algorithm
775 Our old implementation looked something like this (pseudocode):
777 resolveContentBasedTrackSizingFunctions()
779 resolveContentBasedTrackSizingFunctionsForItems() (x4)
780 distributeSpaceToTracks()
783 Now it's done this way (pseudocode):
785 resolveContentBasedTrackSizingFunctions()
787 resolveContentBasedTrackSizingFunctionsForItems() (x4)
788 foreach item in spanGroup
789 distributeSpaceToTracks()
792 As it can be seen the update of track sizes only happens after
793 processing all the items of a given span group. In order to
794 accomplish this a new field was added to GridTrack called
795 tempIncrease which stores per-track increases while distributing
796 the extra space among the items in the same span group. That
797 temporal increase could eventually be used to update the
798 plannedIncrease which is the one we use to finally set the new
801 This change makes our implementation closer to the spec, removes
802 the order dependency and ensures that every track satisfies their
803 min track sizing functions before starting to consider the max
804 track sizing functions.
806 Test: fast/css-grid-layout/grid-update-sizes-after-distributing-all.html
808 * rendering/RenderGrid.cpp:
809 (WebCore::GridTrack::plannedSize):
810 (WebCore::GridTrack::setPlannedSize): New setter.
811 (WebCore::GridTrack::tempSize): New attribute.
812 (WebCore::RenderGrid::computeUsedBreadthOfGridTracks):
813 RenderGrid::distributeSpaceToTracks() no longer updates the track
814 sizes so we have to do it after the call returns.
815 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctions):
816 Call RenderGrid::resolveContentBasedTrackSizingFunctionsForItems()
817 passing a span group instead of a single item.
818 (WebCore::RenderGrid::resolveContentBasedTrackSizingFunctionsForItems):
819 It now receives a span group instead of a single item. Apart from
820 that we need an extra function to get the unaltered track size (as
821 the current one returns the base size whenever the growth limit is
823 (WebCore::RenderGrid::distributeSpaceToTracks): This no longer
824 updates track sizes but only the track's planned size;
825 * rendering/RenderGrid.h:
827 2015-04-06 Chris Dumez <cdumez@apple.com>
829 Bing video search result pages are not PageCacheable
830 https://bugs.webkit.org/show_bug.cgi?id=143463
831 <rdar://problem/20440916>
833 Reviewed by Alexey Proskuryakov.
835 Bing video search result pages are not PageCacheable (tested on iOS).
837 - is bad for power usage as it causes a reload when clicking one of the
838 results then navigating back in history.
839 - degrades user experience because the results page uses infinite
840 scrolling and the scroll position is not properly restored when
841 navigating back, not to mention the user has to wait for the reload
844 The issue was that the bing search page was doing a ping load when
845 clicking on one of the search results. The ping load was done by
846 create an image and its 'src' attribute to the ping URL. This load
847 usually did not have time to complete when navigating away so we would
848 cancel it and the main document would end up with an error that would
849 prevent the page from entering the page cache. We already have code
850 making sure load cancellations do not prevent page caching as long as
851 the loads are for XHR or images. However, the latter check was broken
852 in the case where the ResourceRequest's cachePartition was non-empty.
853 This is because the check was using the MemoryCache::ResourceForUrl()
854 API which rarely does what we want because it will request a dummy
855 ResourceRequest (without cachePartition) and then call
856 MemoryCache::resourceForRequest(). This patch updates the check
857 to use resourceForRequest() directly as we have the ResourceRequest
860 This patch also gets rid of the MemoryCache::ResourceForUrl() API as
861 it rarely does what we want and it is bug prone. It was only used in
862 2 places, one of them causing this bug and the other in Internals.
864 Tests: http/tests/navigation/page-cache-pending-image-load-cache-partition.html
865 http/tests/navigation/page-cache-pending-image-load.html
867 * loader/DocumentLoader.cpp:
868 (WebCore::areAllLoadersPageCacheAcceptable):
869 Use MemoryCache::resourceForRequest() instead of resourceForUrl() as
870 we have the ResourceRequest and calling resourceForUrl() would loose
873 * loader/cache/MemoryCache.cpp:
874 (WebCore::MemoryCache::resourceForURL): Deleted.
875 Drop this API as it is bug prone and rarely does what we want.
877 * testing/Internals.cpp:
878 (WebCore::Internals::isLoadingFromMemoryCache):
879 Update call to create a dummy ResourceRequest and call
880 resourceForRequest() instead of resourceForUrl(), as this API no
881 longer exists. The new code also set the cachePartition on the
882 dummy request so that this function actually behaves as expected
883 if the cachePartition in the memory cache is non-empty.
886 2015-04-06 Jer Noble <jer.noble@apple.com>
888 Synchronize fullscreen animation between processes.
889 https://bugs.webkit.org/show_bug.cgi?id=143131
891 Reviewed by Simon Fraser.
893 Rather than attempt to synchcronize animations across the WebProcess / UIProcess boundary,
894 do the bounds-change animation in-process by applying a sublayer transformation to the
895 video layer. This gives the same visual effect as a synchronized bounds animation, but
896 without needing a synchronization fence. Resolve the difference between the transformation
897 and bounds by doing a fence-synchronized bounds change after the current animation is
898 scheduled to complete.
900 To do this calculation correctly, WebAVPlayer needs to query both the effective
901 videoLayerFrame and the videoLayerGravity. To that end, add getter methods for
902 videoLayerFrame() and videoLayerGravity().
904 * html/HTMLMediaElement.h:
905 (WebCore::HTMLMediaElement::videoFullscreenGravity):
906 * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
907 (-[WebAVVideoLayer dealloc]): Cancel outstanding performSelector requests.
908 (-[WebAVVideoLayer setBounds:]): Add a scale transform to simulate a bonuds change.
909 (-[WebAVVideoLayer resolveBounds]): Reset the scale transform and set the bounds.
910 (WebVideoFullscreenInterfaceAVKit::setupFullscreenInternal): Set the initial video frame bounds.
911 (-[WebAVPlayerController layoutSublayersOfLayer:]): Deleted.
912 * platform/ios/WebVideoFullscreenModel.h:
913 * platform/ios/WebVideoFullscreenModelVideoElement.h:
914 * platform/ios/WebVideoFullscreenModelVideoElement.mm:
915 (WebVideoFullscreenModelVideoElement::videoLayerFrame): Added; simple getter.
916 (WebVideoFullscreenModelVideoElement::videoLayerGravity): Ditto.
918 2015-04-06 Zalan Bujtas <zalan@apple.com>
920 Simple line layout: RunResolver::Iterator class cleanup.
921 https://bugs.webkit.org/show_bug.cgi?id=143445
923 Reviewed by Antti Koivisto.
925 1. SimpleLineLayout::Run is an intermediate structure and should not be publicly accessible through RunResolver::Iterator.
926 RunResolver::Run is the class to use to access run properties.
927 2. Also move advance()/advanceLine() to private. Callers should use LineResolver to advance on lines.
929 No change in functionality.
931 * rendering/SimpleLineLayoutResolver.h:
933 2015-04-06 Simon Fraser <simon.fraser@apple.com>
935 Use a RenderObject bit for isRenderFlowThread()
936 https://bugs.webkit.org/show_bug.cgi?id=143439
938 Reviewed by Darin Adler.
940 Turning isRenderFlowThread() into a bit in rare data rather than a virtual function reduces
941 the time under RenderLayer::scrollTo() on a large overflow:scroll table from 56% to 44%.
943 * rendering/RenderFlowThread.cpp:
944 (WebCore::RenderFlowThread::RenderFlowThread):
945 * rendering/RenderFlowThread.h:
946 * rendering/RenderObject.cpp:
947 (WebCore::RenderObject::setIsRenderFlowThread):
948 * rendering/RenderObject.h:
949 (WebCore::RenderObject::isDragging):
950 (WebCore::RenderObject::hasReflection):
951 (WebCore::RenderObject::isRenderFlowThread):
952 (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
954 2015-04-06 Myles C. Maxfield <mmaxfield@apple.com>
956 [Win] [SVG -> OTF Converter] Support the SVG -> OTF Font Converter
957 https://bugs.webkit.org/show_bug.cgi?id=143402
959 Reviewed by Darin Adler.
961 There are a few pieces to the converter that Windows requires that we haven't already
963 1. Checksums were being calculated with the wrong endianness
964 2. Windows requires a format 4 'cmap' subtable in addition to the format 12 one we already
966 3. Windows requires a reference to a Private DICT inside the CFF table, even if the DICT
969 Covered by all our existing SVG font tests.
971 * svg/SVGFontFaceElement.h: Add capHeight accessor.
972 * svg/SVGFontFaceElement.cpp:
973 (WebCore::SVGFontFaceElement::capHeight): Ditto.
974 * svg/SVGToOTFConversion.cpp: Update the conversion process according to the above
976 (WebCore::SVGToOTFFontConverter::appendFormat12CMAPTable):
977 (WebCore::SVGToOTFFontConverter::appendFormat4CMAPTable):
978 (WebCore::SVGToOTFFontConverter::appendCMAPTable): Use helpers.
979 (WebCore::SVGToOTFFontConverter::appendHHEATable): Use member variables.
980 (WebCore::SVGToOTFFontConverter::appendOS2Table): Update to version 2.
981 (WebCore::SVGToOTFFontConverter::appendCFFTable): Create a reference to a
982 zero-sized Private DICT
983 (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): Populate member
985 (WebCore::SVGToOTFFontConverter::calculateChecksum): Flip endianness
987 2015-04-06 Yusuke Suzuki <utatane.tea@gmail.com>
989 Return Optional<uint32_t> from PropertyName::asIndex
990 https://bugs.webkit.org/show_bug.cgi?id=143422
992 Reviewed by Darin Adler.
994 * bindings/js/JSDOMWindowCustom.cpp:
995 (WebCore::JSDOMWindow::getOwnPropertySlot):
996 (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
997 * bindings/js/JSHTMLAllCollectionCustom.cpp:
998 (WebCore::callHTMLAllCollection):
999 (WebCore::JSHTMLAllCollection::item):
1000 * bindings/scripts/CodeGeneratorJS.pm:
1001 (GenerateGetOwnPropertySlotBody):
1002 (GenerateImplementation):
1003 * bindings/scripts/test/JS/JSFloat64Array.cpp:
1004 (WebCore::JSFloat64Array::getOwnPropertySlot):
1005 (WebCore::JSFloat64Array::getOwnPropertyDescriptor):
1006 (WebCore::JSFloat64Array::put):
1007 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
1008 (WebCore::JSTestEventTarget::getOwnPropertySlot):
1009 * bridge/runtime_array.cpp:
1010 (JSC::RuntimeArray::getOwnPropertySlot):
1011 (JSC::RuntimeArray::put):
1013 2015-04-06 Žan Doberšek <zdobersek@igalia.com>
1015 FileList constructor should move the passed-in Vector<> rvalue reference into the member variable
1016 https://bugs.webkit.org/show_bug.cgi?id=143412
1018 Reviewed by Darin Adler.
1020 * fileapi/FileList.h:
1021 (WebCore::FileList::FileList): An explicit move of the passed-in rvalue
1022 reference into the member variable is required, otherwise a copy is
1023 performed since an rvalue reference is just an lvalue.
1025 2015-04-06 Žan Doberšek <zdobersek@igalia.com>
1027 UserScript, UserStyleSheet constructors should take in Vector<String> rvalue references
1028 https://bugs.webkit.org/show_bug.cgi?id=143411
1030 Reviewed by Darin Adler.
1032 Have the UserScript and UserStyleSheet constructors take in Vector<String>
1033 rvalue references for the whitelist and blacklist parameters. Both classes
1034 store these Vector<String> objects, so the referenced objects can simply be
1035 moved into the member variable.
1037 Because the constructor is now demanding an rvalue, it's up to the caller
1038 to move in the desired object if possible, or create an explicit copy
1041 * page/UserScript.h:
1042 (WebCore::UserScript::UserScript):
1043 * page/UserStyleSheet.h:
1044 (WebCore::UserStyleSheet::UserStyleSheet):
1046 2015-04-05 Andy Estes <aestes@apple.com>
1048 [Content Filtering] Only pass http(s) requests to -[NEFilterSource willSendRequest:...]
1049 https://bugs.webkit.org/show_bug.cgi?id=143437
1051 Reviewed by Dan Bernstein.
1053 No new tests. We can't test NEFilterSource directly.
1055 * platform/cocoa/NetworkExtensionContentFilter.mm:
1056 (WebCore::NetworkExtensionContentFilter::willSendRequest): Immediately allow requests with url schemes other than http and https.
1058 2015-04-05 Darin Adler <darin@apple.com>
1060 FrameView code uses page() without null checking
1061 https://bugs.webkit.org/show_bug.cgi?id=143425
1062 rdar://problem/18920601
1064 Reviewed by Anders Carlsson.
1066 While we don't have tests that cover this, we are seeing crashes coming in
1067 that indicate the shouldEnableSpeculativeTilingDuringLoading function is
1068 being called when the page is null. This patch adds null checks to all the
1069 places in FrameView that use page() without doing null checking.
1071 * page/FrameView.cpp:
1072 (WebCore::FrameView::layout): If page is null, don't try to do the
1073 auto-sizing logic that involves the textAutosizingWidth value from the page.
1074 (WebCore::FrameView::setFixedVisibleContentRect): Get settings from the
1075 frame rather than the page to avoid possible null-dereference.
1076 (WebCore::FrameView::scrollPositionChanged): Check the page for null when
1077 getting the event throttling delay.
1078 (WebCore::FrameView::updateLayerFlushThrottling): Check the page for null,
1079 and return early if it is null.
1080 (WebCore::shouldEnableSpeculativeTilingDuringLoading): Check the page for
1081 null, and return false if it is null.
1082 (WebCore::FrameView::performPostLayoutTasks): Guard the code that calls
1083 didLayout on the page client by a check if the page is null.
1084 (WebCore::FrameView::pagination): Don't call Page::pagination on a null
1086 (WebCore::FrameView::visibleContentScaleFactor): Use a scale factor of 1
1087 if the page is null.
1088 (WebCore::FrameView::setVisibleScrollerThumbRect): Don't call through to
1089 the page client if the page is null.
1090 (WebCore::FrameView::scrollbarStyleChanged): Ditto.
1091 (WebCore::FrameView::setScrollPinningBehavior): Check the page for null
1092 before asking it for the scrolling coordinator.
1094 2015-04-05 Simon Fraser <simon.fraser@apple.com>
1096 Free up some bits in RenderObject by moving rarely used bits into a side table
1097 https://bugs.webkit.org/show_bug.cgi?id=143432
1099 Reviewed by Darin Adler.
1101 Add a side table (global hash) on RenderObject to store data that is rarely
1102 used. Move the "isDragging" and "hasReflection" bits there. Re-use one of
1103 those bits for "hasRareData", and leave the other unused (I have plans for it).
1105 * rendering/RenderBlock.cpp:
1106 (WebCore::getBlockRareData): Renamed for consistency.
1107 (WebCore::ensureBlockRareData): Renamed to avoid conflict with RenderObject::ensureRareData().
1108 (WebCore::RenderBlock::cachedFlowThreadContainingBlock):
1109 (WebCore::RenderBlock::cachedFlowThreadContainingBlockNeedsUpdate):
1110 (WebCore::RenderBlock::setCachedFlowThreadContainingBlockNeedsUpdate):
1111 (WebCore::RenderBlock::updateCachedFlowThreadContainingBlock):
1112 (WebCore::RenderBlock::locateFlowThreadContainingBlock):
1113 (WebCore::RenderBlock::paginationStrut):
1114 (WebCore::RenderBlock::pageLogicalOffset):
1115 (WebCore::RenderBlock::setPaginationStrut):
1116 (WebCore::RenderBlock::setPageLogicalOffset):
1117 (WebCore::getRareData): Deleted.
1118 (WebCore::ensureRareData): Deleted.
1119 * rendering/RenderObject.cpp:
1120 (WebCore::RenderObject::~RenderObject): Assert that rare data hasn't been resurrected
1121 since willBeDestroyed().
1122 (WebCore::RenderObject::willBeDestroyed): Clear the rare data.
1123 (WebCore::RenderObject::setIsDragging): If setting, ensure that we have rare data and
1124 set the bit. Otherwise, only clear the bit of we have rare data.
1125 (WebCore::RenderObject::setHasReflection): Ditto.
1126 (WebCore::RenderObject::rareDataMap):
1127 (WebCore::RenderObject::rareData):
1128 (WebCore::RenderObject::ensureRareData):
1129 (WebCore::RenderObject::clearRareData):
1130 * rendering/RenderObject.h:
1131 (WebCore::RenderObject::isDragging): Fast-fail on the hasRareData() bit, then do the
1132 slower lookup in rare data.
1133 (WebCore::RenderObject::hasReflection): Ditto.
1134 (WebCore::RenderObject::setEverHadLayout): Moved up to group with other bit setters.
1135 (WebCore::RenderObject::hasRareData):
1136 (WebCore::RenderObject::setHasRareData):
1137 (WebCore::RenderObject::RenderObjectBitfields::RenderObjectBitfields):
1138 (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData):
1139 (WebCore::RenderObject::setHasReflection): Deleted. Out of line now.
1140 (WebCore::RenderObject::setIsDragging): Deleted. Ditto.
1142 2015-04-05 Darin Adler <darin@apple.com>
1144 REGRESSION (r181778): Crash after scrolling Google search result page
1145 https://bugs.webkit.org/show_bug.cgi?id=143431
1147 Reviewed by Simon Fraser.
1149 I can't reproduce this crash, nor was I able to make a regression test,
1150 but the crash data makes it clear this is a null dereference.
1152 * page/animation/AnimationController.cpp:
1153 (WebCore::AnimationControllerPrivate::scrollWasUpdated): Check the result
1154 of Frame::view for null. We know this is only called when there is a
1155 valid FrameView, but it can be called after Frame::m_view is already null.
1157 2015-04-05 Andy Estes <aestes@apple.com>
1159 [Content Filtering] Tell the filter about requests and redirects
1160 https://bugs.webkit.org/show_bug.cgi?id=143414
1161 rdar://problem/19239549
1163 Reviewed by Darin Adler.
1165 Tests: contentfiltering/allow-after-will-send-request.html
1166 contentfiltering/block-after-will-send-request.html
1167 http/tests/contentfiltering/allow-after-redirect.html
1168 http/tests/contentfiltering/block-after-redirect.html
1170 NEFilterSource supports making filter decisions based on NSURLRequests, so this patch adds support for telling
1171 ContentFilter about the original main resource request as well as redirect requests.
1173 * bindings/js/JSMockContentFilterSettingsCustom.cpp: Updated decisionPoint values to include AfterWillSendRequest and AfterRedirect.
1174 (WebCore::JSMockContentFilterSettings::decisionPoint):
1175 (WebCore::JSMockContentFilterSettings::setDecisionPoint):
1176 * loader/ContentFilter.cpp:
1177 (WebCore::ContentFilter::willSendRequest): Called willSendRequest() on each filter using forEachContentFilterUntilBlocked().
1178 (WebCore::ContentFilter::redirectReceived): Called willSendRequest().
1179 * loader/ContentFilter.h:
1180 * loader/DocumentLoader.cpp:
1181 (WebCore::DocumentLoader::willSendRequest): Called ContentFilter::willSendRequest() if there is a content filter.
1182 Asserted that this is not a redirect, and that ContentFilter does not set the request to null.
1183 * loader/SubresourceLoader.cpp:
1184 (WebCore::SubresourceLoader::willSendRequest): Called redirectReceived() instead of willSendRequest().
1185 * loader/cache/CachedRawResource.cpp:
1186 (WebCore::CachedRawResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
1187 (WebCore::CachedRawResource::willSendRequest): Deleted.
1188 * loader/cache/CachedRawResource.h:
1189 * loader/cache/CachedResource.cpp:
1190 (WebCore::CachedResource::redirectReceived): Renamed from willSendRequest(), since this function is only called during redirects.
1191 (WebCore::CachedResource::willSendRequest): Deleted.
1192 * loader/cache/CachedResource.h:
1193 * platform/PlatformContentFilter.h:
1194 * platform/cocoa/NetworkExtensionContentFilter.h:
1195 * platform/cocoa/NetworkExtensionContentFilter.mm:
1196 (WebCore::NetworkExtensionContentFilter::willSendRequest): Called responseReceived() if there was a redirectResponse.
1197 Then called -[NEFilterSource willSendRequest:decisionHandler:].
1198 * platform/cocoa/ParentalControlsContentFilter.h:
1199 * platform/spi/cocoa/NEFilterSourceSPI.h: Added a #define for NEFilterSourceOptionsPageData.
1200 * testing/MockContentFilter.cpp:
1201 (WebCore::MockContentFilter::willSendRequest): Added support for willSendRequest.
1202 * testing/MockContentFilter.h: Added decision points for AfterWillSendRequest and AfterRedirect.
1203 * testing/MockContentFilterSettings.h:
1204 * testing/MockContentFilterSettings.idl:
1206 2015-04-05 Sungmann Cho <sungmann.cho@navercorp.com>
1208 Remove DocumentLoader::requestURL().
1209 https://bugs.webkit.org/show_bug.cgi?id=140001
1211 Reviewed by Darin Adler.
1213 No new tests, no behavior change.
1215 * loader/DocumentLoader.cpp:
1216 (WebCore::DocumentLoader::documentURL):
1217 (WebCore::DocumentLoader::requestURL): Deleted.
1218 * loader/DocumentLoader.h:
1219 * loader/ResourceLoadNotifier.cpp:
1220 (WebCore::ResourceLoadNotifier::dispatchWillSendRequest):
1222 2015-04-05 Gyuyoung Kim <gyuyoung.kim@samsung.com>
1224 Use constants of sqlite3 directly for status of SQL result in webdatabase
1225 https://bugs.webkit.org/show_bug.cgi?id=143329
1227 Reviewed by Darin Adler.
1229 In webdatabase, it has used own constant vairables as well as using sqlite3 constants directly.
1230 It causes to use if~else statement which consumes more cpu cycles compared to switch~case. This
1231 patch makes to use constants of sqlite3. Additionally if~else statment is changed to switch~case
1234 No new tests, no behavior changes.
1236 * Modules/webdatabase/Database.cpp:
1237 (WebCore::Database::performGetTableNames):
1238 * Modules/webdatabase/DatabaseBackendBase.cpp:
1239 (WebCore::retrieveTextResultFromDatabase):
1240 (WebCore::setTextValueInDatabase):
1241 (WebCore::DatabaseBackendBase::incrementalVacuumIfNeeded):
1242 * Modules/webdatabase/DatabaseTracker.cpp:
1243 (WebCore::DatabaseTracker::hasEntryForOriginNoLock):
1244 (WebCore::DatabaseTracker::hasEntryForDatabase):
1245 (WebCore::DatabaseTracker::fullPathForDatabaseNoLock):
1246 (WebCore::DatabaseTracker::origins):
1247 (WebCore::DatabaseTracker::databaseNamesForOriginNoLock):
1248 (WebCore::DatabaseTracker::detailsForNameAndOrigin):
1249 (WebCore::DatabaseTracker::setDatabaseDetails):
1250 (WebCore::DatabaseTracker::quotaForOriginNoLock):
1251 (WebCore::DatabaseTracker::setQuota):
1252 (WebCore::DatabaseTracker::addDatabase):
1253 (WebCore::DatabaseTracker::deleteOrigin):
1254 (WebCore::DatabaseTracker::deleteDatabase):
1255 (WebCore::DatabaseTracker::removeDeletedOpenedDatabases):
1256 (WebCore::DatabaseTracker::deleteDatabaseFileIfEmpty):
1257 * Modules/webdatabase/SQLStatementBackend.cpp:
1258 (WebCore::SQLStatementBackend::execute):
1259 * Modules/webdatabase/SQLStatementBackend.h:
1260 * Modules/webdatabase/SQLTransactionBackend.cpp:
1261 (WebCore::SQLTransactionBackend::runCurrentStatementAndGetNextState):
1262 Change to use a reference instead of a pointer in arguemnt of execute().
1263 * loader/appcache/ApplicationCacheStorage.cpp:
1264 (WebCore::ApplicationCacheStorage::loadCacheGroup):
1265 (WebCore::ApplicationCacheStorage::loadManifestHostHashes):
1266 (WebCore::ApplicationCacheStorage::cacheGroupForURL):
1267 (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL):
1268 (WebCore::ApplicationCacheStorage::calculateQuotaForOrigin):
1269 (WebCore::ApplicationCacheStorage::calculateUsageForOrigin):
1270 (WebCore::ApplicationCacheStorage::calculateRemainingSizeForOriginExcludingCache):
1271 (WebCore::ApplicationCacheStorage::storeUpdatedQuotaForOrigin):
1272 (WebCore::ApplicationCacheStorage::verifySchemaVersion):
1273 (WebCore::ApplicationCacheStorage::store):
1274 (WebCore::ApplicationCacheStorage::storeUpdatedType):
1275 (WebCore::ApplicationCacheStorage::ensureOriginRecord):
1276 (WebCore::ApplicationCacheStorage::storeNewestCache):
1277 (WebCore::ApplicationCacheStorage::loadCache):
1278 (WebCore::ApplicationCacheStorage::remove):
1279 (WebCore::ApplicationCacheStorage::getManifestURLs):
1280 (WebCore::ApplicationCacheStorage::cacheGroupSize):
1281 (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord):
1282 (WebCore::ApplicationCacheStorage::checkForMaxSizeReached):
1283 (WebCore::ApplicationCacheStorage::checkForDeletedResources):
1284 (WebCore::ApplicationCacheStorage::flatFileAreaSize):
1285 * loader/icon/IconDatabase.cpp:
1286 (WebCore::IconDatabase::checkIntegrity):
1287 (WebCore::IconDatabase::performURLImport):
1288 (WebCore::IconDatabase::pruneUnretainedIcons):
1289 (WebCore::readySQLiteStatement):
1290 (WebCore::IconDatabase::setIconIDForPageURLInSQLDatabase):
1291 (WebCore::IconDatabase::removePageURLFromSQLDatabase):
1292 (WebCore::IconDatabase::getIconIDForIconURLFromSQLDatabase):
1293 (WebCore::IconDatabase::addIconURLToSQLDatabase):
1294 (WebCore::IconDatabase::getImageDataForIconURLFromSQLDatabase):
1295 (WebCore::IconDatabase::removeIconFromSQLDatabase):
1296 (WebCore::IconDatabase::writeIconSnapshotToSQLDatabase):
1297 * platform/sql/SQLiteDatabase.cpp:
1298 (WebCore::SQLiteDatabase::setMaximumSize):
1299 * platform/sql/SQLiteDatabase.h:
1300 * platform/sql/SQLiteFileSystem.cpp:
1301 (WebCore::SQLiteFileSystem::getFileNameForNewDatabase):
1302 * platform/sql/SQLiteStatement.cpp:
1303 (WebCore::SQLiteStatement::step):
1304 (WebCore::SQLiteStatement::returnIntResults):
1305 (WebCore::SQLiteStatement::returnInt64Results):
1307 2015-04-05 Simon Fraser <simon.fraser@apple.com>
1309 Remove "go ahead and" from comments
1310 https://bugs.webkit.org/show_bug.cgi?id=143421
1312 Reviewed by Darin Adler, Benjamin Poulain.
1314 Remove the phrase "go ahead and" from comments where it doesn't add
1315 anything (which is almost all of them).
1317 * Modules/webdatabase/DatabaseTracker.cpp:
1318 (WebCore::DatabaseTracker::deleteOriginLockFor):
1319 * css/CSSFontFaceSrcValue.cpp:
1320 (WebCore::CSSFontFaceSrcValue::isSupportedFormat):
1321 * css/CSSPrimitiveValue.h:
1322 * css/StyleResolver.cpp:
1323 (WebCore::StyleResolver::styleForKeyframe):
1324 (WebCore::StyleResolver::styleForPage):
1325 (WebCore::StyleResolver::applyMatchedProperties):
1326 * editing/ApplyStyleCommand.cpp:
1327 (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode):
1328 * loader/DocumentLoader.cpp:
1329 (WebCore::DocumentLoader::detachFromFrame):
1330 * loader/cache/CachedImage.cpp:
1331 (WebCore::CachedImage::addIncrementalDataBuffer):
1332 * loader/icon/IconDatabase.cpp:
1333 (WebCore::IconDatabase::performURLImport):
1334 * page/PageOverlay.cpp:
1335 (WebCore::PageOverlay::fadeAnimationTimerFired):
1336 * platform/ScrollView.cpp:
1337 (WebCore::ScrollView::updateScrollbars):
1338 (WebCore::ScrollView::scrollContents):
1339 * platform/graphics/DisplayRefreshMonitor.cpp:
1340 (WebCore::DisplayRefreshMonitor::create):
1341 * platform/graphics/GraphicsContext.cpp:
1342 * platform/graphics/mac/ComplexTextController.cpp:
1343 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
1344 * platform/network/HTTPParsers.cpp:
1345 (WebCore::parseHTTPRefresh):
1346 * rendering/RenderBlock.cpp:
1347 (WebCore::RenderBlock::removeChild):
1348 (WebCore::RenderBlock::layoutPositionedObjects):
1349 (WebCore::RenderBlock::selectionGaps):
1350 (WebCore::RenderBlock::blockSelectionGaps):
1351 (WebCore::RenderBlock::absoluteRects):
1352 (WebCore::RenderBlock::absoluteQuads):
1353 (WebCore::RenderBlock::addFocusRingRects):
1354 * rendering/RenderBlockFlow.cpp:
1355 (WebCore::RenderBlockFlow::layoutBlockChild):
1356 (WebCore::RenderBlockFlow::handleAfterSideOfBlock):
1357 (WebCore::RenderBlockFlow::adjustBlockChildForPagination):
1358 (WebCore::RenderBlockFlow::insertFloatingObject):
1359 (WebCore::RenderBlockFlow::addOverhangingFloats):
1360 (WebCore::RenderBlockFlow::inlineSelectionGaps):
1361 (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
1362 * rendering/RenderBlockLineLayout.cpp:
1363 (WebCore::RenderBlockFlow::appendRunsForObject):
1364 * rendering/RenderBox.cpp:
1365 (WebCore::RenderBox::positionLineBox):
1366 (WebCore::RenderBox::sizesLogicalWidthToFitContent):
1367 * rendering/RenderBoxModelObject.cpp:
1368 (WebCore::RenderBoxModelObject::paintFillLayerExtended):
1369 * rendering/RenderLayer.cpp:
1370 (WebCore::RenderLayer::updateLayerPositions):
1371 (WebCore::RenderLayer::hitTestLayer):
1372 (WebCore::RenderLayer::calculateClipRects):
1373 * rendering/RenderLayerModelObject.cpp:
1374 (WebCore::RenderLayerModelObject::styleWillChange):
1375 * rendering/RenderLineBoxList.cpp:
1376 (WebCore::RenderLineBoxList::dirtyLinesFromChangedChild):
1377 * rendering/RenderTextLineBoxes.cpp:
1378 (WebCore::RenderTextLineBoxes::dirtyRange):
1379 * rendering/line/BreakingContext.h:
1380 (WebCore::BreakingContext::handleOutOfFlowPositioned):
1381 (WebCore::BreakingContext::handleText):
1382 * rendering/line/LineBreaker.cpp:
1383 (WebCore::LineBreaker::nextLineBreak):
1384 * style/StyleResolveTree.cpp:
1385 (WebCore::Style::resolveLocal):
1386 * xml/XMLHttpRequestProgressEventThrottle.cpp:
1387 (WebCore::XMLHttpRequestProgressEventThrottle::dispatchThrottledProgressEvent):
1388 * xml/parser/XMLDocumentParser.cpp:
1389 (WebCore::XMLDocumentParser::append):
1391 2015-04-04 Andy Estes <aestes@apple.com>
1393 [Content Filtering] Blocked page is not always displayed when it should be
1394 https://bugs.webkit.org/show_bug.cgi?id=143410
1395 rdar://problem/20211099
1397 Reviewed by Andreas Kling.
1399 These tests now pass: contentfiltering/block-after-add-data.html
1400 contentfiltering/block-after-response.html
1402 There were several problems with how ContentFilter loaded replacement data:
1403 (1) Replacement data was delivered to DocumentLoader as if it were the original document's data. This assumes
1404 that the original data was a UTF-8 encoded HTML document, which is not always true. We had a way to reset
1405 the encoding, but not the content type.
1406 (2) Replacement data was never delivered when the filter blocks in DocumentLoader::responseReceived().
1407 (3) The main resource load was cancelled before the replacement data could be rendered when the filter blocks
1408 in DocumentLoader::dataReceived().
1409 The result was that only when the load was blocked after DocumentLoader::notifyFinished() would the replacement
1410 data be shown properly, and only when problem (1) wasn't occurring.
1412 This patch addresses these issues by using the substitute data mechanism to deliver replacement data. By using
1413 substitute data, we can ensure that the original load is cancelled at the earliest opportunity and that the
1414 replacement data is loaded with the proper content type and encoding.
1416 Accomplishing this required changing the way ContentFilter interacts with DocumentLoader. Instead of placing
1417 ContentFilter hooks throughout DocumentLoader, this patch makes ContentFilter itself the client of the
1418 CachedRawResource for the duration of the filtering. If the filter decides to allow the load, DocumentLoader
1419 adds itself as a client causing CachedRawResource to deliver to it the response and buffered data. If the
1420 filter decides to block the load, DocumentLoader schedules a substitute data load. An added benefit of this
1421 approach is that ContentFilter can reuse CachedRawResource's original data buffer instead of keeping its own.
1423 * loader/ContentFilter.cpp:
1424 (WebCore::ContentFilter::createIfNeeded): Changed to take a DecisionFunction rather than a ResourceResponse and DocumentLoader.
1425 (WebCore::ContentFilter::ContentFilter): Ditto.
1426 (WebCore::ContentFilter::~ContentFilter): Removed ourself as a CachedRawResource client if needed.
1427 (WebCore::ContentFilter::startFilteringMainResource): Became the client of the CachedRawResource in order to start the filtering process.
1428 (WebCore::ContentFilter::unblockHandler): Returned the unblock handler.
1429 (WebCore::ContentFilter::replacementData): Returned the replacement data.
1430 (WebCore::ContentFilter::unblockRequestDeniedScript): Returned the unblock request denied script.
1431 (WebCore::ContentFilter::responseReceived): Called responseReceived() on each filter using forEachContentFilterUntilBlocked().
1432 (WebCore::ContentFilter::dataReceived): Ditto for dataReceived().
1433 (WebCore::ContentFilter::notifyFinished): Ditto for finishedLoading().
1434 (WebCore::ContentFilter::forEachContentFilterUntilBlocked): For each filter that needs more data, called the function.
1435 If the filter blocked the load, called didDecide() with State::Blocked.
1436 If all filters allowed the load, called didDecide() with State::Allowed.
1437 (WebCore::ContentFilter::didDecide): Set m_state and called m_decisionFunction().
1438 (WebCore::ContentFilter::addData): Deleted.
1439 (WebCore::ContentFilter::finishedAddingData): Deleted.
1440 (WebCore::ContentFilter::needsMoreData): Deleted.
1441 (WebCore::ContentFilter::didBlockData): Deleted.
1442 (WebCore::ContentFilter::getReplacementData): Deleted.
1443 * loader/ContentFilter.h:
1444 (WebCore::ContentFilter::type):
1445 * loader/DocumentLoader.cpp:
1446 (WebCore::DocumentLoader::DocumentLoader): Called ContentFilter::createIfNeeded() if not loading substitute data.
1447 (WebCore::DocumentLoader::finishedLoading): Removed old ContentFilter code.
1448 (WebCore::DocumentLoader::responseReceived): Ditto.
1449 (WebCore::DocumentLoader::commitData): Ditto.
1450 (WebCore::DocumentLoader::dataReceived): Ditto.
1451 (WebCore::DocumentLoader::detachFromFrame): Set m_contentFilter to nullptr.
1452 (WebCore::DocumentLoader::startLoadingMainResource): Called becomeMainResourceClientIfFilterAllows() instead of
1453 becoming m_mainResource's client.
1454 (WebCore::DocumentLoader::clearMainResource): Set m_contentFilter to nullptr.
1455 (WebCore::DocumentLoader::becomeMainResourceClientIfFilterAllows): If ContentFilter is initialized, called
1456 ContentFilter::startFilteringMainResource(). Otherwise added ourself as a client of m_mainResource.
1457 (WebCore::DocumentLoader::installContentFilterUnblockHandler): Added a helper for creating and notifying
1458 FrameLoaderClient of the unblock handler.
1459 (WebCore::DocumentLoader::contentFilterDidDecide): Set m_contentFilter to nullptr. If the content filter
1460 allowed the load, then added ourself as the CachedRawResource's client. Otherwise, installed the unblock handler
1461 and scheduled a substitute data load with the replacement data.
1462 * loader/DocumentLoader.h:
1463 * loader/FrameLoader.cpp:
1464 (WebCore::FrameLoader::prepareForLoadStart): Removed call to PolicyChecker::prepareForLoadStart().
1465 * loader/NavigationScheduler.cpp:
1466 (WebCore::ScheduledSubstituteDataLoad::ScheduledSubstituteDataLoad): Added a ScheduledNavigation subclass that
1467 calls FrameLoader::load() with a FrameLoadRequest containing substitute data.
1468 (WebCore::NavigationScheduler::scheduleSubstituteDataLoad): Scheduled a substitute data load.
1469 * loader/NavigationScheduler.h:
1470 * loader/PolicyChecker.cpp:
1471 (WebCore::PolicyChecker::checkNavigationPolicy): Reset m_contentFilterUnblockHandler if it couldn't handle the request.
1472 (WebCore::PolicyChecker::prepareForLoadStart): Deleted.
1473 * loader/PolicyChecker.h:
1474 * platform/ContentFilterUnblockHandler.h:
1475 (WebCore::ContentFilterUnblockHandler::unreachableURL):
1476 (WebCore::ContentFilterUnblockHandler::setUnreachableURL):
1477 (WebCore::ContentFilterUnblockHandler::unblockURLScheme): Renamed to ContentFilter::urlScheme().
1478 * platform/PlatformContentFilter.h:
1479 * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:
1480 (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): Added a helper to wrap the unblock handler with an outer DecisionHandlerFunction.
1481 (WebCore::ContentFilterUnblockHandler::encode): Added m_unreachableURL to the encoding.
1482 (WebCore::ContentFilterUnblockHandler::decode): Ditto for the decoding.
1483 (WebCore::ContentFilterUnblockHandler::canHandleRequest): Changed to call ContentFilter::urlScheme().
1484 * platform/cocoa/NetworkExtensionContentFilter.h:
1485 * platform/cocoa/NetworkExtensionContentFilter.mm:
1486 (replacementDataFromDecisionInfo): Added a helper to extract replacement data from the decisionInfo dictionary.
1487 (WebCore::NetworkExtensionContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
1488 (WebCore::NetworkExtensionContentFilter::create): Created a new object.
1489 (WebCore::NetworkExtensionContentFilter::NetworkExtensionContentFilter): Created a NEFilterSource immediately when using the modern API.
1490 (WebCore::NetworkExtensionContentFilter::responseReceived): Created a NEFilterSource when using the legacy API.
1491 Called -[NEFilterSource receivedResponse:decisionHandler:] when using the modern API.
1492 (WebCore::NetworkExtensionContentFilter::addData): Stopped buffering the original data.
1493 (WebCore::NetworkExtensionContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
1494 (WebCore::NetworkExtensionContentFilter::canHandleResponse): Deleted.
1495 (WebCore::createNEFilterSource): Deleted.
1496 (WebCore::NetworkExtensionContentFilter::getReplacementData): Deleted.
1497 * platform/cocoa/ParentalControlsContentFilter.h:
1498 * platform/cocoa/ParentalControlsContentFilter.mm:
1499 (WebCore::ParentalControlsContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
1500 (WebCore::ParentalControlsContentFilter::create): Created a new object.
1501 (WebCore::ParentalControlsContentFilter::ParentalControlsContentFilter): Initialized m_filterState to kWFEStateBuffering.
1502 (WebCore::canHandleResponse): Added a helper to check if the response can be filtered.
1503 (WebCore::ParentalControlsContentFilter::responseReceived): If !canHandleResponse(), set m_filterState to kWFEStateAllowed and return.
1504 Otherwise created a new WebFilterEvaluator with the response.
1505 (WebCore::ParentalControlsContentFilter::addData): Called updateFilterState().
1506 (WebCore::ParentalControlsContentFilter::finishedAddingData): Ditto.
1507 (WebCore::ParentalControlsContentFilter::needsMoreData): Changed to check m_filterState.
1508 (WebCore::ParentalControlsContentFilter::didBlockData): Ditto.
1509 (WebCore::ParentalControlsContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
1510 (WebCore::ParentalControlsContentFilter::updateFilterState): Updated m_filterState by calling -[WebFilterEvaluator filterState].
1511 (WebCore::ParentalControlsContentFilter::canHandleResponse): Deleted.
1512 (WebCore::ParentalControlsContentFilter::getReplacementData): Deleted.
1513 * platform/spi/cocoa/NEFilterSourceSPI.h:
1514 * platform/spi/cocoa/WebFilterEvaluatorSPI.h:
1515 * testing/MockContentFilter.cpp:
1516 (WebCore::MockContentFilter::enabled): Renamed from canHandleReponse(); only checks if the filter is enabled.
1517 (WebCore::MockContentFilter::create): Created a new object.
1518 (WebCore::MockContentFilter::responseReceived): Called maybeDetermineStatus().
1519 (WebCore::MockContentFilter::addData): Stopped buffering the original data.
1520 (WebCore::MockContentFilter::replacementData): Returned a SharedBuffer instead of a char* and int&.
1521 (WebCore::MockContentFilter::unblockHandler): Asserted that we blocked data.
1522 (WebCore::MockContentFilter::canHandleResponse): Deleted.
1523 (WebCore::MockContentFilter::MockContentFilter): Deleted.
1524 (WebCore::MockContentFilter::getReplacementData): Deleted.
1525 * testing/MockContentFilter.h:
1526 * testing/MockContentFilterSettings.cpp:
1527 (WebCore::MockContentFilterSettings::unblockRequestURL): Changed to use a StringBuilder.
1529 2015-04-04 Chris Fleizach <cfleizach@apple.com>
1531 AX: Heuristic: Avoid exposing an element as clickable if mouse event delegation is handled on an AXElement with more than one descendant AXElement
1532 https://bugs.webkit.org/show_bug.cgi?id=136247
1534 Reviewed by Mario Sanchez Prada.
1536 Modify the logic for determining whether an element supports the press action by trying to filter out objects being handled by event delegation.
1537 The heuristic is if an element handles click actions and has more than one of a {static text, image, control, link, heading}, then we think
1538 it's using event delegation, and do not expose the press action.
1540 Test: platform/mac/accessibility/press-action-not-exposed-for-event-delegation.html
1542 * accessibility/AccessibilityObject.cpp:
1543 (WebCore::AccessibilityObject::supportsPressAction):
1545 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1547 More const in CSSToStyleMap
1548 https://bugs.webkit.org/show_bug.cgi?id=143409
1550 Reviewed by Andreas Kling.
1552 The CSSValues passed to CSSToStyleMap functions can mostly be treated
1553 as |const|, except for CSSImageValues which have special behavior.
1555 This makes it clearer what the inputs and outputs of these
1558 * css/CSSPrimitiveValue.cpp:
1559 (WebCore::CSSPrimitiveValue::computeDegrees):
1560 * css/CSSPrimitiveValue.h:
1561 (WebCore::CSSPrimitiveValue::computeTime):
1562 * css/CSSToStyleMap.cpp:
1563 (WebCore::CSSToStyleMap::mapFillAttachment):
1564 (WebCore::CSSToStyleMap::mapFillClip):
1565 (WebCore::CSSToStyleMap::mapFillComposite):
1566 (WebCore::CSSToStyleMap::mapFillBlendMode):
1567 (WebCore::CSSToStyleMap::mapFillOrigin):
1568 (WebCore::CSSToStyleMap::mapFillRepeatX):
1569 (WebCore::CSSToStyleMap::mapFillRepeatY):
1570 (WebCore::CSSToStyleMap::mapFillSize):
1571 (WebCore::CSSToStyleMap::mapFillXPosition):
1572 (WebCore::CSSToStyleMap::mapFillYPosition):
1573 (WebCore::CSSToStyleMap::mapFillMaskSourceType):
1574 (WebCore::CSSToStyleMap::mapAnimationDelay):
1575 (WebCore::CSSToStyleMap::mapAnimationDirection):
1576 (WebCore::CSSToStyleMap::mapAnimationDuration):
1577 (WebCore::CSSToStyleMap::mapAnimationFillMode):
1578 (WebCore::CSSToStyleMap::mapAnimationIterationCount):
1579 (WebCore::CSSToStyleMap::mapAnimationName):
1580 (WebCore::CSSToStyleMap::mapAnimationPlayState):
1581 (WebCore::CSSToStyleMap::mapAnimationProperty):
1582 (WebCore::CSSToStyleMap::mapAnimationTimingFunction):
1583 (WebCore::CSSToStyleMap::mapAnimationTrigger):
1584 * css/CSSToStyleMap.h:
1586 2015-04-04 Dan Bernstein <mitz@apple.com>
1588 Tried to fix the build.
1590 * loader/icon/IconController.cpp:
1591 (WebCore::iconsFromLinkElements):
1593 2015-04-02 Darin Adler <darin@apple.com>
1595 Streamline icon-related code, mostly unused
1596 https://bugs.webkit.org/show_bug.cgi?id=143306
1598 Reviewed by Antti Koivisto.
1600 I started on this path because Document::iconURLs had a poor implementation,
1601 storing results in a data member with no benefit, using HTMLCollection for
1602 iteration of the children of the head element instead of using the simpler
1603 faster technique we use inside the engine. Then, I discovered this function was
1604 mostly-unused code left over from before the Blink fork. I removed most of it.
1605 We can add this back later if someone finds a use for it, but if we do we
1606 should do a higher quality implementation without the quirks of the old one.
1608 Refactoring also made it clear that logic isn't exactly sensible. There's a
1609 set of rules about what order to return the list in that is not followed by
1610 the code that tries to find the "default touch icon". Later we could add some
1611 more test coverage and tighten up the logic. But the reality is that at this
1612 time, with some small exceptions, icon logic is in the web browsers, not in WebKit.
1614 * CMakeLists.txt: Removed IconURL.cpp.
1615 * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1616 * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1617 * WebCore.xcodeproj/project.pbxproj: Ditto.
1618 * dom/DOMAllInOne.cpp: Ditto.
1621 (WebCore::Document::evaluate): Tweaked formatting.
1622 (WebCore::Document::shortcutIconURLs): Removed. Unused function.
1623 (WebCore::Document::iconURLs): Removed. Moved code to IconController.
1624 (WebCore::Document::addIconURL): Removed. Moved code to LinkLoader.
1626 * dom/Document.h: Removed shortcutIconURLs, iconURLs, addIconURL,
1629 * dom/IconURL.cpp: Removed.
1630 * dom/IconURL.h: Removed everything from this header except for the
1631 IconType enum. Added a FIXME about possibly renaming the header.
1633 * html/HTMLLinkElement.cpp:
1634 (WebCore::HTMLLinkElement::HTMLLinkElement): Pass a reference when creating
1636 (WebCore::HTMLLinkElement::setDisabledState): Access members of the struct
1637 LinkRelElement without "m_" prefix.
1638 (WebCore::HTMLLinkElement::parseAttribute): Changed to use early return style,
1639 and made the part of this for parsing title use a more normal idiom.
1640 (WebCore::HTMLLinkElement::process): Removed many unneeded arguments, made the
1641 logic of the code a little easier to follow.
1642 (WebCore::HTMLLinkElement::removedFrom): Removed a call to a function that had
1644 (WebCore::HTMLLinkElement::iconType): Updated for change to LinkRelElement.
1645 (WebCore::HTMLLinkElement::addSubresourceAttributeURLs): Ditto.
1646 * html/HTMLLinkElement.h: More of the same.
1648 * html/LinkRelAttribute.cpp:
1649 (WebCore::LinkRelAttribute::LinkRelAttribute): Initialize data members in the
1650 struct itself. Got rid of "m_" prefix since this is a struct, not a class.
1651 Changed code to use modern for loop; even better would be to eliminate the
1652 splitting into a vector entirely and use StringView (do that next time).
1653 * html/LinkRelAttribute.h: See above.
1655 * html/parser/HTMLPreloadScanner.cpp:
1656 (WebCore::TokenPreloadScanner::StartTagScanner::relAttributeIsStyleSheet):
1657 Updated for chnages to LinkRelAttribute and give the local variable a clearer name.
1659 * loader/FrameLoader.cpp:
1660 (WebCore::FrameLoader::didChangeIcons): Removed.
1661 * loader/FrameLoader.h: Removed didChangeIcons.
1663 * loader/FrameLoaderClient.h: Added include for String since it's no longer
1664 taken care of by IconURLs.h.
1666 * loader/LinkLoader.cpp:
1667 (WebCore::LinkLoader::LinkLoader): Take a reference instead of a pointer.
1668 (WebCore::LinkLoader::linkLoadTimerFired): Use m_client reference instead of pointer.
1669 (WebCore::LinkLoader::linkLoadingErrorTimerFired): Ditto.
1670 (WebCore::LinkLoader::notifyFinished): Use nullptr.
1671 (WebCore::LinkLoader::loadLink): Tweak formatting. Move the dispatchDidChangeIcons
1672 call in here instead of going through Document to FrameLoader and then FrameLoader to
1673 FrameLoaderClient, and passing extra unused arguments, the way the old code did.
1674 Use a reference instead of a pointer for the document.
1675 (WebCore::LinkLoader::released): Removed. Empty function.
1677 * loader/LinkLoader.h: Changed constructor argument to be a reference. Made more
1678 things private. Removed empty released function.
1680 * loader/icon/IconController.cpp:
1681 (WebCore::IconController::IconController): Moved initialization of data members to
1682 the class definition in the header.
1683 (WebCore::iconsFromLinkElements): Added. This function replaces the existing
1684 Document::iconURLs function, but has a simpler implementation and interface.
1685 It focuses on exactly what the code in this file needs. If we want to add some
1686 more features to the icon controller we might make this more complex again.
1687 Even now, building a vector is not necessarily helpful; the only client of this
1688 function ends up extracting only one of the URLs this function returns.
1689 (WebCore::IconController::url): Rewrote this. It's the only function actually
1690 using the icon URLs. This contains a combination of the logic from the various
1691 functions in this class before, including iconURL, urlsForTypes, appendToIconURLs,
1692 and defaultURL. Among other improvements, replaced the unusual code to construct
1693 the icon URL with a call to Document::completeURL.
1694 (WebCore::IconController::startLoader): Refactored a bit to remove a local variable.
1695 (WebCore::IconController::continueLoadWithDecision): Ditto.
1697 * loader/icon/IconController.h: Removed unneeded includes, unneeded use of
1698 WTF_MAKE_NONCOPYABLE (since classes with data members of reference type are
1699 automatically noncopyable), unused fucntions. Also initialize m_waitingForLoadDecision.
1701 * testing/Internals.cpp:
1702 (WebCore::Internals::iconURLs): Removed.
1703 (WebCore::Internals::shortcutIconURLs): Left this in place since it is used by
1704 tests. Changed it to return the actual value from the IconController::url function,
1705 since that's the interface to our icon machinery that is actually exposed on some
1706 platforms. That means this returns only a single URL.
1707 (WebCore::Internals::allIconURLs): Removed.
1708 * testing/Internals.h: Removed allIconURLs and iconURLs.
1709 * testing/Internals.idl: Removed allIconURLs.
1711 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1713 Fix EFL and Gtk build.
1716 (WebCore::Document::didRemoveTouchEventHandler):
1718 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1720 Crash under Document::absoluteRegionForEventTargets on build.webkit.org/dashboard
1721 https://bugs.webkit.org/show_bug.cgi?id=143406
1722 rdar://problem/20407080
1724 Reviewed by Ryosuke Niwa.
1726 We failed to remove elements from Document's m_wheelEventTargets HashSet when the
1727 elements were destroyed with wheel handlers still on them. Fix by removing the
1728 node from the set via Node::willBeDeletedFrom().
1730 Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-element-with-multiple-handlers-crash.html
1731 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-crash.html
1732 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/destroy-wheel-element-parent-crash.html
1735 (WebCore::removeHandlerFromSet): Helper to remove one or all handlers on the given node.
1736 (WebCore::Document::didRemoveWheelEventHandler): Add a parameter to specify whether we're
1737 removing all handlers on the given node.
1738 (WebCore::Document::didRemoveTouchEventHandler): Use removeHandlerFromSet().
1741 (WebCore::Node::willBeDeletedFrom): Tell the document we're removing all handlers
1744 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1746 REGRESSION (r182215): Feedly crashes when closing article
1747 https://bugs.webkit.org/show_bug.cgi?id=143405
1748 rdar://problem/20382734, rdar://problem/20395497
1750 Reviewed by Tim Horton.
1752 Calling computeNonFastScrollableRegion() eagerly when scrollable areas come and go
1753 is bad, because it can cause FrameView::layout() to get called in the middle of
1754 RenderObject destruction, which leaves the render tree in a bad state.
1756 Fix by calling computeNonFastScrollableRegion() lazily, just before scrolling tree commit.
1758 AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged() now just sets
1759 a flag to say that the non-fast region needs to be recomputed, and that schedules
1760 a scrolling tree commit. When the commit happens, we recompute the region. If the
1761 region didn't change, and no other changes are pending, there's no need to commit.
1763 Test: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/compute-region-inside-delete-renderer-crash.html
1765 * page/scrolling/AsyncScrollingCoordinator.cpp:
1766 (WebCore::AsyncScrollingCoordinator::setNonFastScrollableRegionDirty):
1767 (WebCore::AsyncScrollingCoordinator::willCommitTree):
1768 (WebCore::AsyncScrollingCoordinator::updateNonFastScrollableRegion):
1769 (WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
1770 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
1771 (WebCore::AsyncScrollingCoordinator::scrollingStateTreeAsText): Need to eagerly update
1772 the non-fast scrollable region.
1773 * page/scrolling/AsyncScrollingCoordinator.h:
1774 (WebCore::AsyncScrollingCoordinator::nonFastScrollableRegionDirty):
1775 * page/scrolling/ScrollingCoordinator.cpp:
1776 (WebCore::ScrollingCoordinator::ScrollingCoordinator):
1777 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1778 * page/scrolling/ScrollingCoordinator.h:
1779 (WebCore::ScrollingCoordinator::willCommitTree):
1780 * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1781 (WebCore::ScrollingCoordinatorMac::commitTreeStateIfNeeded):
1782 (WebCore::ScrollingCoordinatorMac::scheduleTreeStateCommit):
1783 (WebCore::ScrollingCoordinatorMac::commitTreeState):
1785 2015-04-04 Simon Fraser <simon.fraser@apple.com>
1787 Differentiate between composited scrolling, and async scrolling
1788 https://bugs.webkit.org/show_bug.cgi?id=143291
1790 Reviewed by Sam Weinig.
1792 ScrollableArea::usesCompositedScrolling() meant "uses aysnc scrolling", but
1793 FrameView::contentsInCompositedLayer() covered a related concept, that scrolling
1794 happens by moving compositing layers around.
1796 Make the difference between these more explicit by adding ScrollableArea::usesAsyncScrolling(),
1797 which means that scrolling for that ScrollableArea is asynchronous and managed
1798 by a ScrollingCoordinator. This is the meaning that ScrollingCoordinator::computeNonFastScrollableRegion()
1801 ScrollableArea::usesCompositedScrolling() is now repurposed to mean "scrolling
1802 occurs by moving layers around, not requiring repaint". FrameView::contentsInCompositedLayer()
1803 is renamed to usesCompositedScrolling(), and overrides the base class function.
1805 This only changes behavior in tests that call setScrollingTreeIncludesFrames(true).
1807 * page/FrameView.cpp:
1808 (WebCore::FrameView::useSlowRepaints):
1809 (WebCore::FrameView::usesCompositedScrolling):
1810 (WebCore::FrameView::usesAsyncScrolling):
1811 (WebCore::FrameView::scrollContentsFastPath):
1812 (WebCore::FrameView::scrollContentsSlowPath):
1813 (WebCore::FrameView::contentsInCompositedLayer): Deleted.
1815 * page/scrolling/ScrollingCoordinator.cpp:
1816 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
1817 * platform/ScrollableArea.h:
1818 (WebCore::ScrollableArea::usesAsyncScrolling):
1819 * rendering/RenderLayer.cpp:
1820 (WebCore::RenderLayer::usesAsyncScrolling):
1821 * rendering/RenderLayer.h:
1823 2015-04-04 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1825 [Streams API] Collecting a ReadableStreamReader should not unlock its stream
1826 https://bugs.webkit.org/show_bug.cgi?id=143333
1828 Reviewed by Benjamin Poulain.
1830 This patch stores as a boolean whether the stream is locked to a reader.
1831 In case the reader forget to unlock the stream, the reader can be collected and destructor called.
1832 In that case, the link between reader and stream will be reset but the stream will remain in locked state.
1834 Covered by new test in streams/readablestreamreader-constructor.html.
1836 * Modules/streams/ReadableStream.h:
1837 (WebCore::ReadableStream::isLocked):
1838 (WebCore::ReadableStream::lock):
1839 (WebCore::ReadableStream::release):
1840 (WebCore::ReadableStream::releaseButKeepLocked): Introduced to cut the link between reader and stream but stil keeping the stream locked.
1841 * Modules/streams/ReadableStreamReader.cpp:
1842 (WebCore::ReadableStreamReader::~ReadableStreamReader):
1843 * bindings/js/JSReadableStreamCustom.cpp:
1844 (WebCore::JSReadableStream::getReader):
1845 * bindings/js/JSReadableStreamReaderCustom.cpp:
1846 (WebCore::constructJSReadableStreamReader):
1848 2015-04-03 Zan Dobersek <zdobersek@igalia.com>
1850 MediaDevices possesses a vtable despite using ImplementationLacksVTable IDL attribute
1851 https://bugs.webkit.org/show_bug.cgi?id=143367
1853 Reviewed by Eric Carlson.
1855 * Modules/mediastream/MediaDevices.idl: MediaDevices ends up with a vtable
1856 because of inheriting from ContextDestructionObserver. This collides with
1857 the ImplementationLacksVTable IDL attribute, causing compilation errors
1858 with Clang. Since MediaDevices isn't being inherited from, but will still
1859 end up with a vtable, the IDL attribute should be removed.
1861 2015-04-03 Alex Christensen <achristensen@webkit.org>
1863 [Content Extensions] Add memory reporting.
1864 https://bugs.webkit.org/show_bug.cgi?id=143386
1866 Reviewed by Benjamin Poulain.
1868 * contentextensions/CompiledContentExtension.cpp:
1869 (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
1870 * contentextensions/CompiledContentExtension.h:
1871 * contentextensions/ContentExtension.cpp:
1872 (WebCore::ContentExtensions::ContentExtension::globalDisplayNoneStyleSheet):
1873 * contentextensions/ContentExtension.h:
1874 * contentextensions/ContentExtensionsBackend.cpp:
1875 (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1876 * contentextensions/ContentExtensionsDebugging.h:
1877 * contentextensions/DFABytecodeInterpreter.cpp:
1878 (WebCore::ContentExtensions::getBits):
1879 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
1880 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1881 (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1882 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1883 * contentextensions/DFABytecodeInterpreter.h:
1884 (WebCore::ContentExtensions::DFABytecodeInterpreter::DFABytecodeInterpreter):
1885 (WebCore::ContentExtensions::DFABytecodeInterpreter::~DFABytecodeInterpreter):
1886 Keep track of which memory pages in the bytecode are being hit if CONTENT_EXTENSIONS_MEMORY_REPORTING is 1.
1887 When CONTENT_EXTENSIONS_MEMORY_REPORTING is 0, this makes an empty vector in ContentExtension
1888 and passes some pointers on the stack, many of which can be optimized out by the C++ compiler.
1890 2015-04-03 Brent Fulgham <bfulgham@apple.com>
1892 Expand test infrastructure to support scrolling tests
1893 https://bugs.webkit.org/show_bug.cgi?id=143383
1895 Reviewed by Darin Adler.
1897 No new tests: No change in behavior.
1899 This is an initial set of changes that clean up a few things I noticed while extending testing support
1900 for scroll animations and wheel event gestures.
1901 1. Reduce the amount of #ifdef code in EventHandler{Mac}.
1902 2. Consolidate the idea of an "End Gesture" in the PlatformWheelEvent class.
1903 3. Remove a number of unneeded null checks in EventHandler.
1904 4. ScrollController must always have a client, so hold a reference instead of using a pointer.
1906 * page/EventHandler.cpp:
1907 (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
1908 (WebCore::EventHandler::handleWheelEvent): Call 'platformNotifySnapIfNecessary' at method exit points.
1909 (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
1910 * page/EventHandler.h:
1911 * page/mac/EventHandlerMac.mm:
1912 (WebCore::EventHandler::platformCompleteWheelEvent): Remove unneeded null checks for 'view'. Remove
1913 CSS_SNAP-specific call to 'platformNotifySnapIfNecessary'. This logic is now handled in the new
1914 'platformNotifyIfEndGesture' method.
1915 (WebCore::EventHandler::platformNotifyIfEndGesture): Renamed from 'platformNotifySnapIfNecessary'.
1916 (WebCore::EventHandler::platformNotifySnapIfNecessary): Deleted.
1917 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1918 (WebCore::ScrollingTreeFrameScrollingNodeMac::ScrollingTreeFrameScrollingNodeMac): Pass 'this' as
1919 reference to ScrollController constructor.
1920 * platform/PlatformWheelEvent.h:
1921 (WebCore::PlatformWheelEvent::shouldResetLatching): Call new 'isEndGesture' method.
1922 (WebCore::PlatformWheelEvent::isEndGesture): Added method to encapsulate some code that was duplicated
1923 in a number of places.
1924 * platform/ScrollAnimator.cpp:
1925 (WebCore::ScrollAnimator::ScrollAnimator): Pass 'this' as reference to ScrollController constructor.
1926 * platform/cocoa/ScrollController.h:
1927 * platform/cocoa/ScrollController.mm:
1928 (WebCore::ScrollController::ScrollController): Update to reflect m_client is now a reference.
1929 (WebCore::ScrollController::handleWheelEvent): Ditto.
1930 (WebCore::ScrollController::snapRubberBandTimerFired): Ditto. Also, a drive-by fix for ending rubberband
1931 snapping. This end-state wasn't deactivating the timer (even when the animation finished). This isn't a
1932 huge problem, but I (will) rely on the state of the animation timer in a future patch to decide if
1933 tests should run or continue waiting.
1934 (WebCore::ScrollController::isRubberBandInProgress): Ditto.
1935 (WebCore::ScrollController::startSnapRubberbandTimer): Ditto.
1936 (WebCore::ScrollController::stopSnapRubberbandTimer): Ditto.
1937 (WebCore::ScrollController::shouldRubberBandInHorizontalDirection): Ditto.
1938 (WebCore::ScrollController::processWheelEventForScrollSnapOnAxis): Ditto.
1939 (WebCore::ScrollController::startScrollSnapTimer): Ditto.
1940 (WebCore::ScrollController::stopScrollSnapTimer): Ditto.
1941 (WebCore::ScrollController::scrollSnapAnimationUpdate): Ditto.
1942 (WebCore::ScrollController::beginScrollSnapAnimation): Ditto.
1943 (WebCore::ScrollController::computeSnapDelta): Ditto.
1944 (WebCore::ScrollController::computeGlideDelta): Ditto.
1945 * platform/mac/ScrollAnimatorMac.mm:
1946 (WebCore::gestureShouldBeginSnap): Use new PlatformWheelEvent::isEndGesture() method.
1948 2015-04-03 Chris Fleizach <cfleizach@apple.com>
1950 AX: Toggling check box state not speaking using plain space, not VO space.
1951 https://bugs.webkit.org/show_bug.cgi?id=143356
1953 Reviewed by Darin Adler.
1955 The checkbox state change needs to result in a value change being generated, otherwise accessibility won't know the value has changed through keyboard usage.
1957 Test: platform/mac/accessibility/checkbox-posts-value-change-notification-after-activation-with-space.html
1959 * accessibility/mac/AXObjectCacheMac.mm:
1960 (WebCore::AXObjectCache::postPlatformNotification):
1962 2015-04-03 Zalan Bujtas <zalan@apple.com>
1964 Simple line layout: Use pre-computed simple line runs to produce innerText content.
1965 https://bugs.webkit.org/show_bug.cgi?id=143351
1967 Reviewed by Antti Koivisto.
1969 This is in preparation to cover <br> with simple line layout.
1970 Runs provide line layout information that can be used to cover hard line break cases.
1971 (similar to TextIterator::handleTextBox())
1973 Covered by existing tests.
1975 * editing/TextIterator.cpp:
1976 (WebCore::TextIterator::handleTextNode):
1977 (WebCore::TextIterator::emitCharacter):
1978 (WebCore::TextIterator::emitText):
1979 * editing/TextIterator.h:
1980 * rendering/SimpleLineLayoutResolver.h:
1981 (WebCore::SimpleLineLayout::RunResolver::Run::isEndOfLine):
1983 2015-04-03 Antti Koivisto <antti@apple.com>
1985 Add non-counting bloom filter class
1986 https://bugs.webkit.org/show_bug.cgi?id=143366
1988 Reviewed by Sam Weinig.
1990 * css/SelectorFilter.cpp:
1991 (WebCore::SelectorFilter::setupParentStack):
1992 * css/SelectorFilter.h:
1996 2015-04-03 Alex Christensen <achristensen@webkit.org>
1999 https://bugs.webkit.org/show_bug.cgi?id=143352
2001 Reviewed by Gyuyoung Kim.
2003 * html/BaseChooserOnlyDateAndTimeInputType.cpp:
2004 (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
2005 * loader/EmptyClients.cpp:
2006 (WebCore::EmptyChromeClient::openDateTimeChooser): Deleted.
2007 * loader/EmptyClients.h:
2009 (WebCore::Chrome::openDateTimeChooser): Deleted.
2011 * page/ChromeClient.h:
2012 Remove ChromeClient::openDateTimeChooser.
2014 2015-04-03 Zan Dobersek <zdobersek@igalia.com>
2016 Unreviewed, fixing Clang builds of the GTK port on Linux.
2018 * Modules/mediastream/MediaDevices.h:
2019 Include the <functional> header for uses of std::function<>.
2021 2015-04-01 Xabier Rodriguez Calvar <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2023 [Streams API] Split ReadableStream/Reader implementation according source type (JS vs native)
2024 https://bugs.webkit.org/show_bug.cgi?id=143130
2026 Reviewed by Benjamin Poulain.
2028 Introduce ReadableJSStream and ReadableJSStreamReader as subclasses of ReadableStream and ReadableStreamReader.
2029 These classes manage JS based sources: ReadableStream JS constructor instantiates ReadableJStream.
2030 These classes are expected to handle JS source specific handling, in particular JSValue error storage and JSValue chunk queue.
2031 Making ReadableStream and ReadableStreamReader abstract, to be subclassed for native sources.
2033 Current tests cover the changes.
2035 * Modules/streams/ReadableStream.cpp:
2036 (WebCore::ReadableStream::ReadableStream): Moved suspendIfNeeded inside constructor to ease subclassing.
2037 (WebCore::ReadableStream::create): Deleted as ReadableStream is now abstarct.
2038 * Modules/streams/ReadableStream.h: Made createReader virtual pure.
2039 * Modules/streams/ReadableStream.idl: Skipping VTable validation as subclasses of ReadableStream may be JS wrapped.
2040 * Modules/streams/ReadableStreamReader.cpp: Removed ReadableStreamReader::create.
2041 * Modules/streams/ReadableStreamReader.h: Ditto.
2042 * Modules/streams/ReadableStreamReader.idl: Skipping VTable validation as subclasses of ReadableStreamReader may be JS wrapped.
2043 * bindings/js/JSReadableStreamCustom.cpp:
2044 (WebCore::constructJSReadableStream): Instantiating ReadableJSStream in lieu of ReadableStream within JS constructor.
2045 * bindings/js/ReadableStreamJSSource.cpp:
2046 (WebCore::ReadableJSStream::create):
2047 (WebCore::ReadableJSStream::createReader): Instantiating ReadableJSStreamReader.
2048 (WebCore::ReadableJSStream::ReadableJSStream):
2049 (WebCore::ReadableJSStreamReader::create):
2050 (WebCore::ReadableJSStreamReader::ReadableJSStreamReader):
2051 * bindings/js/ReadableStreamJSSource.h: Definition of ReadableJSStream and ReadableJSStreamReader.
2053 2015-04-02 Timothy Horton <timothy_horton@apple.com>
2055 Scrollbars are left in the wrong position when resizing a fixed layout view
2056 https://bugs.webkit.org/show_bug.cgi?id=143360
2058 Reviewed by Beth Dakin.
2060 Test: fast/fixed-layout/fixed-layout.html
2062 * platform/ScrollView.cpp:
2063 (WebCore::ScrollView::setFrameRect):
2064 Update scrollbars when the ScrollView frameRect changes. We were previously
2065 depending on the layout that always happens after this to update scrollbars,
2066 but with fixed layout mode, there won't be a layout! Also, FrameView's
2067 setFrameRect override will sync this scrollbar update with the scrollbar
2068 layers (via RenderLayerCompositor::frameViewDidChangeSize) immediately afterwards.
2070 * testing/Internals.cpp:
2071 (WebCore::Internals::resetToConsistentState):
2072 Turn off fixed layout when resetting state.
2074 (WebCore::Internals::setUseFixedLayout):
2075 (WebCore::Internals::setFixedLayoutSize):
2076 * testing/Internals.h:
2077 * testing/Internals.idl:
2078 Add internals functions to set the fixed layout size and to turn on fixed layout.
2080 2015-04-02 Brady Eidson <beidson@apple.com>
2082 Unreviewed: Reapplied Change after rollout.
2084 Expose the "Share" menu for text selections on platforms where it's available.
2085 rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
2087 * page/ContextMenuClient.h:
2088 (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
2090 * page/ContextMenuContext.h:
2091 (WebCore::ContextMenuContext::setSelectedText):
2092 (WebCore::ContextMenuContext::selectedText):
2094 * page/ContextMenuController.cpp:
2095 (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
2096 (WebCore::ContextMenuController::checkOrEnableIfNeeded):
2098 * platform/ContextMenuItem.cpp:
2099 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
2101 * platform/ContextMenuItem.h:
2102 (WebCore::ContextMenuItem::supportsShareMenu):
2104 * platform/gtk/ContextMenuItemGtk.cpp:
2105 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
2107 * platform/mac/ContextMenuItemMac.mm:
2108 (WebCore::ContextMenuItem::releasePlatformDescription):
2109 (WebCore::ContextMenuItem::getPlatformDescription):
2110 (WebCore::ContextMenuItem::supportsShareMenu):
2111 (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
2113 * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
2115 2015-04-02 Commit Queue <commit-queue@webkit.org>
2117 Unreviewed, rolling out r182293.
2118 https://bugs.webkit.org/show_bug.cgi?id=143355
2120 Broke GTK and EFL builds. (Requested by bfulgham on #webkit).
2124 "Expose the "Share" menu for text selections on platforms
2125 where it's available."
2126 https://bugs.webkit.org/show_bug.cgi?id=143318
2127 http://trac.webkit.org/changeset/182293
2129 2015-04-02 Brent Fulgham <bfulgham@apple.com>
2131 REGRESSION: Caption Menus show language codes instead of display names.
2132 https://bugs.webkit.org/show_bug.cgi?id=143350
2133 <rdar://problem/20094145>
2135 Reviewed by Jer Noble.
2137 The generic caption/track label handling in CaptionUserPreferences does not convert language codes
2138 (e.g. 'fr-CA') into display names (e.g., 'French (Canada)'). Because we did not have an AudioTrack
2139 override to process these types of menu items, they were being handled using the generic code.
2141 * page/CaptionUserPreferencesMediaAF.cpp:
2142 (WebCore::buildStringForTrackBase): Helper function to share code with the two flavors
2143 of 'trackDisplayName'.
2144 (WebCore::trackDisplayName): Add a version to support AudioTracks, and modify the TextTrack
2145 version to use the new 'buildStringForTrackBase' function.
2146 (WebCore::CaptionUserPreferencesMediaAF::displayNameForTrack): Add an AudioTrack override so
2147 our AVFoundation tracks are processed in our CaptionUserPreferencesMediaAF implementation, not the
2149 (WebCore::CaptionUserPreferencesMediaAF::sortedTrackListForMenu): Add an AudioTrack override so
2150 that the menu items are sorted in order of display name, not language code.
2151 * page/CaptionUserPreferencesMediaAF.h:
2153 2015-04-02 Brady Eidson <beidson@apple.com>
2155 Expose the "Share" menu for text selections on platforms where it's available.
2156 rdar://problem/20034174 and https://bugs.webkit.org/show_bug.cgi?id=143318
2158 Reviewed by Sam Weinig.
2160 * page/ContextMenuClient.h:
2161 (WebCore::ContextMenuClient::shareSelectedTextMenuItem):
2163 * page/ContextMenuContext.h:
2164 (WebCore::ContextMenuContext::setSelectedText):
2165 (WebCore::ContextMenuContext::selectedText):
2167 * page/ContextMenuController.cpp:
2168 (WebCore::ContextMenuController::populate): Add a Share menu item returned from the client.
2169 (WebCore::ContextMenuController::checkOrEnableIfNeeded):
2171 * platform/ContextMenuItem.cpp:
2172 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
2174 * platform/ContextMenuItem.h:
2175 (WebCore::ContextMenuItem::supportsShareMenu):
2177 * platform/gtk/ContextMenuItemGtk.cpp:
2178 (WebCore::ContextMenuItem::shareSelectedTextMenuItem):
2180 * platform/mac/ContextMenuItemMac.mm:
2181 (WebCore::ContextMenuItem::releasePlatformDescription):
2182 (WebCore::ContextMenuItem::getPlatformDescription):
2183 (WebCore::ContextMenuItem::supportsShareMenu):
2184 (WebCore::ContextMenuItem::shareSelectedTextMenuItem): Use NSMenu SPI to get the Share menu.
2186 * platform/spi/mac/NSMenuSPI.h: Forward declare instead of #include
2188 2015-04-02 Jer Noble <jer.noble@apple.com>
2190 [Mac] Only pass in the AVURLAssetClientBundleIdentifierKey on iOS.
2191 https://bugs.webkit.org/show_bug.cgi?id=143347
2193 Reviewed by Brent Fulgham.
2195 Only pass in the main app bundle id into AVURLAsset via the AVURLAssetClientBundleIdentifierKey option
2196 on iOS. On OS X, setting this key can cause media playback to fail.
2198 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2199 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL):
2201 2015-04-02 Roger Fong <roger_fong@apple.com>
2203 Show audio media controls on OSX.
2204 https://bugs.webkit.org/show_bug.cgi?id=143346.
2205 <rdar://problem/20306240>
2207 Reviewed by Dean Jackson.
2209 * Modules/mediacontrols/mediaControlsApple.css:
2210 (audio::-webkit-media-controls-panel:hover):
2211 Revert part of r180893.
2213 2015-04-02 Myles C. Maxfield <mmaxfield@apple.com>
2215 Disallow ruby base from having leading or trailing expansions
2216 https://bugs.webkit.org/show_bug.cgi?id=142608
2218 Reviewed by David Hyatt.
2220 If we determine that a ruby base should have either a leading or trailing expansion,
2221 we shunt that expansion over to the neighboring RenderText, assuming one exists. This
2222 requires that we teach RenderText how to force leading or trailing expansions if one
2223 wouldn't naturally be present.
2225 Tests: fast/ruby/ruby-expansion-cjk-2.html
2226 fast/ruby/ruby-expansion-cjk-3.html
2227 fast/ruby/ruby-expansion-cjk-4.html
2228 fast/ruby/ruby-expansion-cjk-5.html
2229 fast/ruby/ruby-expansion-cjk.html
2231 * rendering/InlineFlowBox.cpp:
2232 (WebCore::InlineFlowBox::removeChild): Delete contentIsKnownToFollow.
2233 * rendering/InlineTextBox.cpp:
2234 (WebCore::InlineTextBox::expansionBehavior): Support forced leading and trailing
2236 * rendering/InlineTextBox.h:
2237 (WebCore::InlineTextBox::expansionBehavior): Moved to .cpp
2238 * rendering/RenderBlockLineLayout.cpp:
2239 (WebCore::RenderBlockFlow::updateRubyForJustifiedText): Perform relayout even if
2240 there are no expansions left. This is so that ruby bases with no expansions will get
2242 (WebCore::expansionBehaviorForInlineTextBox): Update to inspect neighboring rubies.
2243 (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment): Use updated
2244 expansionBehaviorForInlineTextBox(). Also center ruby bases if they have no expansion
2246 (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns): Use nullptr.
2247 (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): Ditto.
2248 * rendering/RenderText.cpp:
2249 (WebCore::RenderText::RenderText): Delete contentIsKnownToFollow.
2250 * rendering/RenderText.h:
2251 (WebCore::RenderText::contentIsKnownToFollow): Deleted.
2252 (WebCore::RenderText::setContentIsKnownToFollow): Deleted.
2254 2015-04-02 Alexey Proskuryakov <ap@apple.com>
2256 Clean up access checks in JSHistoryCustom.cpp
2257 https://bugs.webkit.org/show_bug.cgi?id=143227
2259 Reviewed by Sam Weinig.
2261 * bindings/js/JSHistoryCustom.cpp:
2262 (WebCore::JSHistory::putDelegate):
2263 (WebCore::JSHistory::deleteProperty):
2264 (WebCore::JSHistory::deletePropertyByIndex):
2265 (WebCore::JSHistory::getOwnPropertyNames):
2266 (WebCore::JSHistory::pushState):
2267 (WebCore::JSHistory::replaceState):
2269 2015-04-02 Alex Christensen <achristensen@webkit.org>
2271 [Content Extensions] Only add unique universal action locations.
2272 https://bugs.webkit.org/show_bug.cgi?id=143325
2274 Reviewed by Benjamin Poulain.
2276 * contentextensions/ContentExtensionCompiler.cpp:
2277 (WebCore::ContentExtensions::compileRuleList):
2278 Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
2280 2015-04-01 Roger Fong <roger_fong@apple.com>
2282 Fix slider colors for media controls on OSX.
2283 https://bugs.webkit.org/show_bug.cgi?id=143328.
2284 <rdar://problem/20357858>
2286 Reviewed by Darin Adler.
2288 Fill in bottom portion of volume slider.
2289 Adjust colors to make slider controls look better. Will likely be tweaked later.
2290 * Modules/mediacontrols/mediaControlsApple.js:
2291 (Controller.prototype.drawTimelineBackground):
2292 (Controller.prototype.drawVolumeBackground):
2294 2015-04-02 Yusuke Suzuki <utatane.tea@gmail.com>
2296 Clean up EnumerationMode to easily extend
2297 https://bugs.webkit.org/show_bug.cgi?id=143276
2299 Reviewed by Geoffrey Garen.
2301 Use default EnumerationMode().
2303 * bindings/js/Dictionary.cpp:
2304 (WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
2305 (WebCore::Dictionary::getOwnPropertyNames):
2306 * bindings/js/SerializedScriptValue.cpp:
2307 (WebCore::CloneSerializer::serialize):
2308 * bindings/scripts/CodeGeneratorJS.pm:
2310 * bindings/scripts/test/JS/JSFloat64Array.h:
2311 * bindings/scripts/test/JS/JSTestEventTarget.h:
2312 * bridge/NP_jsobject.cpp:
2314 * bridge/runtime_array.cpp:
2315 (JSC::RuntimeArray::getOwnPropertyNames):
2317 2015-04-02 David Hyatt <hyatt@apple.com>
2319 [New Block-Inside-Inline Model] Implement the correct paint order for blocks inside inlines.
2320 https://bugs.webkit.org/show_bug.cgi?id=143320
2322 Reviewed by Darin Adler.
2324 Added new tests in fast/block/inside-inlines.
2326 * rendering/EllipsisBox.cpp:
2327 (WebCore::EllipsisBox::nodeAtPoint):
2328 * rendering/EllipsisBox.h:
2329 * rendering/InlineBox.h:
2330 * rendering/InlineElementBox.cpp:
2331 (WebCore::InlineElementBox::paint):
2332 (WebCore::InlineElementBox::nodeAtPoint):
2333 * rendering/InlineElementBox.h:
2334 * rendering/InlineFlowBox.cpp:
2335 (WebCore::InlineFlowBox::nodeAtPoint):
2336 (WebCore::InlineFlowBox::paint):
2337 * rendering/InlineFlowBox.h:
2338 * rendering/InlineTextBox.cpp:
2339 (WebCore::InlineTextBox::nodeAtPoint):
2340 * rendering/InlineTextBox.h:
2341 The HitTestAction has to be passed to nodeAtPoint so that hit test actions can be honored. All the nodeAtPoint
2342 functions have been patched to include this argument. Painting and hit testing have been patched for InlineElementBox
2343 to honor phases/actions when the element is an anonymous inline block.
2345 The phase filter on RenderLineBoxList has been pushed in to InlineFlowBox::paint and InlineFlowBox::nodeAtPoint so that
2346 we can respect it properly when inlines are painting by themselves (e.g., because they have a layer).
2348 * rendering/RenderBlockLineLayout.cpp:
2349 (WebCore::RenderBlockFlow::createLineBoxes):
2350 (WebCore::RenderBlockFlow::constructLine):
2351 Go ahead and include all of the inline flow boxes between the root and the anonymous inline block if it turns out they
2352 need to be constructed. This will end up being relevant for outlines and for self-painting layers (e.g., opacity).
2354 * rendering/RenderLineBoxList.cpp:
2355 (WebCore::RenderLineBoxList::paint):
2356 (WebCore::RenderLineBoxList::hitTest):
2357 Remove the filters here, since they get pushed in to InlineFlowBox.
2359 * rendering/RootInlineBox.cpp:
2360 (WebCore::RootInlineBox::nodeAtPoint):
2361 * rendering/RootInlineBox.h:
2362 * rendering/svg/SVGInlineTextBox.cpp:
2363 (WebCore::SVGInlineTextBox::nodeAtPoint):
2364 * rendering/svg/SVGInlineTextBox.h:
2365 More patching to pass the HitTestAction into nodeAtPoint.
2367 2015-04-02 Adam Bergkvist <adam.bergkvist@ericsson.com>
2369 WebRTC: Add support for Promise-based MediaDevices.getUserMedia()
2370 https://bugs.webkit.org/show_bug.cgi?id=143255
2372 Reviewed by Eric Carlson.
2374 The MediaDevices object collects functionality related to local media
2375 devices. This patch adds the Promise-based version of getUserMedia()
2376 (unprefixed). Other functionality, like enumerateDevices(), will be
2377 added in later patches.
2379 The old callback-based webkitGetUserMedia() (on Navigator) is kept for
2380 legacy purposes (according to the Media Capture and Streams API spec [1]).
2381 Both versions of getUserMedia are backed up by UserMediaRequest where
2382 the callbacks from the callback-based version are wrapped inside c++
2383 lambda functions. The new Promise-based getUserMedia() uses the lambda
2384 functions directly as created by the Promise bindings.
2386 [1] http://w3c.github.io/mediacapture-main/archives/20150324/getusermedia.html#navigatorusermedia-interface-extensions
2388 Test: fast/mediastream/MediaDevices-getUserMedia.html
2391 * DerivedSources.make:
2392 * Modules/mediastream/MediaDevices.cpp: Added.
2393 (WebCore::MediaDevices::create):
2394 (WebCore::MediaDevices::MediaDevices):
2395 (WebCore::MediaDevices::~MediaDevices):
2396 (WebCore::MediaDevices::document):
2397 (WebCore::MediaDevices::getUserMedia):
2398 * Modules/mediastream/MediaDevices.h: Added.
2399 * Modules/mediastream/MediaDevices.idl: Added.
2400 * Modules/mediastream/NavigatorMediaDevices.cpp: Added.
2401 (WebCore::NavigatorMediaDevices::NavigatorMediaDevices):
2402 (WebCore::NavigatorMediaDevices::~NavigatorMediaDevices):
2403 (WebCore::NavigatorMediaDevices::from):
2404 (WebCore::NavigatorMediaDevices::mediaDevices):
2405 (WebCore::NavigatorMediaDevices::supplementName):
2406 * Modules/mediastream/NavigatorMediaDevices.h: Added.
2407 * Modules/mediastream/NavigatorMediaDevices.idl: Added.
2408 * Modules/mediastream/UserMediaRequest.cpp:
2409 (WebCore::UserMediaRequest::create):
2410 (WebCore::UserMediaRequest::UserMediaRequest):
2411 (WebCore::UserMediaRequest::didCreateStream):
2412 (WebCore::UserMediaRequest::failedToCreateStreamWithConstraintsError):
2413 (WebCore::UserMediaRequest::failedToCreateStreamWithPermissionError):
2414 * Modules/mediastream/UserMediaRequest.h:
2415 * PlatformGTK.cmake:
2416 * WebCore.xcodeproj/project.pbxproj:
2417 * bindings/js/JSMediaDevicesCustom.cpp: Added.
2418 (WebCore::JSMediaDevices::getUserMedia):
2420 2015-04-02 Eric Carlson <eric.carlson@apple.com>
2422 [iOS] Fix AirPlay problem caused by r182240
2423 https://bugs.webkit.org/show_bug.cgi?id=143337
2425 Reviewed by Jer Noble.
2427 * html/HTMLMediaSession.cpp:
2428 (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return false if the legacy attribute
2429 "x-webkit-airplay" has the value "allow".
2430 * html/HTMLVideoElement.cpp:
2431 (WebCore::HTMLVideoElement::parseAttribute): Don't call webkitWirelessVideoPlaybackDisabled when
2432 processing "x-webkit-airplay" and "x-webkit-wirelessvideoplaybackdisabled", just consider
2433 the attribute/value.
2435 2015-04-02 Commit Queue <commit-queue@webkit.org>
2437 Unreviewed, rolling out r182265.
2438 https://bugs.webkit.org/show_bug.cgi?id=143338
2440 Caused an assertion on
2441 http/tests/contentextensions/whitelist.html (Requested by ap
2446 "[Content Extensions] Only add unique universal action
2448 https://bugs.webkit.org/show_bug.cgi?id=143325
2449 http://trac.webkit.org/changeset/182265
2451 2015-04-01 Antti Koivisto <antti@apple.com>
2453 Use std::chrono types to represent time in response and cache classes
2454 https://bugs.webkit.org/show_bug.cgi?id=143316
2456 Reviewed by Andreas Kling.
2458 Use std::chrono::system_clock::time_point to represent clock times and std::chrono::microseconds to
2459 represent durations. Also use WTF::Optional for optional values (instead of coding them as NaNs).
2462 (WebCore::Document::lastModified):
2463 * loader/cache/CachedResource.cpp:
2464 (WebCore::CachedResource::CachedResource):
2465 (WebCore::CachedResource::freshnessLifetime):
2466 (WebCore::CachedResource::responseReceived):
2467 (WebCore::CachedResource::updateResponseAfterRevalidation):
2468 * loader/cache/CachedResource.h:
2469 * platform/network/CacheValidation.cpp:
2470 (WebCore::computeCurrentAge):
2471 (WebCore::computeFreshnessLifetimeForHTTPFamily):
2472 (WebCore::updateRedirectChainStatus):
2473 (WebCore::redirectChainAllowsReuse):
2474 (WebCore::parseCacheControlDirectives):
2475 * platform/network/CacheValidation.h:
2476 (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
2477 * platform/network/HTTPParsers.cpp:
2478 (WebCore::parseHTTPDate):
2479 (WebCore::parseDate): Deleted.
2480 * platform/network/HTTPParsers.h:
2481 * platform/network/ResourceResponseBase.cpp:
2482 (WebCore::ResourceResponseBase::ResourceResponseBase):
2483 (WebCore::ResourceResponseBase::cacheControlMaxAge):
2484 (WebCore::parseDateValueInHeader):
2485 (WebCore::ResourceResponseBase::date):
2486 (WebCore::ResourceResponseBase::age):
2487 (WebCore::ResourceResponseBase::expires):
2488 (WebCore::ResourceResponseBase::lastModified):
2489 * platform/network/ResourceResponseBase.h:
2491 2015-04-02 Joonghun Park <jh718.park@samsung.com>
2493 [CSS MultiColumn] Parse "columns: auto <length>" shorthand property value properly
2494 https://bugs.webkit.org/show_bug.cgi?id=143248
2496 Reviewed by Darin Adler.
2498 Test: fast/multicol/columns-shorthand-parsing-2.html
2500 The two longhands for the 'columns' property ('column-count' and
2501 'column-width') may both take 'auto' as a value. When we encounter
2502 'auto' during parsing the value list of a declaration, we cannot just
2503 make a guess at which property/properties that's meant for. Instead,
2504 don't assign anything to 'auto' right away, but wait until all values
2505 have been processed and at that point set the still unassigned
2506 properties to 'auto'. If 'auto' isn't in the value list at all, set
2507 unassigned properties to 'initial' for the 'columns' property, just
2508 like we do for any other property.
2510 * css/CSSParser.cpp:
2511 (WebCore::CSSParser::parseValue):
2512 (WebCore::CSSParser::parseColumnWidth):
2513 (WebCore::CSSParser::parseColumnCount):
2514 (WebCore::CSSParser::parseColumnsShorthand):
2517 2015-04-01 Commit Queue <commit-queue@webkit.org>
2519 Unreviewed, rolling out r182247.
2520 https://bugs.webkit.org/show_bug.cgi?id=143326
2522 unfortunately broke some tests (Requested by dino on #webkit).
2526 "Async loading of image resources"
2527 https://bugs.webkit.org/show_bug.cgi?id=134488
2528 http://trac.webkit.org/changeset/182247
2530 2015-04-01 Alex Christensen <achristensen@webkit.org>
2532 [Content Extensions] Only add unique universal action locations.
2533 https://bugs.webkit.org/show_bug.cgi?id=143325
2535 Reviewed by Benjamin Poulain.
2537 * contentextensions/ContentExtensionCompiler.cpp:
2538 (WebCore::ContentExtensions::compileRuleList):
2539 Use a HashSet instead of a Vector for the universal action locations to remove duplicates.
2541 2015-04-01 Roger Fong <roger_fong@apple.com>
2543 Fixes to material of inline media controls on OSX.
2544 https://bugs.webkit.org/show_bug.cgi?id=143317
2545 <rdar://problem/20357847>
2547 Reviewed by Dean Jackson.
2549 There are many existing tests for the media controls appearance.
2550 They are currently skipped while we are still updating the controls.
2552 Expand backgrounds of control panel and volume box.
2553 Clip the darker edges away.
2554 * Modules/mediacontrols/mediaControlsApple.css:
2555 (audio::-webkit-media-controls-panel):
2556 (audio::-webkit-media-controls-panel-background-container):
2557 (audio::-webkit-media-controls-panel-tint):
2558 (audio::-webkit-media-controls-panel-background):
2559 (audio::-webkit-media-controls-panel .volume-box):
2560 (audio::-webkit-media-controls-volume-slider-container-background):
2561 (audio::-webkit-media-controls-volume-slider-container-tint):
2562 (audio::-webkit-media-controls-panel .volume-box:active):
2563 (video::-webkit-media-controls-volume-slider):
2564 This needs to be above the background so it can be interacted with.
2565 (video:-webkit-full-screen::-webkit-media-controls-panel .volume-box):
2566 * Modules/mediacontrols/mediaControlsApple.js:
2567 (Controller.prototype.createControls): Create a new div for the control material.
2568 We need to clip the material and not the controls themselves.
2569 (Controller.prototype.configureInlineControls): Use new div.
2570 Remove some unnecessary logic involving hiding materials here.
2571 It just causes the materials to turn on and off at the wrong times.
2572 (Controller.prototype.handlePanelTransitionEnd):
2573 (Controller.prototype.setPlaying):
2574 (Controller.prototype.showControls):
2575 (Controller.prototype.hideControls):
2577 2015-04-01 Eric Carlson <eric.carlson@apple.com>
2579 Media controls should not always auto-hide
2580 https://bugs.webkit.org/show_bug.cgi?id=143322
2582 Reviewed by Dean Jackson.
2584 * Modules/mediacontrols/mediaControlsApple.js:
2585 (Controller): Intialize new properties.
2586 (Controller.prototype.hideControls): Do nothing if controlsAlwaysVisible() returns true;
2587 (Controller.prototype.controlsAlwaysVisible): New.
2588 (Controller.prototype.controlsAreHidden): Consult controlsAlwaysVisible().
2589 (Controller.prototype.currentPlaybackTargetIsWireless): Use new properties.
2590 (Controller.prototype.updateWirelessTargetAvailable): Cache video.webkitCurrentPlaybackTargetIsWireless
2591 and video.webkitWirelessVideoPlaybackDisabled because we know when they change and
2592 use them frequently.
2593 * Modules/mediacontrols/mediaControlsiOS.js:
2594 (ControllerIOS.prototype.controlsAlwaysVisible): New.
2595 * platform/graphics/MediaPlaybackTarget.h:
2597 2015-04-01 Alexey Proskuryakov <ap@apple.com>
2599 REGRESSION (r182121): SVG animation macros cause warnings in MSVC
2600 https://bugs.webkit.org/show_bug.cgi?id=143313
2602 Reviewed by Darin Adler.
2604 * svg/SVGExternalResourcesRequired.h: Undo the change that caused a type mismatch.
2606 2015-04-01 Eric Carlson <eric.carlson@apple.com>
2608 Another attempt to fixi the iOS build after r182240.
2610 Reviewed by Dean Jackson.
2612 * platform/graphics/MediaPlaybackTarget.h:
2613 (WebCore::MediaPlaybackTarget::hasActiveRoute):
2615 2015-04-01 Eric Carlson <eric.carlson@apple.com>
2617 Fix the iOS build after r182240.
2619 * platform/graphics/MediaPlaybackTarget.h:
2621 2015-04-01 Yoav Weiss <yoav@yoav.ws>
2623 Async loading of image resources
2624 https://bugs.webkit.org/show_bug.cgi?id=134488
2626 Reviewed by Dean Jackson.
2628 This patch changes image loading to be asynchronous (per spec), in order
2629 for it to be agnostic to property setting order when it comes to src, srcset and crossorigin,
2630 as well as to enable future hooking of the <picture>-based selection logic on top of it.
2632 Tests: fast/dom/HTMLImageElement/image-load-post-onload.html
2633 fast/dom/HTMLImageElement/sizes/image-sizes-js-change-reverse.html
2635 * WebCore.xcodeproj/project.pbxproj: Change MicroTask.h to be private.
2636 * bindings/js/JSEventListener.cpp:
2637 (WebCore::JSEventListener::handleEvent): Add a microtask checkpoint after event handling.
2638 * bindings/js/ScheduledAction.cpp:
2639 (WebCore::ScheduledAction::execute): Add a microtask checkpoint after running of a scheduled action.
2640 * html/HTMLImageElement.cpp:
2641 (WebCore::HTMLImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2642 * html/HTMLImageLoader.cpp:
2643 (WebCore::HTMLImageLoader::notifyFinished): Avoid a crash when notifyFinished is called and there's no CachedImage.
2644 * html/HTMLInputElement.cpp:
2645 (WebCore::HTMLInputElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2646 * html/HTMLPlugInImageElement.cpp:
2647 (WebCore::HTMLPlugInImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2648 * html/HTMLVideoElement.cpp:
2649 (WebCore::HTMLVideoElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2650 * html/parser/HTMLDocumentParser.cpp:
2651 (WebCore::HTMLDocumentParser::attemptToRunDeferredScriptsAndEnd): Add a microtask checkpoint.
2652 * loader/ImageLoader.cpp: Move image resource loading to be asynchronous.
2653 (WebCore::ImageLoader::ImageLoaderTask::create):
2654 (WebCore::ImageLoader::ImageLoaderTask::run): Run the image loading microtask and called doUpdateFromElement.
2655 (WebCore::ImageLoader::ImageLoaderTask::ImageLoaderTask):
2656 (WebCore::ImageLoader::ImageLoader):
2657 (WebCore::ImageLoader::doUpdateFromElement): This is split from the previous updateFromElement, and performs the actual resource loading.
2658 (WebCore::ImageLoader::updateFromElement): Now only prepares the stage for the actual image resource loading.
2659 (WebCore::ImageLoader::shouldLoadImmediately): If this returns true, the image resource is loaded immediately, without queueing a microtask.
2660 (WebCore::ImageLoader::notifyFinished): Add asserts.
2661 (WebCore::ImageLoader::elementDidMoveToNewDocument): Handle document load event counters decrementing and incrementing.
2662 * loader/ImageLoader.h:
2663 (WebCore::ImageLoader::imageComplete): Make sure that the image is complete only if there aren't any pending tasks.
2664 (WebCore::ImageLoader::hasPendingActivity): Make sure that pending activity takes pending tasks into account.
2665 (WebCore::ImageLoader::hasPendingTask): Getter to know if an ImageLoader has a pending task. (Used by the image loading microtask)
2666 (WebCore::ImageLoader::createWeakPtr): Create a weakPtr to be used by the microtask, so it can called back the loader if it's still alive.
2667 * loader/cache/CachedResourceLoader.cpp:
2668 (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
2669 (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2670 (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2671 * loader/cache/CachedResourceLoader.h:
2672 (WebCore::CachedResourceLoader::canRequest): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag and act upon it.
2673 (WebCore::CachedResourceLoader::requestImage): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2674 (WebCore::CachedResourceLoader::requestResource): Add a 'shouldBypassMainWorldContentSecurityPolicy' flag.
2675 * svg/SVGImageElement.cpp:
2676 (WebCore::SVGImageElement::didMoveToNewDocument): Add the old document to call of elementDidMoveToNewDocument.
2677 * xml/parser/XMLDocumentParser.cpp:
2678 (WebCore::XMLDocumentParser::end): Add a microtask checkpoint after XML finishes parsing.
2680 2015-04-01 Alex Christensen <achristensen@webkit.org>
2682 Unreviewed build fix when using content extensions performance reporting.
2684 * contentextensions/ContentExtensionCompiler.cpp:
2685 (WebCore::ContentExtensions::compileRuleList):
2686 Time how long it takes to build the DFAs.
2688 2015-04-01 Alex Christensen <achristensen@webkit.org>
2690 Progress towards CMake on Windows and Mac.
2691 https://bugs.webkit.org/show_bug.cgi?id=143293
2693 Reviewed by Filip Pizlo.
2695 * PlatformMac.cmake:
2696 Tell open source builders where to find unicode headers.
2697 * PlatformWin.cmake:
2698 Include PlatformWinCairo.cmake.
2699 * PlatformWinCairo.cmake:
2700 Added from bug 115944 by Patrick Gansterer.
2701 * bindings/js/JSDOMStringListCustom.cpp:
2702 * bindings/js/JSDOMWrapper.cpp:
2703 * bindings/js/JSMessageChannelCustom.cpp:
2704 * bindings/js/JSPopStateEventCustom.cpp:
2705 * bindings/js/JSReadableStreamCustom.cpp:
2706 * bindings/js/ReadableStreamJSSource.cpp:
2707 * bindings/js/ScriptController.cpp:
2708 * css/CSSComputedStyleDeclaration.cpp:
2710 * dom/CollectionIndexCache.cpp:
2711 * platform/graphics/ANGLEWebKitBridge.h:
2712 Fixed include quirks.
2714 2015-03-31 Simon Fraser <simon.fraser@apple.com>
2716 Remove scrolling tree dependency on wheel event handler counts, and use fast scrolling even when there are wheel handlers
2717 https://bugs.webkit.org/show_bug.cgi?id=143288
2718 rdar://problem/16049624
2720 Reviewed by Beth Dakin.
2722 Remove the wheel event counting that Document does, and passes into the scrolling tree.
2723 The ScrollingTree now just uses the non-fast scrollable region to determine when to
2724 fast scroll on pages with wheel event handlers.
2726 If a handler includes position:fixed renderers, we just cover the whole document
2727 with the slow-scrolling region currently. This could be improved.
2730 (WebCore::Document::Document):
2731 (WebCore::Document::didBecomeCurrentDocumentInFrame):
2732 (WebCore::Document::wheelEventHandlersChanged):
2733 (WebCore::Document::didAddWheelEventHandler):
2734 (WebCore::Document::didRemoveWheelEventHandler):
2735 (WebCore::Document::wheelEventHandlerCount):
2736 (WebCore::Document::touchEventHandlerCount):
2737 (WebCore::Document::absoluteRegionForEventTargets): Changed to return a pair<Region, bool>
2738 where the bool indicates whether any handler includes position:fixed content.
2739 (WebCore::pageWheelEventHandlerCountChanged): Deleted.
2740 (WebCore::wheelEventHandlerCountChanged): Deleted.
2742 (WebCore::Document::wheelEventHandlerCount): Deleted.
2743 * loader/EmptyClients.h:
2744 * page/ChromeClient.h:
2745 * page/DebugPageOverlays.cpp:
2746 (WebCore::MouseWheelRegionOverlay::updateRegion):
2747 * page/scrolling/AsyncScrollingCoordinator.cpp:
2748 (WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
2749 (WebCore::AsyncScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
2750 * page/scrolling/AsyncScrollingCoordinator.h:
2751 * page/scrolling/ScrollingCoordinator.cpp:
2752 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
2753 (WebCore::ScrollingCoordinator::frameViewRootLayerDidChange):
2754 (WebCore::ScrollingCoordinator::computeCurrentWheelEventHandlerCount): Deleted.
2755 (WebCore::ScrollingCoordinator::frameViewWheelEventHandlerCountChanged): Deleted.
2756 * page/scrolling/ScrollingCoordinator.h:
2757 (WebCore::ScrollingCoordinator::recomputeWheelEventHandlerCountForFrameView): Deleted.
2758 * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
2759 (WebCore::ScrollingStateFrameScrollingNode::ScrollingStateFrameScrollingNode):
2760 (WebCore::ScrollingStateFrameScrollingNode::setWheelEventHandlerCount): Deleted.
2761 * page/scrolling/ScrollingStateFrameScrollingNode.h:
2762 * page/scrolling/ScrollingTree.cpp:
2763 (WebCore::ScrollingTree::ScrollingTree):
2764 (WebCore::ScrollingTree::shouldHandleWheelEventSynchronously):
2765 (WebCore::ScrollingTree::commitNewTreeState):
2766 * page/scrolling/ScrollingTree.h:
2767 * page/scrolling/mac/ScrollingCoordinatorMac.mm:
2768 (WebCore::ScrollingCoordinatorMac::updateTiledScrollingIndicator):
2769 * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
2770 (WebCore::ScrollingTreeFrameScrollingNodeMac::updateBeforeChildren):
2771 (WebCore::logWheelEventHandlerCountChanged): Deleted.
2772 * testing/Internals.cpp:
2773 (WebCore::Internals::touchEventHandlerCount):
2775 2015-04-01 David Hyatt <hyatt@apple.com>
2777 [New Block-Inside-Inline Model] Floats need to be allowed to intrude into anonymous inline-blocks.
2778 https://bugs.webkit.org/show_bug.cgi?id=143307
2780 Reviewed by Dean Jackson.
2782 Added fast/block/inside-inlines/basic-float-intrusion.html
2784 * rendering/InlineFlowBox.cpp:
2785 (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
2786 Make sure to exclude the margins of an anonymous inline-block when considering the height of the line.
2788 * rendering/RenderBlock.cpp:
2789 (WebCore::RenderBlock::lineHeight):
2790 (WebCore::RenderBlock::baselinePosition):
2791 Anonymous inline-block lines ignore line-height and just return the height of the block. For baseline position, the baseline
2792 is considered to be at the bottom border edge of the anonymous inline-block.
2794 * rendering/RenderBlockFlow.cpp:
2795 (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats):
2796 (WebCore::RenderBlockFlow::addIntrudingFloats):
2797 * rendering/RenderBlockFlow.h:
2798 Patch float intrusion to handle the case of anonymous inline-blocks. Instead of collecting the floats from our parent(), we
2799 collect them from the containingBlock() in the anonymous inline-block case. Patch addIntrudingFloats to pass in the container
2800 that acts as the "parent", since it is not the parent() in the anonymous inline-block case.
2802 * rendering/RenderBlockLineLayout.cpp:
2803 (WebCore::updateLogicalInlinePositions):
2804 Make sure to use the full available width for content always in the anonymous inline-block case, since we don't avoid the
2805 floats, but instead let them intrude into the inline-block.
2807 (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForLine):
2808 Patch callers of updateLogicalInlinePositions to pass in the root line box that we're checking for.
2810 (WebCore::RenderBlockFlow::layoutLineBoxes):
2811 Defer the layout of anonymous inline-blocks, since they need to only lay out once the vertical position to lay them out
2814 * rendering/RenderBox.cpp:
2815 (WebCore::RenderBox::createsNewFormattingContext):
2816 (WebCore::RenderBox::avoidsFloats):
2817 Anonymous inline-blocks do not establish a new block formatting context, nor do they avoid floats.
2819 * rendering/line/BreakingContext.h:
2820 (WebCore::BreakingContext::handleReplaced):
2821 Add code to do a just-in-time layout of the anonymous inline-block at the time it is being examined (after the break before
2824 2015-04-01 Eric Carlson <eric.carlson@apple.com>
2826 [Mac] Do not include route button if element does not support target playback
2827 https://bugs.webkit.org/show_bug.cgi?id=143251
2829 Reviewed by Jer Noble.
2831 * Modules/mediacontrols/mediaControlsApple.js:
2832 (Controller.prototype.currentPlaybackTargetIsWireless): Return false if target playback is disabled.
2833 (Controller.prototype.updateWirelessTargetAvailable): Do not show the picker if target
2834 playback is disabled.
2835 (Controller.prototype.handleWirelessPlaybackChange): Call updateWirelessTargetAvailable.
2838 (WebCore::Document::showPlaybackTargetPicker): Update for Page::showPlaybackTargetPicker change.
2839 (WebCore::Document::didChoosePlaybackTarget): Notify clients in vector-order, lower level code
2840 now tracks which one requested the picker.
2842 * html/HTMLMediaElement.cpp:
2843 (WebCore::HTMLMediaElement::loadResource): Don't call applyMediaPlayerRestrictions, it is done
2844 in mediaPlayerEngineFailedToLoad.
2845 (WebCore::HTMLMediaElement::setReadyState): Enqueue a target availability event if there are
2846 listeners readyState reaches HAVE_METADATA so controls are setup correctly.
2847 (WebCore::HTMLMediaElement::mediaPlayerEngineFailedToLoad): Call applyMediaPlayerRestrictions.
2848 (WebCore::HTMLMediaElement::clearMediaPlayer): Enqueue a target availability event in so controls
2849 have a chance to hide the picker.
2850 (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): New, passthrough to the
2852 (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget): Ditto.
2853 (WebCore::HTMLMediaElement::startPlayingToPlaybackTarget): Ditto.
2854 (WebCore::HTMLMediaElement::stopPlayingToPlaybackTarget): Ditto.
2855 * html/HTMLMediaElement.h:
2856 * html/HTMLMediaElement.idl:
2858 * html/HTMLMediaSession.cpp:
2859 (WebCore::HTMLMediaSession::HTMLMediaSession): Initialize m_playbackTarget.
2860 (WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): New.
2861 (WebCore::HTMLMediaSession::showPlaybackTargetPicker): Pull logic from showingPlaybackTargetPickerPermitted
2862 inline. Don't refuse to show a picker if the element doesn't support target playback, it is up
2863 to script to decide which elements can display a picker.
2864 (WebCore::HTMLMediaSession::wirelessVideoPlaybackDisabled): Return true if there is no player.
2865 (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Call startPlayingToPlaybackTarget or
2866 stopPlayingToPlaybackTarget because setWirelessPlaybackTarget doesn't apply the target.
2867 (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange): Add logging.
2868 (WebCore::HTMLMediaSession::showingPlaybackTargetPickerPermitted): Deleted.
2869 * html/HTMLMediaSession.h:
2872 (WebCore::Page::Page): Initialize m_playbackTarget.
2873 (WebCore::Page::showPlaybackTargetPicker): Don't set m_documentRequestingPlaybackTargetPicker.
2874 (WebCore::Page::didChoosePlaybackTarget): Notify Pages in vector-order, lower level code
2875 now tracks which one requested the picker.
2876 (WebCore::Page::configurePlaybackTargetMonitoring): Don't track m_requiresPlaybackTargetMonitoring, it
2877 is too easy for it to get out of sync with the UI process state.
2880 * platform/audio/MediaSession.cpp:
2881 (WebCore::MediaSession::canPlayToWirelessPlaybackTarget): New, client passthrough.
2882 (WebCore::MediaSession::startPlayingToPlaybackTarget): Ditto.
2883 (WebCore::MediaSession::stopPlayingToPlaybackTarget): Ditto.
2884 * platform/audio/MediaSession.h:
2885 (WebCore::MediaSessionClient::canPlayToWirelessPlaybackTarget):
2886 (WebCore::MediaSessionClient::startPlayingToPlaybackTarget):
2887 (WebCore::MediaSessionClient::stopPlayingToPlaybackTarget):
2889 * platform/audio/MediaSessionManager.cpp:
2890 (WebCore::MediaSessionManager::sessionWillBeginPlayback): Call startPlayingToPlaybackTarget &
2891 stopPlayingToPlaybackTarget as necessary.
2892 * platform/audio/MediaSessionManager.h:
2894 * platform/graphics/MediaPlaybackTarget.h:
2895 (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
2896 * platform/graphics/MediaPlaybackTargetPickerClient.h:
2897 * platform/graphics/MediaPlayer.cpp:
2898 (WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): New, engine passthrough.
2899 (WebCore::MediaPlayer::canPlayToWirelessPlaybackTarget): Ditto.
2900 (WebCore::MediaPlayer::startPlayingToPlaybackTarget): Ditto.
2901 (WebCore::MediaPlayer::stopPlayingToPlaybackTarget): Ditto.
2902 * platform/graphics/MediaPlayer.h:
2903 * platform/graphics/MediaPlayerPrivate.h:
2904 (WebCore::MediaPlayerPrivateInterface::isCurrentPlaybackTargetSupported):
2905 (WebCore::MediaPlayerPrivateInterface::wirelessVideoPlaybackDisabled):
2906 (WebCore::MediaPlayerPrivateInterface::canPlayToWirelessPlaybackTarget):
2907 (WebCore::MediaPlayerPrivateInterface::startPlayingToPlaybackTarget):
2908 (WebCore::MediaPlayerPrivateInterface::stopPlayingToPlaybackTarget):
2910 * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm:
2911 (WebCore::MediaPlaybackTarget::hasActiveRoute): New.
2913 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2914 (WebCore::MediaPlayerPrivateAVFoundationObjC::canPlayToWirelessPlaybackTarget):
2915 * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2916 (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): Use playerKVOProperties. Drive-by
2918 (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Use playerKVOProperties.
2919 (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName): Implement for Mac.
2920 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled): Delay callbacks
2921 while setting AVPlayer property.
2922 (WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessPlaybackTarget): Add logging. Don't set
2923 the AVPlayer outputContext immediately.
2924 (WebCore::MediaPlayerPrivateAVFoundationObjC::startPlayingToPlaybackTarget): New.
2925 (WebCore::MediaPlayerPrivateAVFoundationObjC::stopPlayingToPlaybackTarget): New.
2926 (WebCore::playerKVOProperties): New.
2927 (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): Notify when
2928 allowsExternalPlayback changes.
2930 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
2931 * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2932 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): New.
2933 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setWirelessPlaybackTarget): Ditto.
2934 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::togglePlayingToPlaybackTarget): Ditto.
2935 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::startPlayingToPlaybackTarget): Ditto.
2936 (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::stopPlayingToPlaybackTarget): Ditto.
2938 * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
2939 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2940 (WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Ditto.
2941 (WebCore::MediaPlayerPrivateQTKit::setWirelessPlaybackTarget): Ditto.
2942 (WebCore::MediaPlayerPrivateQTKit::togglePlayingToPlaybackTarget): Ditto.
2943 (WebCore::MediaPlayerPrivateQTKit::startPlayingToPlaybackTarget): Ditto.
2944 (WebCore::MediaPlayerPrivateQTKit::stopPlayingToPlaybackTarget): Ditto.
2946 2015-04-01 Alex Christensen <achristensen@webkit.org>
2948 [Content Extensions] Properly handle regexes that match everything.
2949 https://bugs.webkit.org/show_bug.cgi?id=143281
2951 Reviewed by Benjamin Poulain.
2953 * contentextensions/ContentExtensionCompiler.cpp:
2954 (WebCore::ContentExtensions::compileRuleList):
2955 Make sure we always have at least one NFA for rule lists with triggers that all match everything.
2956 * contentextensions/DFABytecodeInterpreter.cpp:
2957 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
2958 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
2959 Add helper functions to reduce duplicate code.
2960 (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
2961 Get all actions without flags from the DFA root.
2962 (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
2963 Remove branches when interpreting.
2964 * contentextensions/DFABytecodeInterpreter.h:
2965 Add helper functions to reduce duplicate code.
2967 2015-04-01 Myles C. Maxfield <mmaxfield@apple.com>
2969 Addressing post-review comments.
2970 https://bugs.webkit.org/show_bug.cgi?id=143292
2974 * platform/graphics/FontCascade.cpp:
2975 (WebCore::FontCascade::leadingExpansionOpportunity):
2976 (WebCore::FontCascade::trailingExpansionOpportunity):
2978 2015-04-01 Per Arne Vollan <peavo@outlook.com>
2980 [WinCairo] Link errors, unresolved texture mapper methods.
2981 https://bugs.webkit.org/show_bug.cgi?id=143308
2983 Reviewed by Alex Christensen.
2985 New texture mapper files should be included in the project.
2987 * WebCore.vcxproj/WebCore.vcxproj:
2988 * WebCore.vcxproj/WebCore.vcxproj.filters:
2990 2015-04-01 Myles C. Maxfield <mmaxfield@apple.com>
2992 Support forcing expansion opportunities at the beginning and ending of a run
2993 https://bugs.webkit.org/show_bug.cgi?id=143292
2995 Reviewed by David Hyatt.
2997 Migrate ExpansionBehavior to an enum comprised of two values: one for leading behavior
2998 and one for trailing behavior. Each of these two values can take on a value of
2999 "force," "forbid," and neither. All calls that interact with justification are
3000 migrated to use this new structure.
3002 Note that in this terminology, "leading" and "trailing" are with respect to the order
3003 that elements get laid out in a line. Therefore, leading is always on the left, since
3004 lines get laid out that way regardless of their bidi attributes.
3006 This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
3008 No new tests because there is no behavior change.
3010 * platform/graphics/FontCascade.cpp:
3011 (WebCore::FontCascade::expansionOpportunityCountInternal): Migrate to these new
3013 (WebCore::FontCascade::expansionOpportunityCount): Ditto.
3014 (WebCore::FontCascade::leadingExpansionOpportunity): Returns whether one is present
3016 (WebCore::FontCascade::trailingExpansionOpportunity): Ditto.
3017 * platform/graphics/FontCascade.h:
3018 * platform/graphics/GlyphBuffer.h: New leading expansion field.
3019 (WebCore::GlyphBuffer::setLeadingExpansion):
3020 (WebCore::GlyphBuffer::leadingExpansion):
3021 * platform/graphics/TextRun.h: m_expansionBehavior needs more bits.
3022 (WebCore::TextRun::expansionBehavior):
3023 (WebCore::TextRun::allowsLeadingExpansion): Deleted.
3024 (WebCore::TextRun::allowsTrailingExpansion): Deleted.
3025 * platform/graphics/WidthIterator.cpp: Update to support new type.
3026 (WebCore::WidthIterator::WidthIterator):
3027 (WebCore::expansionLocation): Where should we insert expansions?
3028 (WebCore::WidthIterator::advanceInternal): Use expansionLocation()
3029 * platform/graphics/cocoa/FontCascadeCocoa.mm:
3030 (WebCore::FontCascade::adjustSelectionRectForComplexText):
3031 (WebCore::FontCascade::getGlyphsAndAdvancesForComplexText):
3032 * platform/graphics/mac/ComplexTextController.cpp: Same as WidthIterator
3033 (WebCore::ComplexTextController::ComplexTextController):
3034 (WebCore::ComplexTextController::advance):
3035 (WebCore::expansionLocation):
3036 (WebCore::ComplexTextController::adjustGlyphsAndAdvances):
3037 * platform/graphics/mac/ComplexTextController.h:
3038 (WebCore::ComplexTextController::leadingExpansion):
3039 * platform/text/TextFlags.h: Add new enum values
3040 * rendering/InlineBox.h: Update to include new values.
3041 (WebCore::InlineBox::InlineBoxBitfields::InlineBoxBitfields):
3042 (WebCore::InlineBox::canHaveTrailingExpansion):
3043 (WebCore::InlineBox::setCanHaveTrailingExpansion):
3044 (WebCore::InlineBox::setForceTrailingExpansion):
3045 (WebCore::InlineBox::forceTrailingExpansion):
3046 (WebCore::InlineBox::setForceLeadingExpansion):
3047 (WebCore::InlineBox::forceLeadingExpansion):
3048 * rendering/InlineTextBox.h:
3049 * rendering/RenderBlockLineLayout.cpp: Update to use new FontCascade signatures.
3050 (WebCore::expansionBehaviorForInlineTextBox):
3051 (WebCore::applyExpansionBehavior):
3052 (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
3054 2015-04-01 Zalan Bujtas <zalan@apple.com>
3056 Lots of time spent querying table cell borders, when there are none.
3057 https://bugs.webkit.org/show_bug.cgi?id=143277
3059 Reviewed by Simon Fraser.
3061 This patch speeds up collapsed border queries by using existing collapsed border
3062 cache to calculate repaint rects and by introducing a fast path for zero width collapsed borders.
3064 It reduces the number of calls to recompute collapsed borders from 36 000 to 1 600, while loading a page with a table of 400 rows (1 cell per row).
3065 When scrolling the same page all the way down to the bottom, the number of calls to recompute collapsed borders falls from 290 000 to 0.
3067 Covered by existing tests.
3069 * rendering/RenderTable.cpp:
3070 (WebCore::RenderTable::styleDidChange): This moves invalidation time from RenderTable::layout() to styleDidChange().
3071 (WebCore::RenderTable::invalidateCollapsedBorders):
3072 (WebCore::RenderTable::recalcCollapsedBorders):
3073 * rendering/RenderTable.h:
3074 (WebCore::RenderTable::collapsedBordersAreValid):
3075 (WebCore::RenderTable::invalidateCollapsedBorders): Deleted.
3076 * rendering/RenderTableCell.cpp:
3077 (WebCore::RenderTableCell::RenderTableCell):
3078 (WebCore::RenderTableCell::willBeRemovedFromTree): Invalidate caches so that when repaint rect is calculated, we don't end up using stale values.
3079 (WebCore::RenderTableCell::styleDidChange): Same as willBeRemovedFromTree.
3080 (WebCore::RenderTableCell::collapsedStartBorder): Check if collapsed border is zero -also query cache.
3081 (WebCore::RenderTableCell::collapsedEndBorder):
3082 (WebCore::RenderTableCell::collapsedBeforeBorder):
3083 (WebCore::RenderTableCell::collapsedAfterBorder):
3084 (WebCore::RenderTableCell::cachedCollapsedLeftBorder):
3085 (WebCore::RenderTableCell::cachedCollapsedRightBorder):
3086 (WebCore::RenderTableCell::cachedCollapsedTopBorder):
3087 (WebCore::RenderTableCell::cachedCollapsedBottomBorder):
3088 (WebCore::RenderTableCell::paintCollapsedBorders):
3089 (WebCore::RenderTableCell::cellAtLeft): Deleted.
3090 (WebCore::RenderTableCell::cellAtRight): Deleted.
3091 (WebCore::RenderTableCell::cellAtTop): Deleted.
3092 (WebCore::RenderTableCell::cellAtBottom): Deleted.
3093 * rendering/RenderTableCell.h:
3094 (WebCore::RenderTableCell::invalidateHasEmptyCollapsedBorders):
3095 * rendering/RenderTableCol.cpp:
3096 (WebCore::RenderTableCol::styleDidChange):
3097 * rendering/RenderTableRow.cpp:
3098 (WebCore::RenderTableRow::styleDidChange):
3099 (WebCore::RenderTableRow::addChild):
3100 * rendering/RenderTableSection.cpp:
3101 (WebCore::RenderTableSection::styleDidChange):
3102 (WebCore::RenderTableSection::clearCachedCollapsedBorders): This is just an extra safety to invalidate collapsed border cache. This is always
3103 called together with RenderTable::invalidateCollapsedBorders() -and that should prevent the RenderCells to use the cache.
3104 (WebCore::RenderTableSection::removeCachedCollapsedBorders):
3105 (WebCore::RenderTableSection::setCachedCollapsedBorder):
3106 (WebCore::RenderTableSection::cachedCollapsedBorder):
3107 * rendering/RenderTableSection.h:
3109 2015-04-01 Carlos Alberto Lopez Perez <clopez@igalia.com>
3111 [CMake][GTK] Use the right variable to include the Wayland headers.
3112 https://bugs.webkit.org/show_bug.cgi?id=143304
3114 Reviewed by Carlos Garcia Campos.
3116 No new tests, no behavior changes.
3118 * PlatformGTK.cmake: Use the right variable WAYLAND_INCLUDE_DIRS.
3120 2015-03-30 Philippe Normand <pnormand@igalia.com>
3122 [GStreamer] Move synchronous message handler to MediaPlayerPrivateGStreamerBase
3123 https://bugs.webkit.org/show_bug.cgi?id=143218
3125 Reviewed by Carlos Garcia Campos.
3127 Moved the pipeline pointer to the base class, sub-classes should
3128 now invoke setPipeline() when loading a resource. The base class
3129 now takes care of configuring the GL shared context, this is more
3130 logical because video rendering is also managed by this class.
3132 No new tests, this is only a code refactoring.
3134 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3135 (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer):
3136 (WebCore::MediaPlayerPrivateGStreamer::load):
3137 (WebCore::MediaPlayerPrivateGStreamer::playbackPosition):
3138 (WebCore::MediaPlayerPrivateGStreamer::changePipelineState):
3139 (WebCore::MediaPlayerPrivateGStreamer::pause):
3140 (WebCore::MediaPlayerPrivateGStreamer::duration):
3141 (WebCore::MediaPlayerPrivateGStreamer::currentTime):
3142 (WebCore::MediaPlayerPrivateGStreamer::seek):
3143 (WebCore::MediaPlayerPrivateGStreamer::doSeek):
3144 (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate):
3145 (WebCore::MediaPlayerPrivateGStreamer::paused):
3146 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
3147 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
3148 (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText):
3149 (WebCore::MediaPlayerPrivateGStreamer::setRate):
3150 (WebCore::MediaPlayerPrivateGStreamer::buffered):
3151 (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
3152 (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired):
3153 (WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress):
3154 (WebCore::MediaPlayerPrivateGStreamer::sourceChanged):
3155 (WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
3156 (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
3157 (WebCore::MediaPlayerPrivateGStreamer::updateStates):
3158 (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
3159 (WebCore::MediaPlayerPrivateGStreamer::cacheDuration):
3160 (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering):
3161 (WebCore::MediaPlayerPrivateGStreamer::audioSink):
3162 (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
3163 (WebCore::MediaPlayerPrivateGStreamer::simulateAudioInterruption):
3164 (WebCore::mediaPlayerPrivateSyncMessageCallback): Deleted.
3165 (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Deleted.
3166 (WebCore::MediaPlayerPrivateGStreamer::ensureGstGLContext): Deleted.
3167 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
3168 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3169 (WebCore::mediaPlayerPrivateNeedContextMessageCallback):
3170 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3171 (WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
3172 (WebCore::MediaPlayerPrivateGStreamerBase::handleNeedContextMessage):
3173 (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext):
3174 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3176 2015-03-24 Philippe Normand <philn@igalia.com>
3178 [GStreamer] GstGL support in the video sink
3179 https://bugs.webkit.org/show_bug.cgi?id=138562
3181 Use GStreamer's glimagesink for video rendering instead of our
3182 custom video sink if a recent-enough version of GstGL is found
3183 during the build. When glimagesink is used it passes a texture to
3184 the media player which then wraps it inside a TextureMapper
3185 texture later used for actual rendering.
3187 Using this new code path will allow us to remove our custom sink
3188 entirely in the long term.
3190 Reviewed by Carlos Garcia Campos.
3192 No new test, existing media tests cover video rendering already.
3194 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
3195 (WebCore::mediaPlayerPrivateDrawCallback): client-draw signal callback.
3196 (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
3197 (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
3198 (WebCore::MediaPlayerPrivateGStreamerBase::naturalSize): Better
3199 check for sample validity.
3200 (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Ditto.
3201 (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint): Trigger a
3202 repaint and wait its completion.
3203 (WebCore::MediaPlayerPrivateGStreamerBase::paintToTextureMapper):
3204 Extract texture ID and video dimensions from the sample and do actual paint.
3205 (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Use
3206 glimagesink if GstGL is available.
3207 * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
3209 2015-04-01 Joonghun Park <jh718.park@samsung.com>
3211 nullptr cleanup in StyleResolver
3212 https://bugs.webkit.org/show_bug.cgi?id=143260
3214 Reviewed by Ryosuke Niwa.
3216 No new tests, no behavior changes
3218 * css/StyleResolver.cpp:
3219 (WebCore::StyleResolver::State::initForStyleResolve):
3220 (WebCore::StyleResolver::locateCousinList):
3221 (WebCore::StyleResolver::locateSharedStyle):
3222 (WebCore::StyleResolver::keyframeStylesForAnimation):
3223 (WebCore::StyleResolver::pseudoStyleForElement):
3224 (WebCore::StyleResolver::pseudoStyleRulesForElement):
3225 (WebCore::StyleResolver::findFromMatchedPropertiesCache):
3226 (WebCore::StyleResolver::applyMatchedProperties):
3227 (WebCore::StyleResolver::applyPropertyToStyle):
3228 (WebCore::StyleResolver::MatchedProperties::MatchedProperties):
3229 * css/StyleResolver.h:
3230 (WebCore::PseudoStyleRequest::PseudoStyleRequest):
3231 (WebCore::StyleResolverParentPusher::StyleResolverParentPusher):
3233 2015-03-31 Simon Fraser <simon.fraser@apple.com>
3235 Make it possible to compute a region for elements on the page that have wheel event handlers
3236 https://bugs.webkit.org/show_bug.cgi?id=142807
3238 Reviewed by David Hyatt.
3240 Make it possible to compute a region that covers the elements on the page that have
3241 a wheel event handler. This region may overestimate, but must not underestimate the area.
3243 Elements with wheel handlers are registered on the document, and when a document gains
3244 its first wheel handler, it registers the ownerElement in the parent document. Thus, on
3245 the main frame, the region encompasses elements with handlers, and iframes whose subdocuments
3248 Element gains some functions that allow it to return a rect which is the bounds of the element's
3249 renderer, and renders for its descendant elements, which is the size or larger than the event
3250 handling region for that element. Some configurations (e.g. position:fixed) require special
3253 Document::absoluteRegionForEventTargets() can then iterate over all elements in the given set,
3254 and build a Region for those (short-circuiting if the document itself has a handler).
3256 The new code is exercised for the debug MouseWheelRegionOverlay, and also added to the
3257 non-fast scrollable region, used by threaded scrolling.
3259 Tests: platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/handlers-in-iframes.html
3260 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-fixed-child.html
3261 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-columns.html
3262 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-in-region.html
3263 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-inside-fixed.html
3264 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-document.html
3265 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-on-fixed.html
3266 platform/mac-wk2/tiled-drawing/scrolling/non-fast-region/wheel-handler-region-basic.html
3268 * dom/ContainerNode.h:
3269 (WebCore::ContainerNode::absoluteEventHandlerBounds): Base class implementation; returns empty rect.
3271 (WebCore::Document::prepareForDestruction): Unregister from the parent document.
3272 (WebCore::Document::didAddWheelEventHandler): Add to the wheel handler set. Tell the parent
3273 document if we are adding wheel handlers for the first time. Eventually the wheelEventHandlerCountChanged()
3274 code will be removed, now we have the set. Tell debug overlays that we changed.
3275 (WebCore::Document::didRemoveWheelEventHandler): Remove from the set, and unregister with the parent
3276 document if necessary. Tell debug overlays that we changed.
3277 (WebCore::Document::didAddTouchEventHandler): Minor cleanup.
3278 (WebCore::Document::didRemoveTouchEventHandler): Ditto.
3279 (WebCore::Document::didRemoveEventTargetNode): Remove from wheel targets.
3280 (WebCore::Document::absoluteEventHandlerBounds): Implementation of the ContainerNode
3281 function, just return the document bounds.
3282 (WebCore::Document::absoluteRegionForEventTargets): Iterate over the given event targets,
3283 and call absoluteEventHandlerBounds() on each.
3285 (WebCore::Document::wheelEventTargets):
3287 (WebCore::layoutOverflowRectContainsAllDescendants): Return true if we can determine that the
3288 layoutOverflow bounds of the given renderer contains the renderers of all descendant elements.
3289 (WebCore::Element::eventBounds): Get the "event handling" bounds of this element (excluding
3290 descendants), and while doing so, compute whether any descendants are position:fixed, and whether
3291 these bounds are known to include descendants.
3292 (WebCore::Element::eventBoundsOfElementAndDescendants): Recursive function that short-circuits
3293 if it can determine that descendants are enclosed by the bounds.
3294 (WebCore::Element::absoluteEventHandlerBounds):
3296 * page/DebugPageOverlays.cpp:
3297 (WebCore::MouseWheelRegionOverlay::updateRegion): Ask the document for the region of wheel
3299 * page/scrolling/ScrollingCoordinator.cpp:
3300 (WebCore::ScrollingCoordinator::computeNonFastScrollableRegion): Add the wheel handler region
3301 to the non-fast scrollable region.
3302 * rendering/RenderLayer.cpp:
3303 (WebCore::RenderLayer::scrollTo): Overflow scrolling needs to dirty event regions.
3304 * rendering/RenderObject.cpp:
3305 (WebCore::RenderObject::absoluteBoundingBoxRect): Need to pass the "wasFixed" flag out
3307 (WebCore::RenderObject::localToAbsolute): Ditto.
3308 * rendering/RenderObject.h:
3310 2015-03-31 Alexey Proskuryakov <ap@apple.com>
3312 Fix bindings tests results after <http://trac.webkit.org/changeset/182205>.
3314 * bindings/scripts/test/JS/JSTestObj.cpp:
3315 (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
3316 (WebCore::setJSTestObjConditionalAttr4Constructor):
3317 (WebCore::setJSTestObjConditionalAttr5Constructor):
3318 (WebCore::setJSTestObjConditionalAttr6Constructor):
3319 (WebCore::setJSTestObjReplaceableAttribute):
3321 2015-03-31 Benjamin Poulain <bpoulain@apple.com>
3323 Content Extensions: split the state machines to minimize prefix states
3324 https://bugs.webkit.org/show_bug.cgi?id=143253
3326 Reviewed by Alex Christensen.
3328 With this patch, we refine how the URLs are partitioned to make
3329 multiple small machines instead of a big one.
3331 Here, considering each pattern as a language, I took the simplest
3332 partitioning: take the union minimizing the states
3333 that differentiate languages.
3335 The idea is the following: every time a subgraph can be skipped
3336 or repeated, it is an opportunity for a merged language to start
3337 with a distinguishable state.
3338 To avoid accumulating those differences, we only merge languages
3339 that share the exact same "variable" subgraph as a prefix.
3341 A side effect is that we could create as many machines as we have patterns.
3342 We'll have to address that in a follow-up by merging small machines
3343 until they reach a certain size.
3344 In the common cases, patterns look very much alike so that is not a problem
3347 * WebCore.xcodeproj/project.pbxproj:
3348 * contentextensions/CombinedURLFilters.cpp: Added.
3349 I moved the prefix tree and graph construction out of URLFilterParser for clarity.
3351 CombinedURLFilters maintain the term prefix tree. Instead of generating on the fly
3352 as we build the prefix tree, we first generate the entire tree of terms, then generate
3353 NFAs for each branch without a variable prefix.
3355 (WebCore::ContentExtensions::CombinedURLFilters::CombinedURLFilters):
3356 (WebCore::ContentExtensions::CombinedURLFilters::~CombinedURLFilters):
3358 (WebCore::ContentExtensions::CombinedURLFilters::addPattern):
3359 Note here that we keep track of which subtree contains a any variable length term.
3360 Instead of anotating the edges, the destination vertex is anotated with the information
3363 The flag "inVariableLengthPrefix" is there to simplify traversal.
3365 (WebCore::ContentExtensions::generateNFAForSubtree):
3366 (WebCore::ContentExtensions::CombinedURLFilters::createNFAs):
3367 Since we are traversing a tree generated by string, using the stack for recursion
3368 is out of the question.
3370 Fortunately, the entire state is very simple when going depth first: we only need
3371 the active vertex and edge, and traverse the edges in order.
3373 To do keep track of the edges, I used the HashTable iterator on the current term.
3374 Since no vertex is modified for generation, storing the iterators is safe.
3376 * contentextensions/CombinedURLFilters.h:
3377 * contentextensions/ContentExtensionCompiler.cpp:
3378 (WebCore::ContentExtensions::compileRuleList):
3379 * contentextensions/NFA.cpp:
3380 (WebCore::ContentExtensions::NFA::setActions):
3381 (WebCore::ContentExtensions::NFA::debugPrintDot):
3382 (WebCore::ContentExtensions::NFA::setFinal): Deleted.
3383 (WebCore::ContentExtensions::NFA::addRuleId): Deleted.
3384 * contentextensions/NFA.h:
3385 * contentextensions/NFAGraphBuilder.cpp: Added.
3386 * contentextensions/NFAGraphBuilder.h: Added.
3387 * contentextensions/NFANode.h:
3388 * contentextensions/Term.h: Added.
3389 Move the Term to its own file since it is now shared between the parser
3390 and the CombinedURLFilters.
3392 (WebCore::ContentExtensions::Term::CharacterSet::operator==):
3393 (WebCore::ContentExtensions::Term::CharacterSet::hash):
3394 (WebCore::ContentExtensions::Term::Group::operator==):
3395 (WebCore::ContentExtensions::Term::Group::hash):
3396 (WebCore::ContentExtensions::TermHash::hash):
3397 (WebCore::ContentExtensions::TermHash::equal):
3398 (WebCore::ContentExtensions::Term::Term):
3399 (WebCore::ContentExtensions::Term::~Term):
3400 (WebCore::ContentExtensions::Term::isValid):
3401 (WebCore::ContentExtensions::Term::addCharacter):
3402 (WebCore::ContentExtensions::Term::extendGroupSubpattern):
3403 (WebCore::ContentExtensions::Term::quantify):
3404 (WebCore::ContentExtensions::Term::Term::generateGraph):
3405 (WebCore::ContentExtensions::Term::isEndOfLineAssertion):
3406 (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter):
3407 (WebCore::ContentExtensions::Term::isKnownToMatchAnyString):
3408 (WebCore::ContentExtensions::Term::hasFixedLength):
3409 (WebCore::ContentExtensions::Term::operator=):
3410 (WebCore::ContentExtensions::Term::operator==):
3411 (WebCore::ContentExtensions::Term::hash):
3412 (WebCore::ContentExtensions::Term::isEmptyValue):
3413 (WebCore::ContentExtensions::Term::isDeletedValue):
3414 (WebCore::ContentExtensions::Term::isUniversalTransition):
3415 (WebCore::ContentExtensions::Term::generateSubgraphForAtom):
3416 (WebCore::ContentExtensions::Term::destroy):
3417 * contentextensions/URLFilterParser.cpp:
3418 (WebCore::ContentExtensions::PatternParser::PatternParser):
3419 (WebCore::ContentExtensions::PatternParser::finalize):
3420 (WebCore::ContentExtensions::PatternParser::assertionBOL):
3421 (WebCore::ContentExtensions::URLFilterParser::URLFilterParser):
3422 (WebCore::ContentExtensions::URLFilterParser::addPattern):
3423 (WebCore::ContentExtensions::Term::Term): Deleted.
3424 (WebCore::ContentExtensions::Term::~Term): Deleted.
3425 (WebCore::ContentExtensions::Term::isValid): Deleted.
3426 (WebCore::ContentExtensions::Term::addCharacter): Deleted.
3427 (WebCore::ContentExtensions::Term::extendGroupSubpattern): Deleted.
3428 (WebCore::ContentExtensions::Term::quantify): Deleted.
3429 (WebCore::ContentExtensions::Term::generateGraph): Deleted.
3430 (WebCore::ContentExtensions::Term::isEndOfLineAssertion): Deleted.
3431 (WebCore::ContentExtensions::Term::matchesAtLeastOneCharacter): Deleted.
3432 (WebCore::ContentExtensions::Term::isKnownToMatchAnyString): Deleted.
3433 (WebCore::ContentExtensions::Term::operator=): Deleted.
3434 (WebCore::ContentExtensions::Term::operator==): Deleted.
3435 (WebCore::ContentExtensions::Term::hash): Deleted.
3436 (WebCore::ContentExtensions::Term::isEmptyValue): Deleted.
3437 (WebCore::ContentExtensions::Term::isDeletedValue): Deleted.
3438 (WebCore::ContentExtensions::Term::isUniversalTransition): Deleted.
3439 (WebCore::ContentExtensions::Term::generateSubgraphForAtom): Deleted.
3440 (WebCore::ContentExtensions::Term::destroy): Deleted.
3441 (WebCore::ContentExtensions::Term::CharacterSet::operator==): Deleted.
3442 (WebCore::ContentExtensions::Term::CharacterSet::hash): Deleted.
3443 (WebCore::ContentExtensions::Term::Group::operator==): Deleted.
3444 (WebCore::ContentExtensions::Term::Group::hash): Deleted.
3445 (WebCore::ContentExtensions::TermHash::hash): Deleted.
3446 (WebCore::ContentExtensions::TermHash::equal): Deleted.
3447 (WebCore::ContentExtensions::GraphBuilder::GraphBuilder): Deleted.
3448 (WebCore::ContentExtensions::GraphBuilder::finalize): Deleted.
3449 (WebCore::ContentExtensions::GraphBuilder::assertionBOL): Deleted.
3450 * contentextensions/URLFilterParser.h:
3452 2015-03-31 Myles C. Maxfield <mmaxfield@apple.com>
3454 Move ExpansionBehaviorFlags and TextDirection to their own file
3455 https://bugs.webkit.org/show_bug.cgi?id=143273
3457 Reviewed by Simon Fraser.
3459 This is a mechanical change. It just moves code around.
3461 This is getting ready for https://bugs.webkit.org/show_bug.cgi?id=142608
3463 No new tests because there is no behavior change.
3465 * Modules/notifications/Notification.h:
3466 * WebCore.vcxproj/WebCore.vcxproj:
3467 * WebCore.vcxproj/WebCore.vcxproj.filters:
3468 * WebCore.xcodeproj/project.pbxproj:
3469 * css/CSSPrimitiveValueMappings.h:
3470 * css/CSSProperty.h:
3472 * editing/VisiblePosition.h:
3473 * editing/VisibleUnits.h:
3474 * editing/htmlediting.h:
3475 * html/canvas/CanvasRenderingContext2D.cpp:
3476 (WebCore::CanvasRenderingContext2D::drawTextInternal):
3477 * html/canvas/CanvasRenderingContext2D.h:
3478 * platform/LengthBox.h:
3479 * platform/PopupMenuStyle.h:
3480 * platform/graphics/FontCascade.h:
3481 * platform/graphics/LayoutBoxExtent.h:
3482 * platform/graphics/TextRun.h:
3483 * platform/ios/SelectionRect.h:
3484 * platform/text/BidiResolver.h:
3485 * platform/text/StringWithDirection.h:
3486 * platform/text/TextHelpers.h: Renamed from Source/WebCore/platform/text/TextDirection.h.
3487 (WebCore::isLeftToRightDirection):
3488 * platform/win/PopupMenuWin.cpp:
3489 (WebCore::PopupMenuWin::paint):
3490 * rendering/EllipsisBox.cpp:
3491 (WebCore::EllipsisBox::paint):
3492 (WebCore::EllipsisBox::selectionRect):
3493 (WebCore::EllipsisBox::paintSelection):
3494 * rendering/HitTestLocation.h:
3495 * rendering/HitTestResult.h:
3496 * rendering/InlineBox.h:
3497 * rendering/InlineTextBox.h:
3498 (WebCore::InlineTextBox::expansionBehavior):
3499 * rendering/RenderBlock.cpp:
3500 (WebCore::constructTextRunInternal):
3501 (WebCore::RenderBlock::constructTextRun):
3502 * rendering/RenderBlock.h:
3503 * rendering/RenderFileUploadControl.cpp:
3504 (WebCore::RenderFileUploadControl::paintObject):
3505 (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
3506 * rendering/RenderListBox.cpp:
3507 (WebCore::RenderListBox::updateFromElement):
3508 (WebCore::RenderListBox::paintItemForeground):
3509 * rendering/RenderListMarker.cpp:
3510 (WebCore::RenderListMarker::computePreferredLogicalWidths):
3511 (WebCore::RenderListMarker::getRelativeMarkerRect):
3512 * rendering/RenderMenuList.cpp:
3513 (RenderMenuList::updateOptionsWidth):
3514 * rendering/RenderTextControl.cpp:
3515 (WebCore::RenderTextControl::getAverageCharWidth):
3516 * rendering/RenderThemeIOS.mm:
3517 * rendering/style/RenderStyle.h:
3518 * rendering/svg/SVGInlineTextBox.cpp:
3519 (WebCore::SVGInlineTextBox::constructTextRun):
3520 * rendering/svg/SVGTextMetrics.cpp:
3521 (WebCore::SVGTextMetrics::constructTextRun):
3523 2015-03-31 Yusuke Suzuki <utatane.tea@gmail.com>
3525 Clean up Identifier factories to clarify the meaning of StringImpl*
3526 https://bugs.webkit.org/show_bug.cgi?id=143146
3528 Reviewed by Filip Pizlo.
3530 Just change Identifier creations.
3532 1. If the code creates Identifier from StringImpl*
3533 which is treated as symbol or string(unique id), use Identifier::fromUid.
3534 2. If the code creates Identifier from string, use Identifier::fromString.
3536 * Modules/plugins/QuickTimePluginReplacement.mm:
3537 (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
3538 (WebCore::QuickTimePluginReplacement::installReplacement):
3539 * bindings/js/IDBBindingUtilities.cpp:
3542 * bindings/js/JSCSSStyleDeclarationCustom.cpp:
3543 (WebCore::JSCSSStyleDeclaration::getOwnPropertyNames):
3544 * bindings/js/JSCallbackData.cpp:
3545 (WebCore::JSCallbackData::invokeCallback):
3546 * bindings/js/JSCommandLineAPIHostCustom.cpp:
3547 (WebCore::getJSListenerFunctions):
3548 (WebCore::JSCommandLineAPIHost::getEventListeners):
3549 * bindings/js/JSCryptoAlgorithmBuilder.cpp:
3550 (WebCore::JSCryptoAlgorithmBuilder::add):
3551 * bindings/js/JSCryptoAlgorithmDictionary.cpp:
3552 (WebCore::getProperty):
3553 (WebCore::getHashAlgorithm):
3554 * bindings/js/JSCryptoKeySerializationJWK.cpp:
3555 (WebCore::getJSArrayFromJSON):
3556 (WebCore::getStringFromJSON):
3557 (WebCore::getBooleanFromJSON):
3558 (WebCore::addToJSON):
3559 (WebCore::buildJSONForRSAComponents):
3560 (WebCore::addBoolToJSON):
3561 (WebCore::addUsagesToJSON):
3562 * bindings/js/JSCustomXPathNSResolver.cpp:
3563 (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
3564 * bindings/js/JSDOMStringMapCustom.cpp:
3565 (WebCore::JSDOMStringMap::getOwnPropertyNames):
3566 * bindings/js/JSDOMWindowCustom.cpp:
3567 (WebCore::JSDOMWindow::defineOwnProperty):
3568 (WebCore::JSDOMWindow::setLocation):
3569 (WebCore::DialogHandler::dialogCreated):
3570 (WebCore::DialogHandler::returnValue):
3571 * bindings/js/JSDeviceMotionEventCustom.cpp:
3572 (WebCore::readAccelerationArgument):
3573 (WebCore::readRotationRateArgument):
3574 (WebCore::createAccelerationObject):
3575 (WebCore::createRotationRateObject):
3576 * bindings/js/JSDictionary.cpp:
3577 (WebCore::JSDictionary::tryGetProperty):
3578 * bindings/js/JSEventListener.cpp:
3579 (WebCore::JSEventListener::handleEvent):
3580 * bindings/js/JSHTMLAllCollectionCustom.cpp:
3581 (WebCore::callHTMLAllCollection):
3582 (WebCore::JSHTMLAllCollection::item):
3583 (WebCore::JSHTMLAllCollection::namedItem):
3584 * bindings/js/JSHTMLDocumentCustom.cpp:
3585 (WebCore::JSHTMLDocument::all):
3586 (WebCore::JSHTMLDocument::setAll):
3587 (WebCore::JSHTMLDocument::open):
3588 * bindings/js/JSHTMLFormControlsCollectionCustom.cpp:
3589 (WebCore::JSHTMLFormControlsCollection::namedItem):
3590 * bindings/js/JSIDBDatabaseCustom.cpp:
3591 (WebCore::JSIDBDatabase::createObjectStore):
3592 * bindings/js/JSIDBObjectStoreCustom.cpp:
3593 (WebCore::JSIDBObjectStore::createIndex):
3594 * bindings/js/JSImageDataCustom.cpp:
3596 * bindings/js/JSInspectorFrontendHostCustom.cpp:
3597 (WebCore::populateContextMenuItems):
3598 * bindings/js/JSLazyEventListener.cpp:
3599 (WebCore::JSLazyEventListener::initializeJSFunction):
3600 * bindings/js/JSNodeFilterCondition.cpp:
3601 (WebCore::JSNodeFilterCondition::acceptNode):
3602 * bindings/js/JSSQLResultSetRowListCustom.cpp:
3603 (WebCore::JSSQLResultSetRowList::item):
3604 * bindings/js/JSStorageCustom.cpp:
3605 (WebCore::JSStorage::getOwnPropertyNames):
3606 * bindings/js/ReadableStreamJSSource.cpp:
3607 (WebCore::setInternalSlotToObject):
3608 (WebCore::getInternalSlotFromObject):
3609 * bindings/js/ScriptGlobalObject.cpp:
3610 (WebCore::ScriptGlobalObject::set):
3611 (WebCore::ScriptGlobalObject::get):
3612 (WebCore::ScriptGlobalObject::remove):
3613 * bindings/js/SerializedScriptValue.cpp:
3614 (WebCore::CloneSerializer::CloneSerializer):
3615 (WebCore::CloneSerializer::write):
3616 (WebCore::CloneDeserializer::deserialize):
3617 * bindings/objc/WebScriptObject.mm:
3618 (-[WebScriptObject callWebScriptMethod:withArguments:]):
3619 (-[WebScriptObject setValue:forKey:]):
3620 (-[WebScriptObject valueForKey:]):
3621 (-[WebScriptObject removeWebScriptKey:]):
3622 (-[WebScriptObject hasWebScriptKey:]):
3623 * bindings/scripts/CodeGeneratorJS.pm:
3624 (GenerateImplementation):
3625 * bindings/scripts/test/JS/JSFloat64Array.cpp:
3626 (WebCore::JSFloat64Array::getOwnPropertyNames):
3627 * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3628 (WebCore::JSTestEventTarget::getOwnPropertyNames):
3629 * bindings/scripts/test/JS/JSTestObj.cpp:
3630 (WebCore::setJSTestObjTestSubObjEnabledBySettingConstructor):
3631 (WebCore::setJSTestObjConditionalAttr4Constructor):
3632 (WebCore::setJSTestObjConditionalAttr5Constructor):
3633 (WebCore::setJSTestObjConditionalAttr6Constructor):
3634 (WebCore::setJSTestObjReplaceableAttribute):
3635 * bridge/c/c_utility.cpp:
3636 (JSC::Bindings::identifierFromNPIdentifier):
3637 * bridge/objc/objc_runtime.mm:
3638 (JSC::Bindings::ObjcFallbackObjectImp::defaultValue):
3639 * bridge/testbindings.cpp:
3641 * bridge/testbindings.mm:
3643 * contentextensions/ContentExtensionParser.cpp:
3644 (WebCore::ContentExtensions::loadTrigger):
3645 (WebCore::ContentExtensions::loadAction):
3646 * html/HTMLMediaElement.cpp:
3647 (WebCore::HTMLMediaElement::parseAttribute):
3648 * html/HTMLPlugInImageElement.cpp:
3649 (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
3650 * testing/js/WebCoreTestSupport.cpp:
3651 (WebCoreTestSupport::injectInternalsObject):
3653 2015-03-31 Jer Noble <jer.noble@apple.com>
3655 [Mac] Songza.com fails to play; QTKit path reports it is always "seeking".
3656 https://bugs.webkit.org/show_bug.cgi?id=143274
3658 Rubber-stamped by Eric Carlson.
3660 MediaTime::invalidTime() is always greater than any valid time. So when
3661 checking to see if MediaPlayerPrivateQTKit is seeking, first check if the
3662 m_seekTo time is valid before checking whether it's > 0.
3664 * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3665 (WebCore::MediaPlayerPrivateQTKit::seeking):
3667 2015-03-31 Said Abou-Hallawa <sabouhallawa@apple.com>
3669 border-image with 'fill' keyword does not fill the middle area unless the border width is greater than zero.
3670 https://bugs.webkit.org/show_bug.cgi?id=142650.
3672 Reviewed by Simon Fraser.
3674 The decoration of a RenderBox, a RenderTable or an InlineFlowBox should be
3675 drawn if its RenderStyle has a non-zero width border or the border-image
3676 has the keyword fill.
3678 Tests: fast/borders/border-image-fill-inline-no-border.html
3679 fast/borders/border-image-fill-no-border.html
3681 * rendering/InlineFlowBox.cpp:
3682 (WebCore::InlineFlowBox::paintBoxDecorations):
3683 * rendering/RenderBox.cpp:
3684 (WebCore::RenderBox::paintBoxDecorations):
3685 * rendering/RenderBoxModelObject.cpp:
3686 (WebCore::RenderBoxModelObject::hasBoxDecorationStyle):
3687 * rendering/RenderTable.cpp:
3688 (WebCore::RenderTable::paintBoxDecorations):
3689 * rendering/style/BorderData.h:
3690 (WebCore::BorderData::hasFill):
3691 * rendering/style/RenderStyle.h:
3693 2015-03-31 Alex Christensen <achristensen@webkit.org>
3695 [Win] Unreviewed build fix.
3697 * WebCore.vcxproj/WebCore.vcxproj:
3698 Don't include inspector files twice in debug builds.
3699 InspectorAllInOne.cpp is now used on debug builds.
3701 2015-03-31 David Hyatt <hyatt@apple.com>
3703 [New Block-Inside-Inline Model] Anonymous inline-blocks should size as though they are block-level.
3704 https://bugs.webkit.org/show_bug.cgi?id=143271
3706 Reviewed by Dean Jackson.
3708 Added fast/block/inside-inlines/block-width-check.html.
3710 * rendering/RenderBox.cpp:
3711 (WebCore::RenderBox::sizesLogicalWidthToFitContent):
3712 Return false when an anonymous inline-block is encountered, since we want to treat it like a regular
3715 2015-03-31 Commit Queue <commit-queue@webkit.org>
3717 Unreviewed, rolling out r182186.
3718 https://bugs.webkit.org/show_bug.cgi?id=143270
3720 it crashes all the WebGL tests on the Debug bots (Requested by
3725 "Web Inspector: add 2D/WebGL canvas instrumentation
3727 https://bugs.webkit.org/show_bug.cgi?id=137278
3728 http://trac.webkit.org/changeset/182186
3730 2015-03-31 Myles C. Maxfield <mmaxfield@apple.com>
3732 Crash in CGContextShowGlyphsWithAdvances when passing kCGFontIndexInvalid
3733 https://bugs.webkit.org/show_bug.cgi?id=143114
3735 This is a workaround for <rdar://problem/20230073>. Please remove when it is no longer necessary.
3737 Reviewed by Alexey Proskuryakov.
3740 compositing/regions/floated-region-with-transformed-child.html
3741 compositing/regions/floated-region-with-transformed-child-expected.html
3742 fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005.html
3743 fast/regions/counters/extract-ordered-lists-in-regions-explicit-counters-005-expected.html
3744 fast/regions/overflow/overflow-content-transform-rotate.html
3745 fast/regions/overflow/overflow-content-transform-rotate-expected.html
3747 * platform/graphics/GlyphBuffer.h:
3748 (WebCore::GlyphBuffer::shrink): Performing shaping may remove glyphs, so we need to shrink the GlyphBuffer.
3749 * platform/graphics/WidthIterator.cpp:
3750 (WebCore::applyFontTransforms): Filter out kCGFontIndexInvalid.
3751 (WebCore::WidthIterator::advanceInternal): Moved code into applyFontTransforms, and trigger the
3752 shrink of the GlyphBuffer.
3754 2015-03-31 Beth Dakin <bdakin@apple.com>
3756 REGRESSION (r173484): Reducing content of scrollable region does not reset scroll
3758 https://bugs.webkit.org/show_bug.cgi?id=138525
3760 rdar://problem/18166043
3762 Reviewed by Simon Fraser.
3764 The change that caused this regression was correct. That change does not allow
3765 RenderLayer to update scroll position after a layout if a rubber-band is currently
3766 happening. The change caused this regression because all of the member variables
3767 in ScrollController that attempt to keep track of the current state of the scroll
3768 gesture (m_inScrollGesture, m_momentumScrollInProgress, and
3769 m_snapRubberbandTimerIsActive) all indicated that a momentum scroll gesture was
3770 still in action for this div even though it very much is not when the bug happens.
3771 Those variables were never properly re-set because the
3772 PlatformWheelEventPhaseEnded events never got dispatched to the ScrollController,
3773 which brought the investigation back to Element.
3775 We must still dispatch events that have zero delta so that the default event
3776 handlers can handle them, but we should stopPropagation() so that these events are
3777 not sent to the DOM. Websites will break if they get wheel events with no delta.
3779 (WebCore::Element::dispatchWheelEvent):
3781 2015-03-31 Alex Christensen <achristensen@webkit.org>
3783 [Win] Unreviewed debug build fix after r182186.
3785 * WebCore.vcxproj/WebCore.vcxproj:
3786 Include InspectorAllInOne.cpp in debug builds.
3788 2015-03-30 David Hyatt <hyatt@apple.com>
3790 [New Block-Inside-Inline Model] Make sure line breaks occur before and after the anonymous inline-block.
3791 https://bugs.webkit.org/show_bug.cgi?id=143238.
3793 Reviewed by Dean Jackson.
3795 Added fast/blocks/inside-inlines/breaking-behavior.html (and new-model equivalent).
3797 * rendering/InlineFlowBox.h:
3798 (WebCore::InlineFlowBox::InlineFlowBox):
3799 (WebCore::InlineFlowBox::hasAnonymousInlineBlock):
3800 (WebCore::InlineFlowBox::setHasAnonymousInlineBlock):
3801 Add a bit to root line boxes (stored in the InlineFlowBox since it has free bits) that indicates whether
3802 or not a line is an anonymous inline-block line.
3804 * rendering/RenderBlockFlow.cpp:
3805 (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths):
3806 Patch the preferred logical width computation to break both before and after an anonymous inline-block.
3807 Also make sure to strip trailing spaces from the line before the anonymous inline-block.
3809 * rendering/RenderBlockLineLayout.cpp:
3810 (WebCore::RenderBlockFlow::constructLine):
3811 Patch line construction so that no intermediate boxes are constructed between the InlineBox for the anonymous
3812 inline-block and the root line box.
3814 * rendering/RootInlineBox.cpp:
3815 (WebCore::RootInlineBox::ascentAndDescentForBox):
3816 The height of a "line" that holds an anonymous inline-block should ignore line-box-contain and also make sure
3817 that the margins of the replaced element are "outside" the line, since those margins will collapse.
3819 * rendering/line/BreakingContext.h:
3820 (WebCore::BreakingContext::handleReplaced):
3821 Patch handleReplaced to make sure breaks occur both before and after an anonymous inline-block. In the case of
3822 a break after the block, we setPreviousLineBrokeCleanly to true so that <br>s that follow the anonymous inline-block
3825 2015-03-31 Csaba Osztrogonác <ossy@webkit.org>
3827 [EFL] Add nullptr check to GraphicsContext3D::makeContextCurrent()
3828 https://bugs.webkit.org/show_bug.cgi?id=143214
3830 Reviewed by Žan Doberšek.
3832 * platform/graphics/efl/GraphicsContext3DEfl.cpp:
3833 (WebCore::GraphicsContext3D::makeContextCurrent):
3835 2015-03-31 Matt Baker <mattbaker@apple.com>
3837 Web Inspector: add 2D/WebGL canvas instrumentation infrastructure
3838 https://bugs.webkit.org/show_bug.cgi?id=137278
3840 Reviewed by Timothy Hatcher.
3842 Added backend agent for canvas inspection. A canvas is instrumented once its CanvasRenderingContext has been
3843 created. WebGLRenderingContext is instrumented to track the lifetime of shader program objects.
3845 To instrument off-screen rendering contexts (CSS canvases and detached canvas elements), the canvas agent must
3846 track all CanvasRenderingContexts as they are created, even in the absense of the frontend. As far as I know,
3847 there is no practical way to identify rendering contexts belonging to a frame that are not in the DOM. In the
3848 absence of the inspector frontend the agent does only the minimum required to track the lifetime of rendering
3849 contexts and their resources, to avoid creating a negative performance impact.
3851 Tests: inspector/canvas/canvas-add-remove-events.html
3852 inspector/canvas/canvas-context-attributes.html
3853 inspector/canvas/canvas-css-name.html
3856 * WebCore.xcodeproj/project.pbxproj:
3859 (WebCore::Document::getCSSCanvasElement):
3860 Instrumentation for CSS canvases.
3862 * html/HTMLCanvasElement.cpp:
3863 (WebCore::HTMLCanvasElement::getContext):
3864 Instrumentation for context creation.
3866 * html/canvas/WebGLRenderingContextBase.cpp:
3867 (WebCore::WebGLRenderingContextBase::attachShader):
3868 (WebCore::WebGLRenderingContextBase::createProgram):
3869 (WebCore::WebGLRenderingContextBase::deleteProgram):
3870 (WebCore::WebGLRenderingContextBase::detachShader):
3871 Instrumentation for programs and shaders.
3873 * inspector/InspectorAllInOne.cpp:
3875 * inspector/InspectorCanvasAgent.cpp: Added.
3876 (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
3877 (WebCore::InspectorCanvasAgent::didCreateFrontendAndBackend):
3878 (WebCore::InspectorCanvasAgent::willDestroyFrontendAndBackend):
3879 (WebCore::InspectorCanvasAgent::frameNavigated):
3880 (WebCore::InspectorCanvasAgent::didCreateCSSCanvas):
3881 (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
3882 (WebCore::InspectorCanvasAgent::didAttachShader):
3883 (WebCore::InspectorCanvasAgent::didDetachShader):
3884 (WebCore::InspectorCanvasAgent::didCreateProgram):
3885 (WebCore::InspectorCanvasAgent::didDeleteProgram):
3886 (WebCore::InspectorCanvasAgent::getCanvases):
3887 (WebCore::InspectorCanvasAgent::canvasDestroyed):
3888 (WebCore::InspectorCanvasAgent::canvasDestroyedTimerFired):
3889 (WebCore::InspectorCanvasAgent::reset):
3890 (WebCore::InspectorCanvasAgent::getCanvasEntry):
3891 (WebCore::InspectorCanvasAgent::getProgramEntry):
3892 (WebCore::InspectorCanvasAgent::removeShaderFromShaderMap):
3893 (WebCore::InspectorCanvasAgent::contextTypeJson):
3894 (WebCore::InspectorCanvasAgent::buildObjectForCanvas):
3895 * inspector/InspectorCanvasAgent.h: Added.
3898 * inspector/InspectorController.cpp:
3899 (WebCore::InspectorController::InspectorController):
3900 Support for new backend agent.