21f0ab6f7989267b5b6da42a6aec2b8b661f19d1
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2015-05-14  Myles C. Maxfield  <mmaxfield@apple.com>
2
3         [Mac] Expose more font weights for -apple-system
4         https://bugs.webkit.org/show_bug.cgi?id=144707
5
6         Reviewed by Simon Fraser.
7
8         Previously, when we parsed a CSS declaration of the form font: keyword; where keyword
9         is one of caption, icon, menu, message-box, small-caption, -webkit-mini-control, -webkit-small-control,
10         or -webkit-control (which html.css does for form controls), we would ask the system what the appropriate
11         system font is, get that font's family name, and synthesize a font-family CSS property for the element.
12         Then, later when we actually go to look up the font, we would look up the font by family name using this
13         information. However, this round-tripping of a font through a family name is actually lossy, and is not
14         guaranteed to preserve system-font-ness (which we use for various things including metrics calculations).
15
16         This patch modifies this logic to specify a token family name instead, which the font lookup code special
17         cases (and reacts by making the appropriate system-font lookup call). This approach is currently how iOS
18         handles these system fonts; this patch simply brings this approach to OS X.
19
20         There is also an added progression here. We used to simply call [NSFont fontWithName:size:] on the system
21         font family name (which the parser found for us) which entirely disregards weight. This means that we
22         used to be getting synthesized bold in form controls which ask for a heavy weight. Migrating to this
23         system-font aware call means that we get the real bold font instead of synthesized bold.
24
25         Once this system-font-ness is guaranteed to be preserved between parsing time and font lookup time, we
26         can safely migrate to using [NSFont systemFontOfSize:weight] instead of [NSFont systemFontOfSize:] on
27         platforms which support it.
28
29         Tests: fast/text/systemFont.html
30                fast/css/css2-system-fonts.html
31                fast/forms/select/optgroup-rendering.html
32                fast/forms/validation-message-appearance.html
33
34         * css/CSSParser.cpp:
35         (WebCore::CSSParser::parseSystemFont): Add a comment regarding why we are bothering with expanding out
36         the font property in the first place.
37         * platform/graphics/cocoa/FontCascadeCocoa.mm:
38         (WebCore::FontCascade::primaryFontIsSystemFont): Update to use new system font tokens.
39         * platform/graphics/mac/FontCacheMac.mm:
40         (WebCore::toNSFontWeight): New static method to map font weights to NSFontWeight constants available on
41         Yosemite and later.
42         (WebCore::fontWithFamilySpecialCase): Pull all these special-case font token name handling into a
43         separate function, which returns an Optional.
44         (WebCore::fontWithFamily):
45         * platform/mac/ThemeMac.mm:
46         (WebCore::ThemeMac::controlFont): Use the font token name instead of the generated system font family
47         name.
48         * platform/spi/mac/NSFontSPI.h: Add [NSFont systemFontWithSize:weight:] and the proper NSFontWeight
49         constants.
50         * rendering/RenderThemeMac.mm:
51         (WebCore::RenderThemeMac::updateCachedSystemFontDescription): Use the font token names instead of the
52         generated system font family name.
53         (WebCore::RenderThemeMac::setFontFromControlSize): Ditto.
54
55 2015-05-14  Roger Fong  <roger_fong@apple.com>
56
57         Add internals setting to disable wireless playback availability for layout tests
58         https://bugs.webkit.org/show_bug.cgi?id=145012.
59         <rdar://problem/20946504>
60
61         Reviewed by Eric Carlson.
62
63         * testing/InternalSettings.cpp:
64         (WebCore::InternalSettings::resetToConsistentState):
65         (WebCore::InternalSettings::setWirelessPlaybackDisabled):
66         * testing/InternalSettings.idl:
67
68 2015-05-14  Beth Dakin  <bdakin@apple.com>
69
70         Change range of possible forces for mouseforcechanged DOM event
71         https://bugs.webkit.org/show_bug.cgi?id=144987
72         -and corresponding-
73         rdar://problem/20472802
74
75         Reviewed by Tim Horton.
76
77         Change to a 0-3 range.
78         * platform/PlatformMouseEvent.h:
79         * platform/mac/PlatformEventFactoryMac.mm:
80         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
81
82 2015-05-14  Manuel Rego Casasnovas  <rego@igalia.com>
83
84         Fix typo in RenderBox::instrinsicScrollbarLogicalWidth()
85         https://bugs.webkit.org/show_bug.cgi?id=144999
86
87         Reviewed by Sergio Villar Senin.
88
89         Rename RenderBox::instrinsicScrollbarLogicalWidth() to
90         RenderBox::intrinsicScrollbarLogicalWidth().
91
92         No new tests, no behavior changes.
93
94         * rendering/RenderBlock.cpp:
95         (WebCore::RenderBlock::computeIntrinsicLogicalWidths):
96         * rendering/RenderBlockFlow.cpp:
97         (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths):
98         * rendering/RenderBox.cpp:
99         (WebCore::RenderBox::intrinsicScrollbarLogicalWidth):
100         (WebCore::RenderBox::instrinsicScrollbarLogicalWidth): Deleted.
101         * rendering/RenderBox.h:
102         * rendering/RenderDeprecatedFlexibleBox.cpp:
103         (WebCore::RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths):
104         * rendering/RenderFlexibleBox.cpp:
105         (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths):
106
107 2015-05-14  Youenn Fablet  <youenn.fablet@crf.canon.fr>
108
109         SharedBuffer::createWithContentsOfFile should use map file routines
110         https://bugs.webkit.org/show_bug.cgi?id=144192
111
112         Reviewed by Darin Adler.
113
114         Made use of mmap routines within SharedBuffer::createWithContentsOfFile for EFL, GTK and Mac ports.
115         If mapping is failing, it falls back to the previous version of SharedBuffer::createWithContentsOfFile renamed as
116         SharedBuffer::createFromReadingFile (using open/read method).
117         File content is mapped until SharedBuffer is cleared, destroyed or additional content is appended to the SharedBuffer.
118
119         A helper class, MappedFileData, is introduced to handle mapped files through calls to open/mmap/munmap/close.
120
121         Patch covered by existing layout tests and added unit tests.
122
123         * platform/FileSystem.cpp:
124         (WebCore::MappedFileData::MappedFileData):
125         (WebCore::MappedFileData::operator=):
126         (WebCore::MappedFileData::~MappedFileData):
127         * platform/FileSystem.h:
128         (WebCore::MappedFileData::MappedFileData):
129         (WebCore::MappedFileData::operator bool):
130         (WebCore::MappedFileData::data):
131         (WebCore::MappedFileData::size):
132         * platform/SharedBuffer.cpp:
133         (WebCore::SharedBuffer::SharedBuffer):
134         (WebCore::SharedBuffer::createWithContentsOfFile): Making use of MappedFileData before using createFromReadingFile.
135         (WebCore::SharedBuffer::size): Checking whether data is coming from a MappedFileData.
136         (WebCore::SharedBuffer::data): Ditto.
137         (WebCore::SharedBuffer::append): Ditto.
138         (WebCore::SharedBuffer::clear): Clearing MappedFileData if needed.
139         (WebCore::SharedBuffer::copy): Transferring mapped data to buffer if needed.
140         (WebCore::SharedBuffer::getSomeData):
141         (WebCore::SharedBuffer::maybeTransferMappedFileData):
142         * platform/SharedBuffer.h:
143         * platform/gtk/SharedBufferGtk.cpp:
144         (WebCore::SharedBuffer::createFromReadingFile): renamed from createWithContentsOfFile.
145         * platform/mac/SharedBufferMac.mm:
146         (WebCore::SharedBuffer::createFromReadingFile): Dito.
147         * platform/posix/SharedBufferPOSIX.cpp:
148         (WebCore::SharedBuffer::createFromReadingFile): Ditto.
149         * platform/win/SharedBufferWin.cpp:
150         (WebCore::SharedBuffer::createFromReadingFile): Ditto.
151
152 2015-05-13  Simon Fraser  <simon.fraser@apple.com>
153
154         Get the ScriptController from the correct frame for media elements and plug-ins
155         https://bugs.webkit.org/show_bug.cgi?id=144983
156         rdar://problem/20692642&19943135
157
158         Reviewed by Sam Weinig.
159
160         HTMLMediaElement, QuickTimePluginReplacement and HTMLPlugInImageElement were
161         getting the main frame's ScriptController instead of the one for their frame.
162         This caused media controls JS to be running in the context of the main frame,
163         which broke media controls which use getCSSCanvasContext() and -webkit-canvas.
164         
165         Fix by getting the frame via the element's document.
166         
167         Also undo r180584 which was working around this bug.
168
169         * Modules/mediacontrols/mediaControlsiOS.js:
170         (ControllerIOS.prototype.drawTimelineBackground):
171         * Modules/plugins/QuickTimePluginReplacement.mm:
172         (WebCore::QuickTimePluginReplacement::ensureReplacementScriptInjected):
173         (WebCore::QuickTimePluginReplacement::installReplacement):
174         * html/HTMLMediaElement.cpp:
175         (WebCore::HTMLMediaElement::updateCaptionContainer):
176         (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
177         (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot):
178         (WebCore::HTMLMediaElement::pageScaleFactorChanged):
179         * html/HTMLPlugInImageElement.cpp:
180         (WebCore::HTMLPlugInImageElement::didAddUserAgentShadowRoot):
181
182 2015-05-13  Sungmann Cho  <sungmann.cho@navercorp.com>
183
184         Fix trivial typos in ApplyBlockElementCommand
185         https://bugs.webkit.org/show_bug.cgi?id=144984
186
187         Reviewed by Alexey Proskuryakov.
188
189         No new tests, no behavior change.
190
191         * editing/ApplyBlockElementCommand.cpp:
192         (WebCore::ApplyBlockElementCommand::formatSelection):
193         (WebCore::ApplyBlockElementCommand::endOfNextParagraphSplittingTextNodesIfNeeded):
194         (WebCore::ApplyBlockElementCommand::endOfNextParagrahSplittingTextNodesIfNeeded): Deleted.
195         * editing/ApplyBlockElementCommand.h:
196
197 2015-05-13  David Kilzer  <ddkilzer@apple.com>
198
199         REGRESION (r179958): Crash in WebCore::DocumentLoader::detachFromFrame when -[id<WebPolicyDelegate> decidePolicyForMIMEType:request:frame:decisionListener:] fails to call -[id<WebPolicyDecisionListener> download|ignore|use]
200         <http://webkit.org/b/144975>
201
202         Reviewed by Andy Estes.
203
204         This change reverts r179958.  It changes RELEASE_ASSERT*()
205         statements back to Debug-only ASSERT*() statements.
206
207         * loader/DocumentLoader.cpp:
208         (WebCore::DocumentLoader::~DocumentLoader):
209         (WebCore::DocumentLoader::continueAfterContentPolicy):
210         (WebCore::DocumentLoader::detachFromFrame):
211
212 2015-05-13  Antti Koivisto  <antti@apple.com>
213
214         Cached CSS image resources don't show up after reloading <http://nightly.webkit.org/start/>
215         https://bugs.webkit.org/show_bug.cgi?id=144952
216         rdar://problem/13387307
217
218         Reviewed by Oliver Hunt.
219
220         This is a symptom of a general problem that we don't revalidate subresources of cached parsed stylesheets.
221
222         Fix by tightening the check we perform when choosing to used the cached sheet. If there are expired subresources
223         we reparse the sheet.
224
225         Test: http/tests/cache/stylesheet-sharing.html
226
227         * css/CSSCrossfadeValue.cpp:
228         (WebCore::CSSCrossfadeValue::traverseSubresources):
229         (WebCore::CSSCrossfadeValue::hasFailedOrCanceledSubresources): Deleted.
230
231             Replace hasFailedOrCanceledSubresources with general purpose subresource traversal functions.
232
233         * css/CSSCrossfadeValue.h:
234         * css/CSSFilterImageValue.cpp:
235         (WebCore::CSSFilterImageValue::traverseSubresources):
236         (WebCore::CSSFilterImageValue::hasFailedOrCanceledSubresources): Deleted.
237         * css/CSSFilterImageValue.h:
238         * css/CSSFontFaceSrcValue.cpp:
239         (WebCore::CSSFontFaceSrcValue::traverseSubresources):
240         (WebCore::CSSFontFaceSrcValue::hasFailedOrCanceledSubresources): Deleted.
241         * css/CSSFontFaceSrcValue.h:
242         * css/CSSImageSetValue.cpp:
243         (WebCore::CSSImageSetValue::traverseSubresources):
244         (WebCore::CSSImageSetValue::hasFailedOrCanceledSubresources): Deleted.
245         * css/CSSImageSetValue.h:
246         * css/CSSImageValue.cpp:
247         (WebCore::CSSImageValue::traverseSubresources):
248         (WebCore::CSSImageValue::hasFailedOrCanceledSubresources): Deleted.
249         * css/CSSImageValue.h:
250         * css/CSSValue.cpp:
251         (WebCore::CSSValue::traverseSubresources):
252         (WebCore::CSSValue::hasFailedOrCanceledSubresources): Deleted.
253         * css/CSSValue.h:
254         * css/CSSValueList.cpp:
255         (WebCore::CSSValueList::traverseSubresources):
256         (WebCore::CSSValueList::hasFailedOrCanceledSubresources): Deleted.
257         * css/CSSValueList.h:
258         * css/StyleProperties.cpp:
259         (WebCore::StyleProperties::traverseSubresources):
260         (WebCore::StyleProperties::hasFailedOrCanceledSubresources): Deleted.
261         * css/StyleProperties.h:
262         * css/StyleSheetContents.cpp:
263         (WebCore::traverseSubresourcesInRules):
264         (WebCore::StyleSheetContents::traverseSubresources):
265         (WebCore::StyleSheetContents::subresourcesAllowReuse):
266
267             Disallow reuse if there are expired subresources.
268
269         (WebCore::StyleSheetContents::isLoadingSubresources):
270
271             Testing support.
272
273         (WebCore::childRulesHaveFailedOrCanceledSubresources): Deleted.
274         (WebCore::StyleSheetContents::hasFailedOrCanceledSubresources): Deleted.
275         * css/StyleSheetContents.h:
276         (WebCore::StyleSheetContents::loadCompleted):
277         * html/HTMLLinkElement.cpp:
278         (WebCore::HTMLLinkElement::setCSSStyleSheet):
279         * loader/cache/CachedCSSStyleSheet.cpp:
280         (WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
281         * loader/cache/CachedCSSStyleSheet.h:
282         * loader/cache/CachedImage.cpp:
283         (WebCore::CachedImage::makeRevalidationDecision):
284         (WebCore::CachedImage::mustRevalidateDueToCacheHeaders): Deleted.
285
286             Move the logging code out from this function (it requires frame access this function doesn't otherwise need)
287             and refactor to return a decision enum.
288
289         * loader/cache/CachedImage.h:
290         * loader/cache/CachedResource.cpp:
291         (WebCore::CachedResource::makeRevalidationDecision):
292         (WebCore::logResourceRevalidationReason): Deleted.
293         (WebCore::CachedResource::mustRevalidateDueToCacheHeaders): Deleted.
294         * loader/cache/CachedResource.h:
295         (WebCore::CachedResource::loadFailedOrCanceled):
296         * loader/cache/CachedResourceLoader.cpp:
297         (WebCore::logRevalidation):
298         (WebCore::logResourceRevalidationDecision):
299         (WebCore::CachedResourceLoader::determineRevalidationPolicy):
300
301             Move logging here.
302
303         * testing/Internals.cpp:
304         (WebCore::Internals::isSharingStyleSheetContents):
305         (WebCore::Internals::isStyleSheetLoadingSubresources):
306         * testing/Internals.h:
307         * testing/Internals.idl:
308
309 2015-05-13  Ryuan Choi  <ryuan.choi@navercorp.com>
310
311         [CoordinatedGraphics] Remove scaleFactor from SurfaceUpdateInfo
312         https://bugs.webkit.org/show_bug.cgi?id=144935
313
314         Reviewed by Darin Adler.
315
316         The members of SurfaceUpdateInfo are only used to update tile except scaleFactor.
317         So, this patch removes scaleFactor from SurfaceUpdateInfo.
318         In addition, removes unnecessary parameters in createTile() 
319
320         No new tests because there is no behavior change.
321
322         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
323         (WebCore::CoordinatedGraphicsLayer::createTile):
324         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
325         * platform/graphics/texmap/coordinated/CoordinatedTile.cpp:
326         (WebCore::CoordinatedTile::updateBackBuffer):
327         * platform/graphics/texmap/coordinated/CoordinatedTile.h:
328         * platform/graphics/texmap/coordinated/SurfaceUpdateInfo.h:
329
330 2015-05-13  Sam Weinig  <sam@webkit.org>
331
332         Modernize ContainerNode::childElementCount
333         https://bugs.webkit.org/show_bug.cgi?id=144930
334
335         Reviewed by Darin Adler.
336
337         * dom/ContainerNode.cpp:
338         (WebCore::ContainerNode::childElementCount):
339         Use std::distance to compute the number of child elements.
340
341         * dom/ElementChildIterator.h:
342         Add typedefs to make the child element iterators conform STL standards.
343
344 2015-05-13  Ryosuke Niwa  <rniwa@webkit.org>
345
346         REGRESSION(r183770): Crash inside WebEditorClient::shouldApplyStyle when applying underline
347         https://bugs.webkit.org/show_bug.cgi?id=144949
348         <rdar://problem/20895753>
349
350         Reviewed by Darin Adler.
351
352         The crash was caused by the variant of applyStyleToSelection that takes EditingStyle passing
353         a null pointer to shouldApplyStyle when we're only applying text decoration changes so that
354         m_mutableStyle in the editing style is null. This didn't reproduce in execCommand since we
355         wouldn't call shouldApplyStyle in that case. It didn't reproduce in my manual testing because
356         font panel also sets text shadow, which ends up filling up m_mutableStyle.
357
358         Fixed the bug by creating a mutable style properties when one is not provided by EditingStyle.
359         Also fixed the "FIXME" in the function by converting text decoration changes to a corresponding
360         text decoration value. The values passed to shouldApplyStyle now matches the old behavior prior
361         to r183770.
362
363         Test: editing/style/underline-by-user.html
364
365         * editing/EditingStyle.cpp:
366         (WebCore::EditingStyle::styleWithResolvedTextDecorations): Added.
367         * editing/EditingStyle.h:
368         * editing/Editor.cpp:
369         (WebCore::Editor::applyStyleToSelection): Use styleWithResolvedTextDecorations to avoid the crash.
370
371 2015-05-13  Eric Carlson  <eric.carlson@apple.com>
372
373         Work around HTMLMediaElement::documentDidResumeFromPageCache being called twice
374         https://bugs.webkit.org/show_bug.cgi?id=144969
375
376         Reviewed by Alexey Proskuryakov.
377
378         * dom/Document.cpp:
379         (WebCore::Document::addPlaybackTargetPickerClient): Replace ASSERT with early 
380         return to work around https://webkit.org/b/144970.
381
382 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
383
384         Going back after resizing causes scroll knob to appear in the middle of the page
385         https://bugs.webkit.org/show_bug.cgi?id=144968
386         <rdar://problem/18299827>
387
388         Reviewed by Beth Dakin.
389
390         * history/CachedPage.cpp:
391         (WebCore::CachedPage::restore):
392         (WebCore::CachedPage::clear):
393         * history/CachedPage.h:
394         (WebCore::CachedPage::markForContentsSizeChanged):
395         * history/PageCache.cpp:
396         (WebCore::PageCache::markPagesForContentsSizeChanged):
397         * history/PageCache.h:
398         Add a flag that will cause us to call updateContentsSize() after a page
399         comes out of the page cache, if necessary.
400
401         * page/FrameView.cpp:
402         (WebCore::FrameView::setContentsSize):
403         * page/FrameView.h:
404         Mark all cached pages for this frame as needing updateContentsSize()
405         when setContentsSize happens. This will ensure that scrollbar layers
406         are repositioned when coming out of the page cache.
407
408 2015-05-13  Beth Dakin  <bdakin@apple.com>
409
410         Need SPI to set the overlay scroll bar style
411         https://bugs.webkit.org/show_bug.cgi?id=144928
412         -and corresponding-
413         rdar://problem/20143614
414
415         Reviewed by Anders Carlsson.
416
417         New ChromeClient function preferredScrollbarOverlayStyle() will fetch the 
418         scrollbar style that was set via the new SPI.
419         * page/ChromeClient.h:
420
421         If the preferredScrollbarOverlayStyle() is anything but None, then use it. None is 
422         used to indicate that the normal heuristic should compute the appropriate color.
423         * page/FrameView.cpp:
424         (WebCore::FrameView::recalculateScrollbarOverlayStyle):
425         * page/FrameView.h:
426
427 2015-05-13  Brent Fulgham  <bfulgham@apple.com>
428
429         Scrollbars in overflow regions are not vanishing after scrolling with scroll snap points
430         https://bugs.webkit.org/show_bug.cgi?id=142521
431         <rdar://problem/20100706>
432
433         Reviewed by Darin Adler.
434
435         The scrollbars were not being dismissed because they were not being notified that the wheel
436         gesture was finished. This was happening because the wheel event 'ended' state has zero
437         deltaX and deltaY. If the region did not allow stretching, it would exit early, never passing
438         through the 'handleWheelEventPhase' code that would notify the scrollbar controller that
439         the gesture had ended.
440
441         * platform/ScrollableArea.cpp:
442         (WebCore::ScrollableArea::mouseExitedContentArea): The wrong ScrollAnimator method was being
443         called when the mouse exited the content area.
444         * platform/mac/ScrollAnimatorMac.mm:
445         (WebCore::ScrollAnimatorMac::handleWheelEvent): Do not early return when the wheel event has
446         no change in X or Y coordinate.
447
448 2015-05-12  David Hyatt  <hyatt@apple.com>
449
450         Don't compute selection painting info when we don't have selection.
451         https://bugs.webkit.org/show_bug.cgi?id=144920
452         <rdar://problem/20919920>
453
454         Reviewed by Simon Fraser.
455
456         * rendering/InlineTextBox.cpp:
457         (WebCore::InlineTextBox::paint):
458
459         Just set the selection paint style to the text paint style when we don't have a selection
460         at all. Computing the selection style takes time in the case where a ::selection pseudo is
461         used on the page, so we don't want to waste time computing that info unless it's actually
462         needed.
463
464 2015-05-13  Joseph Pecoraro  <pecoraro@apple.com>
465
466         Pass String as reference in more places
467         https://bugs.webkit.org/show_bug.cgi?id=144769
468
469         Reviewed by Daniel Bates.
470
471         * bindings/js/SerializedScriptValue.cpp:
472         (WebCore::CloneSerializer::dumpString):
473         (WebCore::CloneSerializer::dumpStringObject):
474         * dom/DocumentMarkerController.cpp:
475         (WebCore::DocumentMarkerController::addMarker):
476         * dom/DocumentMarkerController.h:
477         * inspector/InspectorApplicationCacheAgent.cpp:
478         (WebCore::InspectorApplicationCacheAgent::assertFrameWithDocumentLoader):
479         * inspector/InspectorApplicationCacheAgent.h:
480         * inspector/InspectorNodeFinder.cpp:
481         (WebCore::stripCharacters):
482         (WebCore::InspectorNodeFinder::InspectorNodeFinder):
483         * inspector/InspectorNodeFinder.h:
484
485 2015-05-13  Timothy Horton  <timothy_horton@apple.com>
486
487         View scale changes are temporarily lost after restoring a page from the page cache
488         https://bugs.webkit.org/show_bug.cgi?id=144934
489
490         Reviewed by Brady Eidson.
491
492         * history/CachedPage.cpp:
493         (WebCore::CachedPage::CachedPage):
494         (WebCore::CachedPage::restore):
495         (WebCore::CachedPage::clear):
496         * history/CachedPage.h:
497         (WebCore::CachedPage::markForDeviceOrPageScaleChanged): Renamed.
498         * history/PageCache.cpp:
499         (WebCore::PageCache::markPagesForDeviceOrPageScaleChanged): Renamed.
500         * history/PageCache.h:
501         Rename PageCache/CachedPage methods to make it more clear that they
502         will eventually result in calling deviceOrPageScaleFactorChanged().
503         Also, use modern initialization for CachedPage members.
504
505         * loader/HistoryController.cpp:
506         (WebCore::HistoryController::saveScrollPositionAndViewStateToItem):
507         (WebCore::HistoryController::restoreScrollPositionAndViewState):
508         Store the pageScaleFactor on HistoryItem with the view scale factored out,
509         because the view scale can change while the page is in the page cache, and
510         WebCore needs a way - without consulting with WebKit2 - to apply the changed
511         view scale to the cached page scale.
512
513         * page/Page.cpp:
514         (WebCore::Page::setViewScaleFactor):
515         (WebCore::Page::setDeviceScaleFactor):
516         * page/Page.h:
517         (WebCore::Page::viewScaleFactor):
518         Keep track of the viewScaleFactor, and mark all pages in the page cache
519         as needing to call deviceOrPageScaleFactorChanged and do a full style recalc
520         when they come back from the page cache.
521
522         For now, we expect all callers of setPageScaleFactor (including WebKit2 and
523         HistoryController) to multiply the viewScale in manually, to avoid the
524         significant amount of change in WebCore that would be required to keep them
525         totally separately.
526
527 2015-05-12  Zan Dobersek  <zdobersek@igalia.com>
528
529         Reduce TransformationMatrix copies in MatrixTransformOperation, Matrix3DTransformOperation
530         https://bugs.webkit.org/show_bug.cgi?id=144797
531
532         Reviewed by Darin Adler.
533
534         Using std::swap() on TransformationMatrix objects which don't
535         provide move constructors will result in copies.
536
537         Instead, use a helper function in both MatrixTransformOperation
538         and Matrix3DTransformOperation that calls TransformationMatrix::blend()
539         and returns the new Matrix(3D)TransformOperation object, and call it
540         with fromT and toT arguments switched when blending to identity.
541
542         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
543         (WebCore::createOperation):
544         (WebCore::Matrix3DTransformOperation::blend):
545         * platform/graphics/transforms/Matrix3DTransformOperation.h: No need
546         to copy the m_matrix member, it won't change when passed to
547         TransformationMatrix::multiply().
548         * platform/graphics/transforms/MatrixTransformOperation.cpp:
549         (WebCore::createOperation):
550         (WebCore::MatrixTransformOperation::blend):
551
552 2015-05-12  Carlos Garcia Campos  <cgarcia@igalia.com>
553
554         [EGL][X11] XPixmap created in GLContextEGL::createPixmapContext() is leaked
555         https://bugs.webkit.org/show_bug.cgi?id=144909
556
557         Reviewed by Sergio Villar Senin and Žan Doberšek.
558
559         The pixmap is created and passed to eglCreatePixmapSurface(), but
560         never released. eglCreatePixmapSurface() doesn't take the
561         ownership of the pixmap, so we should explicitly free it when the
562         GLContextEGL is destroyed.
563
564         * platform/graphics/egl/GLContextEGL.cpp:
565         (WebCore::GLContextEGL::createPixmapContext): Use XUniquePixmap
566         and transfer the ownership to the context by using the new
567         constructor that receives a XUniquePixmap&&.
568         (WebCore::GLContextEGL::createContext): createPixmapContext() is
569         now only defined for X11.
570         (WebCore::GLContextEGL::GLContextEGL): New constructor that
571         receives a XUniquePixmap&&.
572         * platform/graphics/egl/GLContextEGL.h: Add new constructor and
573         initialize the cairo device when defined to simplify constructors.
574
575 2015-05-12  Sungmann Cho  <sungmann.cho@navercorp.com>
576
577         Reindent DIBPixelData.h for consistency.
578         https://bugs.webkit.org/show_bug.cgi?id=144942
579
580         Reviewed by Darin Adler.
581
582         No new tests, no behavior change.
583
584         * platform/graphics/win/DIBPixelData.h:
585         (WebCore::DIBPixelData::DIBPixelData):
586         (WebCore::DIBPixelData::buffer):
587         (WebCore::DIBPixelData::bufferLength):
588         (WebCore::DIBPixelData::size):
589         (WebCore::DIBPixelData::bytesPerRow):
590         (WebCore::DIBPixelData::bitsPerPixel):
591
592 2015-05-12  Commit Queue  <commit-queue@webkit.org>
593
594         Unreviewed, rolling out r184224.
595         https://bugs.webkit.org/show_bug.cgi?id=144946
596
597         Made inspector/page/main-frame-resource.html assert every time
598         (Requested by ap on #webkit).
599
600         Reverted changeset:
601
602         "Web Inspector: REGRESSION (r181625): Timeline recording
603         started from console.profile is always empty"
604         https://bugs.webkit.org/show_bug.cgi?id=144882
605         http://trac.webkit.org/changeset/184224
606
607 2015-05-12  Jer Noble  <jer.noble@apple.com>
608
609         [Mac] Hang in MediaPlayerPrivateAVFoundationObjC::audioSourceProvider() - 'tracks' property not yet loaded
610         https://bugs.webkit.org/show_bug.cgi?id=144937
611
612         Reviewed by Eric Carlson.
613
614         Querying for the -[AVAsset tracks] property blocks for network loading; and could
615         block forever if the asset in question is not reachable. Add a "safe" mechanism for
616         querying the list of audible tracks, and use that when providing the audioSourceProvider()
617         with an audible track.
618
619         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
620         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
621         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
622         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
623         (WebCore::MediaPlayerPrivateAVFoundationObjC::audioSourceProvider):
624         (WebCore::MediaPlayerPrivateAVFoundationObjC::processLegacyClosedCaptionsTracks):
625         (WebCore::MediaPlayerPrivateAVFoundationObjC::safeAVAssetTracksForAudibleMedia):
626
627 2015-05-12  Ryosuke Niwa  <rniwa@webkit.org>
628
629         Mac build fix after r184228.
630
631         * bindings/scripts/CodeGeneratorJS.pm:
632
633 2015-05-12  Simon Fraser  <simon.fraser@apple.com>
634
635         Turn antialiased font dilation off by default
636         https://bugs.webkit.org/show_bug.cgi?id=144940
637         rdar://problem/20923031
638
639         Reviewed by Sam Weinig.
640
641         Turn antialised font dilation off by default.
642
643         * page/Settings.cpp:
644         (WebCore::Settings::Settings):
645         * platform/graphics/FontCascade.cpp:
646
647 2015-05-12  Alex Christensen  <achristensen@webkit.org>
648
649         Don't export all JS bindings classes.
650         https://bugs.webkit.org/show_bug.cgi?id=144932
651
652         Reviewed by Dan Bernstein.
653
654         This change is good if it compiles and links successfully.
655
656         * bindings/scripts/CodeGeneratorJS.pm:
657         (ExportLabelForClass):
658         Add a list of the JS bindings classes that need WEBCORE_EXPORT to prevent exporting too many symbols from WebCore.
659         * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
660         * bindings/scripts/test/JS/JSTestCustomNamedGetter.h:
661         * bindings/scripts/test/JS/JSTestEventConstructor.h:
662         * bindings/scripts/test/JS/JSTestEventTarget.h:
663         * bindings/scripts/test/JS/JSTestException.h:
664         * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
665         * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
666         * bindings/scripts/test/JS/JSTestNamedConstructor.h:
667         * bindings/scripts/test/JS/JSTestNode.h:
668         * bindings/scripts/test/JS/JSTestNondeterministic.h:
669         * bindings/scripts/test/JS/JSTestObj.h:
670         * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
671         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
672         * bindings/scripts/test/JS/JSTestTypedefs.h:
673         * bindings/scripts/test/JS/JSattribute.h:
674         * bindings/scripts/test/JS/JSreadonly.h:
675         Update bindings tests to remove WEBCORE_EXPORT from most of the tests,
676         but keep one test with WEBCORE_EXPORT and one test with WEBCORE_TESTSUPPORT_EXPORT.
677
678 2015-05-12  Brent Fulgham  <bfulgham@apple.com>
679
680         [Win] Update DXSDK_DIR settings for build system.
681
682         Unreviewed build fix.
683
684         * WebCore.vcxproj/WebCore.proj: Add DXSDK_DIR definition for builder.
685
686 2015-05-12  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
687
688         Return Ref instead of PassRefPtr in create() factory functions of WebCore/dom
689         https://bugs.webkit.org/show_bug.cgi?id=144904
690
691         Reviewed by Andreas Kling.
692
693         We return Ref when we're sure if pointer can't be null. If not, we use RefPtr instead PassRefPtr.
694
695         No new tests, no behavior changes.
696
697         * dom/AutocompleteErrorEvent.h:
698         * dom/DOMNamedFlowCollection.h:
699         (WebCore::DOMNamedFlowCollection::create):
700         * dom/MessageChannel.h:
701         (WebCore::MessageChannel::create):
702         * dom/MessagePort.h:
703         * dom/MutationObserver.cpp:
704         (WebCore::MutationObserver::create):
705         * dom/MutationObserver.h:
706         * dom/NamedFlowCollection.h:
707         * dom/NodeFilter.h:
708         (WebCore::NodeFilter::create):
709         * dom/NodeIterator.h:
710         (WebCore::NodeIterator::create):
711         * dom/ProcessingInstruction.cpp:
712         (WebCore::ProcessingInstruction::create):
713         * dom/ProcessingInstruction.h:
714         * dom/ScriptedAnimationController.h:
715         (WebCore::ScriptedAnimationController::create):
716         * dom/SecurityPolicyViolationEvent.h:
717         * dom/StaticNodeList.h:
718         * dom/TemplateContentDocumentFragment.h:
719         * dom/Touch.cpp:
720         (WebCore::Touch::cloneWithNewTarget):
721         * dom/Touch.h:
722         (WebCore::Touch::create):
723         * dom/TouchEvent.h:
724         * dom/TouchList.h:
725         (WebCore::TouchList::create):
726         * dom/TreeWalker.h:
727         (WebCore::TreeWalker::create):
728         * dom/WebKitNamedFlow.cpp:
729         (WebCore::WebKitNamedFlow::create):
730         * dom/WebKitNamedFlow.h:
731         * dom/default/PlatformMessagePortChannel.cpp:
732         (WebCore::PlatformMessagePortChannel::create):
733         * dom/default/PlatformMessagePortChannel.h:
734         (WebCore::PlatformMessagePortChannel::MessagePortQueue::create):
735
736 2015-05-12  Matt Baker  <mattbaker@apple.com>
737
738         Web Inspector: REGRESSION (r181625): Timeline recording started from console.profile is always empty
739         https://bugs.webkit.org/show_bug.cgi?id=144882
740
741         Reviewed by Brian Burg.
742
743         A timeline recording will always be stopped before the end of the current run loop is observed. Before
744         dispatching the recording stopped event, the last run loop record must be completed and sent to the frontend
745         to prevent it from being discarded.
746
747         * inspector/InspectorTimelineAgent.cpp:
748         (WebCore::InspectorTimelineAgent::internalStop):
749
750 2015-05-12  Zalan Bujtas  <zalan@apple.com>
751
752         REGRESSION(r175617): Some text doesn't render on internationalculinarycenter.com
753         https://bugs.webkit.org/show_bug.cgi?id=144917
754         rdar://problem/20545878
755
756         Reviewed by Andreas Kling.
757
758         This patch ensures that text stroke width value is taken into account while
759         calculating visual overflow for simple line layout.
760         Ceiling the text stroke width value matches the normal text layout behaviour.
761
762         Test: fast/text/simple-line-layout-text-stroke-width.html
763
764         * rendering/SimpleLineLayoutFunctions.cpp:
765         (WebCore::SimpleLineLayout::paintFlow):
766         (WebCore::SimpleLineLayout::collectFlowOverflow):
767
768 2015-05-12  Alexey Proskuryakov  <ap@apple.com>
769
770         Build fix.
771
772         * platform/spi/cf/CFNetworkSPI.h:
773
774 2015-05-12  Brent Fulgham  <bfulgham@apple.com>
775
776         ROLLOUT [Win] Unreviewed build fix for older DirectX build environments.
777
778         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
779
780 2015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
781
782         AX: [ATK] ARIA menu items should not have anonymous block children
783         https://bugs.webkit.org/show_bug.cgi?id=144653
784
785         Reviewed by Chris Fleizach.
786
787         Exclude anonymous block children of menu items from the accessible tree
788         for ATK. Exclude list markers from the accessibility tree if the parent
789         is not being exposed as an accessible list item.
790
791         No new tests. Instead, modified the existing tests to reflect the correct
792         behavior.
793
794         * accessibility/AccessibilityRenderObject.cpp:
795         (WebCore::AccessibilityRenderObject::computeAccessibilityIsIgnored):
796         * accessibility/atk/AccessibilityObjectAtk.cpp:
797         (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
798
799 2015-05-08  Alexey Proskuryakov  <ap@apple.com>
800
801         [Mac] Share cookie storage between UI process and secondary processes
802         https://bugs.webkit.org/show_bug.cgi?id=144820
803         rdar://problem/20572830
804
805         Reviewed by Darin Adler.
806
807         * platform/network/mac/CookieJarMac.mm:
808         * platform/spi/cf/CFNetworkSPI.h:
809         Moved SPIs into an SPI header, so that WebKit2 could use them too without duplication.
810
811 2015-05-12  Chris Dumez  <cdumez@apple.com>
812
813         [WK2] Log using diagnostic logging how far back in history we navigate
814         https://bugs.webkit.org/show_bug.cgi?id=144919
815         <rdar://problem/20920043>
816
817         Reviewed by Gavin Barraclough.
818
819         Add diagnostic logging keys for logging back history navigation delta.
820
821         * page/DiagnosticLoggingKeys.cpp:
822         (WebCore::DiagnosticLoggingKeys::deltaKey):
823         (WebCore::DiagnosticLoggingKeys::backNavigationKey):
824         * page/DiagnosticLoggingKeys.h:
825
826 2015-05-12  Yoav Weiss  <yoav@yoav.ws>
827
828         Avoid CSSPrimitiveValue allocation when parsing sizes
829         https://bugs.webkit.org/show_bug.cgi?id=144910
830
831         Reviewed by Darin Adler.
832
833         Turn non-calc length calculation logic into a static method,
834         so that it can be called without a CSSPrimitiveValue object.
835         Then, call that method to calculate the default source-size length.
836
837         No new tests, since no functionality change.
838
839         * css/CSSPrimitiveValue.cpp:
840         (WebCore::CSSPrimitiveValue::computeLengthDouble): Split out the logic for everything that's not calc into a static method.
841         (WebCore::CSSPrimitiveValue::computeNonCalcLengthDouble): Static length computation logic for everything that is not calc.
842         * css/CSSPrimitiveValue.h:
843         (WebCore::CSSPrimitiveValue::isFontRelativeLength): Turn into static.
844         * css/SourceSizeList.cpp:
845         (WebCore::defaultLength): Use the new static method to compute the length.
846         (WebCore::computeLength): Use the calc length computation methods directly.
847
848 2015-05-12  Brent Fulgham  <bfulgham@apple.com>
849
850         [Win] Unreviewed build fix for older DirectX build environments.
851
852         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: Switch back to our
853         d3d stub header to avoid build failures on July 2004 DXSDK build environments.
854
855 2015-05-12  Eric Carlson  <eric.carlson@apple.com>
856
857         [Mac] Refine media playback target client configuration
858         https://bugs.webkit.org/show_bug.cgi?id=144892
859
860         Reviewed by Brent Fulgham.
861
862         Client and target picker state changes fequently happen several times in quick succession, so
863         don't react to immediately so we can batch callbacks to the web process. 
864         * Modules/mediasession/WebMediaSessionManager.cpp:
865         (WebCore::ClientState::ClientState): Store the client as a reference rather than a pointer
866         because it can never be NULL.
867         (WebCore::ClientState::operator == ): New.
868         (WebCore::WebMediaSessionManager::addPlaybackTargetPickerClient): Schedule the initial client 
869         configuration and a target configuration check.
870         (WebCore::WebMediaSessionManager::removePlaybackTargetPickerClient): Schedule a target monitoring
871         update, and a target configuration check.
872         (WebCore::WebMediaSessionManager::removeAllPlaybackTargetPickerClients): Ditto.
873         (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Schedule a target monitoring update.
874         (WebCore::WebMediaSessionManager::clientStateDidChange): If the client whose state has changed
875         can play to a target, tell it to start using the target even if it isn't playing as long as
876         no other client is actively using a target.
877         (WebCore::WebMediaSessionManager::setPlaybackTarget): Configure clients after a pause.
878         (WebCore::WebMediaSessionManager::configureNewClients): New, do new client configuration.
879         (WebCore::WebMediaSessionManager::configurePlaybackTargetClients): New, configure target clients.
880         (WebCore::WebMediaSessionManager::scheduleDelayedTask): Schedule the timer.
881         (WebCore::WebMediaSessionManager::taskTimerFired): Execute delayed tasks.
882         (WebCore::WebMediaSessionManager::find): 
883         * Modules/mediasession/WebMediaSessionManager.h:
884
885         * html/HTMLMediaElement.cpp:
886         (WebCore::HTMLMediaElement::setMuted): Call updateMediaState.
887         (WebCore::HTMLMediaElement::setPlaying): Ditto.
888         (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
889         (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): Expand logging.
890         (WebCore::HTMLMediaElement::updateMediaState): New, don't broadcast a media state change
891         unless something actually changed.
892         * html/HTMLMediaElement.h:
893
894         * html/HTMLMediaSession.cpp:
895         (WebCore::HTMLMediaSession::externalOutputDeviceAvailableDidChange): Update logging.
896         (WebCore::HTMLMediaSession::setShouldPlayToPlaybackTarget): Ditto.
897         (WebCore::HTMLMediaSession::mediaEngineUpdated): Cleanup.
898
899         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
900         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Remove the call to
901         deprecated API and the "-Wdeprecated-declarations".
902
903 2015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
904
905         AX: [GTK] Defer to WebCore Accessibility for table exposure
906         https://bugs.webkit.org/show_bug.cgi?id=144896
907
908         Reviewed by Chris Fleizach.
909
910         Stop unconditionally exposing all HTMLTableElement nodes as AccessibilityTables
911         for WebKitGtk.
912
913         No new tests. Several existing tests already cover table exposure. They have
914         been updated accordingly.
915
916         * accessibility/AccessibilityTable.cpp:
917         (WebCore::AccessibilityTable::computeIsTableExposableThroughAccessibility):
918
919 2015-05-12  Joanmarie Diggs  <jdiggs@igalia.com>
920
921         [GTK][WK2] rowAtIndex is not implemented in DRT/WKTR
922         https://bugs.webkit.org/show_bug.cgi?id=116971
923
924         Reviewed by Chris Fleizach.
925
926         Because ATK lacks API to directly get an accessible row via its index,
927         the implementation of rowAtIndex gets a cell in the indexed row and
928         returns the parent row. The failing test continued to fail because
929         AccessibilityARIAGridCell::parentTable called parentObjectUnignored at
930         most twice, the second call in place to handle rows which are included
931         in the tree. However, given a well-formed ARIA grid with a rowgroup that
932         is interactive, that rowgroup also needs to be in the tree necessitating
933         parentObjectUnignored be called a third time to get to the grid. Given a
934         poorly-formed ARIA grid, there may additional objects which pass the test
935         for inclusion standing in between the cell and grid necessitating more
936         calls still. Therefore, ascend the hierarchy to find the parent grid.
937
938         No new tests. The failing test now passes.
939
940         * accessibility/AccessibilityARIAGridCell.cpp:
941         (WebCore::AccessibilityARIAGridCell::parentTable):
942
943 2015-05-08  Carlos Garcia Campos  <cgarcia@igalia.com>
944
945         [X11] Add XUniquePtr and XUniqueResource to automatically free X resources
946         https://bugs.webkit.org/show_bug.cgi?id=144521
947
948         Reviewed by Darin Adler.
949
950         Add XUniquePtr as a template alias of std:unique_ptr to handle X
951         resources using pointers and XUniqueResource as a new class to
952         handle X resources using a long unsigned identifier. This
953         simplifies the code and makes it more difficult to leak X resources.
954
955         * PlatformEfl.cmake: Add new files to compilation.
956         * PlatformGTK.cmake: Ditto.
957         * platform/graphics/cairo/BackingStoreBackendCairoX11.cpp:
958         (WebCore::BackingStoreBackendCairoX11::BackingStoreBackendCairoX11):
959         Remove the display member, and use XUnique for Pixmap and GC.
960         (WebCore::BackingStoreBackendCairoX11::~BackingStoreBackendCairoX11):
961         Remove code to explicitly free Pixmap and GC.
962         (WebCore::BackingStoreBackendCairoX11::scroll):
963         * platform/graphics/cairo/BackingStoreBackendCairoX11.h:
964         * platform/graphics/glx/GLContextGLX.cpp:
965         (WebCore::GLContextGLX::createWindowContext): Use XUnique and the
966         new constructor that receives a XID, since there's no longer
967         conflict with the one receiving a Pbuffer.
968         (WebCore::GLContextGLX::createPbufferContext): Use XUnique and the
969         new constructor that receives a XUniqueGLXPbuffer&&.
970         (WebCore::GLContextGLX::createPixmapContext):
971         (WebCore::GLContextGLX::createContext):
972         (WebCore::GLContextGLX::GLContextGLX):
973         (WebCore::GLContextGLX::~GLContextGLX): Remove code to explicitly
974         free X resources.
975         (WebCore::GLContextGLX::makeContextCurrent):
976         (WebCore::GLContextGLX::cairoDevice):
977         (WebCore::GLContextGLX::platformContext):
978         * platform/graphics/glx/GLContextGLX.h:
979         * platform/graphics/surfaces/egl/EGLXSurface.cpp:
980         (WebCore::EGLXTransportSurfaceClient::EGLXTransportSurfaceClient):
981         (WebCore::EGLXTransportSurfaceClient::destroy):
982         (WebCore::EGLXTransportSurfaceClient::prepareTexture):
983         * platform/graphics/surfaces/egl/EGLXSurface.h:
984         * platform/graphics/surfaces/glx/GLXConfigSelector.h:
985         (WebCore::GLXConfigSelector::findMatchingConfig): Use XUnique
986         instead of the custom std::unique X11Deleter.
987         (WebCore::GLXConfigSelector::findMatchingConfigWithVisualId): Ditto.
988         * platform/graphics/surfaces/glx/GLXSurface.cpp:
989         (WebCore::GLXTransportSurface::GLXTransportSurface): Ditto.
990         (WebCore::GLXOffScreenSurface::initialize):
991         * platform/graphics/surfaces/glx/X11Helper.cpp:
992         (WebCore::X11Helper::createOffScreenWindow): Ditto.
993         (WebCore::X11Helper::createPixmap): Ditto.
994         * platform/graphics/surfaces/glx/X11Helper.h:
995         * platform/graphics/x11/XUniquePtr.h: Remove X11Deleter.
996         (WebCore::XPtrDeleter::operator()):
997         * platform/graphics/x11/XUniqueResource.cpp: Added.
998         (WebCore::XUniqueResource<XResource::Colormap>::deleteXResource):
999         (WebCore::XUniqueResource<XResource::Damage>::deleteXResource):
1000         (WebCore::XUniqueResource<XResource::Pixmap>::deleteXResource):
1001         (WebCore::XUniqueResource<XResource::Window>::deleteXResource):
1002         (WebCore::XUniqueResource<XResource::GLXPbuffer>::deleteXResource):
1003         (WebCore::XUniqueResource<XResource::GLXPixmap>::deleteXResource):
1004         * platform/graphics/x11/XUniqueResource.h: Added.
1005         (WebCore::XUniqueResource::XUniqueResource):
1006         (WebCore::XUniqueResource::operator=):
1007         (WebCore::XUniqueResource::~XUniqueResource):
1008         (WebCore::XUniqueResource::get):
1009         (WebCore::XUniqueResource::release):
1010         (WebCore::XUniqueResource::reset):
1011         (WebCore::XUniqueResource::operator!):
1012         (WebCore::XUniqueResource::operator UnspecifiedBoolType*):
1013
1014 2015-05-12  Zan Dobersek  <zdobersek@igalia.com>
1015
1016         Move TransformOperation-based classes off of PassRefPtr
1017         https://bugs.webkit.org/show_bug.cgi?id=144876
1018
1019         Reviewed by Darin Adler.
1020
1021         Remove uses of PassRefPtr from the TransformOperation class and its
1022         derivatives, operating on Ref and RefPtr objects instead.
1023
1024         * platform/graphics/transforms/IdentityTransformOperation.h:
1025         * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
1026         (WebCore::Matrix3DTransformOperation::blend):
1027         * platform/graphics/transforms/Matrix3DTransformOperation.h:
1028         * platform/graphics/transforms/MatrixTransformOperation.cpp:
1029         (WebCore::MatrixTransformOperation::blend):
1030         * platform/graphics/transforms/MatrixTransformOperation.h:
1031         * platform/graphics/transforms/PerspectiveTransformOperation.cpp:
1032         (WebCore::PerspectiveTransformOperation::blend):
1033         * platform/graphics/transforms/PerspectiveTransformOperation.h:
1034         * platform/graphics/transforms/RotateTransformOperation.cpp:
1035         (WebCore::RotateTransformOperation::blend):
1036         * platform/graphics/transforms/RotateTransformOperation.h:
1037         * platform/graphics/transforms/ScaleTransformOperation.cpp:
1038         (WebCore::ScaleTransformOperation::blend):
1039         * platform/graphics/transforms/ScaleTransformOperation.h:
1040         * platform/graphics/transforms/SkewTransformOperation.cpp:
1041         (WebCore::SkewTransformOperation::blend):
1042         * platform/graphics/transforms/SkewTransformOperation.h:
1043         * platform/graphics/transforms/TransformOperation.h:
1044         * platform/graphics/transforms/TransformOperations.cpp:
1045         (WebCore::TransformOperations::blendByMatchingOperations):
1046         * platform/graphics/transforms/TranslateTransformOperation.cpp:
1047         (WebCore::TranslateTransformOperation::blend):
1048         * platform/graphics/transforms/TranslateTransformOperation.h:
1049
1050 2015-05-12  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1051
1052         [Streams API] ReadableStream reader should not be disposable when having pending promises
1053         https://bugs.webkit.org/show_bug.cgi?id=144869
1054
1055         Reviewed by Darin Adler.
1056
1057         Made error promise callback to take a ref to the reader so that the reader is not disposed as long as the promise callback is not resolved.
1058
1059         Covered by tests added to streams/readable-stream-gc.html.
1060
1061         * Modules/streams/ReadableStreamReader.cpp:
1062         (WebCore::ReadableStreamReader::ReadableStreamReader): Moved initialize() call outside constructor as it can ref/unref.
1063         (WebCore::ReadableStreamReader::releaseStreamAndClean): Added protector.
1064         * Modules/streams/ReadableStreamReader.h:
1065         * bindings/js/JSReadableStreamReaderCustom.cpp:
1066         (WebCore::JSReadableStreamReader::closed): Lambda for error now takes a ref to the reader.
1067         * bindings/js/ReadableJSStream.cpp:
1068         (WebCore::ReadableJSStream::Reader::create): Calling initialize() after adoptRef().
1069
1070 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
1071
1072         Clean up redundant resources in case of failure in GLContextEGL context creation methods
1073         https://bugs.webkit.org/show_bug.cgi?id=144878
1074
1075         Reviewed by Martin Robinson.
1076
1077         GLContextEGL::createWindowContext() and GLContextEGL::createPixmapContext() methods
1078         should clean up the freshly-created resources when prematurely returning due to a
1079         failure.
1080
1081         * platform/graphics/egl/GLContextEGL.cpp:
1082         (WebCore::GLContextEGL::createWindowContext):
1083         (WebCore::GLContextEGL::createPixmapContext):
1084
1085 2015-05-11  Dan Bernstein  <mitz@apple.com>
1086
1087         WebCore part of <rdar://problem/20878075> Trying to navigate to an invalid URL loads about:blank, but -[WKWebView URL] returns the invalid URL
1088
1089         Reviewed by Alexey Proskuryakov.
1090
1091         Test: TestWebKitAPI/Tests/WebKit2Cocoa/ProvisionalURLChange.mm
1092
1093         In some cases, trying to navigate to an invalid URL results in navigation to about:blank.
1094         When the about:blank load is committed, the UI process still thinks that the provisional
1095         URL is the original, invalid URL, and updates its state to reflect that that’s the URL that
1096         has been committed.
1097
1098         The provisional URL changes (1) when a provisional load begins, (2) when a server redirect
1099         happens, (3) when the client changes the request in willSendRequest, and (4) in this
1100         about:blank case. For (1) and (2), there are frame loader client callbacks. (3) is client-
1101         initiated. So this patch addresses (4).
1102
1103         * loader/DocumentLoader.cpp:
1104         (WebCore::DocumentLoader::maybeLoadEmpty): If our request URL is changing to about:blank and
1105         while loading the main resource, call FrameLoaderClient::dispatchDidChangeProvisionalURL.
1106         * loader/FrameLoaderClient.h: Added dispatchDidChangeProvisionalURL with an empty
1107         implementation.
1108
1109 2015-05-11  Zalan Bujtas  <zalan@apple.com>
1110
1111         Text is misplaced when custom font does not have space glyph.
1112         https://bugs.webkit.org/show_bug.cgi?id=144879
1113
1114         Reviewed by Myles C. Maxfield
1115
1116         This patch ensures that we use fallback font for the missing space glyph only when the rendered text has space in it.
1117
1118         If a font does not provide all the glyphs required to render the associated text, we initiate fallback fonts. It is done while
1119         measuring the text at layout time. However due to the fact that we always pre-measure space, a font with no space glyph in it is never sufficient.
1120         (even when the text does not require space at all)
1121         Fallback fonts impact line positions through ascent/descent calculation.
1122
1123         Test: fast/text/font-with-no-space-glyph.html
1124
1125         * rendering/RenderText.cpp:
1126         (WebCore::RenderText::computePreferredLogicalWidths):
1127         * rendering/line/BreakingContext.h:
1128         (WebCore::WordTrailingSpace::WordTrailingSpace):
1129         (WebCore::WordTrailingSpace::width):
1130         (WebCore::BreakingContext::handleText):
1131
1132 2015-05-11  Simon Fraser  <simon.fraser@apple.com>
1133
1134         Small tidyup in animations code
1135         https://bugs.webkit.org/show_bug.cgi?id=144893
1136
1137         Reviewed by Eric Carlson.
1138
1139         Reading progress(1, 0, 0) in callers of AnimationBase::progress() was confusing,
1140         particularly as the last parameter is a TimingFunction*. Put default values 
1141         in the header (with nullptr) and fix the callers. Also fix variable names in
1142         the implementation.
1143
1144         * page/animation/AnimationBase.cpp:
1145         (WebCore::AnimationBase::progress):
1146         * page/animation/AnimationBase.h:
1147         * page/animation/ImplicitAnimation.cpp:
1148         (WebCore::ImplicitAnimation::animate):
1149         (WebCore::ImplicitAnimation::getAnimatedStyle):
1150         (WebCore::ImplicitAnimation::blendPropertyValueInStyle):
1151
1152 2015-05-11  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1153
1154         Purge PassRefPtr in WebCore/rendering
1155         https://bugs.webkit.org/show_bug.cgi?id=144872
1156
1157         Reviewed by Darin Adler.
1158
1159         As a step to remove PassRefPtr, this patch replaces PassRefPtr with Ref in WebCore/rendering.
1160
1161         No new tests, no behavior changes.
1162
1163         * rendering/HitTestingTransformState.h:
1164         (WebCore::HitTestingTransformState::create):
1165         * rendering/RenderLayer.cpp:
1166         (WebCore::ClipRects::create):
1167         * rendering/RenderThemeGtk.cpp:
1168         (WebCore::RenderThemeGtk::create):
1169         (WebCore::RenderTheme::themeForPage):
1170         * rendering/RenderThemeGtk.h:
1171         * rendering/RenderThemeIOS.h:
1172         * rendering/RenderThemeIOS.mm:
1173         (WebCore::RenderTheme::themeForPage):
1174         (WebCore::RenderThemeIOS::create):
1175         * rendering/RenderThemeMac.h:
1176         * rendering/RenderThemeMac.mm:
1177         (WebCore::RenderTheme::themeForPage):
1178         (WebCore::RenderThemeMac::create):
1179         * rendering/RenderThemeSafari.cpp:
1180         (WebCore::RenderThemeSafari::create):
1181         (WebCore::RenderTheme::themeForPage):
1182         * rendering/RenderThemeSafari.h:
1183         * rendering/RenderThemeWin.cpp:
1184         (WebCore::RenderThemeWin::create):
1185         (WebCore::RenderTheme::themeForPage):
1186         * rendering/RenderThemeWin.h:
1187         * rendering/TextAutoSizing.h:
1188         (WebCore::TextAutoSizingValue::create):
1189         * rendering/style/ShapeValue.h:
1190         (WebCore::ShapeValue::createShapeValue):
1191         (WebCore::ShapeValue::createBoxShapeValue):
1192         (WebCore::ShapeValue::createImageValue):
1193         * rendering/style/StyleCachedImage.h:
1194         * rendering/style/StyleCachedImageSet.h:
1195         * rendering/style/StyleGeneratedImage.h:
1196         * rendering/style/StylePendingImage.h:
1197         * rendering/style/StyleReflection.h:
1198         (WebCore::StyleReflection::create):
1199
1200 2015-05-11  Eric Carlson  <eric.carlson@apple.com>
1201
1202         [Mac] Update device picker icon when video tracks change
1203         https://bugs.webkit.org/show_bug.cgi?id=144889
1204         <rdar://problem/20907253>
1205
1206         Reviewed by Brent Fulgham.
1207
1208         * Modules/mediacontrols/mediaControlsApple.js:
1209         (Controller.prototype.updateHasVideo):
1210
1211 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
1212
1213         Scroll snap logic should be triggered when resizing the WebView
1214         https://bugs.webkit.org/show_bug.cgi?id=142590
1215         <rdar://problem/20125088>
1216
1217         Reviewed by Simon Fraser.
1218
1219         Tests coming in a second patch.
1220
1221         Resizing of the main frame or overflow regions was properly recalculating the scroll snap points,
1222         but there was no code to honor these values when window resizing was occurring. The correction was
1223         handled in two ways:
1224         1. Scrolling thread operations that moved to new snap points needed to notify the main thread that
1225            it had shifted to a new snap point, so that the resize code (which happens on the main thread)
1226            could ensure that we stayed clamped to the correct 'tile' in the snap region.
1227         2. Main thread (overflow) resizes were likewise missing code to honor the current snap position
1228            after resizing calculations were complete.
1229
1230         This change also required the addition of two indices to the scrollable area to track which scroll
1231         snap point was currently being used. We don't bother with a 'none' case because you cannot have a
1232         'none' state when you have an active set of scroll snap points, and we do not execute this code
1233         if the scroll snap points are null.
1234
1235         The FrameView code was computing updated snap offsets after it had dispatched frame view layout
1236         information to the scrolling thread, which was wrong. This was also corrected.
1237
1238         I think it might be possible to track all of this state inside the ScrollController, but the current
1239         scroll snap architecture destroys and recreates the state each time a new set of interactions starts.
1240         This should be fixed in the future, which would allow us to remove some of this local state.
1241
1242         * page/FrameView.cpp:
1243         (WebCore::FrameView::performPostLayoutTasks): Make sure 'updateSnapOffsets' is called prior to
1244         calling 'frameViewLayoutUpdated' so the scrolling thread gets correct updated points. Add a new
1245         call to 'scrollToNearestActiveSnapPoint', which will keep us on our current snap point during
1246         resize (if appropriate).
1247         * page/scrolling/AsyncScrollingCoordinator.cpp:
1248         (WebCore::AsyncScrollingCoordinator::updateScrollSnapOffsetIndices): Added. This finds and notifies
1249         the correct scroll region when a new snap position (index) has been selected by user interaction on
1250         the scrolling thread.
1251         (WebCore::AsyncScrollingCoordinator::deferTestsForReason): Added an assertion for 'isMainThread'.
1252         (WebCore::AsyncScrollingCoordinator::removeTestDeferralForReason): Ditto.
1253         * page/scrolling/AsyncScrollingCoordinator.h:
1254         * page/scrolling/AxisScrollSnapOffsets.h:
1255         (WebCore::closestSnapOffset): Modified to also return the selected snap point index so we can track
1256         it to handle resize operations.
1257         * page/scrolling/ScrollingTree.h:
1258         (WebCore::ScrollingTree::updateScrollSnapOffsetIndices):
1259         * page/scrolling/ThreadedScrollingTree.cpp:
1260         (WebCore::ThreadedScrollingTree::updateScrollSnapOffsetIndices): Added method to dispatch the active
1261         horizontal and vertical scroll snap indices back to the main thread.
1262         * page/scrolling/ThreadedScrollingTree.h:
1263         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1264         (WebCore::ScrollingTreeFrameScrollingNodeMac::handleWheelEvent): After the scroll controller processes
1265         the current event, notify the main thread of any change in the active scroll snap index.
1266         * platform/ScrollAnimator.cpp:
1267         (WebCore::ScrollAnimator::activeScrollSnapOffsetIndexDidChange): Added method to allow ScrollAnimator
1268         clients to find out about the current scroll snap state, which is only known by the ScrollController.
1269         (WebCore::ScrollAnimator::activeScrollSnapOffsetIndexForAxis): Ditto.
1270         * platform/ScrollAnimator.h:
1271         * platform/ScrollView.cpp:
1272         (WebCore::ScrollView::scrollToNearestActiveSnapPoint): Added method that allows us to set scroll position
1273         to one of our active scroll snap offsets.
1274         * platform/ScrollView.h:
1275         * platform/ScrollableArea.cpp:
1276         (WebCore::ScrollableArea::handleWheelEvent): If the active scroll snap offset has changed, make sure we
1277         keep track of the new values for potential resize operations.
1278         (WebCore::ScrollableArea::clearHorizontalSnapOffsets): Make sure to also clear out the current snap index.
1279         (WebCore::ScrollableArea::clearVerticalSnapOffsets): Ditto.
1280         (WebCore::ScrollableArea::nearestActiveSnapPoint): New method that returns an updated IntPoint reflecting
1281         the proper scroll position based on the active scroll snap offset.
1282         * platform/ScrollableArea.h:
1283         (WebCore::ScrollableArea::currentHorizontalSnapPointIndex): Added.
1284         (WebCore::ScrollableArea::setCurrentHorizontalSnapPointIndex): Added.
1285         (WebCore::ScrollableArea::currentVerticalSnapPointIndex): Added.
1286         (WebCore::ScrollableArea::setCurrentVerticalSnapPointIndex): Added.
1287         (WebCore::ScrollableArea::scrollToNearestActiveSnapPoint): Added.
1288         * platform/cocoa/ScrollController.h:
1289         (WebCore::ScrollControllerClient::activeScrollOffsetIndex): Added new method for clients to implement.
1290         (WebCore::ScrollController::activeScrollSnapOffsetIndexDidChange): Added.
1291         (WebCore::ScrollController::setScrollSnapOffsetIndexDidChange): Added.
1292         * platform/cocoa/ScrollController.mm:
1293         (WebCore::ScrollController::activeScrollSnapOffsetIndexForAxis): Helper method to return current active
1294         index (if applicable).
1295         (WebCore::ScrollController::setActiveScrollSnapOffsetIndexForAxis): Helper function to safely set
1296         the current active index.
1297         (WebCore::ScrollController::beginScrollSnapAnimation): Updated to keep track of the new active scroll snap
1298         index, as well as whether the current animation actually changed the active snap point offset.
1299         * platform/cocoa/ScrollSnapAnimatorState.h: Revise to use modern C++ initializers, and to track a new index
1300         that represents the current scroll snap offset.
1301         * platform/cocoa/ScrollSnapAnimatorState.mm:
1302         (WebCore::ScrollSnapAnimatorState::ScrollSnapAnimatorState): Update for modern C++ syntax.
1303         * rendering/RenderLayer.cpp:
1304         (WebCore::RenderLayer::scrollToNearestActiveSnapPoint): New method to set scroll position to be one of our
1305         active scroll snap points.
1306         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Add a new call to 'scrollToNearestActiveSnapPoint' so that
1307         we stay on the current scroll snap offset during resizing.
1308         * rendering/RenderLayer.h:
1309
1310 2015-05-11  Myles C. Maxfield  <mmaxfield@apple.com>
1311
1312         Addressing post-review comments after r184037.
1313
1314         Unreviewed.
1315
1316         No new tests because there is no behavior change.
1317
1318         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
1319         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
1320
1321 2015-05-11  Brent Fulgham  <bfulgham@apple.com>
1322
1323         [Win] Move Windows build target to Windows 7 (or newer)
1324         https://bugs.webkit.org/show_bug.cgi?id=144890
1325         <rdar://problem/20707307>
1326
1327         Reviewed by Anders Carlsson.
1328
1329         Update linked SDK and minimal Windows level to be compatible with
1330         Windows 7 or newer.
1331
1332         * WebCore.vcxproj/WebCore.vcxproj:
1333         * WebCore.vcxproj/WebCoreGenerated.vcxproj:
1334         * WebCore.vcxproj/WebCoreTestSupport.vcxproj:
1335         * WebCorePrefix.h:
1336         * config.h:
1337         * testing/js/WebCoreTestSupportPrefix.h:
1338
1339 2015-05-11  Joanmarie Diggs  <jdiggs@igalia.com>
1340
1341         AX: [ATK] Always include rows in the tree of accessible tables
1342         https://bugs.webkit.org/show_bug.cgi?id=144885
1343
1344         Reviewed by Chris Fleizach.
1345
1346         Remove the code that excluded rows from the tree of accessible tables for
1347         Gtk and Efl, the latter of which inherited the exclusion from the former.
1348
1349         No new tests. We already have several tests which cover table hierarchy.
1350         The associated expectations have been updated as part of this fix.
1351
1352         * accessibility/AccessibilityTable.cpp:
1353         (WebCore::AccessibilityTable::addChildrenFromSection):
1354         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
1355         (webkitAccessibleGetParent):
1356
1357 2015-05-11  Matt Baker  <mattbaker@apple.com>
1358
1359         Web Inspector: REGRESSION (r175203): No profile information is shown in Inspector
1360         https://bugs.webkit.org/show_bug.cgi?id=144808
1361
1362         Reviewed by Darin Adler.
1363
1364         Profiles started from the console should always use the Inspector environment's shared stopwatch.
1365
1366         * inspector/InspectorTimelineAgent.cpp:
1367         (WebCore::InspectorTimelineAgent::startFromConsole):
1368
1369 2015-05-11  Alex Christensen  <achristensen@webkit.org>
1370
1371         [Content Extensions] Support domain-specific rules and exceptions.
1372         https://bugs.webkit.org/show_bug.cgi?id=144833
1373
1374         Reviewed by Darin Adler.
1375
1376         Test: http/tests/contentextensions/domain-rules.html
1377         (And lots of API tests)
1378
1379         This patch adds if-domain and unless-domain to the trigger in the JSON format.
1380         if-domain makes the rule apply only to domains in the list.
1381         unless-domain makes the rule apply to domains that are not in the list.
1382         
1383         All rules without if-domain or unless-domain are compiled into a set of DFAs.  This behavior is unchanged.
1384         All rules with if-domain or unless-domain are compiled into a separate set of DFAs.
1385         The domains are also compiled into another set of DFAs.  This makes 3 arrays of DFA bytecode instead of 1.
1386         
1387         If there are no domain specific rules, there is no change in behavior.
1388         If there are domain specific rules, the URL will be checked for matches in both
1389         filtersWithoutDomainsBytecode and filtersWithDomainsBytecode.  If there are matches from 
1390         filtersWithDomainsBytecode then the domain of the main document will be checked with 
1391         domainFiltersBytecode to see which of the matches applies to this domain.
1392
1393         * contentextensions/CombinedURLFilters.cpp:
1394         (WebCore::ContentExtensions::CombinedURLFilters::isEmpty):
1395         (WebCore::ContentExtensions::CombinedURLFilters::addDomain):
1396         * contentextensions/CombinedURLFilters.h:
1397         Added addDomain, which adds characters from a domain to the prefix tree directly without using YARR.
1398         * contentextensions/CompiledContentExtension.cpp:
1399         (WebCore::ContentExtensions::CompiledContentExtension::globalDisplayNoneSelectors):
1400         * contentextensions/CompiledContentExtension.h:
1401         * contentextensions/ContentExtensionCompiler.cpp:
1402         (WebCore::ContentExtensions::serializeActions):
1403         (WebCore::ContentExtensions::compileRuleList):
1404         Separate the rules into rules with domains and rules without domains and compile to bytecode.
1405         * contentextensions/ContentExtensionCompiler.h:
1406         Updated compiler interface to reflect the slightly more complicated structure.
1407         * contentextensions/ContentExtensionError.cpp:
1408         (WebCore::ContentExtensions::contentExtensionErrorCategory):
1409         * contentextensions/ContentExtensionError.h:
1410         Added new parsing errors.
1411         * contentextensions/ContentExtensionParser.cpp:
1412         (WebCore::ContentExtensions::getDomainList):
1413         (WebCore::ContentExtensions::loadTrigger):
1414         (WebCore::ContentExtensions::loadEncodedRules):
1415         * contentextensions/ContentExtensionRule.h:
1416         (WebCore::ContentExtensions::Trigger::operator==):
1417         Parse the new domain structures from JSON into the Trigger structure.
1418         * contentextensions/ContentExtensionsBackend.cpp:
1419         (WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad):
1420         Interpret as much bytecode as necessary to determine which rules apply to this URL and domain.
1421         * contentextensions/DFABytecode.h:
1422         (WebCore::ContentExtensions::instructionSizeWithArguments):
1423         * contentextensions/DFABytecodeCompiler.cpp:
1424         (WebCore::ContentExtensions::DFABytecodeCompiler::emitAppendAction):
1425         (WebCore::ContentExtensions::DFABytecodeCompiler::emitTestFlagsAndAppendAction):
1426         (WebCore::ContentExtensions::DFABytecodeCompiler::compileNode):
1427         * contentextensions/DFABytecodeCompiler.h:
1428         * contentextensions/DFABytecodeInterpreter.cpp:
1429         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretAppendAction):
1430         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpretTestFlagsAndAppendAction):
1431         (WebCore::ContentExtensions::DFABytecodeInterpreter::actionsFromDFARoot):
1432         (WebCore::ContentExtensions::DFABytecodeInterpreter::interpret):
1433         * contentextensions/DFABytecodeInterpreter.h:
1434         * loader/ResourceLoadInfo.h:
1435         Keep track of which actions have an if-domain trigger.  If an action is in the 
1436         filtersWithDomainsBytecode, then it either has an if-domain or an unless-domain in its trigger.
1437         This requires additional information in the bytecode, so there are two new bytecode types.
1438
1439 2015-05-11  Yoav Weiss  <yoav@yoav.ws>
1440
1441         Add srcset, sizes and picture to the features json
1442         https://bugs.webkit.org/show_bug.cgi?id=144862
1443
1444         Reviewed by Benjamin Poulain.
1445
1446         Add the srcset w descriptor and sizes attribute as a new feature in the JSON file,
1447         as well as adding the picture element and srcset's x descriptor as seperate features.
1448
1449         No new tests, since no new functionality added.
1450
1451         * features.json:
1452
1453 2015-05-11  Chris Dumez  <cdumez@apple.com>
1454
1455         Fix checkingLogicalHeight initialization in Document::updateLayoutIfDimensionsOutOfDate()
1456         https://bugs.webkit.org/show_bug.cgi?id=144873
1457
1458         Reviewed by Simon Fraser.
1459
1460         Fix checkingLogicalHeight initialization in Document::updateLayoutIfDimensionsOutOfDate().
1461         checkingLogicalHeight should only be initialized to true when
1462         "dimensionsCheck & WidthDimensionsCheck" if isVertical is true.
1463
1464         * dom/Document.cpp:
1465         (WebCore::Document::updateLayoutIfDimensionsOutOfDate):
1466
1467 2015-05-11  Daniel Bates  <dabates@apple.com>
1468
1469         [iOS] Close all open databases in expiration handler of process assertion
1470         https://bugs.webkit.org/show_bug.cgi?id=144661
1471         <rdar://problem/20845052>
1472
1473         Reviewed by Darin Adler.
1474
1475         Expose functionality in WebCore to close all open databases. Closing a SQLite database
1476         will interrupt any in-progress database transactions.
1477
1478         * Modules/webdatabase/AbstractDatabaseServer.h:
1479         * Modules/webdatabase/DatabaseManager.cpp:
1480         (WebCore::DatabaseManager::closeAllDatabases): Added; turns around and calls DatabaseServer::closeAllDatabases().
1481         * Modules/webdatabase/DatabaseManager.h: Export DatabaseManager::closeAllDatabases() so that
1482         we can call in from WebKit2.
1483         * Modules/webdatabase/DatabaseServer.cpp:
1484         (WebCore::DatabaseServer::closeAllDatabases): Added; turns around and calls DatabaseTracker::closeAllDatabases().
1485         * Modules/webdatabase/DatabaseServer.h:
1486         * Modules/webdatabase/DatabaseTracker.cpp:
1487         (WebCore::DatabaseTracker::closeAllDatabases): Added; closes all open databases.
1488         * Modules/webdatabase/DatabaseTracker.h: Export DatabaseTracker::closeAllDatabases() so that
1489         we can call in from Legacy WebKit.
1490
1491 2015-05-11  Antti Koivisto  <antti@apple.com>
1492
1493         WebContent crash under com.apple.WebCore: WebCore::WebKitCSSResourceValue::isCSSValueNone const + 6
1494         https://bugs.webkit.org/show_bug.cgi?id=144870
1495         rdar://problem/20727702
1496
1497         Reviewed by Simon Fraser.
1498
1499         No repro but we are seeing null pointer crashes like this:
1500
1501         Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
1502         0   com.apple.WebCore   0x00007fff92da5706 WebCore::WebKitCSSResourceValue::isCSSValueNone() const + 6
1503         1   com.apple.WebCore   0x00007fff93382b48 WebCore::MaskImageOperation::isCSSValueNone() const + 24
1504         2   com.apple.WebCore   0x00007fff92e0475e WebCore::FillLayer::hasNonEmptyMaskImage() const + 30
1505
1506         * platform/graphics/MaskImageOperation.cpp:
1507         (WebCore::MaskImageOperation::MaskImageOperation):
1508         (WebCore::MaskImageOperation::isCSSValueNone):
1509
1510             This would crash like this if both m_styleImage and m_cssMaskImageValue are null.
1511             There are no obvious guarantees that this doesn't happen. Two of the constructor variants allow it
1512             and there is setImage which may turn m_styleImage null later too.
1513
1514             Fix by making null m_cssMaskImageValue always signify CSSValueNone.
1515
1516         (WebCore::MaskImageOperation::cssValue):
1517
1518 2015-05-11  Chris Fleizach  <cfleizach@apple.com>
1519
1520         AX: Crash at WebCore::AccessibilityMenuList::addChildren()
1521         https://bugs.webkit.org/show_bug.cgi?id=144860
1522
1523         Reviewed by Mario Sanchez Prada.
1524
1525         There were some unsafe pointer accesses in AccessibilityMenuList code that needed to be cleaned up.
1526
1527         Test: accessibility/menu-list-crash2.html
1528
1529         * accessibility/AccessibilityMenuList.cpp:
1530         (WebCore::AccessibilityMenuList::addChildren):
1531
1532 2015-05-11  Przemyslaw Szymanski  <p.szymanski3@samsung.com>
1533
1534         [WebGL] Unnecessary condition check in the while loop
1535         https://bugs.webkit.org/show_bug.cgi?id=125001
1536
1537         Reviewed by Csaba Osztrogonác.
1538
1539         While loop in this case needs to be optimized a little.
1540         For now a conditional statement in while will execute two
1541         times at begin. do-while loop avoids to check first statement.
1542
1543         No new tests. No behaviour changed.
1544
1545         * html/canvas/WebGLFramebuffer.cpp:
1546         (WebCore::WebGLFramebuffer::removeAttachmentFromBoundFramebuffer):
1547
1548 2015-05-11  Joonghun Park  <jh718.park@samsung.com>
1549
1550         [GTK] Reorder Performance class's member initialization sequence
1551         https://bugs.webkit.org/show_bug.cgi?id=144858
1552
1553         Reviewed by Csaba Osztrogonác.
1554
1555         No new tests, no new behaviors.
1556
1557         * page/Performance.cpp:
1558         (WebCore::Performance::Performance):
1559
1560 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
1561
1562         Reduce TransformationMatrix copies in WebKitCSSMatrix operations
1563         https://bugs.webkit.org/show_bug.cgi?id=144795
1564
1565         Reviewed by Darin Adler.
1566
1567         Instead of copying the TransformationMatrix member, performing
1568         the operation on it and then copying it again when creating
1569         the new WebKitCSSMatrix object, copy it just once by first
1570         creating the new WebKitCSSMatrix object and then performing
1571         the operation on that object's TransformationMatrix directly.
1572
1573         * css/WebKitCSSMatrix.cpp:
1574         (WebCore::WebKitCSSMatrix::multiply):
1575         (WebCore::WebKitCSSMatrix::translate):
1576         (WebCore::WebKitCSSMatrix::scale):
1577         (WebCore::WebKitCSSMatrix::rotate):
1578         (WebCore::WebKitCSSMatrix::rotateAxisAngle):
1579         (WebCore::WebKitCSSMatrix::skewX):
1580         (WebCore::WebKitCSSMatrix::skewY):
1581
1582 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
1583
1584         Add missing vtable override specifiers under Source/WebCore/loader, Source/WebCore/xml
1585         https://bugs.webkit.org/show_bug.cgi?id=144793
1586
1587         Reviewed by Darin Adler.
1588
1589         Update virtual method overrides under Source/WebCore/loader
1590         and Source/WebCore/dom which are missing the override specifier.
1591
1592         * loader/DocumentThreadableLoader.h:
1593         (WebCore::DocumentThreadableLoader::refThreadableLoader):
1594         (WebCore::DocumentThreadableLoader::derefThreadableLoader):
1595         * loader/cache/CachedRawResource.h:
1596         * xml/parser/XMLDocumentParser.h:
1597
1598 2015-05-11  Zan Dobersek  <zdobersek@igalia.com>
1599
1600         Add missing vtable override specifiers under Source/WebCore/accessibility, Source/WebCore/dom
1601         https://bugs.webkit.org/show_bug.cgi?id=144792
1602
1603         Reviewed by Darin Adler.
1604
1605         Update virtual method overrides under Source/WebCore/accessibility
1606         and Source/WebCore/dom which are missing the override specifier.
1607
1608         * accessibility/AccessibilityMockObject.h:
1609         (WebCore::AccessibilityMockObject::isDetachedFromParent): Deleted.
1610         * accessibility/AccessibilityRenderObject.h:
1611         * dom/DecodedDataDocumentParser.h:
1612         * dom/TouchEvent.h:
1613
1614 2015-05-10  Zan Dobersek  <zdobersek@igalia.com>
1615
1616         Have MediaStream::getAudioTracks(), MediaStream::getVideoTracks() return const references
1617         https://bugs.webkit.org/show_bug.cgi?id=144794
1618
1619         Reviewed by Philippe Normand.
1620
1621         * Modules/mediastream/MediaStream.h: getAudioTracks() and getVideoTracks()
1622         should return a const reference to the member variables, instead of
1623         copying the objects on every call.
1624
1625 2015-05-10  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
1626
1627         Use Ref instead of PassRefPtr in WebCore/page
1628         https://bugs.webkit.org/show_bug.cgi?id=144841
1629
1630         Reviewed by Darin Adler.
1631
1632         To kill PassRefPtr, this patch replaces PassRefPtr with Ref or RefPtr
1633         in WebCore/page.
1634
1635         No new tests, no behavior changes.
1636
1637         * page/DebugPageOverlays.cpp:
1638         * page/EventSource.cpp:
1639         (WebCore::EventSource::create):
1640         * page/EventSource.h:
1641         * page/History.h:
1642         (WebCore::History::create):
1643         * page/Location.h:
1644         (WebCore::Location::create):
1645         * page/MainFrame.cpp:
1646         (WebCore::MainFrame::create):
1647         * page/MainFrame.h:
1648         * page/Navigator.h:
1649         (WebCore::Navigator::create):
1650         * page/PageOverlay.cpp:
1651         (WebCore::PageOverlay::create):
1652         * page/PageOverlay.h:
1653         * page/Performance.h:
1654         * page/PerformanceEntryList.h:
1655         (WebCore::PerformanceEntryList::create):
1656         * page/PerformanceMark.h:
1657         (WebCore::PerformanceMark::create):
1658         * page/PerformanceMeasure.h:
1659         (WebCore::PerformanceMeasure::create):
1660         * page/PerformanceNavigation.h:
1661         (WebCore::PerformanceNavigation::create):
1662         * page/PerformanceResourceTiming.h:
1663         (WebCore::PerformanceResourceTiming::create):
1664         * page/PerformanceTiming.h:
1665         (WebCore::PerformanceTiming::create):
1666         * page/PerformanceUserTiming.h:
1667         (WebCore::UserTiming::create):
1668         * page/Screen.h:
1669         * page/Settings.cpp:
1670         (WebCore::Settings::create):
1671         * page/Settings.h:
1672         * page/TextIndicator.cpp:
1673         (WebCore::TextIndicator::create):
1674         * page/TextIndicator.h:
1675         * page/UserContentController.cpp:
1676         (WebCore::UserContentController::create):
1677         * page/UserContentController.h:
1678         * page/UserMessageHandlerDescriptor.h:
1679         (WebCore::UserMessageHandlerDescriptor::create):
1680         * page/UserMessageHandlersNamespace.h:
1681         * page/VisitedLinkStore.h:
1682         * page/WebKitNamespace.h:
1683         (WebCore::WebKitNamespace::create):
1684         * page/WebKitPoint.h:
1685         (WebCore::WebKitPoint::create):
1686         * page/WorkerNavigator.h:
1687         (WebCore::WorkerNavigator::create):
1688         * page/animation/ImplicitAnimation.h:
1689         (WebCore::ImplicitAnimation::create):
1690         * page/animation/KeyframeAnimation.h:
1691         * page/mac/ServicesOverlayController.h:
1692         * page/mac/ServicesOverlayController.mm:
1693         (WebCore::ServicesOverlayController::Highlight::createForSelection):
1694         (WebCore::ServicesOverlayController::Highlight::createForTelephoneNumber):
1695         * page/scrolling/ScrollingCoordinator.cpp:
1696         (WebCore::ScrollingCoordinator::create):
1697         * page/scrolling/ScrollingCoordinator.h:
1698         * page/scrolling/ScrollingStateFixedNode.cpp:
1699         (WebCore::ScrollingStateFixedNode::create):
1700         (WebCore::ScrollingStateFixedNode::clone):
1701         * page/scrolling/ScrollingStateFixedNode.h:
1702         * page/scrolling/ScrollingStateFrameScrollingNode.cpp:
1703         (WebCore::ScrollingStateFrameScrollingNode::create):
1704         (WebCore::ScrollingStateFrameScrollingNode::clone):
1705         * page/scrolling/ScrollingStateFrameScrollingNode.h:
1706         * page/scrolling/ScrollingStateNode.h:
1707         * page/scrolling/ScrollingStateOverflowScrollingNode.cpp:
1708         (WebCore::ScrollingStateOverflowScrollingNode::create):
1709         (WebCore::ScrollingStateOverflowScrollingNode::clone):
1710         * page/scrolling/ScrollingStateOverflowScrollingNode.h:
1711         * page/scrolling/ScrollingStateStickyNode.cpp:
1712         (WebCore::ScrollingStateStickyNode::create):
1713         (WebCore::ScrollingStateStickyNode::clone):
1714         * page/scrolling/ScrollingStateStickyNode.h:
1715         * page/scrolling/ios/ScrollingCoordinatorIOS.mm:
1716         (WebCore::ScrollingCoordinator::create):
1717         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h:
1718         * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm:
1719         (WebCore::ScrollingTreeFrameScrollingNodeIOS::create):
1720         * page/scrolling/ios/ScrollingTreeIOS.cpp:
1721         (WebCore::ScrollingTreeIOS::create):
1722         * page/scrolling/mac/ScrollingCoordinatorMac.mm:
1723         (WebCore::ScrollingCoordinator::create):
1724         * page/scrolling/mac/ScrollingTreeFixedNode.h:
1725         * page/scrolling/mac/ScrollingTreeFixedNode.mm:
1726         (WebCore::ScrollingTreeFixedNode::create):
1727         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h:
1728         * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
1729         (WebCore::ScrollingTreeFrameScrollingNodeMac::create):
1730         * page/scrolling/mac/ScrollingTreeMac.cpp:
1731         (ScrollingTreeMac::create):
1732         * page/scrolling/mac/ScrollingTreeMac.h:
1733         * page/scrolling/mac/ScrollingTreeStickyNode.h:
1734         * page/scrolling/mac/ScrollingTreeStickyNode.mm:
1735         (WebCore::ScrollingTreeStickyNode::create):
1736
1737 2015-05-10  Simon Fraser  <simon.fraser@apple.com>
1738
1739         background-position sometimes doesn't work properly with background-attachment: fixed
1740         https://bugs.webkit.org/show_bug.cgi?id=103757
1741         rdar://problem/18749925
1742
1743         Reviewed by Darin Adler.
1744         
1745         Fix sizing issues with fixed backgrounds when top content inset (blurred toolbar) is in
1746         effect.
1747         
1748         The primary issue was that positioningAreaSize was including the top content inset
1749         height, and should not have been, but there were also issues with the "fixedBackgroundPaintsInLocalCoordinates"
1750         code path, which kicks in when the root background is fixed.
1751
1752         Tests: platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-cover-local.html
1753                platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-cover.html
1754                platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-local.html
1755                platform/mac-wk2/tiled-drawing/top-content-inset-fixed-attachment-positioned.html
1756
1757         * rendering/RenderBoxModelObject.cpp:
1758         (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry):
1759
1760 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
1761
1762         Get rid of the public item accessors in BackForwardClient
1763         https://bugs.webkit.org/show_bug.cgi?id=144827
1764
1765         Reviewed by Darin Adler.
1766
1767         Remove backItem(), currentItem(), and forwardItem() from BackForwardClient.
1768         We can still use these functionalities through BackForwardController.
1769
1770         No new tests, no behavior change.
1771
1772         * history/BackForwardClient.h:
1773         (WebCore::BackForwardClient::backItem): Deleted.
1774         (WebCore::BackForwardClient::currentItem): Deleted.
1775         (WebCore::BackForwardClient::forwardItem): Deleted.
1776
1777 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
1778
1779         Rename Length::isPercent() and Length::isPercentNotCalculated().
1780         https://bugs.webkit.org/show_bug.cgi?id=144791
1781
1782         Reviewed by Darin Adler.
1783
1784         1. Rename these methods as below for consistency and clarity.
1785
1786         Length::isPercentNotCalculated() => Length::isPercent()
1787         Length::isPercent() => Length::isPercentOrCalculated()
1788
1789         2. Simplify the condition check of length type in SVGLengthContext::valueForLength().
1790
1791         "length.isPercent() && !length.isCalculated()" => "length.isPercent()"
1792
1793         No new tests, no behavior change.
1794
1795         * css/CSSComputedStyleDeclaration.cpp:
1796         (WebCore::valueForImageSliceSide):
1797         (WebCore::valueForReflection):
1798         (WebCore::percentageOrZoomAdjustedValue):
1799         (WebCore::lineHeightFromStyle):
1800         (WebCore::ComputedStyleExtractor::propertyValue):
1801         * html/HTMLPlugInImageElement.cpp:
1802         (WebCore::is100Percent):
1803         * page/animation/AnimationBase.cpp:
1804         (WebCore::AnimationBase::computeTransformedExtentViaTransformList):
1805         * platform/Length.h:
1806         (WebCore::Length::percent):
1807         (WebCore::Length::isPercent):
1808         (WebCore::Length::isPercentOrCalculated):
1809         (WebCore::Length::isSpecified):
1810         (WebCore::Length::isPercentNotCalculated): Deleted.
1811         * platform/graphics/transforms/TranslateTransformOperation.h:
1812         * rendering/AutoTableLayout.cpp:
1813         (WebCore::AutoTableLayout::recalcColumn):
1814         (WebCore::AutoTableLayout::fullRecalc):
1815         (WebCore::shouldScaleColumns):
1816         (WebCore::AutoTableLayout::computeIntrinsicLogicalWidths):
1817         (WebCore::AutoTableLayout::calcEffectiveLogicalWidth):
1818         (WebCore::AutoTableLayout::layout):
1819         * rendering/FixedTableLayout.cpp:
1820         (WebCore::FixedTableLayout::calcWidthArray):
1821         (WebCore::FixedTableLayout::applyPreferredLogicalWidthQuirks):
1822         (WebCore::FixedTableLayout::layout):
1823         * rendering/RenderBlock.cpp:
1824         (WebCore::RenderBlock::isSelfCollapsingBlock):
1825         (WebCore::RenderBlock::textIndentOffset):
1826         * rendering/RenderBox.cpp:
1827         (WebCore::RenderBox::needsPreferredWidthsRecalculation):
1828         (WebCore::RenderBox::computeLogicalHeight):
1829         (WebCore::RenderBox::computeContentAndScrollbarLogicalHeightUsing):
1830         (WebCore::RenderBox::computePercentageLogicalHeight):
1831         (WebCore::RenderBox::computeReplacedLogicalWidthRespectingMinMaxWidth):
1832         (WebCore::RenderBox::computeReplacedLogicalWidthUsing):
1833         (WebCore::RenderBox::computeReplacedLogicalHeightUsing):
1834         (WebCore::RenderBox::availableLogicalHeightUsing):
1835         (WebCore::logicalWidthIsResolvable):
1836         (WebCore::RenderBox::percentageLogicalHeightIsResolvableFromBlock):
1837         (WebCore::RenderBox::hasUnsplittableScrollingOverflow):
1838         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1839         * rendering/RenderBoxModelObject.cpp:
1840         (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight):
1841         (WebCore::RenderBoxModelObject::relativePositionOffset):
1842         (WebCore::RenderBoxModelObject::computedCSSPadding):
1843         (WebCore::RenderBoxModelObject::calculateImageIntrinsicDimensions):
1844         (WebCore::RenderBoxModelObject::calculateFillTileSize):
1845         * rendering/RenderDeprecatedFlexibleBox.cpp:
1846         (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
1847         (WebCore::RenderDeprecatedFlexibleBox::clearLineClamp):
1848         * rendering/RenderElement.cpp:
1849         (WebCore::mustRepaintFillLayers):
1850         * rendering/RenderFileUploadControl.cpp:
1851         (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths):
1852         * rendering/RenderFrameSet.cpp:
1853         (WebCore::RenderFrameSet::layOutAxis):
1854         * rendering/RenderImage.cpp:
1855         (WebCore::RenderImage::repaintOrMarkForLayout):
1856         * rendering/RenderInline.cpp:
1857         (WebCore::computeMargin):
1858         * rendering/RenderListBox.cpp:
1859         (WebCore::RenderListBox::computeIntrinsicLogicalWidths):
1860         * rendering/RenderMenuList.cpp:
1861         (RenderMenuList::computeIntrinsicLogicalWidths):
1862         * rendering/RenderObject.cpp:
1863         (WebCore::objectIsRelayoutBoundary):
1864         * rendering/RenderReplaced.cpp:
1865         (WebCore::RenderReplaced::computePreferredLogicalWidths):
1866         * rendering/RenderSlider.cpp:
1867         (WebCore::RenderSlider::computeIntrinsicLogicalWidths):
1868         * rendering/RenderTable.cpp:
1869         (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight):
1870         * rendering/RenderTableSection.cpp:
1871         (WebCore::RenderTableSection::layoutRows):
1872         * rendering/RenderTextControl.cpp:
1873         (WebCore::RenderTextControl::computeIntrinsicLogicalWidths):
1874         * rendering/RenderView.cpp:
1875         (WebCore::RenderView::layout):
1876         * rendering/RootInlineBox.cpp:
1877         (WebCore::RootInlineBox::verticalPositionForBox):
1878         * rendering/style/GridLength.h:
1879         (WebCore::GridLength::isPercentage):
1880         * rendering/style/GridTrackSize.h:
1881         (WebCore::GridTrackSize::isPercentage):
1882         * rendering/style/RenderStyle.cpp:
1883         (WebCore::RenderStyle::computedLineHeight):
1884         * rendering/svg/RenderSVGRoot.cpp:
1885         (WebCore::RenderSVGRoot::hasRelativeDimensions):
1886         * svg/SVGLengthContext.cpp:
1887         (WebCore::SVGLengthContext::valueForLength):
1888         * svg/graphics/SVGImage.cpp:
1889         (WebCore::SVGImage::hasRelativeWidth):
1890         (WebCore::SVGImage::hasRelativeHeight):
1891
1892 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
1893
1894         Remove unnecessary semicolons.
1895         https://bugs.webkit.org/show_bug.cgi?id=144844
1896
1897         Reviewed by Darin Adler.
1898
1899         No new tests, no behavior change.
1900
1901         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1902         (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
1903         * platform/ios/PasteboardIOS.mm:
1904         (WebCore::Pasteboard::readString):
1905         * platform/mediastream/RealtimeMediaSourceCapabilities.h:
1906         (WebCore::RealtimeMediaSourceCapabilities::setHasVideoSource):
1907         * platform/network/mac/ResourceErrorMac.mm:
1908         (WebCore::ResourceError::nsError):
1909         * rendering/RenderThemeIOS.mm:
1910         (WebCore::getSharedFunctionRef):
1911
1912 2015-05-10  Sungmann Cho  <sungmann.cho@navercorp.com>
1913
1914         Remove unnecessary forward declarations in StyleProperties.h
1915         https://bugs.webkit.org/show_bug.cgi?id=144843
1916
1917         Reviewed by Darin Adler.
1918
1919         No new tests, no behavior change.        
1920
1921         * css/StyleProperties.h:
1922
1923 2015-05-10  Darin Adler  <darin@apple.com>
1924
1925         [Cocoa] Fix paths and resort WebCore project file
1926         https://bugs.webkit.org/show_bug.cgi?id=144838
1927
1928         Reviewed by Dan Bernstein.
1929
1930         * WebCore.xcodeproj/project.pbxproj: Re-sorted this file with the
1931         sort-Xcode-project-file script and fixed the paths in the platform/ios directory.
1932
1933 2015-05-10  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
1934
1935         [Streams API] Refactor ReadableStreamReader close promise callback cleaning
1936         https://bugs.webkit.org/show_bug.cgi?id=144799
1937
1938         Reviewed by Darin Adler.
1939
1940         Moved close callback cleaning to releaseStream, which is now releaseStreamAndClean.
1941         Moved that method to private as it is no longer needed by subclasses.
1942
1943         No behavior changes.
1944
1945         * Modules/streams/ReadableStreamReader.cpp:
1946         (WebCore::ReadableStreamReader::releaseStreamAndClean):
1947         (WebCore::ReadableStreamReader::changeStateToClosed):
1948         (WebCore::ReadableStreamReader::changeStateToErrored):
1949         * Modules/streams/ReadableStreamReader.h:
1950
1951 2015-05-10  Darin Adler  <darin@apple.com>
1952
1953         [Cocoa] Don't soft link DataDetectorsCore
1954         https://bugs.webkit.org/show_bug.cgi?id=144837
1955
1956         Reviewed by Dan Bernstein.
1957
1958         Linking this in the normal way should slightly speed up the web process
1959         startup time. We don't need to soft link it: It's present in the
1960         OS X base system and there is no reference cycle with WebKit.
1961
1962         * Configurations/WebCore.xcconfig: Added PrivateFrameworks to
1963         FRAMEWORK_SEARCH_PATHS for Mac and added DataDetectorsCore to
1964         OTHER_LDFLAGS_PLATFORM for Mac. We may want to do this later for iOS too.
1965
1966         * WebCore.xcodeproj/project.pbxproj: Added DataDetectorsCoreSPI.h.
1967
1968         * editing/mac/DataDetection.mm:
1969         (WebCore::DataDetection::detectItemAroundHitTestResult): Removed check to see
1970         if DataDetectorsCore is available.
1971
1972         * page/mac/ServicesOverlayController.h: Simplified a forward declaration to
1973         only declare what we actually use.
1974         * page/mac/ServicesOverlayController.mm: Moved SOFT_LINK from here to the
1975         DataDetectorsSPI.h header.
1976
1977         * platform/spi/cocoa/DataDetectorsCoreSPI.h: Added. This is the low level
1978         DataDetectorsCore framework, which has no reference cycle with WebKit, and
1979         which we can link to normally. Moved the content here from DataDetectorsSPI.h,
1980         added a USE(APPLE_INTERNAL_SDK) path that uses the system headers, and fixed
1981         the incorrect return type on DDScannerScanQuery, which was detected when
1982         using the system headers in conjunction with this file.
1983
1984         * platform/spi/mac/DataDetectorsSPI.h: Removed the content of this file that
1985         was actually about DataDetectorsCore. Also added a USE(APPLE_INTERNAL_SDK)
1986         path that uses the system headers and moved a few stray DataDetectors SPI
1987         definitions from elsewhere into this header.
1988
1989 2015-05-10  Chris Fleizach  <cfleizach@apple.com>
1990
1991         AX: Don't expose elements as data tables just because they use display: table
1992         https://bugs.webkit.org/show_bug.cgi?id=144804
1993
1994         Reviewed by Mario Sanchez Prada.
1995
1996         Elements will create RenderTable objects if they have display:table. We shouldn't assume these are accessibility tables.
1997
1998         Test: accessibility/css-table-ignored.html
1999
2000         * accessibility/AccessibilityTable.cpp:
2001         (WebCore::AccessibilityTable::isDataTable):
2002
2003 2015-05-09  Chris Dumez  <cdumez@apple.com>
2004
2005         Introduce ParentNode.idl / NonDocumentTypeChildNode.idl
2006         https://bugs.webkit.org/show_bug.cgi?id=144825
2007
2008         Reviewed by Sam Weinig.
2009
2010         Introduce ParentNode.idl / NonDocumentTypeChildNode.idl as per DOM
2011         specification and to avoid IDL code duplication:
2012         - https://dom.spec.whatwg.org/#interface-parentnode
2013         - https://dom.spec.whatwg.org/#interface-nondocumenttypechildnode
2014
2015         No Web-Exposed behavior change.
2016
2017         * CMakeLists.txt:
2018         * DerivedSources.make:
2019         * WebCore.xcodeproj/project.pbxproj:
2020         * dom/CharacterData.idl:
2021         * dom/Document.idl:
2022         * dom/DocumentFragment.idl:
2023         * dom/Element.idl:
2024         * dom/NonDocumentTypeChildNode.idl: Copied from Source/WebCore/dom/DocumentFragment.idl.
2025         * dom/ParentNode.idl: Copied from Source/WebCore/dom/DocumentFragment.idl.
2026
2027 2015-05-09  Chris Dumez  <cdumez@apple.com>
2028
2029         Invalidate the FontCache on WebProcess suspension / critical memory pressure
2030         https://bugs.webkit.org/show_bug.cgi?id=144821
2031
2032         Reviewed by Antti Koivisto.
2033
2034         Invalidate the FontCache on WebProcess suspension / critical memory
2035         pressure to free a bit more memory (an extra 4-16Kb per WebProcess on
2036         the pages I tested). We already purge inactive font data on
2037         non-critical memory warning but invalidating the whole FontCache takes
2038         care of clearing the FontCascade cache and the fontPlatformData cache
2039         as well.
2040
2041         * platform/MemoryPressureHandler.cpp:
2042         (WebCore::MemoryPressureHandler::releaseCriticalMemory):
2043
2044 2015-05-09  Yoav Weiss  <yoav@yoav.ws>
2045
2046         Remove the PICTURE_SIZES build flag
2047         https://bugs.webkit.org/show_bug.cgi?id=144679
2048
2049         Reviewed by Benjamin Poulain.
2050
2051         Removed the PICTURE_SIZES build time flag.
2052
2053         No new tests, since there's no functionality change.
2054
2055         * Configurations/FeatureDefines.xcconfig:
2056         * css/CSSGrammar.y.in:
2057         * css/CSSParser.cpp:
2058         (WebCore::CSSParser::detectAtToken):
2059         * css/CSSParser.h:
2060         * css/SourceSizeList.cpp:
2061         (WebCore::parseSizesAttribute): Deleted.
2062         * html/HTMLImageElement.cpp:
2063         (WebCore::HTMLImageElement::setBestFitURLAndDPRFromImageCandidate):
2064         * html/HTMLImageElement.h:
2065         (WebCore::HTMLImageElement::currentSrc):
2066         * html/HTMLImageElement.idl:
2067         * html/parser/HTMLPreloadScanner.cpp:
2068         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2069         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
2070         * html/parser/HTMLSrcsetParser.cpp:
2071         (WebCore::parseDescriptors):
2072         (WebCore::pickBestImageCandidate):
2073
2074 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
2075
2076         Remove convenience constructors for TextRun
2077         https://bugs.webkit.org/show_bug.cgi?id=144752
2078
2079         These convenience constructors are unnecessary. Moving the code that makes the StringView
2080         back to the call site will also help us make things more elegant in future refactoring.
2081
2082         Reviewed by Darin Adler.
2083
2084         No new tests because there is no behavior change.
2085
2086         * css/CSSPrimitiveValue.cpp:
2087         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Remove ambiguous call.
2088         * platform/graphics/StringTruncator.cpp:
2089         (WebCore::stringWidth):
2090         * platform/graphics/TextRun.h:
2091         (WebCore::TextRun::TextRun):
2092         * platform/mac/DragImageMac.mm:
2093         (WebCore::widthWithFont):
2094         (WebCore::drawAtPoint):
2095         * rendering/SimpleLineLayout.cpp:
2096         (WebCore::SimpleLineLayout::canUseFor):
2097         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2098         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2099         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
2100         * rendering/TextPainter.cpp:
2101         (WebCore::TextPainter::paintText):
2102
2103 2015-05-08  Sam Weinig  <sam@webkit.org>
2104
2105         Element Traversal is not just Elements anymore
2106         https://bugs.webkit.org/show_bug.cgi?id=144822
2107
2108         Reviewed by Simon Fraser.
2109
2110         Match other browsers and the new DOM spec at https://dom.spec.whatwg.org by
2111         exposing the element traversal methods on non-Elements.
2112
2113         - Makes firstElementChild, lastElementChild and childElementCount available on
2114           Document and DocumentFragment in addition to Element.
2115         - Makes nextElementSibling and previousElementSibling available on CharacterData
2116           in addition to Element.
2117
2118         Tests: fast/dom/element-traversal-on-character-data.html
2119                fast/dom/element-traversal-on-document-fragment.html
2120                fast/dom/element-traversal-on-document.html
2121
2122         * dom/CharacterData.idl:
2123         Expose nextElementSibling and previousElementSibling.
2124
2125         * dom/ContainerNode.cpp:
2126         (WebCore::ContainerNode::firstElementChild):
2127         (WebCore::ContainerNode::lastElementChild):
2128         (WebCore::ContainerNode::childElementCount):
2129         * dom/ContainerNode.h:
2130         Move implementations of firstElementChild, lastElementChild and childElementCount here
2131         from Element to make them shareable.
2132
2133         * dom/Document.idl:
2134         * dom/DocumentFragment.idl:
2135         Expose firstElementChild, lastElementChild and childElementCount.
2136
2137         * dom/Element.cpp:
2138         (WebCore::Element::firstElementChild): Deleted.
2139         (WebCore::Element::lastElementChild): Deleted.
2140         (WebCore::Element::previousElementSibling): Deleted.
2141         (WebCore::Element::nextElementSibling): Deleted.
2142         (WebCore::Element::childElementCount): Deleted.
2143         * dom/Element.h:
2144         Move element traversal functions down to Node and ContainerNode.
2145
2146         * dom/Element.idl:
2147         Update comments to indicate where these functions are defined now.
2148
2149         * dom/Node.cpp:
2150         (WebCore::Node::previousElementSibling):
2151         (WebCore::Node::nextElementSibling):
2152         * dom/Node.h:
2153         Move implementations of nextElementSibling and previousElementSibling here
2154         from Element to make them shareable.
2155
2156 2015-05-08  Michael Catanzaro  <mcatanzaro@igalia.com>, Martin Robinson <mrobinson@igalia.com>
2157
2158         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
2159         https://bugs.webkit.org/show_bug.cgi?id=144746
2160
2161         Reviewed by Carlos Garcia Campos.
2162
2163         Use ENABLE(DEVELOPER_MODE) rather than DEVELOPMENT_BUILD.
2164
2165         * platform/gtk/GtkUtilities.cpp:
2166         * platform/gtk/GtkUtilities.h:
2167         * platform/text/gtk/HyphenationLibHyphen.cpp:
2168         (WebCore::availableLocales):
2169
2170 2015-05-08  Alexey Proskuryakov  <ap@apple.com>
2171
2172         Crashes in SocketStreamHandleBase::close
2173         https://bugs.webkit.org/show_bug.cgi?id=144767
2174         rdar://problem/20486538
2175
2176         Reviewed by Brady Eidson.
2177
2178         This is a speculative fix, I could not reproduce the crash.
2179
2180         * Modules/websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::processFrame):
2181         Normally, processOutgoingFrameQueue() closes the handle in the end when called in
2182         OutgoingFrameQueueClosing state. But there is no definitive protection against
2183         processing two CLOSE frames, in which case we'd try to close the handle twice.
2184
2185         * platform/network/cf/SocketStreamHandleCFNet.cpp:
2186         (WebCore::SocketStreamHandle::readStreamCallback): Passing empty data to the client
2187         results in the socket being closed, which makes no sense here.
2188
2189 2015-05-08  Commit Queue  <commit-queue@webkit.org>
2190
2191         Unreviewed, rolling out r183996.
2192         https://bugs.webkit.org/show_bug.cgi?id=144806
2193
2194         ASan detected use-after free (Requested by ap on #webkit).
2195
2196         Reverted changeset:
2197
2198         "Remove convenience constructors for TextRun"
2199         https://bugs.webkit.org/show_bug.cgi?id=144752
2200         http://trac.webkit.org/changeset/183996
2201
2202 2015-05-08  Eric Carlson  <eric.carlson@apple.com>
2203
2204         [Mac] Playback target clients do not unregister on page reload
2205         https://bugs.webkit.org/show_bug.cgi?id=144761
2206
2207         Reviewed by Brady Eidson.
2208
2209         * dom/Document.cpp:
2210         (WebCore::Document::prepareForDestruction): Unregister all target picker clients.
2211
2212         * html/HTMLMediaElement.cpp:
2213         (WebCore::HTMLMediaElement::registerWithDocument): Register for page cache callback.
2214         (WebCore::HTMLMediaElement::unregisterWithDocument): Unregister for page cache callback.
2215         (WebCore::HTMLMediaElement::documentWillSuspendForPageCache): New.
2216         (WebCore::HTMLMediaElement::documentDidResumeFromPageCache): New.
2217
2218 2015-05-08  Chris Dumez  <cdumez@apple.com>
2219
2220         Throttle RequestAnimationFrame in subframes that are outside the viewport
2221         https://bugs.webkit.org/show_bug.cgi?id=144718
2222         <rdar://problem/20688782>
2223
2224         Reviewed by Simon Fraser.
2225
2226         Throttle RequestAnimationFrame in subframes that are outside the
2227         viewport or have "display: none" for performance and power.
2228
2229         Tests: fast/animation/request-animation-frame-throttle-subframe-display-none.html
2230                fast/animation/request-animation-frame-throttle-subframe.html
2231
2232         * dom/Document.h:
2233         (WebCore::Document::scriptedAnimationController):
2234         * dom/ScriptedAnimationController.cpp:
2235         (WebCore::ScriptedAnimationController::setThrottled):
2236         (WebCore::ScriptedAnimationController::isThrottled):
2237         * dom/ScriptedAnimationController.h:
2238         * loader/FrameLoader.cpp:
2239         (WebCore::FrameLoader::open):
2240         Call FrameView::setFrameRect() only *after* the view has been
2241         set on the Frame. Otherwise, setFrameRect() ends up calling
2242         viewportContentsChanged() and we hit the
2243         ASSERT(frame().view() == this) assertion in windowClipRect()
2244         because the Frame still has its old FrameView. This is covered
2245         by loader/go-back-to-different-window-size.html layout test.
2246
2247         * page/FrameView.cpp:
2248         (WebCore::FrameView::viewportContentsChanged):
2249         (WebCore::FrameView::applyRecursivelyWithVisibleRect):
2250         (WebCore::FrameView::resumeVisibleImageAnimations):
2251         (WebCore::FrameView::updateScriptedAnimationsThrottlingState):
2252         (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
2253         (WebCore::FrameView::updateThrottledDOMTimersState):
2254         (WebCore::FrameView::scrollPositionChanged): Deleted.
2255         (WebCore::FrameView::sendResizeEventIfNeeded): Deleted.
2256         * page/FrameView.h:
2257         * testing/Internals.cpp:
2258         (WebCore::Internals::isRequestAnimationFrameThrottled):
2259         (WebCore::Internals::isTimerThrottled): Deleted.
2260         * testing/Internals.h:
2261         * testing/Internals.idl:
2262
2263 2015-05-08  Daniel Bates  <dabates@apple.com>
2264
2265         Fix the iOS Simulator external SDK build following <http://trac.webkit.org/changeset/181918>
2266
2267         Remove unused iOS Simulator-variant of CARenderServerRenderLayerWithTransform(). Also guard
2268         IOSurfaceRef-variant of CARenderServerRenderLayerWithTransform() with USE(IOSURFACE)
2269         since it is only applicable on platforms that use IOSurface.
2270
2271         * platform/spi/cocoa/QuartzCoreSPI.h:
2272
2273 2015-05-08  Myles C. Maxfield  <mmaxfield@apple.com>
2274
2275         Remove convenience constructors for TextRun
2276         https://bugs.webkit.org/show_bug.cgi?id=144752
2277
2278         These convenience constructors are unnecessary. Moving the code that makes the StringView
2279         back to the call site will also help us make things more elegant in future refactoring.
2280
2281         Reviewed by Darin Adler.
2282
2283         No new tests because there is no behavior change.
2284
2285         * css/CSSPrimitiveValue.cpp:
2286         (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Remove ambiguous call.
2287         * platform/graphics/StringTruncator.cpp:
2288         (WebCore::stringWidth):
2289         * platform/graphics/TextRun.h:
2290         (WebCore::TextRun::TextRun):
2291         * platform/mac/DragImageMac.mm:
2292         (WebCore::widthWithFont):
2293         (WebCore::drawAtPoint):
2294         * rendering/SimpleLineLayout.cpp:
2295         (WebCore::SimpleLineLayout::canUseFor):
2296         * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
2297         (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
2298         (WebCore::SimpleLineLayout::TextFragmentIterator::runWidth):
2299         * rendering/TextPainter.cpp:
2300         (WebCore::TextPainter::paintText):
2301
2302 2015-05-08  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet <youenn.fablet@crf.canon.fr>
2303
2304         [Streams API] ReadableStream constructor start function should be able to error the stream
2305         https://bugs.webkit.org/show_bug.cgi?id=141162
2306
2307         Reviewed by Darin Adler.
2308
2309         This patch implements the functionality of the ReadableStreamController error function.
2310         It basically changes the state of the stream to errored, resolves the ready promise and rejects the closed promise.
2311         Adding support to reject promise with any JSValue.
2312
2313         Support for storing the error is added to both reader and stream.
2314
2315         Test: streams/readable-stream-controller-error.html and rebased tests
2316
2317         * Modules/streams/ReadableStream.cpp:
2318         (WebCore::ReadableStream::changeStateToErrored):
2319         * Modules/streams/ReadableStream.h:
2320         * Modules/streams/ReadableStreamReader.cpp:
2321         (WebCore::ReadableStreamReader::initialize):
2322         (WebCore::ReadableStreamReader::closed):
2323         (WebCore::ReadableStreamReader::changeStateToClosed):
2324         (WebCore::ReadableStreamReader::changeStateToErrored):
2325         * Modules/streams/ReadableStreamReader.h:
2326         * bindings/js/JSDOMPromise.h:
2327         (WebCore::DeferredWrapper::reject):
2328         * bindings/js/JSReadableStreamControllerCustom.cpp:
2329         (WebCore::JSReadableStreamController::error):
2330         * bindings/js/JSReadableStreamReaderCustom.cpp:
2331         (WebCore::JSReadableStreamReader::closed):
2332         * bindings/js/ReadableJSStream.cpp:
2333         (WebCore::ReadableJSStream::createReader):
2334         (WebCore::ReadableJSStream::storeError):
2335         (WebCore::ReadableJSStream::Reader::storeError):
2336         (WebCore::ReadableJSStream::jsController): Deleted.
2337         * bindings/js/ReadableJSStream.h:
2338
2339 2015-05-08  Commit Queue  <commit-queue@webkit.org>
2340
2341         Unreviewed, rolling out r183985.
2342         https://bugs.webkit.org/show_bug.cgi?id=144796
2343
2344         broke loader/go-back-to-different-window-size.html (Requested
2345         by kling on #webkit).
2346
2347         Reverted changeset:
2348
2349         "Throttle RequestAnimationFrame in subframes that are outside
2350         the viewport"
2351         https://bugs.webkit.org/show_bug.cgi?id=144718
2352         http://trac.webkit.org/changeset/183985
2353
2354 2015-05-08  Youenn Fablet  <youenn.fablet@crf.canon.fr>
2355
2356         SharedBuffer::m_size should be initialized to 0 when defining it
2357         https://bugs.webkit.org/show_bug.cgi?id=144740
2358
2359         Reviewed by Darin Adler.
2360
2361         Setting m_size to 0 when declaring it and updating constructor definitions.
2362
2363         No change in behaviour.
2364
2365         * platform/SharedBuffer.cpp:
2366         (WebCore::SharedBuffer::SharedBuffer):
2367         * platform/SharedBuffer.h:
2368         * platform/cf/SharedBufferCF.cpp:
2369         (WebCore::SharedBuffer::SharedBuffer):
2370         * platform/soup/SharedBufferSoup.cpp:
2371         (WebCore::SharedBuffer::SharedBuffer):
2372
2373 2015-05-08  Commit Queue  <commit-queue@webkit.org>
2374
2375         Unreviewed, rolling out r183945.
2376         https://bugs.webkit.org/show_bug.cgi?id=144789
2377
2378         "It broke all the GTK+ tests" (Requested by KaL on #webkit).
2379
2380         Reverted changeset:
2381
2382         "[GTK] Checks for DEVELOPMENT_BUILD are all wrong"
2383         https://bugs.webkit.org/show_bug.cgi?id=144746
2384         http://trac.webkit.org/changeset/183945
2385
2386 2015-05-07  Chris Dumez  <cdumez@apple.com>
2387
2388         Throttle RequestAnimationFrame in subframes that are outside the viewport
2389         https://bugs.webkit.org/show_bug.cgi?id=144718
2390         <rdar://problem/20688782>
2391
2392         Reviewed by Simon Fraser.
2393
2394         Throttle RequestAnimationFrame in subframes that are outside the
2395         viewport or have "display: none" for performance and power.
2396
2397         Tests: fast/animation/request-animation-frame-throttle-subframe-display-none.html
2398                fast/animation/request-animation-frame-throttle-subframe.html
2399
2400         * dom/Document.h:
2401         (WebCore::Document::scriptedAnimationController):
2402         * dom/ScriptedAnimationController.cpp:
2403         (WebCore::ScriptedAnimationController::setThrottled):
2404         (WebCore::ScriptedAnimationController::isThrottled):
2405         * dom/ScriptedAnimationController.h:
2406         * page/FrameView.cpp:
2407         (WebCore::FrameView::viewportContentsChanged):
2408         (WebCore::FrameView::applyRecursivelyWithVisibleRect):
2409         (WebCore::FrameView::resumeVisibleImageAnimations):
2410         (WebCore::FrameView::updateScriptedAnimationsThrottlingState):
2411         (WebCore::FrameView::resumeVisibleImageAnimationsIncludingSubframes):
2412         (WebCore::FrameView::updateThrottledDOMTimersState):
2413         (WebCore::FrameView::scrollPositionChanged): Deleted.
2414         (WebCore::FrameView::sendResizeEventIfNeeded): Deleted.
2415         * page/FrameView.h:
2416         * testing/Internals.cpp:
2417         (WebCore::Internals::isRequestAnimationFrameThrottled):
2418         (WebCore::Internals::isTimerThrottled): Deleted.
2419         * testing/Internals.h:
2420         * testing/Internals.idl:
2421
2422 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
2423
2424         Calculate source-size length as a float
2425         https://bugs.webkit.org/show_bug.cgi?id=144766
2426
2427         Reviewed by Dean Jackson.
2428
2429         Make sure that the source-size length is calculated as a float,
2430         to align with the spec.
2431
2432         Test: fast/dom/HTMLImageElement/sizes/image-sizes-1x.html
2433               fast/dom/HTMLImageElement/sizes/image-sizes-2x.html
2434
2435         * css/SourceSizeList.cpp:
2436         (WebCore::parseSizesAttribute):
2437         (WebCore::defaultLength):
2438         (WebCore::computeLength):
2439         * css/SourceSizeList.h:
2440         * html/HTMLImageElement.cpp:
2441         (WebCore::HTMLImageElement::parseAttribute):
2442         * html/parser/HTMLPreloadScanner.cpp:
2443         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2444         * html/parser/HTMLSrcsetParser.cpp:
2445         (WebCore::pickBestImageCandidate):
2446         (WebCore::bestFitSourceForImageAttributes):
2447         * html/parser/HTMLSrcsetParser.h:
2448
2449 2015-05-07  Commit Queue  <commit-queue@webkit.org>
2450
2451         Unreviewed, rolling out r183895.
2452         https://bugs.webkit.org/show_bug.cgi?id=144786
2453
2454         Many tests became flaky (Requested by ap on #webkit).
2455
2456         Reverted changeset:
2457
2458         "Expose more font weights for -apple-system"
2459         https://bugs.webkit.org/show_bug.cgi?id=144707
2460         http://trac.webkit.org/changeset/183895
2461
2462 2015-05-07  Hyungwook Lee  <hyungwook.lee@navercorp.com>
2463
2464         Add first-letter assert exception in RenderButton::setupInnerStyle().
2465         https://bugs.webkit.org/show_bug.cgi?id=140517OB
2466
2467         Reviewed by Darin Adler.
2468
2469         StyleResolver references inner block's render style temporary in
2470         RenderBlock::styleDidChange() when we have first-letter css pseudo
2471         element.
2472
2473         * rendering/RenderButton.cpp:
2474         (WebCore::RenderButton::setupInnerStyle):
2475
2476 2015-05-07  Chris Dumez  <cdumez@apple.com>
2477
2478         Unreviewed, fix build after r183970.
2479
2480         WEBCORE_EXPORT should not be used on inlined functions.
2481
2482         * platform/graphics/ca/GraphicsLayerCA.h:
2483
2484 2015-05-07  Anders Carlsson  <andersca@apple.com>
2485
2486         Build fixes.
2487
2488         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
2489         (-[WebAccessibilityObjectWrapper doAXRTFForRange:]):
2490         * editing/cocoa/HTMLConverter.mm:
2491         (HTMLConverter::_addMarkersToList):
2492         * platform/mac/PasteboardMac.mm:
2493         (WebCore::writeFileWrapperAsRTFDAttachment):
2494         * platform/mac/PlatformPasteboardMac.mm:
2495         (WebCore::PlatformPasteboard::setTypes):
2496         Pass empty arrays and dictionaries instead of nil.
2497
2498         * rendering/RenderThemeMac.mm:
2499         (WebCore::RenderThemeMac::paintSliderThumb):
2500         Pass the document view to the AppKit paint method.
2501
2502 2015-05-07  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2503
2504         Purge PassRefPtr in WebCore/html - 3
2505         https://bugs.webkit.org/show_bug.cgi?id=144686
2506
2507         Reviewed by Andreas Kling.
2508
2509         Replace PassRefPtr with Ref in create() factory functions, because
2510         it doesn't have to change to be null.
2511
2512         No new tests, no behavior changes.
2513
2514         * html/FTPDirectoryDocument.h:
2515         * html/HTMLDetailsElement.cpp:
2516         (WebCore::DetailsContentElement::create):
2517         * html/HTMLKeygenElement.cpp:
2518         * html/HTMLSummaryElement.cpp:
2519         (WebCore::SummaryContentElement::create):
2520         * html/TimeRanges.cpp:
2521         (WebCore::TimeRanges::create):
2522         * html/shadow/SliderThumbElement.cpp:
2523         (WebCore::SliderContainerElement::create):
2524         * html/shadow/SliderThumbElement.h:
2525         (WebCore::SliderThumbElement::create):
2526         * html/shadow/SpinButtonElement.cpp:
2527         (WebCore::SpinButtonElement::create):
2528         * html/shadow/SpinButtonElement.h:
2529         * html/shadow/TextControlInnerElements.cpp:
2530         (WebCore::TextControlInnerContainer::create):
2531         (WebCore::TextControlInnerElement::create):
2532         (WebCore::TextControlInnerTextElement::create):
2533         (WebCore::SearchFieldResultsButtonElement::create):
2534         (WebCore::SearchFieldCancelButtonElement::create):
2535         * html/shadow/TextControlInnerElements.h:
2536         * html/shadow/YouTubeEmbedShadowElement.cpp:
2537         (WebCore::YouTubeEmbedShadowElement::create):
2538         * html/track/InbandDataTextTrack.cpp:
2539         (WebCore::InbandDataTextTrack::create):
2540         * html/track/InbandDataTextTrack.h:
2541         * html/track/InbandGenericTextTrack.cpp:
2542         (WebCore::InbandGenericTextTrack::create):
2543         * html/track/InbandGenericTextTrack.h:
2544         * html/track/InbandWebVTTTextTrack.cpp:
2545         (WebCore::InbandWebVTTTextTrack::create):
2546         * html/track/InbandWebVTTTextTrack.h:
2547         * html/track/LoadableTextTrack.h:
2548         * html/track/TextTrack.h:
2549         (WebCore::TextTrack::create):
2550         * html/track/TextTrackCueGeneric.cpp:
2551         * html/track/TextTrackCueGeneric.h:
2552         * html/track/TextTrackList.h:
2553         * html/track/VTTRegionList.h:
2554         (WebCore::VTTRegionList::create):
2555
2556 2015-05-07  Dean Jackson  <dino@apple.com>
2557
2558         [iOS] MediaControls: disappear while scrubbing
2559         https://bugs.webkit.org/show_bug.cgi?id=144777
2560         <rdar://problem/20065572>
2561
2562         Reviewed by Eric Carlson.
2563
2564         If we are scrubbing we shouldn't hide the controls.
2565
2566         * Modules/mediacontrols/mediaControlsApple.js:
2567         (Controller.prototype.hideControls): Return early if we are scrubbing.
2568         * Modules/mediacontrols/mediaControlsiOS.js:
2569         (ControllerIOS.prototype): Add initial value for _potentiallyScrubbing and
2570         rename from non-underscored value throughout the file.
2571         (ControllerIOS.prototype.handleTimelineTouchEnd): When we finish scrubbing, reset
2572         the timer to hide the controls.
2573
2574 2015-05-07  Simon Fraser  <simon.fraser@apple.com>
2575
2576         REGRESSION (r183300): Fixed elements flash when scrolling
2577         https://bugs.webkit.org/show_bug.cgi?id=144778
2578         rdar://problem/20769741
2579
2580         Reviewed by Dean Jackson.
2581
2582         After r183300 we can detached layer backing store when outside the coverage region.
2583         However, position:fixed layers are moved around by the ScrollingCoordinator behind
2584         GraphicsLayer's back, so we can do layer flushes with stale information about layer
2585         geometry.
2586         
2587         To avoid dropping backing store for layers in this situation, prevent backing
2588         store detachment on layers registered with the ScrollingCoordinator as viewport-constrained
2589         layers. Preventing detachment on a layer also prevents detachment on all descendant
2590         layers.
2591
2592         * platform/graphics/GraphicsLayer.h:
2593         (WebCore::GraphicsLayer::setAllowsBackingStoreDetachment):
2594         (WebCore::GraphicsLayer::allowsBackingStoreDetachment):
2595         * platform/graphics/ca/GraphicsLayerCA.cpp:
2596         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2597         (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): Set m_intersectsCoverageRect to true
2598         if backing store detachment is prevented.
2599         (WebCore::GraphicsLayerCA::recursiveCommitChanges): Set a bit in the CommitState to 
2600         communicate to descendants that detachment is prevented.
2601         * platform/graphics/ca/GraphicsLayerCA.h:
2602         (WebCore::GraphicsLayerCA::CommitState::CommitState): Deleted.
2603         * rendering/RenderLayerBacking.cpp:
2604         (WebCore::RenderLayerBacking::setIsScrollCoordinatedWithViewportConstrainedRole):
2605         * rendering/RenderLayerBacking.h:
2606         (WebCore::RenderLayerBacking::setScrollingNodeIDForRole): If registering with a non-zero
2607         nodeID for the ViewportConstrained role, turn off backing store detachment.
2608
2609 2015-05-07  Sam Weinig  <sam@webkit.org>
2610
2611         Consider implementing Document.scrollingElement
2612         <rdar://problem/20845213>
2613         https://bugs.webkit.org/show_bug.cgi?id=143609
2614
2615         Reviewed by Simon Fraser.
2616
2617         Add the non-compliant implementation of Document.scrollingElement that the spec,
2618         found at http://dev.w3.org/csswg/cssom-view/#dom-document-scrollingelement, 
2619         says we should have while we have non-compliant implementations of Element.scrollTop
2620         and Element.scrollLeft (fixing that is tracked by https://bugs.webkit.org/show_bug.cgi?id=106133).
2621
2622         Tests: fast/dom/Document/scrollingElement-quirks-mode.html
2623                fast/dom/Document/scrollingElement-standards-mode.html
2624
2625         * dom/Document.cpp:
2626         (WebCore::Document::scrollingElement):
2627         * dom/Document.h:
2628         * dom/Document.idl:
2629
2630 2015-05-07  Dean Jackson  <dino@apple.com>
2631
2632         [iOS] While scrubbing and holding down, video continues to play
2633         https://bugs.webkit.org/show_bug.cgi?id=144776
2634         <rdar://problem/20863757>
2635
2636         Reviewed by Simon Fraser.
2637
2638         When we are scrubbing a video, we should pause playback. As we
2639         let go of the scrubber playback can resume (but only if it was
2640         playing originally).
2641
2642         * Modules/mediacontrols/mediaControlsiOS.js:
2643         (ControllerIOS.prototype.createControls): Listen for touchstart on the scrubber.
2644         (ControllerIOS.prototype.handleTimelineInput): Call the prototype, but pause if necessary.
2645         (ControllerIOS.prototype.handleTimelineChange): Just moved this to be with the other timeline functions.
2646         (ControllerIOS.prototype.handleTimelineTouchStart): Add the listeners for end and cancel. Remember that we are
2647         potentially about to scrub.
2648         (ControllerIOS.prototype.handleTimelineTouchEnd): Remove the listeners.
2649
2650 2015-05-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
2651
2652         Applying a filter on an SVG element, which is larger than 4096 pixels, causes this element to be rendered shifted to the left
2653         https://bugs.webkit.org/show_bug.cgi?id=144335
2654
2655         Reviewed by Daniel Bates.
2656
2657         Address comments raised by Darin Adler in review.
2658
2659         * platform/graphics/ImageBuffer.cpp:
2660         (WebCore::ImageBuffer::sizeNeedsClamping):
2661         (WebCore::ImageBuffer::clampedSize):
2662         (WebCore::ImageBuffer::isSizeClamped): Deleted.
2663         * platform/graphics/ImageBuffer.h:
2664         The condition for the negative width/height in isSizeClamped() was wrong. Use
2665         FloatSize::isEmpty() instead and rename the function to sizeNeedsClamping().
2666         The new function should return the opposite of the old function return value.
2667         
2668         * platform/graphics/filters/FilterEffect.cpp:
2669         (WebCore::FilterEffect::apply):
2670         (WebCore::FilterEffect::asUnmultipliedImage):
2671         (WebCore::FilterEffect::asPremultipliedImage):
2672         (WebCore::FilterEffect::copyUnmultipliedImage):
2673         (WebCore::FilterEffect::copyPremultipliedImage):
2674         (WebCore::FilterEffect::createUnmultipliedImageResult):
2675         (WebCore::FilterEffect::createPremultipliedImageResult):
2676         * rendering/FilterEffectRenderer.cpp:
2677         (WebCore::FilterEffectRenderer::updateBackingStoreRect):
2678         (WebCore::FilterEffectRendererHelper::beginFilterEffect):
2679         * rendering/svg/RenderSVGResourceFilter.cpp:
2680         (WebCore::RenderSVGResourceFilter::applyResource):
2681         Call the new function and negate the condition for the return value.
2682
2683 2015-05-07  Anders Carlsson  <andersca@apple.com>
2684
2685         Build fix.
2686
2687         * editing/mac/EditorMac.mm:
2688         (WebCore::dataInRTFDFormat):
2689         (WebCore::dataInRTFFormat):
2690
2691 2015-05-07  Said Abou-Hallawa  <sabouhallawa@apple.com>
2692
2693         Applying a filter on an SVG element, which is larger than 4096 pixels, causes this element to be rendered shifted to the left
2694         https://bugs.webkit.org/show_bug.cgi?id=144335
2695
2696         Reviewed by Darin Adler.
2697
2698         When the SVG element is larger than 4096x4096 pixels and it has a filter,
2699         a clipper or a masker, the ImageBuffer which is created for drawing the
2700         sourceGraphicBuffer has to be clamped to this size. The reason for this
2701         clamping is the FilterEffect simply ignores processing any ImageBuffer
2702         larger than this size.
2703         
2704         The bug was happening because we did not propagate the clamping logic to
2705         the FilterEffect. The FilterEffect result ImageBuffer was not clamped as
2706         what we do for drawing the sourceGraphicBuffer. If only the destination
2707         point is specified, the GraphicsContext::drawImageBuffer() assumes the
2708         source and the destination images have the same size which is not true
2709         with the clamping.
2710         
2711         The fix is to add the clamping logic to the FilterEffect. Two places we
2712         need to change. (1) FilterEffect::createImageBufferResult() has to apply
2713         the same clamping we do in SVGRenderingContext::createImageBuffer(). (2)
2714         FilterEffect::drawingRegionOfInputImage() has to consider the clamping 
2715         when mapping from absolute coordinates to the ImageBuffer coordinates.
2716         
2717         Tests: svg/filters/big-sized-off-viewport-filter.svg
2718
2719         * platform/graphics/ImageBuffer.cpp:
2720         (WebCore::ImageBuffer::isSizeClamped):
2721         (WebCore::ImageBuffer::clampedSize):
2722         (WebCore::ImageBuffer::clampedRect):
2723         * platform/graphics/ImageBuffer.h:
2724         (WebCore::ImageBuffer::setSpaceSize): Move all the clamping helper methods
2725         from SVGRenderingContext and RenderSVGResourceFilter to the ImageBuffer.
2726
2727         * platform/graphics/filters/FEColorMatrix.cpp:
2728         (WebCore::FEColorMatrix::platformApplySoftware): Use logicalSize() of the
2729         result image instead of using absolutePaintRect(). The later returns the
2730         rectangle of the element without clamping.
2731         
2732         * platform/graphics/filters/FETile.cpp:
2733         (WebCore::FETile::platformApplySoftware):
2734         * rendering/svg/RenderSVGResourceClipper.cpp:
2735         (WebCore::RenderSVGResourceClipper::applyClippingToContext):
2736         * rendering/svg/RenderSVGResourceFilter.cpp:
2737         (WebCore::RenderSVGResourceFilter::applyResource):
2738         (WebCore::RenderSVGResourceFilter::fitsInMaximumImageSize): Deleted.
2739         * rendering/svg/RenderSVGResourceFilter.h:
2740         * rendering/svg/RenderSVGResourceGradient.cpp:
2741         (WebCore::createMaskAndSwapContextForTextGradient):
2742         (WebCore::clipToTextMask):
2743         * rendering/svg/RenderSVGResourceMasker.cpp:
2744         (WebCore::RenderSVGResourceMasker::applySVGMask):
2745         * rendering/svg/RenderSVGResourcePattern.cpp:
2746         (WebCore::RenderSVGResourcePattern::buildPattern):
2747         (WebCore::RenderSVGResourcePattern::createTileImage): Make the modifications
2748         which are needed because of moving the clamping helper methods to ImageBuffer
2749         and because of changing the prototype of SVGRenderingContext methods.
2750
2751         * platform/graphics/filters/FilterEffect.cpp:
2752         (WebCore::FilterEffect::drawingRegionOfInputImage): Consider the clamping
2753         when mapping from absolute coordinates to the ImageBuffer coordinates.
2754
2755         (WebCore::FilterEffect::createImageBufferResult): Apply the same clamping
2756         we do in SVGRenderingContext::createImageBuffer() when creating the 
2757         FilterEffect result ImageBuffer.
2758         
2759         (WebCore::FilterEffect::apply):
2760         (WebCore::FilterEffect::asUnmultipliedImage):
2761         (WebCore::FilterEffect::asPremultipliedImage):
2762         (WebCore::FilterEffect::copyUnmultipliedImage):
2763         (WebCore::FilterEffect::copyPremultipliedImage):
2764         (WebCore::FilterEffect::createUnmultipliedImageResult):
2765         (WebCore::FilterEffect::createPremultipliedImageResult):
2766         (WebCore::FilterEffect::maxFilterArea): Deleted.
2767         (WebCore::FilterEffect::isFilterSizeValid): Deleted.
2768         * platform/graphics/filters/FilterEffect.h: Use the new ImageBuffer clamping
2769         helper methods and delete the local ones.
2770
2771         * platform/graphics/transforms/AffineTransform.cpp:
2772         (WebCore::AffineTransform::scaleNonUniform):
2773         (WebCore::AffineTransform::scale):
2774         (WebCore::AffineTransform::translate):
2775         * platform/graphics/transforms/AffineTransform.h: Add new scale and translate
2776         overloads to AffineTransform.
2777         
2778         * rendering/FilterEffectRenderer.cpp:
2779         (WebCore::FilterEffectRenderer::updateBackingStoreRect):
2780         (WebCore::FilterEffectRendererHelper::beginFilterEffect): Code clean up.
2781         
2782         * rendering/svg/SVGRenderingContext.cpp:
2783         (WebCore::SVGRenderingContext::calculateScreenFontSizeScalingFactor):
2784         (WebCore::SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem):
2785         Return the AffineTransform instead of passing it through the reference of
2786         an argument.
2787         
2788         (WebCore::SVGRenderingContext::createImageBuffer):
2789         (WebCore::SVGRenderingContext::createImageBufferForPattern): Deleted.
2790         Code clean up and method rename.
2791         
2792         (WebCore::SVGRenderingContext::clampedAbsoluteTargetRect): Deleted.
2793         (WebCore::SVGRenderingContext::clampedAbsoluteSize): Deleted.
2794         * rendering/svg/SVGRenderingContext.h: Move the clamping helper methods to
2795         the ImageBuffer class.
2796     
2797 2015-05-07  Beth Dakin  <bdakin@apple.com>
2798
2799         New force-related DOM events should fire in WK1 views
2800         https://bugs.webkit.org/show_bug.cgi?id=144663
2801         -and corresponding-
2802         rdar://problem/20281886
2803
2804         Reviewed by Sam Weinig.
2805
2806         All of the WK1 mouse events need to take the correspondingPressureEvent.
2807         * page/EventHandler.h:
2808
2809         Make correspondingPressureEvent a part of CurrentEventScope. This is needed to 
2810         have accurate pressure information for all of the mouse events in subframes.
2811         * page/mac/EventHandlerMac.mm:
2812         (WebCore::correspondingPressureEventSlot):
2813         (WebCore::EventHandler::correspondingPressureEvent):
2814         (WebCore::CurrentEventScope::CurrentEventScope):
2815         (WebCore::CurrentEventScope::~CurrentEventScope):
2816
2817         These events don’t have an associated pressure, so send nil for the 
2818         correspondingPressureEvent.
2819         (WebCore::EventHandler::wheelEvent):
2820         (WebCore::EventHandler::keyEvent):
2821
2822         Pipe through correspondingPressureEvent.
2823         (WebCore::EventHandler::mouseDown):
2824         (WebCore::EventHandler::mouseDragged):
2825         (WebCore::EventHandler::mouseUp):
2826         (WebCore::EventHandler::mouseMoved):
2827
2828         New function to handle pressure change events.
2829         (WebCore::EventHandler::pressureChange):
2830
2831         Pipe through correspondingPressureEvent.
2832         (WebCore::EventHandler::passMouseMovedEventToScrollbars):
2833         (WebCore::EventHandler::currentPlatformMouseEvent):
2834
2835         Take the correspondingPressureEvent in order to build a PlatformMouseEvent with 
2836         the correct pressure information.
2837         * platform/mac/PlatformEventFactoryMac.h:
2838         * platform/mac/PlatformEventFactoryMac.mm:
2839         (WebCore::globalPointForEvent):
2840         (WebCore::pointForEvent):
2841         (WebCore::mouseButtonForEvent):
2842         (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder):
2843         (WebCore::PlatformEventFactory::createPlatformMouseEvent):
2844
2845 2015-05-06  Roger Fong  <roger_fong@apple.com>
2846
2847         Media Controls: Scrubber should be independent of actual video time, causes scrubber to be jumpy.
2848         https://bugs.webkit.org/show_bug.cgi?id=144700.
2849         <rdar://problem/19997548>
2850
2851         Reviewed by Jer Noble.
2852
2853         Update time and timeline during the timeline input event instead of the wrapper's mousemove.
2854         (Controller.prototype.handleWrapperMouseMove):
2855         (Controller.prototype.handleTimelineMouseMove):
2856         (Controller.prototype.drawTimelineBackground): 
2857
2858         (Controller.prototype.updateControlsWhileScrubbing): 
2859         Updates time and scrubber to reflect timeline user input.
2860
2861 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
2862
2863         Handle meta viewport in HTMLPreloadScanner
2864         https://bugs.webkit.org/show_bug.cgi?id=144640
2865
2866         Reviewed by Dean Jackson.
2867
2868         Add support for the <meta> tag to the HTMLPreloadScanner
2869         and when the meta tag's name is viewport, get the document
2870         to process the tag's attribute value, and set its ViewportArgument.
2871
2872         Tests: fast/dom/HTMLMetaElement/meta-preloader.html
2873
2874         * html/parser/HTMLPreloadScanner.cpp:
2875         (WebCore::TokenPreloadScanner::tagIdFor): Added meta.
2876         (WebCore::TokenPreloadScanner::initiatorFor): Added meta.
2877         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Call document.processViewport is meta viewport encountered.
2878         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
2879         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Keep track of meta viewport tags.
2880         (WebCore::testPreloadScannerViewportSupport): Testing function that makes sure this functionality is working.
2881         * html/parser/HTMLPreloadScanner.h:
2882         * testing/Internals.cpp:
2883         (WebCore::Internals::testPreloaderSettingViewport): Calls the testing function.
2884         * testing/Internals.h:
2885         * testing/Internals.idl:
2886
2887 2015-05-07  Zalan Bujtas  <zalan@apple.com>
2888
2889         REGRESSION (r164449): Subpixel rendering: http://www.apple.com/iphone-6/ "Faster wireless." image displays vertical black line on 1x displays at specific window width.
2890         https://bugs.webkit.org/show_bug.cgi?id=144723
2891         rdar://problem/18307094
2892
2893         Reviewed by Simon Fraser.
2894
2895         This patch ensures that the backing store's graphics layer is always positioned on a device pixel boundary.
2896
2897         While calculating the backing store's graphics layer location, its ancestor layer's compositing bounds is taken into account.
2898         However the compositing bounds is an unsnapped value, so in order to place the graphics layer properly,
2899         we need to pixel align the ancestor compositing bounds before using it to adjust the child's graphics layer position.
2900
2901         Test: compositing/ancestor-compositing-layer-is-on-subpixel-position.html
2902
2903         * rendering/RenderLayerBacking.cpp:
2904         (WebCore::RenderLayerBacking::updateGeometry):
2905
2906 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
2907
2908         Fix sizes crash and add invalid value tests.
2909         https://bugs.webkit.org/show_bug.cgi?id=144739
2910
2911         Reviewed by Darin Adler.
2912
2913         Make sure that only CSS length are allowed when the sizes parser is calling computeLength.
2914         Also make sure that for invalid lengths, the 100vw default is used instead.
2915
2916         Test: fast/dom/HTMLImageElement/sizes/image-sizes-invalids.html
2917
2918         * css/SourceSizeList.cpp:
2919         (WebCore::computeLength):
2920         (WebCore::defaultLength):
2921         (WebCore::parseSizesAttribute):
2922
2923 2015-05-07  Michael Catanzaro  <mcatanzaro@igalia.com>
2924
2925         [GTK] Checks for DEVELOPMENT_BUILD are all wrong
2926         https://bugs.webkit.org/show_bug.cgi?id=144746
2927
2928         Reviewed by Martin Robinson.
2929
2930         Use DEVELOPER_MODE rather than DEVELOPMENT_BUILD.
2931
2932         * platform/gtk/GtkUtilities.cpp:
2933         * platform/gtk/GtkUtilities.h:
2934         * platform/text/gtk/HyphenationLibHyphen.cpp:
2935         (WebCore::availableLocales):
2936
2937 2015-05-07  Simon Fraser  <simon.fraser@apple.com>
2938
2939         Remove the WK1-only code path for independently composited iframes
2940         https://bugs.webkit.org/show_bug.cgi?id=144722
2941
2942         Reviewed by Dean Jackson.
2943
2944         In WebKit1 on Mac, we allowed iframes to be composited independently of their
2945         parent document, relying on the fact that the frame's platform view can host
2946         a layer-backed view. However, this ran into bugs (rdar://problem/18862298),
2947         and triggers the assertion at the end of FrameView::updateLayoutAndStyleIfNeededRecursive(),
2948         because the compositing update after a layout can dirty style in notifyIFramesOfCompositingChange().
2949         
2950         Removing the WK1-only code path solves these problems. It also eliminates the need
2951         to do compositing-specific frame overlap testing.
2952
2953         * page/FrameView.cpp:
2954         (WebCore::FrameView::setIsOverlapped): No need to do compositing-related things here.
2955         Any iframe that gets composited will participate in the normal compositing overlap
2956         testing in its parent frame.
2957         (WebCore::FrameView::hasCompositedContentIncludingDescendants): Deleted.
2958         (WebCore::FrameView::hasCompositingAncestor): Deleted.
2959         * page/FrameView.h:
2960         * rendering/RenderLayerCompositor.cpp: Replace ownerElement() checks in this file
2961         with an isMainFrameCompositor() for readability. Some 0->nullptr.
2962         (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
2963         (WebCore::RenderLayerCompositor::chromeClient):
2964         (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers):
2965         (WebCore::RenderLayerCompositor::updateCompositingLayers):
2966         (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers):
2967         (WebCore::RenderLayerCompositor::updateBacking):
2968         (WebCore::RenderLayerCompositor::layerTreeAsText):
2969         (WebCore::RenderLayerCompositor::frameContentsCompositor):
2970         (WebCore::RenderLayerCompositor::setIsInWindow):
2971         (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame):
2972         (WebCore::RenderLayerCompositor::requiresCompositingForFrame): frameRenderer.requiresAcceleratedCompositing()
2973         already bails on no content RenderView, so the shouldPropagateCompositingToEnclosingFrame() check does
2974         nothing and is removed.
2975         (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer):
2976         (WebCore::RenderLayerCompositor::requiresScrollLayer):
2977         (WebCore::RenderLayerCompositor::documentUsesTiledBacking):
2978         (WebCore::RenderLayerCompositor::isMainFrameCompositor):
2979         (WebCore::RenderLayerCompositor::shouldCompositeOverflowControls):
2980         (WebCore::RenderLayerCompositor::requiresOverhangAreasLayer):
2981         (WebCore::RenderLayerCompositor::requiresContentShadowLayer):
2982         (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea):
2983         (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea):
2984         (WebCore::RenderLayerCompositor::updateLayerForHeader):
2985         (WebCore::RenderLayerCompositor::updateLayerForFooter):
2986         (WebCore::RenderLayerCompositor::ensureRootLayer): Main frame attaches via ChromeClient,
2987         all other frames attach via parent frame.
2988         (WebCore::RenderLayerCompositor::notifyIFramesOfCompositingChange): This call to
2989         scheduleSetNeedsStyleRecalc(SyntheticStyleChange) was the source of dirtying style after
2990         layout, but is no longer needed so remove it.
2991         (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers):
2992         (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers):
2993         (WebCore::RenderLayerCompositor::scrollingCoordinator):
2994         (WebCore::RenderLayerCompositor::graphicsLayerFactory):
2995         (WebCore::RenderLayerCompositor::allowsIndependentlyCompositedFrames): Deleted.
2996         (WebCore::RenderLayerCompositor::shouldPropagateCompositingToEnclosingFrame): Deleted.
2997         (WebCore::RenderLayerCompositor::mainFrameBackingIsTiled): Deleted. This was mis-named;
2998         it really asks whether the document uses tiled backing, but does not check for main frame.
2999         * rendering/RenderLayerCompositor.h:
3000         * rendering/RenderWidget.cpp:
3001         (WebCore::RenderWidget::paintContents): No need to do frame overlap testing for
3002         compositing now.
3003
3004 2015-05-06  Dean Jackson  <dino@apple.com>
3005
3006         Handle backdrop views that have to tile
3007         https://bugs.webkit.org/show_bug.cgi?id=142317
3008         <rdar://problem/20049088>
3009
3010         Reviewed by Simon Fraser.
3011
3012         Take 2 - this was rolled out because Mavericks was crashing.
3013
3014         Make sure backdrop layers don't tile. If they are big
3015         enough, we'll leave it to the platform compositor to handle.
3016
3017         This also fixes a bug where if a layer changed from a backdrop
3018         type to a tiled type, it would still retain its custom appearance
3019         and we'd try to add children to the wrong layer.
3020
3021         Test: compositing/media-controls-bar-appearance-big.html
3022
3023         * platform/graphics/ca/GraphicsLayerCA.cpp:
3024         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
3025         a layer needs a backdrop before checking if it needs to tile.
3026
3027 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
3028
3029         Revert "Introducing the Platform Abstraction Layer (PAL)"
3030         https://bugs.webkit.org/show_bug.cgi?id=144751
3031
3032         Unreviewed.
3033
3034         PAL should be a new target inside WebCore, rather than a top-level folder.
3035
3036         * WebCore.xcodeproj/project.pbxproj:
3037         * Configurations/FeatureDefines.xcconfig:
3038
3039 2015-05-07  Dan Bernstein  <mitz@apple.com>
3040
3041         Tried to fix the build.
3042
3043         * Configurations/WebCoreTestSupport.xcconfig:
3044
3045 2015-05-07  Joanmarie Diggs  <jdiggs@igalia.com>
3046
3047         AX: [ATK] The pre element should be mapped to ATK_ROLE_SECTION; not ATK_ROLE_PANEL
3048         https://bugs.webkit.org/show_bug.cgi?id=144702
3049
3050         Reviewed by Chris Fleizach.
3051
3052         Add a new PreRole AccessibilityRole so that per-platform mapping is possible.
3053         Map PreRole to ATK_ROLE_SECTION for Efl and Gtk; to NSAccessibilityGroupRole
3054         for the Mac. Add PreRole to the list of "text type" ATK roles.
3055
3056         No new tests. Existing tests were updated to reflect the corrected mapping.
3057
3058         * accessibility/AccessibilityObject.h:
3059         * accessibility/AccessibilityRenderObject.cpp:
3060         (WebCore::AccessibilityRenderObject::determineAccessibilityRole):
3061         * accessibility/atk/AccessibilityObjectAtk.cpp:
3062         (WebCore::AccessibilityObject::allowsTextRanges):
3063         * accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
3064         (atkRole):
3065         (roleIsTextType):
3066         * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
3067         (createAccessibilityRoleMap):
3068
3069 2015-05-07  Dan Bernstein  <mitz@apple.com>
3070
3071         <rdar://problem/19317140> [Xcode] Remove usage of AspenFamily.xcconfig in Source/
3072         https://bugs.webkit.org/show_bug.cgi?id=144727
3073
3074         Reviewed by Darin Adler.
3075
3076         * Configurations/Base.xcconfig: Don’t include AspenFamily.xcconfig.
3077         * Configurations/WebCore.xcconfig: For iOS, define INSTALL_PATH in terms of
3078         INSTALL_PATH_PREFIX, and set INSTALL_PATH_PREFIX for the iOS 8.x Simulator.
3079         * Configurations/WebCoreTestSupport.xcconfig: Define INSTALL_PATH in terms of
3080         INSTALL_PATH_PREFIX and INSTALL_PATH_ACTUAL, and define INSTALL_PATH_PREFIX for the iOS 8.x
3081         Simulator.
3082
3083 2015-05-07  Eric Carlson  <eric.carlson@apple.com>
3084
3085         [Mac] Playback target isn't set on new element
3086         https://bugs.webkit.org/show_bug.cgi?id=144724
3087
3088         Reviewed by Jer Noble.
3089
3090         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3091         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3092         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): Call setShouldPlayToPlaybackTarget
3093         if necessary.
3094         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Remember
3095         the setting in case we don't have an AVPlayer yet.
3096
3097 2015-05-07  Yoav Weiss  <yoav@yoav.ws>
3098
3099         Fix <script srcset> being loaded by the preloader.
3100         https://bugs.webkit.org/show_bug.cgi?id=144675
3101
3102         Reviewed by Darin Adler.
3103
3104         Fix HTMLPreloadScanner to make sure that srcset is only loaded
3105         when it is present on an <img>.
3106
3107         Tests: http/tests/loading/preload-script-src.html
3108                http/tests/loading/preload-script-srcset-ignored.html
3109
3110         * html/parser/HTMLPreloadScanner.cpp:
3111         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes):
3112
3113 2015-05-07  Žan Doberšek  <zdobersek@igalia.com>
3114
3115         Add missing type traits specialization for PlatformDisplayWayland
3116         https://bugs.webkit.org/show_bug.cgi?id=144671
3117
3118         Reviewed by Carlos Garcia Campos.
3119
3120         * platform/graphics/wayland/PlatformDisplayWayland.h:
3121         Add missing type traits specialization for the PlatformDisplayWayland
3122         class via the SPECIALIZE_TYPE_TRAITS_PLATFORM_DISPLAY macro.
3123
3124 2015-05-06  Manuel Rego Casasnovas  <rego@igalia.com>
3125
3126         [CSS Grid Layout] Mark grid shorthands as layout dependent
3127         https://bugs.webkit.org/show_bug.cgi?id=144687
3128
3129         Reviewed by Darin Adler.
3130
3131         grid-template and grid shorthands were not marked us layout dependent,
3132         so you can end up calling them before the grid has been laid out and
3133         you'll get a crash at valueForGridTrackList() because of trackPositions
3134         won't be initialized yet.
3135
3136         Tests: fast/css-grid-layout/grid-shorthand-computed-style-crash.html
3137                fast/css-grid-layout/grid-template-shorthand-computed-style-crash.html
3138
3139         * css/CSSComputedStyleDeclaration.cpp:
3140         (WebCore::isLayoutDependent): Add the grid shorthands only if the object
3141         is a RenderGrid as otherwise it's not needed (using the same condition
3142         for grid-template-columns and grid-template-rows properties too).
3143
3144 2015-05-06  Daniel Bates  <dabates@apple.com>
3145
3146         [iOS][WK2] Pause/resume database thread when UIProcess enters/leaves the background
3147         https://bugs.webkit.org/show_bug.cgi?id=144657
3148         <rdar://problem/18894598>
3149
3150         Reviewed by Andy Estes.
3151
3152         Export WebCore functionality to pause and resume the database thread so that we can
3153         make use of this functionality from WebKit2.
3154
3155         * Modules/webdatabase/AbstractDatabaseServer.h:
3156         * Modules/webdatabase/DatabaseManager.cpp:
3157         (WebCore::DatabaseManager::setPauseAllDatabases): Added; turns around and calls DatabaseServer::setPauseAllDatabases().
3158         * Modules/webdatabase/DatabaseManager.h:
3159         * Modules/webdatabase/DatabaseServer.cpp:
3160         (WebCore::DatabaseServer::setPauseAllDatabases): Added; turns around and calls
3161         DatabaseTracker::tracker().setDatabasesPaused() to pause or resume the database thread.
3162         For now, we guard this call with PLATFORM(IOS). We'll look to remove this guard once
3163         we fix <https://bugs.webkit.org/show_bug.cgi?id=144660>.
3164         * Modules/webdatabase/DatabaseServer.h:
3165
3166 2015-05-06  Brent Fulgham  <bfulgham@apple.com>
3167
3168         Scroll-snap points do not handle margins and padding propertly
3169         https://bugs.webkit.org/show_bug.cgi?id=144647
3170         <rdar://problem/20829473>
3171
3172         Reviewed by Simon Fraser.
3173
3174         The calculation of scroll snap points was incorrect because it did not account for margins or padding.
3175         This was fixed by using the "paddingBoxRect" to represent the overall size of the view area, and
3176         subtracting the relevant padding when computing the size of the scroll snap offsets.
3177
3178         Extend testing internals with accessor methods to retrieve string representations of the scroll snap
3179         offsets and scroll snap coordinates computed during layout. These values are used in the new
3180         'css3/scroll-snap/scroll-snap-offsets-and-coordinates.html' test.
3181
3182         New tests:
3183         * css3/scroll-snap/scroll-snap-offsets-and-coordinates.html: Added.
3184         * platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-borders.html: Added.
3185         * platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-padding.html: Added.
3186         * platform/mac-wk2/tiled-drawing/scrolling/scroll-snap/scroll-snap-mandatory-rotated.html: Added.
3187
3188         * css/LengthFunctions.h: Expose the 'valueForLength' method so we can use it in WebCoreTestSupport.
3189         * dom/Node.h: Expose the 'renderBox' method so we can use it in WebCoreTestSupport.
3190         * page/scrolling/AxisScrollSnapOffsets.cpp:
3191         (WebCore::appendChildSnapOffsets): Use 'contentBoxRect' for overall size, so that we don't use padding
3192         as part of our offset calculations.
3193         (WebCore::updateSnapOffsetsForScrollableArea): Ditto.
3194         * rendering/RenderBox.h: Expose 'canBeScrolledAndHasScrollableArea' for use in WebCoreTestSupport.
3195         * rendering/style/RenderStyle.h: Expose 'scrollSnapCoordinates' for use in WebCoreTestSupport.
3196         * testing/Internals.cpp:
3197         (WebCore::appendOffsets): Helper function.
3198         (WebCore::Internals::scrollSnapOffsets): Added.
3199         * testing/Internals.h:
3200         * testing/Internals.idl:
3201
3202 2015-05-06  Myles C. Maxfield  <mmaxfield@apple.com>
3203
3204         Clean up TextRun constructors
3205         https://bugs.webkit.org/show_bug.cgi?id=144712
3206
3207         Reviewed by Zalan Bujtas.
3208
3209         This patch uses constructor forwarding to make TextRun's constructors much simpler. It then
3210         updates the implementations of RenderBlock::constructTextRun() to be more consistent with
3211         TextRun (via using StringViews).
3212
3213         No new tests because there is no behavior change.
3214
3215         * mathml/MathMLMencloseElement.cpp:
3216         (WebCore::MathMLMencloseElement::longDivLeftPadding):
3217         * platform/graphics/TextRun.h:
3218         (WebCore::TextRun::TextRun):
3219         * rendering/RenderBlock.cpp:
3220         (WebCore::RenderBlock::constructTextRun):
3221         (WebCore::constructTextRunInternal): Deleted.
3222         * rendering/RenderBlock.h:
3223         * rendering/RenderEmbeddedObject.cpp:
3224         (WebCore::RenderEmbeddedObject::paintReplaced):
3225         (WebCore::RenderEmbeddedObject::unavailablePluginIndicatorBounds):
3226         (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
3227         * rendering/svg/SVGTextMetricsBuilder.cpp:
3228         (WebCore::SVGTextMetricsBuilder::SVGTextMetricsBuilder):
3229         * platform/win/DragImageWin.cpp:
3230         (WebCore::createDragImageForLink):
3231
3232 2015-05-06  Sungmann Cho  <sungmann.cho@navercorp.com>
3233
3234         Rename URL::copy() to URL::isolatedCopy() to match String.
3235         https://bugs.webkit.org/show_bug.cgi?id=144684
3236
3237         Reviewed by Darin Adler.
3238
3239         No new tests, no behavior change.
3240
3241         * Modules/websockets/WebSocketHandshake.cpp:
3242         (WebCore::WebSocketHandshake::setURL):
3243         (WebCore::WebSocketHandshake::httpURLForAuthenticationAndCookies):
3244         * fileapi/ThreadableBlobRegistry.cpp:
3245         (WebCore::BlobRegistryContext::BlobRegistryContext):
3246         * html/parser/HTMLPreloadScanner.cpp:
3247         (WebCore::TokenPreloadScanner::updatePredictedBaseURL):
3248         * html/parser/HTMLResourcePreloader.h:
3249         (WebCore::PreloadRequest::PreloadRequest):
3250         * html/parser/XSSAuditor.cpp:
3251         (WebCore::XSSAuditor::init):
3252         * platform/CrossThreadCopier.cpp:
3253         (WebCore::URL>::copy):
3254         * platform/URL.cpp:
3255         (WebCore::URL::isolatedCopy):
3256         (WebCore::URL::copy): Deleted.
3257         * platform/URL.h:
3258         (WebCore::URLCapture::URLCapture):
3259         * platform/network/BlobPart.h:
3260         (WebCore::BlobPart::detachFromCurrentThread):
3261         * platform/network/ResourceRequestBase.cpp:
3262         (WebCore::ResourceRequestBase::copyData):
3263         * platform/network/ResourceResponseBase.cpp:
3264         (WebCore::ResourceResponseBase::copyData):
3265         * workers/WorkerThread.cpp:
3266         (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
3267
3268 2015-05-06  Commit Queue  <commit-queue@webkit.org>
3269
3270         Unreviewed, rolling out r183894.
3271         https://bugs.webkit.org/show_bug.cgi?id=144719
3272
3273         crashes on mavericks (Requested by dino on #webkit).
3274
3275         Reverted changeset:
3276
3277         "Handle backdrop views that have to tile"
3278         https://bugs.webkit.org/show_bug.cgi?id=142317
3279         http://trac.webkit.org/changeset/183894
3280
3281 2015-05-06  Jon Lee  <jonlee@apple.com>
3282
3283         CoreTextSPI.h uses wrong version number to denote Yosemite
3284         https://bugs.webkit.org/show_bug.cgi?id=144701
3285
3286         Reviewed by Dean Jackson.
3287
3288         * platform/spi/cocoa/CoreTextSPI.h: Should 101000 not 10100.
3289
3290 2015-05-06  Jon Lee  <jonlee@apple.com>
3291
3292         Expose more font weights for -apple-system
3293         https://bugs.webkit.org/show_bug.cgi?id=144707
3294
3295         Reviewed by Dean Jackson.
3296
3297         Update to platform/mac/fast/text/systemFont.html
3298
3299         * platform/graphics/mac/FontCacheMac.mm:
3300         (WebCore::toNSFontWeight): New static method to map font weights to NSFontWeight constants available on
3301         Yosemite and later.
3302         (WebCore::fontWithFamily): Request the system font with a mapped weight on Yosemite and later.
3303         * platform/spi/mac/NSFontSPI.h: Add [NSFont systemFontWithSize:weight:], and the proper NSFontWeight
3304         constants.
3305
3306 2015-05-06  Dean Jackson  <dino@apple.com>
3307
3308         Handle backdrop views that have to tile
3309         https://bugs.webkit.org/show_bug.cgi?id=142317
3310         <rdar://problem/20049088>
3311
3312         Reviewed by Simon Fraser.
3313
3314         Make sure backdrop layers don't tile. If they are big
3315         enough, we'll leave it to the platform compositor to handle.
3316
3317         This also fixes a bug where if a layer changed from a backdrop
3318         type to a tiled type, it would still retain its custom appearance
3319         and we'd try to add children to the wrong layer.
3320
3321         Test: compositing/media-controls-bar-appearance-big.html
3322
3323         * platform/graphics/ca/GraphicsLayerCA.cpp:
3324         (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Check if
3325         a layer needs a backdrop before checking if it needs to tile.
3326
3327 2015-05-06  Carlos Garcia Campos  <cgarcia@igalia.com> and Per Arne Vollan  <peavo@outlook.com>
3328
3329         [WinCairo] Compile error due to undefined symbols after r183868
3330         https://bugs.webkit.org/show_bug.cgi?id=144692
3331
3332         Reviewed by Alex Christensen.
3333
3334         Speculative build fix. Add dummy PlatformDisplayWin.
3335
3336         * PlatformWinCairo.cmake: Add PlatformDisplay.cpp to compilation.
3337         * platform/graphics/PlatformDisplay.cpp:
3338         (WebCore::PlatformDisplay::createPlatformDisplay):
3339         * platform/graphics/PlatformDisplay.h:
3340         * platform/graphics/win/PlatformDisplayWin.h:
3341         Add stubs to compile.
3342         * WebCore.vcxproj/WebCore.vcxproj
3343         * WebCore.vcxproj/WebCore.vcxproj.filters
3344         Add new files to Windows build.
3345
3346 2015-05-06  David Hyatt  <hyatt@apple.com>
3347
3348         Avoid copies in scrollOffsetForFixedPosition() and inline it.
3349         https://bugs.webkit.org/show_bug.cgi?id=144709
3350
3351         Reviewed by Simon Fraser.
3352
3353         * page/FrameView.cpp:
3354         (WebCore::FrameView::frameScaleFactor):
3355         Added so that scrollOffsetForFixedPosition() can be inlined without having to
3356         reference Frame's implementation.
3357
3358         (WebCore::FrameView::scrollOffsetForFixedPosition): Deleted.
3359         Moved this to the header.
3360
3361         * page/FrameView.h:
3362         Inline scrollOffsetForFixedPosition() and get rid of all the copying
3363         it was doing.
3364
3365 2015-05-06  David Hyatt  <hyatt@apple.com>
3366
3367         RenderLayer::currentTransform computes a pixel snapped rect it doesn't use.
3368         https://bugs.webkit.org/show_bug.cgi?id=144708
3369
3370         Reviewed by Simon Fraser.
3371
3372         * rendering/RenderLayer.cpp:
3373         (WebCore::RenderLayer::currentTransform):
3374
3375         Only compute a pixel snapped rect if we actually end up needing it. The common case
3376         is that this rect is not needed, so pushing it inside the two if statements
3377         speeds up the common case.
3378
3379 2015-05-06  Timothy Horton  <timothy_horton@apple.com>
3380
3381         Fix the build.
3382
3383         * platform/spi/cocoa/QuartzCoreSPI.h:
3384
3385 2015-05-06  David Hyatt  <hyatt@apple.com>
3386
3387         Optimize topLeftLocationOffset() addition in updateLayerPosition
3388         https://bugs.webkit.org/show_bug.cgi?id=144704
3389
3390         Reviewed by Dean Jackson.
3391
3392         * page/FrameView.cpp:
3393         (WebCore::FrameView::FrameView):
3394         * page/FrameView.h:
3395         Move the hasFlippedBlocks bit to FrameView instead of RenderView. Works better for inlining
3396         the check in any renderer header, and it also makes more sense conceptually, since the RenderView
3397         itself could be a flipped block.
3398
3399         * rendering/RenderBox.cpp:
3400         (WebCore::RenderBox::layoutOverflowRectForPropagation):
3401         Change over to the FrameView bit.
3402
3403         * rendering/RenderBox.h:
3404         (WebCore::RenderBox::applyTopLeftLocationOffset):
3405         Add a new inlined function that can apply the top left location offset to a point without
3406         multiple LayoutSize creations and copies. It invokes a helper for flipping that is not
3407         inlined only in the case where actual flipped blocks exist in the render tree.
3408
3409         * rendering/RenderBoxModelObject.cpp:
3410         (WebCore::RenderBoxModelObject::updateFromStyle):
3411         Set the bit on the FrameView now instead of the RenderView.
3412
3413         * rendering/RenderLayer.cpp:
3414         (WebCore::RenderLayer::updateLayerPosition):
3415         Call the new applyTopLeftLocationOffset function so that the point can have offsets added
3416         in without any extra copies.
3417
3418         (WebCore::RenderLayer::calculateClipRects):
3419         * rendering/RenderLineBoxList.cpp:
3420         (WebCore::RenderLineBoxList::rangeIntersectsRect):
3421         Switch over to the bit on the FrameView.
3422
3423         * rendering/RenderView.cpp:
3424         (WebCore::RenderView::RenderView):
3425         * rendering/RenderView.h:
3426         Get rid of the bit on the RenderView.
3427
3428 2015-05-05  Myles C. Maxfield  <mmaxfield@apple.com>
3429
3430         Introducing the Platform Abstraction Layer (PAL)
3431         https://bugs.webkit.org/show_bug.cgi?id=143358
3432
3433         Reviewed by Simon Fraser.
3434
3435         * WebCore.xcodeproj/project.pbxproj: Let the project know about the .a
3436         * Configurations/FeatureDefines.xcconfig: Updated
3437
3438 2015-05-06  Eric Carlson  <eric.carlson@apple.com>
3439
3440         [iOS] remove some unnecessary iOS-only media code
3441         https://bugs.webkit.org/show_bug.cgi?id=144697
3442         <rdar://problem/20229914>
3443
3444         Reviewed by Jer Noble.
3445
3446         * html/HTMLAttributeNames.in: Remove data-youtube-id.
3447
3448         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3449         (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem): Remove dataYouTubeID.
3450
3451 2015-05-06  David Hyatt  <hyatt@apple.com>
3452
3453         Optimize relativePositionOffset() to avoid doing unnecessary work
3454         https://bugs.webkit.org/show_bug.cgi?id=144698
3455
3456         Reviewed by Simon Fraser.
3457
3458         * rendering/RenderBoxModelObject.cpp:
3459         (WebCore::RenderBoxModelObject::relativePositionOffset):
3460
3461         Patch relativePositionOffset to avoid doing unnecessary work in the common case where
3462         all values of top/left/right/bottom are either auto or fixed. We no longer fetch
3463         containingBlock() into a local always, but instead just invoke the function only
3464         when necessary.
3465
3466         Also avoid computing the percentage-relative maximum for the top/right/bottom/left lengths
3467         when they are fixed values, since that maximum won't be examined at all.
3468
3469 2015-05-06  Martin Robinson  <mrobinson@igalia.com>
3470
3471         [FreeType] Vertical CJK glyphs should not be rendered with synthetic oblique
3472         https://bugs.webkit.org/show_bug.cgi?id=144612
3473
3474         Reviewed by Darin Adler.
3475
3476         No new tests. This causes fast/text/international/synthesized-italic-vertical.html to pass.
3477
3478         * platform/graphics/Font.cpp:
3479         (WebCore::Font::nonSyntheticItalicFont): Compile this method for Cairo as well.
3480         * platform/graphics/FontCascadeFonts.cpp:
3481         (WebCore::FontCascadeFonts::glyphDataForSystemFallback): When searching for the system fallback,
3482         ensure that we do not use synthetic oblique when rendering vertical CJK glyphs.
3483         (WebCore::FontCascadeFonts::glyphDataForNormalVariant): Extend the CJK fix to Cairo ports.
3484         * platform/graphics/FontPlatformData.h:
3485         (WebCore::FontPlatformData::setSyntheticOblique): Added this helper method, because
3486         Freetype/Cairo ports needs to be able to recreate the scaled font matrix when the
3487         synthetic oblique settings changes.
3488         * platform/graphics/freetype/FontPlatformData.h: Rename initializeWithFontFace to buildScaledFont.
3489         Remove the now unused m_horizontalOrientationMatrix member.
3490         (WebCore::FontPlatformData::setSyntheticOblique): Added the helper here as well.
3491         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
3492         (WebCore::FontPlatformData::FontPlatformData): Calculate whether or not to use synthetic oblique here,
3493         before buildScaledFont is called. Call buildScaledFont instead of initializeWithFontFace.
3494         (WebCore::FontPlatformData::operator=):
3495         (WebCore::FontPlatformData::buildScaledFont): Renamed from initializeWithFontFace, does
3496         the same thing, except calculate whether or not to use synthetic oblique. Instead just
3497         reads the value.
3498         (WebCore::FontPlatformData::setOrientation): Instead of adjusting the font matrix, recreate
3499         the entire font.
3500         (WebCore::FontPlatformData::setSyntheticOblique): Added.
3501         (WebCore::rotateCairoMatrixForVerticalOrientation): Deleted.
3502         (WebCore::FontPlatformData::initializeWithFontFace): Deleted.
3503
3504 2015-05-06  Alex Christensen  <achristensen@webkit.org>
3505
3506         [Content Extensions] Test splitting NFAs by max NFA size.
3507         https://bugs.webkit.org/show_bug.cgi?id=144659
3508
3509         Reviewed by Darin Adler.
3510
3511         * WebCore.xcodeproj/project.pbxproj:
3512         * contentextensions/CombinedURLFilters.cpp:
3513         (WebCore::ContentExtensions::generateNFAForSubtree):
3514         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
3515         * contentextensions/CombinedURLFilters.h:
3516         * contentextensions/ContentExtensionCompiler.cpp:
3517         (WebCore::ContentExtensions::compileRuleList):
3518         * contentextensions/DFABytecodeCompiler.h:
3519         * contentextensions/DFABytecodeInterpreter.h:
3520         Make maxNFASize a parameter so we can test it with small values.
3521
3522 2015-05-06  Antti Koivisto  <antti@apple.com>
3523
3524         REGRESSION (r183467): Unable to start downloads in private browsing mode
3525         https://bugs.webkit.org/show_bug.cgi?id=144533
3526
3527         Reviewed by Darin Adler.
3528
3529         If willSendRequest delegate mutated the request we would lose the requester field value from the original.
3530
3531         No test runner support for mutating requests.
3532
3533         * platform/network/cf/ResourceRequestCFNet.cpp:
3534         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties):
3535
3536             This needs to keep the requester too.
3537
3538         * platform/network/cocoa/ResourceRequestCocoa.mm:
3539         (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): Deleted.
3540
3541             Share implementations.
3542
3543 2015-05-06  Ryosuke Niwa  <rniwa@webkit.org>
3544
3545         Toggling underline on font panel removes strike through
3546         https://bugs.webkit.org/show_bug.cgi?id=144670
3547         <rdar://problem/3790443>
3548
3549         Reviewed by Darin Adler.
3550
3551         * editing/EditingStyle.cpp:
3552         (WebCore::EditingStyle::EditingStyle): Added a variant that takes CSSStyleDeclaration.
3553         * editing/EditingStyle.h:
3554         (WebCore::EditingStyle::create): Ditto.
3555         * editing/Editor.cpp:
3556         (WebCore::Editor::applyStyleToSelection): Takes Ref<EditingStyle>&& instead of RefPtr<EditingStyle>&&.
3557         * editing/Editor.h:
3558         * editing/EditorCommand.cpp:
3559         (WebCore::applyCommandToFrame): Ditto.
3560         (WebCore::executeStrikethrough):
3561         (WebCore::executeUnderline):
3562
3563 2015-05-06  Jessie Berlin  <jberlin@webkit.org>
3564
3565         More build fixing.
3566
3567         * page/mac/TextIndicatorWindow.mm:
3568
3569 2015-05-06  Jessie Berlin  <jberlin@webkit.org>
3570
3571         32-bit build fix after r183859 and r183860.
3572
3573         * page/mac/TextIndicatorWindow.mm:
3574         Autosynthesis isn't available for our 32-bit builds.
3575
3576 2015-05-06  Carlos Garcia Campos  <cgarcia@igalia.com>
3577
3578         [EGL] Move EGLDisplay handling to PlatformDisplay and remove PlatformDisplay definition from GLDefs.h
3579         https://bugs.webkit.org/show_bug.cgi?id=144685
3580
3581         Reviewed by Martin Robinson.
3582
3583         The EGL display is also initialized in multiple places, and could
3584         be unified in PlatformDisplay. Remove the PlatformDisplay
3585         definition from platform/graphics/opengl/GLDefs.h to avoid conflicts.
3586
3587         * platform/graphics/PlatformDisplay.cpp:
3588         (WebCore::PlatformDisplay::PlatformDisplay): Initialize m_eglDisplay.
3589         (WebCore::PlatformDisplay::~PlatformDisplay): Call terminateEGLDisplay().
3590         (WebCore::PlatformDisplay::eglDisplay): Lazy intialize the EGL
3591         display and return it.
3592         (WebCore::PlatformDisplay::initializeEGLDisplay):
3593         (WebCore::PlatformDisplay::terminateEGLDisplay):
3594         * platform/graphics/PlatformDisplay.h:
3595         * platform/graphics/egl/GLContextEGL.cpp:
3596         (WebCore::sharedEGLDisplay): Use PlatformDisplay::eglDisplay().
3597         * platform/graphics/opengl/GLDefs.h: Remove unneeded definitions.
3598         * platform/graphics/opengl/GLPlatformSurface.cpp:
3599         (WebCore::GLPlatformSurface::GLPlatformSurface): Remove
3600         m_sharedDisplay member, PlatformDisplay::sharedDisplay() can be used instead.
3601         (WebCore::GLPlatformSurface::sharedDisplay): Deleted.
3602         * platform/graphics/opengl/GLPlatformSurface.h:
3603         * platform/graphics/surfaces/egl/EGLConfigSelector.h: Use
3604         EGLDisplay instead of PlatformDisplay.
3605         * platform/graphics/surfaces/egl/EGLContext.cpp:
3606         (WebCore::EGLOffScreenContext::initialize): Use PlatformDisplay::eglDisplay().
3607         * platform/graphics/surfaces/egl/EGLHelper.cpp: Remove the
3608         EGLDisplayConnection clas and use PlatformDisplay instead.
3609         (WebCore::EGLHelper::eglDisplay):
3610         (WebCore::EGLHelper::currentDisplay):
3611         (WebCore::EGLDisplayConnection::EGLDisplayConnection): Deleted.
3612         (WebCore::EGLDisplayConnection::~EGLDisplayConnection): Deleted.
3613         (WebCore::EGLDisplayConnection::display): Deleted.
3614         (WebCore::EGLDisplayConnection::terminate): Deleted.
3615         * platform/graphics/surfaces/egl/EGLHelper.h:
3616         * platform/graphics/surfaces/egl/EGLSurface.cpp:
3617         (WebCore::EGLTransportSurface::EGLTransportSurface): Use EGLHelper::eglDisplay().
3618         (WebCore::EGLTransportSurface::destroy): Ditto.
3619         (WebCore::EGLOffScreenSurface::EGLOffScreenSurface): Ditto.
3620         (WebCore::EGLOffScreenSurface::destroy): Ditto.
3621         * platform/graphics/surfaces/egl/EGLXSurface.cpp:
3622         (WebCore::EGLWindowTransportSurface::EGLWindowTransportSurface):
3623         Use PlatformDisplay::eglDisplay().
3624         (WebCore::EGLWindowTransportSurface::swapBuffers): Ditto.
3625         (WebCore::EGLPixmapSurface::EGLPixmapSurface): Ditto.
3626         * platform/graphics/surfaces/glx/GLXContext.cpp:
3627         (WebCore::GLXOffScreenContext::initialize): Use X11Helper::nativeDisplay().
3628         * platform/graphics/surfaces/glx/GLXSurface.cpp:
3629         (WebCore::GLXTransportSurface::GLXTransportSurface): Do not use m_sharedDisplay.
3630         (WebCore::GLXOffScreenSurface::initialize): Ditto.
3631         * platform/graphics/wayland/PlatformDisplayWayland.cpp:
3632         (WebCore::PlatformDisplayWayland::PlatformDisplayWayland): Call
3633         PlatformDisplay::initializeEGLDisplay() to insialize the EGL display.
3634         * platform/graphics/wayland/PlatformDisplayWayland.h:
3635         * platform/graphics/x11/PlatformDisplayX11.cpp:
3636         (WebCore::PlatformDisplayX11::initializeEGLDisplay): Override
3637         PlatformDisplay::initializeEGLDisplay() to initialize the
3638         m_eglDisplay member.
3639         * platform/graphics/x11/PlatformDisplayX11.h:
3640
3641 2015-05-06  Joseph Pecoraro  <pecoraro@apple.com>
3642
3643         Web Inspector: DOMStorage exception and issue with sessionStorage
3644         https://bugs.webkit.org/show_bug.cgi?id=144646
3645
3646         Reviewed by Timothy Hatcher.
3647
3648         * inspector/InspectorDOMStorageAgent.cpp:
3649         (WebCore::InspectorDOMStorageAgent::findStorageArea):
3650         Return session storage if the identifier says not local storage.
3651
3652 2015-05-06  Xabier Rodriguez Calvar  <calvaris@igalia.com> and Youenn Fablet  <youenn.fablet@crf.canon.fr>
3653
3654         Move ReadableStreamJSSource.h/.cpp to ReadableJSStream.h/.cpp
3655         https://bugs.webkit.org/show_bug.cgi?id=144567
3656
3657         Reviewed by Darin Adler.
3658
3659         In addition to renaming ReadableStreamJSSource.h/.cpp, ReadableStreamJSSource is now made a private class of
3660         ReadableJSStream, called ReadableJSStream::Source.
3661         Made some minor refactoring (passing some ExecState by ref and not by pointer).
3662         No functional change, existing tests cover the changes.
3663
3664         * bindings/js/JSReadableStreamCustom.cpp:
3665         * bindings/js/ReadableJSStream.cpp:
3666         (WebCore::ReadableJSStream::Source::create):
3667         (WebCore::ReadableJSStream::Source::Source):
3668         (WebCore::ReadableJSStream::Source::~Source):
3669         (WebCore::ReadableJSStream::Source::globalObject):
3670         (WebCore::ReadableJSStream::Source::start):
3671         (WebCore::ReadableJSStream::create):
3672         (WebCore::ReadableJSStream::ReadableJSStream):
3673         * bindings/js/ReadableJSStream.h:
3674
3675 2015-05-05  Tim Horton  <timothy_horton@apple.com>
3676
3677         REGRESSION (r183517): Yellow find-in-page highlight gets stuck forever
3678         https://bugs.webkit.org/show_bug.cgi?id=144651
3679         <rdar://problem/20755722>
3680
3681         * page/mac/TextIndicatorWindow.mm:
3682         Fix an incorrectly-applied review comment.
3683
3684 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
3685
3686         REGRESSION (r183517): Yellow find-in-page highlight gets stuck forever
3687         https://bugs.webkit.org/show_bug.cgi?id=144651
3688         <rdar://problem/20755722>
3689
3690         Reviewed by Dan Bernstein.
3691
3692         * page/mac/TextIndicatorWindow.h:
3693         * page/mac/TextIndicatorWindow.mm:
3694         (WebCore::TextIndicatorWindow::clearTextIndicator):
3695         (WebCore::TextIndicatorWindow::setTextIndicator):
3696         (WebCore::TextIndicatorWindow::closeWindow):
3697         (WebCore::TextIndicatorWindow::startFadeOut):
3698         We can't keep m_fadingOut on TextIndicatorWindow, since it is reused.
3699         Keep it on the WebTextIndicatorView instead.
3700
3701 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
3702
3703         Add missing vtable override specifiers under Source/WebCore/html
3704         https://bugs.webkit.org/show_bug.cgi?id=144578
3705
3706         Reviewed by Daniel Bates.
3707
3708         Update virtual method overrides under Source/WebCore/html
3709         which are missing the override specifier.
3710
3711         * html/canvas/WebGL2RenderingContext.h:
3712         * html/canvas/WebGLRenderingContext.h:
3713         * html/track/InbandTextTrack.h:
3714         * html/track/TrackListBase.h:
3715
3716 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
3717
3718         Add missing vtable override specifiers under Source/WebCore/rendering
3719         https://bugs.webkit.org/show_bug.cgi?id=144570
3720
3721         Reviewed by Darin Adler.
3722
3723         Update virtual method overrides under Source/WebCore/rendering
3724         which are missing the override specifiers.
3725
3726         * rendering/InlineTextBox.h:
3727         (WebCore::InlineTextBox::calculateBoundaries): Deleted.
3728         * rendering/RenderFlowThread.h:
3729         * rendering/RenderMedia.h:
3730         (WebCore::RenderMedia::shadowControlsNeedCustomLayoutMetrics): Deleted.
3731         * rendering/RenderMultiColumnSet.h:
3732         * rendering/RenderRegion.h:
3733         * rendering/RenderRegionSet.h:
3734         * rendering/RenderThemeGtk.h:
3735         * rendering/mathml/RenderMathMLOperator.h:
3736         * rendering/svg/RenderSVGBlock.h:
3737
3738 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
3739
3740         Add missing vtable override specifiers under Source/WebCore/Modules
3741         https://bugs.webkit.org/show_bug.cgi?id=144569
3742
3743         Reviewed by Darin Adler.
3744
3745         Update virtual method overrides under Source/WebCore/Modules
3746         which are missing the override specifier.
3747
3748         * Modules/mediasource/SourceBuffer.h:
3749         * Modules/mediastream/MediaStreamTrack.h:
3750         * Modules/mediastream/RTCVoidRequestImpl.h:
3751         * Modules/webaudio/AudioContext.h:
3752         (WebCore::AudioContext::mediaType): Deleted.
3753         (WebCore::AudioContext::presentationType): Deleted.
3754         (WebCore::AudioContext::canReceiveRemoteControlCommands): Deleted.
3755         (WebCore::AudioContext::didReceiveRemoteControlCommand): Deleted.
3756         (WebCore::AudioContext::overrideBackgroundPlaybackRestriction): Deleted.
3757         * Modules/webaudio/MediaStreamAudioDestinationNode.h:
3758         * Modules/webaudio/MediaStreamAudioSourceNode.h:
3759         * Modules/webaudio/WaveShaperDSPKernel.h:
3760         * Modules/websockets/WebSocketChannel.h:
3761         (WebCore::WebSocketChannel::refThreadableWebSocketChannel): Deleted.
3762         (WebCore::WebSocketChannel::derefThreadableWebSocketChannel): Deleted.
3763         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
3764         (WebCore::WorkerThreadableWebSocketChannel::refThreadableWebSocketChannel): Deleted.
3765         (WebCore::WorkerThreadableWebSocketChannel::derefThreadableWebSocketChannel): Deleted.
3766
3767 2015-05-05  Žan Doberšek  <zdobersek@igalia.com>
3768
3769         EventHandler::m_eventHandlerWillResetCapturingMouseEventsElement is incorrectly initialized
3770         https://bugs.webkit.org/show_bug.cgi?id=144583
3771
3772         Reviewed by Daniel Bates.
3773
3774         * page/EventHandler.cpp:
3775         (WebCore::EventHandler::EventHandler): The
3776         m_eventHandlerWillResetCapturingMouseEventsElement is a boolean,
3777         so initialize it to false, instead of to nullptr.
3778
3779 2015-05-05  Manuel Rego Casasnovas  <rego@igalia.com>
3780
3781         [CSS Grid Layout] grid-template-areas should accept none value
3782         https://bugs.webkit.org/show_bug.cgi?id=144624
3783
3784         Reviewed by Darin Adler.
3785
3786         Default value for grid-template-areas property is "none":
3787         http://dev.w3.org/csswg/css-grid/#propdef-grid-template-areas
3788
3789         Currently if you set the property to "none" from JavaScript, the value
3790         doesn't get reseted and it keeps the old value.
3791
3792         Update fast/css-grid-layout/grid-template-areas-get-set.html adding a
3793         new test case.
3794
3795         * css/CSSParser.cpp:
3796         (WebCore::CSSParser::parseGridTemplateAreas): Add support to parse
3797         "none" successfully.
3798
3799 2015-05-05  Zalan Bujtas  <zalan@apple.com>
3800
3801         Remove unused RenderLayerBacking::hasContentsLayer().
3802         https://bugs.webkit.org/show_bug.cgi?id=144658
3803
3804         Reviewed by Simon Fraser.
3805
3806         No change in functionality.
3807
3808         * rendering/RenderLayerBacking.h:
3809
3810 2015-05-05  Alex Christensen  <achristensen@webkit.org>
3811
3812         [Content Extensions] Limit NFA size.
3813         https://bugs.webkit.org/show_bug.cgi?id=144649
3814
3815         Reviewed by Benjamin Poulain.
3816
3817         * contentextensions/CombinedURLFilters.cpp:
3818         (WebCore::ContentExtensions::generateNFAForSubtree):
3819         (WebCore::ContentExtensions::CombinedURLFilters::processNFAs):
3820         Add a maximum NFA size to ensure that we do not use too much memory when compiling.
3821         * contentextensions/ContentExtensionCompiler.cpp:
3822         (WebCore::ContentExtensions::compileRuleList):
3823         Remove debugging code that doesn't compile any more.
3824
3825 2015-05-05  Roger Fong  <roger_fong@apple.com>
3826
3827         Unreviewed. Some assertion failures in compositing code after r183820.
3828         https://bugs.webkit.org/show_bug.cgi?id=144630.
3829
3830         * rendering/RenderLayerCompositor.cpp:
3831         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
3832
3833 2015-05-05  Timothy Horton  <timothy_horton@apple.com>
3834
3835         Add a layout mode for computing fixed layout size from a minimum size
3836         https://bugs.webkit.org/show_bug.cgi?id=144610
3837         <rdar://problem/19790341>
3838
3839         Reviewed by Simon Fraser.
3840
3841         * platform/spi/cocoa/QuartzCoreSPI.h:
3842         Add some SPI.
3843
3844 2015-05-05  Brent Fulgham  <bfulgham@apple.com>
3845
3846         iOS] Scroll snap points trigger reentrant layout
3847         https://bugs.webkit.org/show_bug.cgi?id=144644
3848         <rdar://problem/20366547>
3849
3850         Reviewed by Simon Fraser.
3851
3852         Covered by scroll-snap-mandatory.html test.
3853
3854         We had an iOS code path in 'appendChildSnapOffsets' that used offsetLeft and offsetTop. This code
3855         was sometimes called during layout, which triggered a reentrant layout call, resulting in a debug
3856         assertion.
3857
3858         * page/scrolling/AxisScrollSnapOffsets.cpp:
3859         (WebCore::appendChildSnapOffsets): Remove iOS codepath.
3860
3861 2015-05-05  Roger Fong  <roger_fong@apple.com>
3862
3863         Blurry media control icons on non retina displays.
3864         https://bugs.webkit.org/show_bug.cgi?id=144638.
3865         <rdar://problem/20526166>
3866
3867         Reviewed by Dean Jackson.
3868
3869         * Modules/mediacontrols/mediaControlsApple.css:
3870         Adjust fullscreen buttons so that they look good on both 1x and 2x displays.
3871         (audio::-webkit-media-controls-fullscreen-button):
3872         (audio::-webkit-media-controls-fullscreen-button.exit):
3873         (audio::-webkit-media-controls-fullscreen-button:active):
3874         (audio::-webkit-media-controls-panel button.exit:active):
3875         Handle wireless playback picker button background in mediaControlsApple.js
3876         (audio::-webkit-media-controls-wireless-playback-picker-button):
3877         (audio::-webkit-media-controls-wireless-playback-picker-button.playing): Deleted.
3878
3879         * Modules/mediacontrols/mediaControlsApple.js:
3880         Update wireless playback picker button based on display type.
3881         (Controller.prototype.UIString):
3882         (Controller.prototype.handleReadyStateChange):
3883         (Controller.prototype.updateWirelessTargetPickerButton):
3884         (Controller.prototype.updateWirelessPlaybackStatus):
3885
3886 2015-05-05  Joseph Pecoraro  <pecoraro@apple.com>
3887
3888         Web Inspector: Crash under WebCore::domWindowFromExecState reloading page with inspector open
3889         https://bugs.webkit.org/show_bug.cgi?id=144636
3890
3891         Reviewed by Mark Lam.
3892
3893         This ensures we create an InjectedScript for the execution context
3894         (frame) preventing the global object / exec state from getting garbage
3895         collected before we remove it from our map.
3896
3897         * inspector/PageRuntimeAgent.cpp:
3898         (WebCore::PageRuntimeAgent::notifyContextCreated):
3899
3900 2015-05-05  Dean Jackson  <dino@apple.com>
3901
3902         [iOS] AirPlay placeholder in inline videos uses Helvetica or Times, should be system font
3903         https://bugs.webkit.org/show_bug.cgi?id=144643
3904
3905         Reviewed by Brent Fulgham.
3906
3907         The Airplay placard should use "-apple-system" as a font-family.
3908
3909         * Modules/mediacontrols/mediaControlsiOS.css:
3910         (audio::-webkit-media-controls-wireless-playback-status):
3911
3912 2015-05-05  Zalan Bujtas  <zalan@apple.com>
3913
3914         Navigating to www.apple.com hits assertion in WebCore::TextIteratorCopyableText::set()
3915         https://bugs.webkit.org/show_bug.cgi?id=144629
3916         rdar://problem/20689877
3917
3918         Reviewed by Andreas Kling.
3919
3920         This patch ensures that we don't emit empty text for the text iterator.
3921         In TextIterator::handleTextNode before emitting a string, certain characters (\n \t) need to
3922         be replaced with space. When such character is found, we emit the string we've processed so far and
3923         handle the replacement during the next callback.
3924         When the first character in the string needs replacing, there's nothing to emit. However if we don't
3925         handle at least one character, TextIterator::advance believes that processing is done and never calls  
3926         TextIterator::handleTextNode back with the rest of the string. 
3927
3928         Test: fast/text/simple-line-layout-innerText-with-newline.html
3929
3930         * editing/TextIterator.cpp:
3931         (WebCore::isNewLineOrTabCharacter):
3932         (WebCore::TextIterator::handleTextNode):
3933
3934 2015-05-05  Alex Christensen  <achristensen@webkit.org>
3935
3936         [Content Extensions] Use less memory to store the json input.
3937         https://bugs.webkit.org/show_bug.cgi?id=144604
3938
3939         Reviewed by Benjamin Poulain.
3940
3941         * contentextensions/ContentExtensionCompiler.cpp:
3942         (WebCore::ContentExtensions::compileRuleList):
3943         * contentextensions/ContentExtensionCompiler.h:
3944         (WebCore::ContentExtensions::loadEncodedRules):
3945         Don't copy strings as much or keep them alive after done using them.
3946
3947 2015-05-05  Eric Carlson  <eric.carlson@apple.com>
3948
3949         Prevent recursive calls to show target picker menu.
3950         https://bugs.webkit.org/show_bug.cgi?id=144637
3951         <rdar://problem/20824726>
3952
3953         Reviewed by Jer Noble.
3954
3955         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: Add m_showingMenu.
3956         * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
3957         (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Do nothing if the menu
3958         is already showing.
3959
3960 2015-05-05  Dean Jackson  <dino@apple.com>
3961
3962         Use system blue for Airplay Glyph
3963         https://bugs.webkit.org/show_bug.cgi?id=144614
3964
3965         There was a typo in the last commit.
3966
3967         * Modules/mediacontrols/mediaControlsiOS.css:
3968         (audio::-webkit-media-controls-optimized-fullscreen-button): Transition duration should be 250ms.
3969
3970 2015-05-04  Dean Jackson  <dino@apple.com>
3971
3972         [iOS] Use system blue for Airplay Glyph
3973         https://bugs.webkit.org/show_bug.cgi?id=144614
3974
3975         Reviewed by Eric Carlson.
3976
3977         Revert to using masks for the glyphs in the media controls,
3978         which allows us to:
3979         - use the system blue color when Airplay is active <rdar://problem/20245297>
3980         - fade out from the active state <rdar://problem/20245487>
3981         - allow the play button to give touch feedback <rdar://problem/17849930>
3982
3983         While those are three separate bugs, they all get addressed by
3984         this single change.
3985
3986         * Modules/mediacontrols/mediaControlsiOS.css:
3987         (audio::-webkit-media-controls-optimized-fullscreen-button):
3988         (audio::-webkit-media-controls-optimized-fullscreen-button:active):
3989         (video::-webkit-media-controls-play-button):
3990         (video::-webkit-media-controls-play-button.paused):
3991         (video::-webkit-media-controls-fullscreen-button):
3992         (video::-webkit-media-controls-wireless-playback-picker-button):
3993         (video::-webkit-media-controls-wireless-playback-picker-button.playing):
3994         (video::-webkit-media-controls-optimized-fullscreen-button):
3995         (video::-webkit-media-controls-play-button:active): Deleted.
3996         (video::-webkit-media-controls-play-button.paused:active): Deleted.
3997         (video::-webkit-media-controls-fullscreen-button:active): Deleted.
3998         (video::-webkit-media-controls-wireless-playback-picker-button:active): Deleted.
3999
4000 2015-05-05  Eric Carlson  <eric.carlson@apple.com>
4001
4002         Only autoplay videos should not automatically play to playback target
4003         https://bugs.webkit.org/show_bug.cgi?id=144633
4004
4005         Reviewed by Jer Noble.
4006
4007         * html/HTMLMediaElement.cpp:
4008         (WebCore::HTMLMediaElement::HTMLMediaElement): Set RequireUserGestureToAutoplayToExternalDevice.
4009         (WebCore::HTMLMediaElement::removeBehaviorsRestrictionsAfterFirstUserGesture): Remove
4010         RequireUserGestureToAutoplayToExternalDevice.
4011         (WebCore::HTMLMediaElement::mediaState): Set ExternalDeviceAutoPlayCandidate if playback
4012         was started from a user gesture, even if the video loops and/or doesn't have audio.
4013
4014         * html/HTMLMediaSession.h: Define RequireUserGestureToAutoplayToExternalDevice.
4015         (WebCore::HTMLMediaSession::hasBehaviorRestriction): New.
4016
4017 2015-05-05  Brent Fulgham  <bfulgham@apple.com>
4018
4019         Unreviewed logging fix.
4020
4021         * page/WheelEventTestTrigger.cpp:
4022         (WebCore::WheelEventTestTrigger::triggerTestTimerFired): Fix typo in logging channel.
4023
4024 2015-05-04  Roger Fong  <roger_fong@apple.com>
4025
4026         Media control volume slider is opaque.
4027         https://bugs.webkit.org/show_bug.cgi?id=144470.
4028         <rdar://problem/20770350>