Text bounding box computation for simple line layout is wrong
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-04-20  Antti Koivisto  <antti@apple.com>
2
3         Text bounding box computation for simple line layout is wrong
4         https://bugs.webkit.org/show_bug.cgi?id=131912
5
6         Reviewed by Andreas Kling.
7
8         Top-left is currently the first line top-left which is not always correct.
9
10         * WebCore.exp.in:
11         * rendering/RenderText.cpp:
12         (WebCore::RenderText::firstRunLocation):
13         (WebCore::RenderText::firstRunOrigin): Deleted.
14         (WebCore::RenderText::firstRunX): Deleted.
15         (WebCore::RenderText::firstRunY): Deleted.
16         
17             Keep just one accessor and rename it.
18             Encapsulate the line box and simple line versions.
19
20         * rendering/RenderText.h:
21         * rendering/RenderTextLineBoxes.cpp:
22         (WebCore::RenderTextLineBoxes::firstRunLocation):
23
24             Line box version.
25
26         * rendering/RenderTextLineBoxes.h:
27         * rendering/RenderTreeAsText.cpp:
28         
29             Simplify RenderText dumping.
30
31         (WebCore::RenderTreeAsText::writeRenderObject):
32         * rendering/SimpleLineLayoutFunctions.cpp:
33         (WebCore::SimpleLineLayout::computeTextBoundingBox):
34         
35             Return the correct x position.
36
37         (WebCore::SimpleLineLayout::computeTextFirstRunLocation):
38         
39             Simple line version.
40
41         * rendering/SimpleLineLayoutFunctions.h:
42         * rendering/svg/SVGRenderTreeAsText.cpp:
43         (WebCore::writeSVGInlineText):
44
45 2014-04-19  Zalan Bujtas  <zalan@apple.com>
46
47         Subpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
48         https://bugs.webkit.org/show_bug.cgi?id=131466
49
50         Reviewed by Simon Fraser.
51
52         Fractional pixel clipping can produce cruft on RenderLayers. Since RenderLayer
53         sizing and painting are snapped, painting clip rect needs to be snapped the same way.
54
55         Test: fast/clip/clip-when-rect-has-fractional-pixel-value.html
56
57         * rendering/RenderLayer.cpp:
58         (WebCore::RenderLayer::clipToRect):
59
60 2014-04-19  Brent Fulgham  <bfulgham@apple.com>
61
62         Latched scrolling may interact badly with custom programmatic scrolling
63         https://bugs.webkit.org/show_bug.cgi?id=131869
64         <rdar://problem/16249557>
65
66         Reviewed by Darin Adler.
67
68         * dom/Element.cpp:
69         (WebCore::Element::setScrollLeft): Mark scrollable area as having
70         been scrolled programmatically.
71         (WebCore::Element::setScrollTop): Ditto.
72         * page/EventHandler.cpp:
73         (WebCore::EventHandler::handleWheelEvent): Check for programmatic scroll, and
74         clear latched state if the handler manually scrolled. Clear programmatic
75         scroll state at the end of event handling.
76         (WebCore::EventHandler::clearLatchedState): Refactored code.
77         * page/EventHandler.h:
78         * page/mac/EventHandlerMac.mm:
79         (WebCore::EventHandler::platformPrepareForWheelEvents): Check
80         if scrollable area was scrolled programmatically. If it was, do
81         not honor latching behavior.
82         * platform/ScrollableArea.cpp:
83         (WebCore::ScrollableArea::ScrollableArea): Initialize new member.
84         * platform/ScrollableArea.h:
85         (WebCore::ScrollableArea::isScrolledProgrammatically): Added.
86         (WebCore::ScrollableArea::setScrolledProgrammatically): Added.
87
88 2014-04-19  Chris Fleizach  <cfleizach@apple.com>
89
90         AX: grid rows are not recognized do to lack of explicit role="row", role="gridcell"
91         https://bugs.webkit.org/show_bug.cgi?id=131819
92
93         Reviewed by Darin Adler.
94
95         Test: accessibility/table-with-missing-aria-role-rows.html
96
97         If a table is using role="grid", and it has <tr> elements that do not have
98         role="row", we should still treat them as row elements.
99
100         * accessibility/AccessibilityARIAGrid.cpp:
101         (WebCore::AccessibilityARIAGrid::addTableCellChild):
102
103 2014-04-19  Chris Fleizach  <cfleizach@apple.com>
104
105         AX: Malformed tables exposing incorrect col and colSpans
106         https://bugs.webkit.org/show_bug.cgi?id=131796
107
108         Reviewed by Darin Adler.
109
110         Test: accessibility/table-incorrect-colspan-cell.html
111
112         When a developer has specified malformed colspans, accessibility is reporting those values instead of the effective column information.
113
114         * accessibility/AccessibilityTableCell.cpp:
115         (WebCore::AccessibilityTableCell::columnIndexRange):
116
117 2014-04-19  Benjamin Poulain  <bpoulain@apple.com>
118
119         Make the CSS JIT compile for ARM64
120         https://bugs.webkit.org/show_bug.cgi?id=131834
121
122         Reviewed by Gavin Barraclough.
123
124         Add the CPU specific code required to compile SelectorCompiler on ARM64.
125         The code is absolutely non-functional, it would crash immediately, but it compiles.
126
127         * cssjit/FunctionCall.h:
128         (WebCore::FunctionCall::FunctionCall):
129         (WebCore::FunctionCall::callAndBranchOnCondition):
130         * cssjit/RegisterAllocator.h:
131         What am I supposed to do with all those registers? There are so many of them :)
132         The array calleeSavedRegisters is defined for compatibility but it cannot be reached at the moment.
133
134         (WebCore::RegisterAllocator::isValidRegister):
135         * cssjit/SelectorCompiler.cpp:
136         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
137         Implement modulo by doing dividend - (divisor * int(dividend/divisor)).
138
139         * cssjit/StackAllocator.h:
140         StackAllocator will need a small redesign to handle the 16 bytes alligned stack of
141         ARM64.
142         The code has been modified to build but it is pretty useless.
143
144         (WebCore::StackAllocator::allocateUninitialized):
145         (WebCore::StackAllocator::push):
146         (WebCore::StackAllocator::pop):
147         (WebCore::StackAllocator::popAndDiscard):
148         (WebCore::StackAllocator::popAndDiscardUpTo):
149         (WebCore::StackAllocator::alignStackPreFunctionCall):
150         (WebCore::StackAllocator::unalignStackPostFunctionCall):
151
152 2014-04-19  Simon Fraser  <simon.fraser@apple.com>
153
154         [UI-side compositing] Implement blend modes
155         https://bugs.webkit.org/show_bug.cgi?id=131891
156         <rdar://problem/16490085>
157
158         Reviewed by Tim Horton.
159
160         Implement blend modes with UI-side compositing.
161         
162         PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in
163         PlatformCALayerMac and PlatformCALayerRemote.
164         PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform
165         layer, so it can be called from the UI process on a CALayer*.
166         
167         Fix an issue with GraphicsLayerCA::LayerChange flags. 1 << 31 shifts
168         a signed integer, so it ended up setting all the high bits in m_uncommittedChanges,
169         causing us to push blend modes to the UI process for every layer. Fix by shifting
170         an unsigned long long (1LLU << 31). This should also fix a build warning on Windows.
171
172         * WebCore.exp.in:
173         * platform/graphics/ca/GraphicsLayerCA.h:
174         * platform/graphics/ca/PlatformCAFilters.h:
175         * platform/graphics/ca/PlatformCALayer.h:
176         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
177         (PlatformCAFilters::setBlendingFiltersOnLayer):
178         * platform/graphics/ca/mac/PlatformCALayerMac.h:
179         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
180         (PlatformCALayerMac::setFilters):
181         (PlatformCALayerMac::setBlendMode):
182         (PlatformCALayer::setBlendMode): Deleted.
183
184 2014-04-19  Joseph Pecoraro  <pecoraro@apple.com>
185
186         Fix AVPlayerController leak on pages with video
187         https://bugs.webkit.org/show_bug.cgi?id=131878
188
189         Reviewed by Eric Carlson.
190
191         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
192         (-[WebAVPlayerController init]):
193         Assigning to the retain property will increment the count,
194         so balance the alloc with an autorelease.
195
196 2014-04-19  Andreas Kling  <akling@apple.com>
197
198         Slap ALWAYS_INLINE on Element attribute lookup things.
199         <https://webkit.org/b/131892>
200
201         Most of the "inline" helpers for setting/getting attributes were not
202         actually getting inlined by the compiler, so let's make that happen.
203
204         Reviewed by Geoffrey Garen.
205
206         * dom/Element.cpp:
207         (WebCore::Element::synchronizeAttribute):
208         * dom/ElementData.h:
209         (WebCore::ElementData::findAttributeByName):
210         (WebCore::ElementData::findAttributeIndexByName):
211
212 2014-04-19  Darin Adler  <darin@apple.com>
213
214         Telephone number detection should respect its setting consistently
215         https://bugs.webkit.org/show_bug.cgi?id=131893
216         rdar://problem/16597639
217
218         Reviewed by Tim Horton.
219
220         * editing/Editor.cpp:
221         (WebCore::Editor::respondToChangedSelection): Only start the timer
222         if shouldDetectTelephoneNumbers returns true.
223         (WebCore::Editor::shouldDetectTelephoneNumbers): Added. Calls both
224         isTelephoneNumberParsingEnabled and TelephoneNumberDetector::isSupported.
225         (WebCore::Editor::scanSelectionForTelephoneNumbers): Use
226         shouldDetectTelephoneNumbers.
227         (WebCore::Editor::clearDataDetectedTelephoneNumbers): Use document()
228         instead of m_frame.document().
229
230         * editing/Editor.h: Added declaration of shouldDetectTelephoneNumbers.
231
232 2014-04-19  Andrei Bucur  <abucur@adobe.com>
233
234         [CSS Regions] Harden the layout in case there are no regions
235         https://bugs.webkit.org/show_bug.cgi?id=131517
236
237         Reviewed by Mihnea Ovidenie.
238
239         The patch fixes the cases when the content of a flow thread is not
240         properly invalidated when all the regions of its chain are removed.
241
242         Test: fast/regions/simplified-layout-no-regions.html
243
244         * rendering/RenderFlowThread.cpp:
245         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
246         * rendering/RenderRegion.cpp:
247         (WebCore::RenderRegion::ensureOverflowForBox):
248
249 2014-04-19  Zalan Bujtas  <zalan@apple.com>
250
251         https://bugs.webkit.org/show_bug.cgi?id=131594
252         Subpixel rendering: WK1: Wrong repaint rect is calculated when layer has non-compositing transform.
253
254         Reviewed by Simon Fraser.
255
256         We need to snap the repaint rect for transformed object the same way when we paint them.
257
258         Test: fast/repaint/hidpi-wrong-repaint-rect-when-parent-has-noncompositing-transform.html
259
260         * rendering/RenderBox.cpp:
261         (WebCore::RenderBox::computeRectForRepaint):
262
263 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
264
265         Use 'override' in GraphicsLayerCA
266         https://bugs.webkit.org/show_bug.cgi?id=131882
267
268         Reviewed by Tim Horton.
269
270         Add 'override' to all overridden functions. Found a few that need
271         not have been virtual. Removed "allowTiledLayer" stuff that was
272         never called.
273
274         * WebCore.exp.in:
275         * platform/graphics/ca/GraphicsLayerCA.cpp:
276         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
277         (WebCore::GraphicsLayerCA::requiresTiledLayer):
278         (WebCore::GraphicsLayerCA::setAllowTiledLayer): Deleted.
279         * platform/graphics/ca/GraphicsLayerCA.h:
280         (WebCore::GraphicsLayerCA::platformCALayer):
281         (WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
282         (WebCore::GraphicsLayerCA::allowTiledLayer): Deleted.
283         (WebCore::GraphicsLayerCA::isGraphicsLayerCA): Deleted.
284         (WebCore::GraphicsLayerCA::platformCALayerLayoutSublayersOfLayer): Deleted.
285         (WebCore::GraphicsLayerCA::platformCALayerRespondsToLayoutChanges): Deleted.
286         (WebCore::GraphicsLayerCA::platformCALayerContentsOrientation): Deleted.
287         (WebCore::GraphicsLayerCA::platformCALayerShowDebugBorders): Deleted.
288         (WebCore::GraphicsLayerCA::platformCALayerIncrementRepaintCount): Deleted.
289         (WebCore::GraphicsLayerCA::platformCALayerContentsOpaque): Deleted.
290         (WebCore::GraphicsLayerCA::platformCALayerDrawsContent): Deleted.
291         (WebCore::GraphicsLayerCA::platformCALayerLayerDidDisplay): Deleted.
292
293 2014-04-18  Timothy Hatcher  <timothy@apple.com>
294
295         Web Inspector: Move InspectorProfilerAgent to JavaScriptCore
296         https://bugs.webkit.org/show_bug.cgi?id=131673
297
298         Passes existing profiler and inspector tests.
299
300         Reviewed by Joseph Pecoraro.
301
302         * CMakeLists.txt:
303         * DerivedSources.make:
304         * ForwardingHeaders/inspector/agents/InspectorProfilerAgent.h: Added.
305         * WebCore.exp.in:
306         * WebCore.vcxproj/WebCore.vcxproj:
307         * WebCore.vcxproj/WebCore.vcxproj.filters:
308         * WebCore.xcodeproj/project.pbxproj:
309         * bindings/js/ScriptProfile.cpp: Removed.
310         * bindings/js/ScriptProfile.h:
311         * bindings/js/ScriptProfiler.cpp: Removed.
312         * bindings/js/ScriptProfiler.h: Removed.
313         * inspector/InspectorAllInOne.cpp:
314         * inspector/InspectorConsoleInstrumentation.h:
315         (WebCore::InspectorInstrumentation::profilerEnabled):
316         (WebCore::InspectorInstrumentation::startProfiling):
317         (WebCore::InspectorInstrumentation::stopProfiling):
318         * inspector/InspectorController.cpp:
319         (WebCore::InspectorController::InspectorController):
320         * inspector/InspectorController.h:
321         * inspector/InspectorInstrumentation.cpp:
322         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
323         (WebCore::InspectorInstrumentation::startProfilingImpl):
324         (WebCore::InspectorInstrumentation::stopProfilingImpl):
325         (WebCore::InspectorInstrumentation::consoleTimeStampImpl): Deleted.
326         * inspector/InspectorInstrumentation.h:
327         * inspector/InspectorProfilerAgent.cpp: Removed.
328         * inspector/InspectorProfilerAgent.h: Removed.
329         * inspector/InspectorTimelineAgent.cpp:
330         (WebCore::startProfiling):
331         (WebCore::stopProfiling):
332         (WebCore::InspectorTimelineAgent::willCallFunction):
333         (WebCore::InspectorTimelineAgent::didCallFunction):
334         (WebCore::InspectorTimelineAgent::willEvaluateScript):
335         (WebCore::InspectorTimelineAgent::didEvaluateScript):
336         (WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent): Deleted.
337         * inspector/InstrumentingAgents.h:
338         (WebCore::InstrumentingAgents::inspectorProfilerAgent):
339         (WebCore::InstrumentingAgents::setInspectorProfilerAgent):
340         * inspector/PageDebuggerAgent.cpp:
341         (WebCore::PageDebuggerAgent::sourceMapURLForScript): Deleted.
342         * inspector/PageDebuggerAgent.h:
343         * inspector/PageProfilerAgent.cpp: Added.
344         (WebCore::PageProfilerAgent::PageProfilerAgent):
345         (WebCore::PageProfilerAgent::profilingGlobalExecState):
346         * inspector/PageProfilerAgent.h: Added.
347         (WebCore::PageProfilerAgent::~PageProfilerAgent):
348         * inspector/ScriptProfile.idl:
349         * inspector/TimelineRecordFactory.cpp:
350         (WebCore::TimelineRecordFactory::appendProfile):
351         * inspector/TimelineRecordFactory.h:
352         * inspector/WebConsoleAgent.cpp:
353         * inspector/WebProfilerAgent.cpp: Added.
354         (WebCore::WebProfilerAgent::WebProfilerAgent):
355         (WebCore::WebProfilerAgent::enable):
356         (WebCore::WebProfilerAgent::disable):
357         * inspector/WebProfilerAgent.h: Added.
358         (WebCore::WebProfilerAgent::~WebProfilerAgent):
359         * inspector/WorkerInspectorController.cpp:
360         (WebCore::WorkerInspectorController::WorkerInspectorController):
361         * inspector/WorkerProfilerAgent.cpp: Added.
362         (WebCore::WorkerProfilerAgent::WorkerProfilerAgent):
363         (WebCore::WorkerProfilerAgent::profilingGlobalExecState):
364         * inspector/WorkerProfilerAgent.h: Added.
365         (WebCore::WorkerProfilerAgent::~WorkerProfilerAgent):
366         * loader/appcache/ApplicationCacheGroup.cpp:
367         * page/PageConsole.cpp:
368         (WebCore::PageConsole::profile):
369         (WebCore::PageConsole::profileEnd):
370         (WebCore::PageConsole::time): Deleted.
371         (WebCore::PageConsole::timeEnd): Deleted.
372         (WebCore::PageConsole::timeStamp): Deleted.
373         * page/PageConsole.h:
374         * testing/Internals.cpp:
375         * testing/Internals.h:
376         * xml/XMLHttpRequest.cpp:
377
378 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
379
380         Contents of directly composited image layers are sometimes missing
381         https://bugs.webkit.org/show_bug.cgi?id=131880
382
383         Reviewed by Tim Horton.
384         
385         RenderLayerBacking::updateGraphicsLayerGeometry() tested whether a
386         GraphicsLayer had a contents layer to determine whether to call code
387         that updates the contents rect. However, on Mac, we don't make a contents
388         layer until later at layer flush time. That would result in an empty
389         contentsRect being set.
390         
391         Fix by renaming GraphicsLayer::hasContentsLayer() to usesContentsLayer(),
392         and on Mac consulting the m_contentsLayerPurpose flag, which is set
393         at the appropriate time.
394
395         Test: compositing/images/update-content-rect.html
396
397         * platform/ScrollView.cpp:
398         (WebCore::positionScrollbarLayer):
399         * platform/graphics/GraphicsLayer.cpp:
400         (WebCore::GraphicsLayer::getDebugBorderInfo):
401         * platform/graphics/GraphicsLayer.h:
402         (WebCore::GraphicsLayer::usesContentsLayer):
403         (WebCore::GraphicsLayer::hasContentsLayer): Deleted.
404         * platform/graphics/ca/GraphicsLayerCA.h:
405         (WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
406         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
407         (WebCore::GraphicsLayerTextureMapper::usesContentsLayer):
408         (WebCore::GraphicsLayerTextureMapper::hasContentsLayer): Deleted.
409         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
410         * rendering/RenderLayerBacking.cpp:
411         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
412         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
413         (WebCore::RenderLayerBacking::compositingLayerType):
414
415 2014-04-18  Commit Queue  <commit-queue@webkit.org>
416
417         Unreviewed, rolling out r167527.
418         https://bugs.webkit.org/show_bug.cgi?id=131883
419
420         Broke 32-bit build (Requested by ap on #webkit).
421
422         Reverted changeset:
423
424         "[Mac] implement WebKitDataCue"
425         https://bugs.webkit.org/show_bug.cgi?id=131799
426         http://trac.webkit.org/changeset/167527
427
428 2014-04-18  Eric Carlson  <eric.carlson@apple.com>
429
430         [Mac] implement WebKitDataCue
431         https://bugs.webkit.org/show_bug.cgi?id=131799
432
433         Reviewed by Dean Jackson.
434
435         Tests: http/tests/media/track-in-band-hls-metadata.html
436                media/track/track-datacue-value.html
437
438         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
439         * DerivedSources.make: Add ENABLE_DATACUE_VALUE to HTML_FLAGS when appropriate.
440
441         * CMakeLists.txt: Add JSDataCueCustom.cpp.
442         * bindings/js/JSBindingsAllInOne.cpp:
443         * WebCore.xcodeproj/project.pbxproj: Add new files.
444
445         * bindings/js/JSDataCueCustom.cpp: Added.
446         (WebCore::JSDataCue::value): 
447         (WebCore::JSDataCue::setValue):
448         (WebCore::JSDataCueConstructor::constructJSDataCue): Custom constructor.
449
450         * html/HTMLMediaElement.cpp:
451         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by fixes: don't schedule timeupdate
452             events when paused, don't call sort on an Vector that can't be sorted.
453
454         * html/track/DataCue.cpp:
455         (WebCore::DataCue::DataCue): Initialize m_type.
456         (WebCore::DataCue::~DataCue): Unprotect the JSValue if necessary.
457         (WebCore::DataCue::data): Ask the platform value for data if non-null.
458         (WebCore::DataCue::setData): Clear m_platformValue and m_value.
459         (WebCore::DataCue::isEqual): New.
460         (WebCore::DataCue::value): Return a JSValue from the platform value, or the value passed
461             to the constructor/set by script.
462         (WebCore::DataCue::setValue): Set m_value.
463         * html/track/DataCue.h:
464         * html/track/DataCue.idl:
465
466         * html/track/InbandDataTextTrack.cpp:
467         (WebCore::InbandDataTextTrack::addDataCue): Don't add the same cue more than once.
468         (WebCore::InbandDataTextTrack::updateDataCue): Update a cue's duration.
469         (WebCore::InbandDataTextTrack::removeDataCue): Remove an incomplete cue.
470         (WebCore::InbandDataTextTrack::removeCue): Remove a cue from the incomplete cue map if necessary.
471         * html/track/InbandDataTextTrack.h:
472
473         * html/track/InbandGenericTextTrack.cpp:
474         (WebCore::InbandGenericTextTrack::addGenericCue): CueMatchRules is now in TextTrackCue instead
475             of VTTCue.
476         * html/track/InbandTextTrack.h:
477
478         * html/track/InbandWebVTTTextTrack.cpp:
479         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto.
480
481         * html/track/TextTrack.cpp:
482         (WebCore::TextTrack::hasCue): Ditto.
483         * html/track/TextTrack.h:
484
485         * html/track/TextTrackCue.cpp:
486         (WebCore::TextTrackCue::isEqual): New, test base class equality.
487         * html/track/TextTrackCue.h:
488
489         * html/track/TextTrackCueGeneric.cpp:
490         (WebCore::TextTrackCueGeneric::isEqual): Call TextTrackCue::isEqual first.
491         * html/track/TextTrackCueGeneric.h:
492
493         * html/track/VTTCue.cpp:
494         (WebCore::VTTCue::isEqual): Call TextTrackCue::isEqual first.
495         * html/track/VTTCue.h:
496
497         * platform/SerializedPlatformRepresentation.h: Added.
498         (WebCore::SerializedPlatformRepresentation::~SerializedPlatformRepresentation):
499         (WebCore::SerializedPlatformRepresentation::SerializedPlatformRepresentation):
500
501         * platform/graphics/InbandTextTrackPrivateClient.h: Add methods for DataCue with SerializedPlatformRepresentation.
502
503         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Added.
504         (WebCore::InbandMetadataTextTrackPrivateAVF::create):
505         (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF):
506         (WebCore::InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF):
507         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
508         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
509         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
510         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: Added.
511
512         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
513         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): currentTrack -> currentTextTrack.
514         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
515         (WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Ditto.
516         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
517         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTextTrack):
518         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTrack): Deleted.
519
520         Renamed currentTrack and setCurrentTrack to currentTextTrack and setCurrentTextTrack.
521         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
522         (WebCore::AVFWrapper::currentTextTrack):
523         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTextTrack):
524         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTextTrack):
525         (WebCore::AVFWrapper::setCurrentTextTrack):
526         (WebCore::AVFWrapper::AVFWrapper):
527         (WebCore::AVFWrapper::processCue):
528         (WebCore::AVFWrapper::currentTrack): Deleted.
529         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTrack): Deleted.
530         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTrack): Deleted.
531         (WebCore::AVFWrapper::setCurrentTrack): Deleted.
532         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
533
534         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
535         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
536         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
537         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): currentTrack -> currentTextTrack
538         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): currentTrack -> currentTextTrack.
539         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): New.
540         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): m_currentTrack -> m_currentTextTrack.
541         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): Ditto.
542         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): Renamed from setCurrentTextTrack.
543         (WebCore::metadataType): Map an AVFoundation metadata key space to a metadata cue type.
544         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Process new metadata.
545         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
546         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Deleted.
547
548         Create a JSValue representation from an AVMetadataItem.
549         * platform/mac/SerializedPlatformRepresentationMac.h: Added.
550         (WebCore::SerializedPlatformRepresentationMac::platformType):
551         (WebCore::SerializedPlatformRepresentationMac::nativeValue):
552         * platform/mac/SerializedPlatformRepresentationMac.mm: Added.
553         (WebCore::SerializedPlatformRepresentationMac::SerializedPlatformRepresentationMac):
554         (WebCore::SerializedPlatformRepresentationMac::~SerializedPlatformRepresentationMac):
555         (WebCore::SerializedPlatformRepresentationMac::create):
556         (WebCore::SerializedPlatformRepresentationMac::data):
557         (WebCore::SerializedPlatformRepresentationMac::deserialize):
558         (WebCore::SerializedPlatformRepresentationMac::isEqual):
559         (WebCore::toSerializedPlatformRepresentationMac):
560         (WebCore::jsValueWithValueInContext):
561         (WebCore::jsValueWithDataInContext):
562         (WebCore::jsValueWithArrayInContext):
563         (WebCore::jsValueWithDictionaryInContext):
564         (WebCore::jsValueWithAVMetadataItemInContext):
565
566 2014-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
567
568         Harden RenderInline::inlineElementContinuation()
569
570         <https://bugs.webkit.org/show_bug.cgi?id=131858>
571
572         Reviewed by Sam Weinig.
573
574         No new tests, as there are no known cases of this happening.
575
576         * rendering/RenderInline.cpp:
577         (WebCore::RenderInline::inlineElementContinuation):
578         Return nullptr if the continuation is neither a RenderInline nor a
579         RenderBlock.
580
581 2014-04-18  Stephanie Lewis  <slewis@apple.com>
582
583         We shouldn’t create page throttlers for other pages than WebKit2 pages.
584         Part of <rdar://problem/16473045> Visibility state counters are often incorrect
585         https://bugs.webkit.org/show_bug.cgi?id=131696
586
587         Reviewed by Gavin Barraclough.
588
589         No new test since not web exposed.
590
591         Page throttlers were being created for SVG images and other page instances that
592         were not accurately tracking the states that enable and disable page throttling.
593         Make the throttler an unique ptr and only initialize it for WebKit2.
594
595         This also fixes an inefficiency where we would throttle a new page on creation because 
596         we assumed it was visible even if that was not the case.
597
598         * WebCore.exp.in:
599         * html/HTMLMediaElement.cpp:
600         (WebCore::HTMLMediaElement::parseAttribute): Check page throttler exists.
601         * loader/FrameLoader.cpp:
602         (WebCore::FrameLoader::started): ditto
603         * page/Page.cpp:
604         (WebCore::Page::Page): Don’t automatically create page throttler.
605         (WebCore::Page::createPageThrottler): Create page throttler.
606         (WebCore::Page::setViewState): Check page throttler exists.
607         * page/Page.h:
608         (WebCore::Page::pageThrottler): Make the page throttler a unique ptr.
609         * page/PageThrottler.h:
610         * page/Settings.cpp: 
611         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled): Check page throttler exists.
612
613 2014-04-18  Stephanie Lewis  <slewis@apple.com>
614
615         Move DOM throttling out of the page throttler
616         <rdar://problem/16473004>
617         https://bugs.webkit.org/show_bug.cgi?id=131697
618
619         Reviewed by Gavin Barraclough.
620
621         No new tests since it's not web exposed.
622
623         DOM timer throttling is currently part of the page throttler which uses per process 
624         state and per page state to determine when to throttle.  This led us to being overly 
625         conservative when turning DOM throttling off.  It should only respond to view state changes.
626
627         Additionally since creating extra page throttlers SVG images caused bugs 
628         in tracking state we'll reserve the page throttler for WebKit2 views.  To avoid regressing 
629         WebKit1 we should move DOM timer throttling back to the page.
630
631         * page/Page.cpp:
632         (WebCore::Page::Page): set DOM timer throttling.
633         (WebCore::Page::setIsVisuallyIdleInternal): ditto.
634         (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged): ditto.
635         (WebCore::Page::setIsVisible): Update view state masks for WebKit1 to include IsVisibleOrOccluded and IsVisuallyIdle
636         * page/Page.h:
637         * page/PageThrottler.cpp:
638         (WebCore::PageThrottler::PageThrottler): remove DOM timer throttling.
639         (WebCore::PageThrottler::started): ditto.
640         (WebCore::PageThrottler::stopped): ditto.
641         (WebCore::PageThrottler::hiddenPageDOMTimerThrottlingStateChanged): Deleted.
642         * page/PageThrottler.h:
643         * page/Settings.cpp:
644         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled):
645
646 2014-04-18  Dean Jackson  <dino@apple.com>
647
648         [WebGL] Limit maximum texture sizes on older Intel hardware
649         https://bugs.webkit.org/show_bug.cgi?id=131867
650
651         Reviewed by Geoffrey Garen.
652
653         Both Chrome and Firefox limit the MAX_TEXTURE_SIZE on
654         older Intel hardware to be at most 4096. This does the
655         same for WebKit.
656
657         * platform/graphics/Extensions3D.h: Add requiresRestrictedMaximumTextureSize() accessor.
658         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
659         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): Record the value of GL_RENDERER
660         and test for "Intel HD Graphics 3000", which is the problematic hardware.
661         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
662         (WebCore::Extensions3DOpenGLCommon::requiresRestrictedMaximumTextureSize): Getter.
663         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
664         (WebCore::GraphicsContext3D::getIntegerv): If you're asking for MAX_TEXTURE_SIZE or
665         MAX_CUBE_MAP_TEXTURE_SIZE, and you're on problematic hardware, return a clamped value
666         (4096 and 1024 respectively).
667
668 2014-04-18  Hans Muller  <hmuller@adobe.com>
669
670         [CSS Shapes] Add parsing support for gradients
671         https://bugs.webkit.org/show_bug.cgi?id=131444
672
673         Reviewed by Bem Jones-Bey.
674
675         Added support for shape-outside gradient values.
676
677         Test: fast/shapes/shape-outside-floats/shape-outside-linear-gradient.html
678
679         * css/DeprecatedStyleBuilder.cpp:
680         (WebCore::ApplyPropertyShape::applyValue): Accept generated images as shape-outside values.
681         * rendering/shapes/ShapeOutsideInfo.cpp:
682         (WebCore::checkShapeImageOrigin): Generated images get a pass, others do not.
683         (WebCore::getShapeImageAndRect): Use StyleImage::image() to get a generated image.
684         (WebCore::ShapeOutsideInfo::isEnabledFor):
685         * rendering/style/ShapeValue.h:
686         (WebCore::ShapeValue::isImageValid): Generated images are always considered valid.
687
688 2014-04-18  Brady Eidson  <beidson@apple.com>
689
690         REGRESSION (r155700): Pasting an image into content-editable regions is broken.
691         <rdar://problem/16654156> and https://bugs.webkit.org/show_bug.cgi?id=131844
692
693         Reviewed by Enrica Casucci.
694
695         * editing/mac/EditorMac.mm:
696         (WebCore::Editor::createFragmentForImageResourceAndAddResource): Add the ArchiveResource before
697           creating the element that uses it.
698
699 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
700
701         [iOS WK2] Make window.scroll() and window.scrollBy() work
702         https://bugs.webkit.org/show_bug.cgi?id=131848
703         <rdar://problem/16638319>
704
705         Reviewed by Beth Dakin.
706
707         The scrolling-related functions in DOMWindow were #ifdeffed for iOS
708         to use the hacky WK1-specific "actual scroll" functions, which do nothing
709         in WK2.
710         
711         Fix by adding a scroll position wrapper (contentsScrollPosition) which does
712         the right thing on WK1 and WK2, and change almost all the places that used "actualScrollPosition"
713         to us it (with the exception of contentsScrollOffset() in MouseRelatedEvent.cpp, which has
714         confusing scaling behavior).
715
716         * dom/MouseRelatedEvent.cpp:
717         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
718         * dom/TreeScope.cpp:
719         (WebCore::nodeFromPoint): Remove #ifdefs. 
720         * html/HTMLBodyElement.cpp:
721         (WebCore::HTMLBodyElement::scrollLeft):
722         (WebCore::HTMLBodyElement::scrollTop):
723         * page/DOMWindow.cpp:
724         (WebCore::DOMWindow::scrollX):
725         (WebCore::DOMWindow::scrollY):
726         (WebCore::DOMWindow::scrollBy):
727         (WebCore::DOMWindow::scrollTo):
728         * platform/ScrollView.cpp:
729         (WebCore::ScrollView::contentsScrollPosition):
730         (WebCore::ScrollView::setContentsScrollPosition):
731         * platform/ScrollView.h:
732
733 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
734
735         Worse animation performance on pages with 3D transforms
736         https://bugs.webkit.org/show_bug.cgi?id=131838
737         <rdar://problem/16428630&15705876>
738
739         Reviewed by Dean Jackson.
740         
741         r155977 added logic to adjust the contentsScale of compositing layers
742         based on a root-relative transform. However, this resulted in
743         the contentsScale continually changing on layers whose transforms
744         are changed dynamically, which caused lots of expensive painting.
745         
746         Fix by bucketing the part of the scale computed from the root-relative transform
747         into buckets of 0.25 via rounding.
748
749         Test: compositing/contents-scale/rounded-contents-scale.html
750
751         * platform/graphics/ca/GraphicsLayerCA.cpp:
752         (WebCore::clampedContentsScaleForScale):
753         (WebCore::GraphicsLayerCA::updateContentsOpaque):
754         (WebCore::GraphicsLayerCA::updateContentsScale):
755         (WebCore::GraphicsLayerCA::updateContentsVisibility): Deleted.
756         (WebCore::GraphicsLayerCA::animatedLayerClones): Deleted.
757
758 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
759
760         Remove some includes from image-related headers, and Document.h
761         https://bugs.webkit.org/show_bug.cgi?id=131797
762
763         Reviewed by Martin Robinson.
764
765         Remove some #includes from Document.h, DragImage.h, GradientImage.h,
766         Image.h, and ImageBuffer.h and deal with the fallout.
767
768         * dom/ContainerNode.h:
769         * dom/Document.cpp:
770         (WebCore::Document::setInputCursor):
771         * dom/Document.h:
772         (WebCore::Document::inputCursor):
773         * dom/MutationObserverRegistration.cpp:
774         * html/canvas/WebGLRenderingContext.cpp:
775         * page/FrameSnapshotting.cpp:
776         * page/Page.cpp:
777         * platform/DragImage.h:
778         * platform/graphics/BitmapImage.cpp:
779         * platform/graphics/GradientImage.cpp:
780         (WebCore::GradientImage::GradientImage):
781         (WebCore::GradientImage::~GradientImage):
782         * platform/graphics/GradientImage.h:
783         * platform/graphics/Image.h:
784         * platform/graphics/ImageBuffer.cpp:
785         * platform/graphics/ImageBuffer.h:
786         (WebCore::ImageBuffer::create):
787         (WebCore::ImageBuffer::internalSize):
788         (WebCore::ImageBuffer::logicalSize):
789         (WebCore::ImageBuffer::baseTransform):
790         (WebCore::ImageBuffer::spaceSize):
791         (WebCore::ImageBuffer::setSpaceSize):
792         * rendering/RenderThemeMac.mm:
793         * rendering/shapes/Shape.cpp:
794         * rendering/svg/RenderSVGContainer.cpp:
795         * svg/SVGURIReference.h:
796
797 2014-04-18  Gabor Rapcsanyi  <rgabor@webkit.org>
798
799         Unreviewed. ARM64 buildfix after r167473.
800
801         * platform/audio/DenormalDisabler.h: Put back the MathExtras.h include.
802
803 2014-04-18  Radu Stavila  <stavila@adobe.com>
804
805         [CSSRegions] Incorrect background paint on positioned element hover
806         https://bugs.webkit.org/show_bug.cgi?id=131617
807
808         Reviewed by Andrei Bucur.
809
810         When computing the repaint rect for absolute elements flowed into regions, the Y location of the
811         region within the flow thread must no longer be added to the repaint rect's location because absolute
812         positioned elements get pushed down through the regions by their absolute top. So adding the region's
813         position in the flow thread and then adding the element's absolute top would cause us to add
814         something twice.
815
816         Tests: fast/regions/repaint/repaint-absolute-pushed-to-next-region.html
817
818         * rendering/RenderBox.cpp:
819         (WebCore::RenderBox::computeRectForRepaint):
820
821 2014-04-18  Philippe Normand  <pnormand@igalia.com>
822
823         Remove NETWORK_INFO support
824         https://bugs.webkit.org/show_bug.cgi?id=131841
825
826         Reviewed by Gyuyoung Kim.
827
828         * CMakeLists.txt:
829         * Modules/networkinfo/NavigatorNetworkInfoConnection.cpp: Removed.
830         * Modules/networkinfo/NavigatorNetworkInfoConnection.h: Removed.
831         * Modules/networkinfo/NavigatorNetworkInfoConnection.idl: Removed.
832         * Modules/networkinfo/NetworkInfo.cpp: Removed.
833         * Modules/networkinfo/NetworkInfo.h: Removed.
834         * Modules/networkinfo/NetworkInfoClient.h: Removed.
835         * Modules/networkinfo/NetworkInfoConnection.cpp: Removed.
836         * Modules/networkinfo/NetworkInfoConnection.h: Removed.
837         * Modules/networkinfo/NetworkInfoConnection.idl: Removed.
838         * Modules/networkinfo/NetworkInfoController.cpp: Removed.
839         * Modules/networkinfo/NetworkInfoController.h: Removed.
840         * PlatformEfl.cmake:
841         * dom/EventTargetFactory.in:
842         * platform/efl/NetworkInfoProviderEfl.cpp: Removed.
843         * platform/efl/NetworkInfoProviderEfl.h: Removed.
844         * testing/Internals.cpp:
845         (WebCore::Internals::setNetworkInformation): Deleted.
846         * testing/Internals.h:
847         * testing/Internals.idl:
848
849 2014-04-17  Commit Queue  <commit-queue@webkit.org>
850
851         Unreviewed, rolling out r167478.
852         https://bugs.webkit.org/show_bug.cgi?id=131840
853
854         Broke multicol tests (Requested by ap on #webkit).
855
856         Reverted changeset:
857
858         "[New Multicolumn] Pagination mode messed up with non-inline
859         axis and reversed direction."
860         https://bugs.webkit.org/show_bug.cgi?id=131811
861         http://trac.webkit.org/changeset/167478
862
863 2014-04-17  Daniel Bates  <dabates@apple.com>
864
865         [iOS] Hook up screen.{availHeight, availWidth, height, width}
866         https://bugs.webkit.org/show_bug.cgi?id=131821
867         <rdar://problem/16413795>
868
869         Reviewed by Benjamin Poulain and Tim Horton.
870
871         Implement support for screen.{availHeight, availWidth, height, width} in WebKit2 for iOS.
872
873         Additionally substitute "screenSize" for "viewporScreenSize" to make the code more understandable.
874
875         * WebCore.exp.in: Export symbol for WebCore System Interface function
876         _wkGetAvailableScreenSize.
877         * dom/Document.cpp:
878         (WebCore::Document::processViewport): Modified to call Chrome::screenSize(); formerly it
879         called ChromeClient::viewportScreenSize().
880         * page/Chrome.cpp:
881         (WebCore::Chrome::screenSize): Added; turns around and calls ChromeClient::screenSize().
882         (WebCore::Chrome::availableScreenSize): Added; turns around and calls ChromeClient::availableScreenSize().
883         * page/Chrome.h:
884         * page/ChromeClient.h:
885         (WebCore::ChromeClient::screenSize): Renamed; formerly named viewportScreenSize.
886         (WebCore::ChromeClient::availableScreenSize): Added; default implementation, which
887         returns the size of Chrome::windowRect().
888         * page/ViewportConfiguration.cpp:
889         (WebCore::ViewportConfiguration::textDocumentParameters):
890         * platform/HostWindow.h: Added declarations for availableScreenSize() and screenSize()
891         so that a caller (e.g. WebCore::screenRect()) can query for such screen information using
892         only the HostWindow interface. That is, a caller doesn't need to know about ChromeClient.
893         * platform/ios/PlatformScreenIOS.mm:
894         (WebCore::screenRect): Modified to query HostWindow::screenSize() when computing the
895         screen rectangle in WebKit2 for iOS.
896         (WebCore::screenAvailableRect): Modified to query HostWindow::availableScreenSize()
897         when computing the available screen rectangle in WebKit2 for iOS.
898         * platform/ios/WebCoreSystemInterfaceIOS.mm:
899         * platform/mac/WebCoreSystemInterface.h:
900
901 2014-04-17  Darin Adler  <darin@apple.com>
902
903         origin spoofing possible (HTTP Origin, postMessage event.origin) due to inappropriate URL escape sequence decoding
904         https://bugs.webkit.org/show_bug.cgi?id=131837
905         rdar://problem/15211936
906
907         Reviewed by Anders Carlsson and Dave Hyatt.
908
909         Tests: fast/dom/DOMURL/parsing.html
910                fast/dom/HTMLAnchorElement/anchor-element-href-parsing.html
911
912         * platform/URL.cpp:
913         (WebCore::URL::host): Removed unnecessary call to decodeURLEscapeSequences, which caused
914         problems and was not needed.
915
916 2014-04-17  David Hyatt  <hyatt@apple.com>
917
918         [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
919         https://bugs.webkit.org/show_bug.cgi?id=131811
920
921         Reviewed by Dean Jackson.
922
923         Added fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html
924         
925         With block axis pagination mode, it is possible to set a column height that is not the same
926         as the available fill height for a block. The new multi-column code had the assumption that
927         the column height was the same as the amount of fill room you had available. This is not
928         the case.
929         
930         To correct the issue, I added a member variable to RenderMultiColumnSet that stores the
931         available column height as a separate variable from the computed column height. This allows
932         the pagination API to specify a different column height that is not the same as the view's
933         content height.
934
935         Even though it isn't involved in the solution, I also patched pageOrViewLogicalHeight on
936         RenderView to work with the new column code as well.
937
938         * rendering/RenderMultiColumnSet.cpp:
939         (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
940         (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
941         (WebCore::RenderMultiColumnSet::computeLogicalHeight):
942         * rendering/RenderMultiColumnSet.h:
943         * rendering/RenderView.cpp:
944         (WebCore::RenderView::pageOrViewLogicalHeight):
945
946 2014-04-17  Anders Carlsson  <andersca@apple.com>
947
948         Build fix.
949
950         * svg/animation/SMILTime.h:
951
952 2014-04-17  Bem Jones-Bey  <bjonesbe@adobe.com>
953
954         Unreviewed, rolling out r167384.
955
956         Sounds like this isn't the right fix, and causes generation to
957         run far too often.
958
959         Reverted changeset:
960
961         "Fix CodeGenerator.pm to only write files if the generated
962         content has changed"
963         https://bugs.webkit.org/show_bug.cgi?id=131756
964         http://trac.webkit.org/changeset/167384
965
966 2014-04-17  Ryuan Choi  <ryuan.choi@samsung.com>
967
968         Remove unnecessary MathExtras.h includes
969         https://bugs.webkit.org/show_bug.cgi?id=131789
970
971         Reviewed by Anders Carlsson.
972
973         * platform/FileSystem.h:
974         * platform/Scrollbar.h:
975         * platform/animation/AnimationUtilities.h:
976         * platform/audio/DenormalDisabler.h:
977         * platform/graphics/Font.h:
978         * platform/graphics/IntPoint.h: Included cmath instad of MathExtras.h.
979         * platform/graphics/LayoutPoint.h:
980         * platform/graphics/cairo/GraphicsContextPlatformPrivateCairo.h:
981         * rendering/svg/SVGMarkerData.h:
982         * svg/animation/SMILTime.h:
983
984 2014-04-16  Huang Dongsung  <luxtella@company100.net>
985
986         Make RenderLayerBacking get the timingFunction of the correct animation.
987         https://bugs.webkit.org/show_bug.cgi?id=100632
988
989         Reviewed by Simon Fraser.
990
991         When an element has multiple animations that have different timingFunctions,
992         the progress of each animation should be calculated using its respective
993         timingFunction. But at this point, the timingFunction of the first animation is
994         only used in RenderLayerBacking::startAnimation(), regardless of how many
995         animations the element has.
996
997         getAnimationFromStyleByName() was introduced in r89462 so that the
998         timingFunction of the correct animation searched by its name would be
999         used. This patch moves the function to KeyframeValue::timingFunction()
1000         so that RenderLayerBacking reuses this method.
1001
1002         Test: animations/keyframe-multiple-timing-functions-transform.html
1003
1004         * page/animation/KeyframeAnimation.cpp:
1005         (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty):
1006         * rendering/RenderLayerBacking.cpp:
1007         (WebCore::RenderLayerBacking::startAnimation):
1008         * rendering/style/KeyframeList.cpp:
1009         (WebCore::KeyframeValue::timingFunction):
1010         (WebCore):
1011         * rendering/style/KeyframeList.h:
1012         (WebCore):
1013         (KeyframeValue):
1014
1015 2014-04-17  Andreas Kling  <akling@apple.com>
1016
1017         Rollout: Add a way to cache never-changing IDL attributes in the wrapper.
1018         <https://webkit.org/b/131759>
1019
1020         This behavior may be observable from the web, so we can't do it this way.
1021
1022         * bindings/scripts/CodeGeneratorJS.pm:
1023         (GenerateImplementation):
1024         * bindings/scripts/IDLAttributes.txt:
1025         * bindings/scripts/test/*:
1026         * dom/Element.idl:
1027         * dom/Node.idl:
1028
1029 2014-04-17  Andreas Kling  <akling@apple.com>
1030
1031         Cheesy Mountain Lion build fix.
1032
1033         * platform/MemoryPressureHandler.h:
1034         (WebCore::MemoryPressureHandler::ReliefLogger::logString):
1035
1036 2014-04-17  David Hyatt  <hyatt@apple.com>
1037
1038         [New Multicolumn] Column rules don't respect the specified stacking order.
1039         https://bugs.webkit.org/show_bug.cgi?id=131804
1040
1041         Reviewed by Beth Dakin.
1042
1043         Added fast/multicol/newmulticol/compare_with_old_impl/column-rules-stacking.html
1044
1045         * rendering/RenderBlockFlow.cpp:
1046         (WebCore::RenderBlockFlow::paintBoxDecorations):
1047         * rendering/RenderBlockFlow.h:
1048         Override paintBoxDecorations for block flows so that we can iterate over our column sets
1049         and paint their rules just after painting our background and border. We can't wait until
1050         the child column sets paint their backgrounds, since that is specified as being above negative
1051         z-index children. We have to pretend that the column sets don't exist as
1052         far as column rule painting is concerned.
1053
1054         * rendering/RenderMultiColumnSet.cpp:
1055         (WebCore::RenderMultiColumnSet::paintObject): Deleted.
1056         * rendering/RenderMultiColumnSet.h:
1057         Turn paintObject in RenderMultiColumnSet into an override that doesn't paint anything.
1058
1059 2014-04-17  Beth Dakin  <bdakin@apple.com>
1060
1061         Hit-testing is incorrect for plugins inside iframes when there is a 
1062         topContentInset
1063         https://bugs.webkit.org/show_bug.cgi?id=131826
1064         -and corresponding-
1065         <rdar://problem/16649996>
1066
1067         Reviewed by Tim Horton.
1068
1069         I missed one coordinate-conversion spot when getting hit-testing to work. Like 
1070         headerHeight() which also manipulates the location of the root layer, 
1071         topContentInset() has to be factored into all of these conversions.
1072         * page/FrameView.cpp:
1073         (WebCore::FrameView::convertFromRenderer):
1074
1075 2014-04-17  Andreas Kling  <akling@apple.com>
1076
1077         Stub out MemoryPressureHandler::ReliefLogger on older OS X'es.
1078
1079         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1080         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
1081         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
1082
1083 2014-04-17  Dirk Schulze  <krit@webkit.org>
1084
1085         Remove CANVAS_PATH where possible
1086         https://bugs.webkit.org/show_bug.cgi?id=131788
1087
1088         Reviewed by Dean Jackson.
1089
1090         Since Firefox and Chrome ship the same interoperable subset of Path2D soon, 
1091         it is time to remove CANVAS_PATH where possible.
1092
1093         * html/canvas/CanvasRenderingContext2D.cpp:
1094         (WebCore::CanvasRenderingContext2D::clip):
1095         (WebCore::CanvasRenderingContext2D::isPointInStroke):
1096         * html/canvas/CanvasRenderingContext2D.h:
1097         * html/canvas/CanvasRenderingContext2D.idl:
1098         * html/canvas/DOMPath.h:
1099         * html/canvas/DOMPath.idl:
1100
1101 2014-04-17  Brendan Long  <b.long@cablelabs.com>
1102
1103         [GStreamer] Store TrackPrivateBaseGStreamer's label and language as AtomicStrings
1104         https://bugs.webkit.org/show_bug.cgi?id=130404
1105
1106         Reviewed by Philippe Normand.
1107
1108         No new tests, this just makes things more efficient.
1109
1110         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.cpp:
1111         (WebCore::TrackPrivateBaseGStreamer::getLanguageCode):
1112         (WebCore::TrackPrivateBaseGStreamer::getTag):
1113         * platform/graphics/gstreamer/TrackPrivateBaseGStreamer.h:
1114
1115 2014-04-17  Andreas Kling  <akling@apple.com>
1116
1117         Fix Cocoa build.
1118
1119         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1120         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
1121
1122 2014-04-17  Rik Cabanier  <cabanier@adobe.com>
1123
1124         [CSS Blending] Remove the -webkit- prefix for mix-blend-mode and isolation CSS properties
1125         https://bugs.webkit.org/show_bug.cgi?id=131355
1126
1127         Reviewed by Dean Jackson.
1128
1129         Removed webkit prefix from mix-blend-mode and isolation. These properties
1130         never shipped and their spec is now in CR.
1131
1132         Covered by existing tests.
1133
1134         * css/CSSComputedStyleDeclaration.cpp:
1135         (WebCore::ComputedStyleExtractor::propertyValue):
1136         * css/CSSParser.cpp:
1137         (WebCore::isValidKeywordPropertyAndValue):
1138         (WebCore::isKeywordPropertyID):
1139         (WebCore::CSSParser::parseValue):
1140         * css/CSSPropertyNames.in:
1141         * css/DeprecatedStyleBuilder.cpp:
1142         (WebCore::DeprecatedStyleBuilder::DeprecatedStyleBuilder):
1143
1144 2014-04-17  David Kilzer  <ddkilzer@apple.com>
1145
1146         Tidy up isIsolatedInline() and highestContainingIsolateWithinRoot()
1147         <http://webkit.org/b/131117>
1148
1149         Reviewed by Daniel Bates.
1150
1151         Based on review feedback for r166650.
1152
1153         * rendering/InlineIterator.h:
1154         (WebCore::isIsolatedInline):
1155         - Switch argument to a reference since it is never called with a
1156           nullptr.
1157         (WebCore::highestContainingIsolateWithinRoot):
1158         - Switch first argument to a reference since it's never a
1159           nullptr.
1160         - Use nullptr for pointer initialization.
1161         - Switch while() loop to for() loop. Pass reference to
1162           isIsolatedInline().
1163         (WebCore::numberOfIsolateAncestors):
1164         - Switch while() loop to for() loop. Pass reference to
1165           isIsolatedInline().
1166         * rendering/RenderBlockLineLayout.cpp:
1167         (WebCore::constructBidiRunsForSegment):
1168         - Rename startObj to startObject.
1169         - No longer need to pass the address of startObject here.
1170
1171 2014-04-17  Andreas Kling  <akling@apple.com>
1172
1173         Log number of bytes reclaimed at each step of memory pressure relief.
1174         <https://webkit.org/b/131751>
1175
1176         Reviewed by Antti Koivisto.
1177
1178         * platform/MemoryPressureHandler.h:
1179         * platform/MemoryPressureHandler.cpp:
1180         (WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
1181         (WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
1182         (WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
1183         (WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
1184         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1185         (WebCore::MemoryPressureHandlerCocoa::ReliefLogger::platformMemoryUsage):
1186         (WebCore::MemoryPressureHandlerCocoa::ReliefLogger::platformLog):
1187
1188             Add a simple RAII helper to check memory usage before and after
1189             a block of code, and then dump the delta to system log.
1190
1191         (WebCore::MemoryPressureHandler::releaseMemory):
1192         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1193         (WebCore::MemoryPressureHandler::platformReleaseMemory):
1194
1195             Use ReliefLogger to annotate the various attempts to reduce
1196             our memory footprint. This will help us understand the efficiency
1197             of our current strategy.
1198
1199 2014-04-17  David Hyatt  <hyatt@apple.com>
1200
1201         [New Multicolumn] columnNumberForOffset is not patched for new multicolumn code yet.
1202         https://bugs.webkit.org/show_bug.cgi?id=131740
1203
1204         Reviewed by Enrica Casucci.
1205         
1206         I took the opportunity to clean this code up while adding support for the new columns.
1207         columnNumberForOffset only applied for paginated RenderViews and was really about
1208         pages and not columns. It also only returns an actual page number if the columns are
1209         block progressed (e.g., right-to-left vertical Japanese books).
1210         
1211         Therefore I renamed columnNumberForOffset to pageNumberForBlockProgressionOffset and
1212         moved it to RenderView.
1213         
1214         I also renamed the member variable of SelectionRect to be pageNumber instead of
1215         columnNumber in order to make it more obvious that this isn't about columns per se
1216         (since the fact that we implemented RenderView's pagination mode using columns is an
1217         implementation detail).
1218
1219         * dom/Range.cpp:
1220         (WebCore::coalesceSelectionRects):
1221         (WebCore::Range::collectSelectionRects):
1222         * platform/ios/SelectionRect.h:
1223         (WebCore::SelectionRect::pageNumber):
1224         (WebCore::SelectionRect::columnNumber): Deleted.
1225         * rendering/RenderImage.cpp:
1226         (WebCore::RenderImage::collectSelectionRects):
1227         * rendering/RenderObject.cpp:
1228         (WebCore::RenderObject::collectSelectionRects):
1229         (WebCore::RenderObject::columnNumberForOffset): Deleted.
1230         * rendering/RenderObject.h:
1231         * rendering/RenderText.cpp:
1232         (WebCore::RenderText::collectSelectionRects):
1233         * rendering/RenderView.cpp:
1234         (WebCore::RenderView::pageNumberForBlockProgressionOffset):
1235         * rendering/RenderView.h:
1236
1237 2014-04-16  Brent Fulgham  <bfulgham@apple.com>
1238
1239         [Win] A few final cleanups to the DataObject classes.
1240         https://bugs.webkit.org/show_bug.cgi?id=131784
1241
1242         Reviewed by Anders Carlsson.
1243
1244         * platform/win/WCDataObject.cpp:
1245         (WebCore::WCDataObject::clearData): Use 'last()' method.
1246
1247 2014-04-15  Jer Noble  <jer.noble@apple.com>
1248
1249         Fullscreen media controls are unusable in pagination mode
1250         https://bugs.webkit.org/show_bug.cgi?id=131705
1251
1252         Reviewed by Darin Adler.
1253
1254         When pagination mode is enabled, the full screen media will (depending on the width of the
1255         pagination columns) overflow its column, and hit testing will be clipped to the column. In extreme
1256         cases, where the column width < 0.5 * media element width, the media controls will be entirely
1257         unclickable.
1258
1259         Rather than making the RenderFullScreen a child of the full screen element's parent's renderer,
1260         make it a child of the RenderView, putting it outside of the columns entirely. Always create and
1261         insert the fullscreenRenderer's placeholder, using it as the remembered insertion point for the
1262         fullscreen element's renderer when we exit full screen.
1263
1264         Drive-by fix: don't wrap the full screen element's renderer in webkitWillEnterFullScreenForElement();
1265         it will just be re-wrapped in createRendererIfNeeded().
1266
1267         * dom/Document.cpp:
1268         (WebCore::Document::webkitWillEnterFullScreenForElement): Don't wrap the full screen element's renderer.
1269         (WebCore::Document::setFullScreenRenderer): Call setPlaceholderStyle.
1270         * rendering/RenderFullScreen.cpp:
1271         (WebCore::RenderFullScreenPlaceholder::willBeDestroyed): Call clearPlaceholder.
1272         (WebCore::RenderFullScreen::wrapRenderer): Make fullscreenRenderer a child of the view().
1273         (WebCore::RenderFullScreen::unwrapRenderer): Return the children to the parent of the placeholder().
1274         (WebCore::RenderFullScreen::clearPlaceholder): Renamed from setPlaceholder().
1275         (WebCore::RenderFullScreen::ensurePlaceholder): Added. 
1276         (WebCore::RenderFullScreen::setPlaceholderStyle): Renamed from createPlaceholder().
1277         (WebCore::RenderFullScreen::setPlaceholder): Deleted.
1278         (WebCore::RenderFullScreen::createPlaceholder): Deleted.
1279         * rendering/RenderFullScreen.h:
1280
1281 2014-04-16  Jer Noble  <jer.noble@apple.com>
1282
1283         [MSE] Multiple initialization segments with same codecs in tracks fail validation.
1284         https://bugs.webkit.org/show_bug.cgi?id=131768
1285
1286         Additional initialization segments added to the same SourceBuffer with the same
1287         codec values will fail validation. Update the validation check to add the correct
1288         codec information for the initial segment, and check against the correct codecs during
1289         the validation step.
1290
1291         Additionally, after validation, if successful update the Audio, Video, and TextTracks
1292         for the SourceBuffer with the updated initialization segment information.
1293
1294         Reviewed by Eric Carlson.
1295
1296         Test: media/media-source/media-source-multiple-initialization-segments.html
1297
1298         * Modules/mediasource/SourceBuffer.cpp:
1299         (WebCore::SourceBuffer::appendBufferTimerFired): m_source may have been cleared
1300             as a result of the append, so check it before using.
1301         (WebCore::SourceBuffer::sourceBufferPrivateDidEndStream): Call streamEndedWithError
1302             instead of endOfStream as the latter is safe to call within an update.
1303         (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): Ditto.
1304             Update the track lists if validation succeeds.
1305         (WebCore::SourceBuffer::validateInitializationSegment): Switch the audio and video
1306             codec checks.
1307
1308         Add the ability for Audio, Video, and InbandTextTracks to replace their private tracks:
1309         * html/track/AudioTrack.cpp:
1310         (WebCore::AudioTrack::AudioTrack): Call updateKindFromPrivate().
1311         (WebCore::AudioTrack::setPrivate):
1312         (WebCore::AudioTrack::updateKindFromPrivate): Split out from constructor.
1313         * html/track/AudioTrack.h:
1314         * html/track/InbandTextTrack.cpp:
1315         (WebCore::InbandTextTrack::InbandTextTrack): Call updateKindFromPrivate().
1316         (WebCore::InbandTextTrack::setPrivate):
1317         (WebCore::InbandTextTrack::setMode): Split up into setModeInternal().
1318         (WebCore::InbandTextTrack::setModeInternal): Broke out from setMode().
1319         (WebCore::InbandTextTrack::updateKindFromPrivate): Split out from constructor.
1320         * html/track/InbandTextTrack.h:
1321         * html/track/TextTrack.h:
1322         (WebCore::TextTrack::isInband): Added, returns false.
1323         * html/track/VideoTrack.cpp:
1324         (WebCore::VideoTrack::VideoTrack): Call updateKindFromPrivate().
1325         (WebCore::VideoTrack::setPrivate):
1326         (WebCore::VideoTrack::updateKindFromPrivate):  Split out from constructor.
1327         * html/track/VideoTrack.h:
1328
1329 2014-04-17  David Hyatt  <hyatt@apple.com>
1330
1331         [New Multicolumn] Column sets below spanners don't repaint properly.
1332         https://bugs.webkit.org/show_bug.cgi?id=131778
1333
1334         Reviewed by Beth Dakin.
1335
1336         Added fast/repaint/spanner-with-margins.html.
1337
1338         * rendering/RenderBox.cpp:
1339         (WebCore::RenderBox::computeRectForRepaint):
1340         Turn off some code that was running for in-flow RenderFlowThreads that made no sense.
1341         I'm not convinced the code is right for other types of RenderFlowThreads either,
1342         but will leave that to the named flow thread experts. :)
1343
1344 2014-04-17  Koji Ishii  <kojishi@gmail.com>
1345
1346         Catch up ruby and its tag omission rule changes in HTML5 CR Feb 2014
1347         https://bugs.webkit.org/show_bug.cgi?id=131175
1348
1349         Reviewed by Darin Adler.
1350
1351         Tests: html5lib/resources/ruby.dat
1352                html5lib/resources/tests19.dat
1353
1354         This patch makes WebKit HTML parser to match to the tag omission rules of HTML5 CR Feb 2014:
1355         http://www.w3.org/TR/2014/CR-html5-20140204/syntax.html#syntax-tag-omission
1356         with the support for two new elements (rb, rtc) which were also defined in the spec:
1357         http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rb-element
1358         http://www.w3.org/TR/2014/CR-html5-20140204/text-level-semantics.html#the-rtc-element
1359         to better support use cases presented by W3C I18N WG:
1360         http://www.w3.org/TR/ruby-use-cases/
1361
1362         * html/HTMLTagNames.in: rb and rtc added as HTMLElement interfaces.
1363         * html/parser/HTMLConstructionSite.cpp:
1364         (WebCore::hasImpliedEndTag): the spec says rb and rtc have implied end tags.
1365         * html/parser/HTMLTreeBuilder.cpp:
1366         (WebCore::HTMLTreeBuilder::processStartTagForInBody): rb and rtc added. rt excludes rtc from its implied end tags.
1367
1368 2014-04-17  Darin Adler  <darin@apple.com>
1369
1370         Try to fix EFL and GTK builds.
1371
1372         * workers/WorkerGlobalScope.idl: Touch file to make it rebuild, assuming that
1373         module dependencies aren't working right with CMake. Tweaked formatting quite a
1374         bit while I was in here.
1375
1376 2014-04-17  David Hyatt  <hyatt@apple.com>
1377
1378         [New Multicolumn] REGRESSION: Column set styles don't update when zooming etc.
1379         https://bugs.webkit.org/show_bug.cgi?id=131777
1380
1381         Reviewed by Enrica Casucci.
1382
1383         Added fast/multicol/zoom-test.html
1384
1385         * rendering/RenderBlockFlow.cpp:
1386         (WebCore::RenderBlockFlow::styleDidChange):
1387         Put back in the code that propagates new styles to the flow thread and column sets
1388         when styles change. This propagation was removed when the column span code landed.
1389         This patch puts it back in but qualifies the types of objects that get styles
1390         propagated to avoid accidentally propagating the wrong style to column spans.
1391
1392 2014-04-17  Darin Adler  <darin@apple.com>
1393
1394         Add separate flag for IndexedDatabase in workers since the current implementation is not threadsafe
1395         https://bugs.webkit.org/show_bug.cgi?id=131785
1396         rdar://problem/16003108
1397
1398         Reviewed by Brady Eidson.
1399
1400         * Configurations/FeatureDefines.xcconfig: Added INDEXED_DATABASE_IN_WORKERS.
1401
1402         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.cpp: Use the new conditional
1403         instead of the old one.
1404         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.h: Ditto.
1405         * Modules/indexeddb/WorkerGlobalScopeIndexedDatabase.idl: Ditto.
1406
1407 2014-04-17  Dan Bernstein  <mitz@apple.com>
1408
1409         WebCore part of <rdar://problem/16601336> [Cocoa] _userInitiated is always NO in WKNavigationAction passed to -webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:
1410         https://bugs.webkit.org/show_bug.cgi?id=131783
1411
1412         Reviewed by Tim Horton.
1413
1414         * loader/NavigationAction.cpp:
1415         (WebCore::NavigationAction::NavigationAction): Initialize m_processingUserGesture to
1416         ScriptController::processingUserGesture() at the time the NavigationAction is constructed.
1417         * loader/NavigationAction.h:
1418         Added boolean member variable m_processionUserGesture
1419         (WebCore::NavigationAction::processingUserGesture): Added this getter.
1420
1421 2014-04-17  Ion Rosca  <rosca@adobe.com>
1422
1423         [CSS Blending] Isolation descendant dependent flags are not updated correctly
1424         https://bugs.webkit.org/show_bug.cgi?id=130892
1425
1426         Reviewed by Dean Jackson.
1427
1428         The isolation descendant dependent flag (m_hasUnisolatedBlendingDescendants)
1429         will help us to determine if a layer should isolate blending descendants or not.
1430         The m_hasUnisolatedBlendingDescendants flag should be set for layers that have blending descendant layers
1431         not isolated by descendant stacking contexts.
1432         An element isolatesBlending() if it has this flag set and creates stacking context.
1433
1434         Tests: css3/compositing/blend-mode-isolation-flags-append-non-stacking-context-blending.html
1435                css3/compositing/blend-mode-isolation-flags-append-stacking-context-blending.html
1436                css3/compositing/blend-mode-isolation-flags-remove-non-stacking-context-blending.html
1437                css3/compositing/blend-mode-isolation-flags-remove-stacking-context-blending.html
1438                css3/compositing/blend-mode-isolation-flags-turn-off-blending-no-isolation.html
1439                css3/compositing/blend-mode-isolation-flags-turn-off-blending.html
1440                css3/compositing/blend-mode-isolation-flags-turn-off-stacking-context.html
1441                css3/compositing/blend-mode-isolation-flags-turn-on-blending.html
1442                css3/compositing/blend-mode-isolation-flags-turn-on-stacking-context.html
1443
1444         * rendering/RenderLayer.cpp:
1445         (WebCore::RenderLayer::RenderLayer):
1446         (WebCore::RenderLayer::updateBlendMode):
1447         (WebCore::RenderLayer::updateAncestorChainHasBlendingDescendants):
1448             When a layer has blending and it hasn't had it before, we set the isolation
1449         flag for all its ancestors up to the first layer creating stacking context.
1450         I removed the isComposited() check here. Isolation flags should be correct regardless
1451         of compositing state. Moreover, if this method is called from styleChanged(),
1452         the compositing state might not be accurate, it's going to be recalculated afterwards.  
1453         (WebCore::RenderLayer::dirtyAncestorChainHasBlendingDescendants):
1454             When a layer doesn't have blending, but it used to have it before, we mark
1455         the isolation flag as dirty for all its ancestors up to the first layer
1456         creating stacking context. The isolation flags will be recalculated by
1457         RenderLayer::updateDescendantDependentFlags.
1458         (WebCore::RenderLayer::updateDescendantDependentFlags):
1459             Evaluates if the layer has unisolated blending descendants by traversing
1460         the layer subtree.
1461         (WebCore::RenderLayer::addChild):
1462             When adding a subtree that has blending or has some unisolated descendants,
1463         we set the flag for all the ancestors, up to the stacking context layer.
1464         (WebCore::RenderLayer::removeChild):
1465             When removing a subtree that had blending or had some unisolated descendants,
1466         we dirty the flag so that it could be reevaluated.
1467         (WebCore::RenderLayer::calculateClipRects):
1468         (WebCore::RenderLayer::updateTransform):
1469         * rendering/RenderLayer.h:
1470             Rename m_hasBlendedElementInChildStackingContext => m_hasUnisolatedBlendingDescendants
1471         and m_hasBlendedElementInChildStackingContextStatusDirty => m_hasUnisolatedBlendingDescendantsStatusDirty,
1472         * rendering/RenderLayerCompositor.cpp:
1473         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1474             Add an assert to make sure that if m_hasUnisolatedCompositedBlendingDescendants is true,
1475         then m_hasUnisolatedBlendingDescendants is true as well.
1476
1477 2014-04-17  Tim Horton  <timothy_horton@apple.com>
1478
1479         Uninline blend(Color, Color) to get AnimationUtilities out of Color.h
1480         https://bugs.webkit.org/show_bug.cgi?id=131781
1481
1482         Reviewed by Simon Fraser.
1483
1484         * platform/graphics/Color.cpp:
1485         (WebCore::blend):
1486         Un-inline.
1487
1488         * platform/graphics/Color.h:
1489         No more AnimationUtilities.
1490
1491 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
1492
1493         Fix the build after r167412
1494
1495         * platform/ScrollView.cpp:
1496         (WebCore::ScrollView::updateScrollbars):
1497
1498 2014-04-16  Benjamin Poulain  <bpoulain@apple.com>
1499
1500         [iOS][WK2] Fix annoying scrolling bugs
1501         https://bugs.webkit.org/show_bug.cgi?id=131722
1502
1503         Reviewed by Simon Fraser.
1504
1505         * platform/ScrollView.cpp:
1506         (WebCore::ScrollView::updateScrollbars):
1507         Since ScrollingStateScrollingNode::setRequestedScrollPosition() was added, we see ScrollView::updateScrollbars()
1508         keep changing the scroll position to incorrect values.
1509
1510         On iOS, the scrollbars are handled by the native UI, the code just compute incorrect scroll position. On WebKit1,
1511         the code does not run because there is a platformWidget().
1512
1513         Just #ifdef the whole useless code.
1514
1515 2014-04-16  Alexandru Chiculita  <achicu@adobe.com>
1516
1517         Improve performance of the RenderLayerCompositor::OverlapMap
1518         https://bugs.webkit.org/show_bug.cgi?id=115063
1519
1520         Reviewed by Simon Fraser.
1521
1522         No new tests, no new functionality or behavior.
1523
1524         Do not use the OverlapMap in RenderLayerCompositor::computeCompositingRequirements if the layer already
1525         has a 3D transform. This way we can avoid a potential expensive lookups when we know for sure the layer
1526         is already supposed to be composited. 
1527
1528         Also, added a bounding box of the overlap map, so that it can catch cases when the new layer is not overlapping
1529         any of the previous layers. This is pretty common when having composited layers laid out in a vertical/horizontal list.
1530
1531
1532         * rendering/RenderLayerCompositor.cpp:
1533         (OverlapMapContainer):
1534         (WebCore::OverlapMapContainer::add):
1535         (WebCore::OverlapMapContainer::overlapsLayers):
1536         (WebCore::OverlapMapContainer::unite):
1537         (WebCore):
1538         (WebCore::RenderLayerCompositor::OverlapMap::add):
1539         (WebCore::RenderLayerCompositor::OverlapMap::overlapsLayers):
1540         (WebCore::RenderLayerCompositor::OverlapMap::pushCompositingContainer):
1541         (WebCore::RenderLayerCompositor::OverlapMap::popCompositingContainer):
1542         (RenderLayerCompositor::OverlapMap):
1543         (WebCore::RenderLayerCompositor::computeCompositingRequirements):
1544
1545 2014-04-16  Brian J. Burg  <burg@cs.washington.edu>
1546
1547         Web Replay: memoize fallback time values for document.lastModified
1548         https://bugs.webkit.org/show_bug.cgi?id=131318
1549
1550         Reviewed by Joseph Pecoraro.
1551
1552         If a document's Last-Modified header can't be found or used, then 
1553         document.lastModified is derived from the current system time or
1554         from filesystem data, which is obviously nondeterministic.
1555
1556         It's better to handle this inside Document::lastModified rather than using
1557         MemoizedDOMResult, because only the fallback case is nondeterministic.
1558
1559         Test: http/tests/inspector/replay/document-last-modified-fallback-value.html
1560
1561         The test is skipped for now, as it will be very flaky without the
1562         functionality introduced by bugs 130728 and 129391.
1563
1564         * dom/Document.cpp:
1565         (WebCore::Document::lastModified): Save or reuse memoized fallback value.
1566         * replay/WebInputs.json: Add input DocumentLastModifiedDate.
1567
1568 2014-04-16  David Hyatt  <hyatt@apple.com>
1569
1570         [New Multicolumn] Selection gets confused when the mouse is in the column gaps.
1571         https://bugs.webkit.org/show_bug.cgi?id=131739
1572
1573         Reviewed by Enrica Casucci.
1574
1575         * rendering/RenderBlock.cpp:
1576         (WebCore::RenderBlock::selectionGaps):
1577         Make sure not to paint selection gaps. This matches the old multi-column behavior. Even though
1578         selection gaps *nearly* work with the new multi-column code, I am disabling them so that we
1579         can turn them on without visual regressions.
1580         
1581         (WebCore::isChildHitTestCandidate):
1582         Don't allow in-flow RenderFlowThreads to be descended into from positionForPoint. We always want
1583         to look only at the spanners and at the sets.
1584
1585         * rendering/RenderMultiColumnFlowThread.cpp:
1586         (WebCore::RenderMultiColumnFlowThread::nodeAtPoint):
1587         * rendering/RenderMultiColumnFlowThread.h:
1588         Override nodeAtPoint to disallow the RenderMultiColumnFlowThread from being considered for hit
1589         testing when no DOM node is found. It's better to just let RenderBlock's positionForPoint run
1590         to drill back down into the appropriate column set.
1591
1592         * rendering/RenderMultiColumnSet.cpp:
1593         (WebCore::RenderMultiColumnSet::positionForPoint):
1594         Implement positionForPoint for RenderMultiColumnSets. This is a straight-up port of the
1595         old multi-column code's adjustPointToColumnContents function.
1596
1597         * rendering/RenderMultiColumnSet.h:
1598         Add override of positionForPoint.
1599
1600 2014-04-16  Dean Jackson  <dino@apple.com>
1601
1602         MediaDocument on iOS should be full page
1603         https://bugs.webkit.org/show_bug.cgi?id=131774
1604
1605         Reviewed by Jer Noble.
1606
1607         A MediaDocument on iOS has two problems. It can't rely
1608         on intrinsic size, since it doesn't load the content until
1609         a user gesture. Secondly, on a small screen you want the
1610         media to fill the page.
1611
1612         Add width/height 100% for iOS documents.
1613
1614         Test: platform/iphone-simulator/media/media-document-controls-size.html
1615
1616         * html/MediaDocument.cpp:
1617         (WebCore::MediaDocumentParser::createDocumentStructure):
1618
1619 2014-04-16  Roger Fong  <roger_fong@apple.com>
1620
1621         Add a way for layout tests to determine whether or not a plugin is snapshotted.
1622         https://bugs.webkit.org/show_bug.cgi?id=131650.
1623         <rdar://problem/16615528>
1624
1625         Reviewed by Dean Jackson.
1626
1627         * testing/Internals.cpp:
1628         (WebCore::Internals::isPluginSnapshotted):
1629         * testing/Internals.h:
1630         * testing/Internals.idl:
1631
1632 2014-04-16  Zoltan Horvath  <zoltan@webkit.org>
1633
1634         Vanish unnecessary includes from Shapes.{h|cpp}
1635         https://bugs.webkit.org/show_bug.cgi?id=131762
1636
1637         Reviewed by Andreas Kling.
1638
1639         No new tests, no behavior change.
1640
1641         * rendering/shapes/BoxShape.h:
1642         * rendering/shapes/Shape.cpp:
1643         * rendering/shapes/Shape.h:
1644         * rendering/shapes/ShapeOutsideInfo.h:
1645
1646 2014-04-16  Andreas Kling  <akling@apple.com>
1647
1648         Revert direct caching of tagName and nodeName from r167383.
1649
1650         Ryosuke tells me this is not entirely safe, will need to rethink.
1651
1652         * dom/Element.idl:
1653         * dom/Node.idl:
1654
1655 2014-04-16  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
1656
1657         Improve security mitigation added in webkit r94001.
1658         We missed the case where attachLine was called when we already had an inline box wrapper.
1659         https://bugs.webkit.org/show_bug.cgi?id=127285
1660
1661         Reviewed by Brent Fulgham.
1662
1663         Merged from Blink: https://src.chromium.org/viewvc/blink?revision=150697&view=revision
1664
1665         * rendering/RenderBox.cpp:
1666         (WebCore::RenderBox::positionLineBox):
1667         * rendering/RenderBox.h:
1668         (WebCore::RenderBox::setInlineBoxWrapper):
1669
1670 2014-04-16  Bem Jones-Bey  <bjonesbe@adobe.com>
1671
1672         Fix CodeGenerator.pm to only write files if the generated content has changed
1673         https://bugs.webkit.org/show_bug.cgi?id=131756
1674
1675         Reviewed by Sam Weinig.
1676
1677         To improve build speed, don't touch generated files unless the newly
1678         generated content is actually different.
1679
1680         * bindings/scripts/CodeGenerator.pm:
1681         (UpdateFile):
1682
1683 2014-04-16  Andreas Kling  <akling@apple.com>
1684
1685         Add a way to cache never-changing IDL attributes in the wrapper.
1686         <https://webkit.org/b/131759>
1687
1688         Some IDL attributes will always return the same value when queried
1689         on an object, so let's have a way to avoid calling into C++ code
1690         every time they are queried.
1691
1692         This patch adds a custom IDL thingy called "ReturnsCacheableValue"
1693         which causes the code generator to emit code to cache the returned
1694         value directly in the JS wrapper object.
1695
1696         Reviewed by Oliver Hunt.
1697
1698         * bindings/scripts/IDLAttributes.txt:
1699         * bindings/scripts/CodeGeneratorJS.pm:
1700         (GenerateImplementation):
1701
1702             Add ReturnsCacheableValue custom attribute.
1703
1704         * dom/Element.idl:
1705         * dom/Node.idl:
1706
1707             Annotate some attributes that return fully cacheable values.
1708
1709         * bindings/scripts/test/*:
1710
1711             Rebaseline.
1712
1713 2014-04-16  Noel Gordon  <noel.gordon@gmail.com>
1714
1715         Progressive JPEG outputScanlines() calls should handle failure
1716         https://bugs.webkit.org/show_bug.cgi?id=116701
1717
1718         Reviewed by Brent Fulgham.
1719
1720         outputScanlines() can fail and delete |this|. Copy the decoder pointer
1721         member and use that copy to detect and handle the failure case.
1722
1723         * platform/image-decoders/jpeg/JPEGImageDecoder.cpp:
1724         (WebCore::JPEGImageReader::decode):
1725
1726 2014-04-16  Robert Sipka  <sipka@inf.u-szeged.hu>
1727
1728         [curl] Add WEB_TIMING support
1729         https://bugs.webkit.org/show_bug.cgi?id=127555
1730
1731         Reviewed by Brent Fulgham.
1732
1733         Access timing information related to navigation.
1734
1735         * platform/network/curl/ResourceHandleManager.cpp:
1736         (WebCore::milisecondsSinceRequest):
1737         (WebCore::calculateWebTimingInformations):
1738         (WebCore::sockoptfunction):
1739         (WebCore::headerCallback):
1740         (WebCore::ResourceHandleManager::downloadTimerCallback):
1741         (WebCore::ResourceHandleManager::dispatchSynchronousJob):
1742         (WebCore::ResourceHandleManager::initializeHandle):
1743
1744 2014-04-16  Zoltan Horvath  <zoltan@webkit.org>
1745
1746         Cleanup header includes in ShapeOutsideInfo.h
1747         https://bugs.webkit.org/show_bug.cgi?id=131750
1748
1749         Reviewed by Antti Koivisto.
1750
1751         Make the build faster by removing unnecessary header includes.
1752
1753         No new tests, no behavior change.
1754
1755         * rendering/shapes/ShapeOutsideInfo.h:
1756
1757 2014-04-16  Simon Fraser  <simon.fraser@apple.com>
1758
1759         Fix the iOS build.
1760
1761         * platform/graphics/cg/BitmapImageCG.cpp:
1762         (WebCore::BitmapImage::draw):
1763
1764 2014-04-16  Alexey Proskuryakov  <ap@apple.com>
1765
1766         DataTransfer should cache its FileList
1767         https://bugs.webkit.org/show_bug.cgi?id=131694
1768
1769         Reviewed by Darin Adler.
1770
1771         Test: fast/events/data-transfer-files-attribute-identity.html
1772
1773         * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal):
1774         Switched to a new FileList constructor, CloneDeserializer doesn't really need to modify
1775         the FileList with append().
1776
1777         * dom/DataTransfer.h:
1778         * dom/DataTransfer.cpp:
1779         (WebCore::DataTransfer::types): Added a FIXME.
1780         (WebCore::DataTransfer::files): Changed to reuse a cached FileList. It's currently
1781         easy, because we don't support DataTransferItemList. Once we do, making any changes
1782         through it will also require updating the FileList in a way that doesn't replace
1783         File objects for unchanged files.
1784
1785         * fileapi/FileList.h:
1786         (WebCore::FileList::create):
1787         (WebCore::FileList::isEmpty):
1788         (WebCore::FileList::FileList):
1789         (WebCore::FileList::append):
1790         (WebCore::FileList::clear):
1791         Made non-const functions private, because neither DataTransfer nor FileInputType
1792         expect the list to be modified without their knowledge. Added a new Vector based
1793         constructor so that a FileList could be created without the use of append().
1794
1795         * html/FileInputType.cpp: (WebCore::FileInputType::createFileList): Simplified
1796         the code a little bit. FileInputType still needs to modify the list for clear(),
1797         but doesn't need to add to it dynamically - unlike with DataTransfer, it's expected
1798         to create a new FileList when it's modified.
1799
1800 2014-04-15  Brent Fulgham  <bfulgham@apple.com>
1801
1802         [Win] Eliminate use of deleteAllValues in Windows Files
1803         https://bugs.webkit.org/show_bug.cgi?id=131631
1804
1805         Reviewed by Darin Adler.
1806
1807         Update to use std::unique_ptr for object lifetime. Get rid of
1808         deleteAllValues now that it is no loner needed. Use ranged for
1809         loops where possible.
1810
1811         * platform/win/WCDataObject.cpp:
1812         (WebCore::WCEnumFormatEtc::WCEnumFormatEtc):
1813         (WebCore::WCDataObject::~WCDataObject):
1814         (WebCore::WCDataObject::GetData):
1815         (WebCore::WCDataObject::QueryGetData):
1816         (WebCore::WCDataObject::SetData):
1817         (WebCore::WCDataObject::clearData):
1818         * platform/win/WCDataObject.h:
1819
1820 2014-04-16  Chris Fleizach  <cfleizach@apple.com>
1821
1822         AX: Accessing a table cell with an invalid column header crashes
1823         https://bugs.webkit.org/show_bug.cgi?id=131719
1824
1825         Reviewed by Darin Adler.
1826
1827         If no tableCell is available as a column/row header, then do not continue processing.
1828
1829         Test: accessibility/table-missing-column-header-crash.html
1830
1831         * accessibility/AccessibilityTableCell.cpp:
1832         (WebCore::AccessibilityTableCell::columnHeaders):
1833         (WebCore::AccessibilityTableCell::rowHeaders):
1834
1835 2014-04-16  Brendan Long  <b.long@cablelabs.com>
1836
1837         [GTK] Fix unused parameter warnings
1838         https://bugs.webkit.org/show_bug.cgi?id=131721
1839
1840         Reviewed by Darin Adler.
1841
1842         * bindings/js/JSMediaStreamCapabilitiesCustom.cpp:
1843         (WebCore::toJS): Remove unused 'exec' parameter.
1844
1845 2014-04-16  Simon Fraser  <simon.fraser@apple.com>
1846
1847         Convert the boolean param of Image::startAnimation() to an enum
1848         https://bugs.webkit.org/show_bug.cgi?id=131742
1849
1850         Reviewed by Tim Horton.
1851
1852         Use an enum to make the code more readable.
1853
1854         * platform/graphics/BitmapImage.cpp:
1855         (WebCore::BitmapImage::startAnimation):
1856         * platform/graphics/BitmapImage.h:
1857         * platform/graphics/Image.cpp:
1858         (WebCore::Image::drawTiled):
1859         * platform/graphics/Image.h:
1860         (WebCore::Image::startAnimation):
1861         * svg/graphics/SVGImage.cpp:
1862         (WebCore::SVGImage::startAnimation):
1863         * svg/graphics/SVGImage.h:
1864
1865 2014-04-16  David Hyatt  <hyatt@apple.com>
1866
1867         Make sure to skip the RenderMultiColumnFlowThread when resolving percentage heights inside columns against
1868         containing blocks. The flow thread's auto height should not interfere if a fixed height is specified on
1869         an ancestor.
1870
1871         https://bugs.webkit.org/show_bug.cgi?id=131741
1872
1873         Reviewed by Simon Fraser.
1874
1875         Added fast/multicol/percent-height.html.
1876
1877         * rendering/RenderBox.cpp:
1878         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
1879         Add an isInFlowRenderFlowThread check so that we skip those blocks and don't consider them at all
1880         when resolving percentage heights.
1881
1882 2014-04-16  Daewoong Jang  <daewoong.jang@navercorp.com>
1883
1884         [WinCairo][cURL] Build fix for WinCairo build with USE(CURL).
1885         https://bugs.webkit.org/show_bug.cgi?id=131614
1886
1887         Reviewed by Brent Fulgham.
1888
1889         Build fix, no new tests needed.
1890
1891         * platform/network/curl/CurlCacheEntry.cpp:
1892         (WebCore::CurlCacheEntry::loadResponseHeaders):
1893         * platform/network/curl/CurlCacheManager.cpp:
1894         (WebCore::CurlCacheManager::loadIndex):
1895         * platform/network/soup/ResourceError.h:
1896         * platform/network/soup/SocketStreamHandle.h:
1897
1898 2014-04-16  Martin Hodovan  <mhodovan@inf.u-szeged.hu>
1899
1900         ASSERTION FAILED: x2 >= x1 in WebCore::RenderObject::drawLineForBoxSide
1901         https://bugs.webkit.org/show_bug.cgi?id=127835
1902
1903         In some cases when a negative margin and a positive padding are applied
1904         together to the right and/or left side of the box, the logical width of
1905         the borders can be set to a negative value, making the assertion fire.
1906         The fix checks if the width or height of the box is negative, and if so,
1907         it will not display the borders and shadows of the box.
1908
1909         Reviewed by Darin Adler.
1910
1911         Test: fast/css/padding-margin-negative-border.html
1912
1913         * rendering/RenderBoxModelObject.cpp:
1914         (WebCore::RenderBoxModelObject::paintBorder):
1915
1916 2014-04-16  Jer Noble  <jer.noble@apple.com>
1917
1918         [MSE] Seeks into buffered ranges will never complete.
1919         https://bugs.webkit.org/show_bug.cgi?id=131717
1920
1921         Reviewed by Eric Carlson.
1922
1923         Test: media/media-source/media-source-seek-complete.html
1924
1925         Run the SourceBuffer Monitoring step after initiating a seek.
1926
1927         * Modules/mediasource/SourceBuffer.cpp:
1928         (WebCore::SourceBuffer::sourceBufferPrivateSeekToTime):
1929
1930 2014-04-15  Hyowon Kim  <hw1008.kim@samsung.com>
1931
1932         [EFL] Fix problems with the pixel dump.
1933         https://bugs.webkit.org/show_bug.cgi?id=131265
1934
1935         Reviewed by Gyuyoung Kim.
1936
1937         Painting and compositing paths of WebKit-EFL were totally modified from r166768.
1938         However pixel dump codes still call deprecated functions like ewk_view_paint(),
1939         which causes that nothing is drawn.
1940
1941         This patch adds new member functions to AcceleratedCompositingContext to support pixel dump.
1942         One of new functions is AcceleratedCompositingContext::extractImageData(),
1943         which replaces deprecated function calls. Besides the extractImageData() is invoked by
1944         ewk_view_screenshot_contents_get() in order to take the visible content displayed on the EFL webview.
1945
1946         * platform/graphics/cairo/CairoUtilities.cpp:
1947         (WebCore::flipImageSurfaceVertically): Flip pixel data of given cairo_surface_t vertically up/down.
1948         Whereas Cairo uses the top-left corner as being 0,0 of the coordinate system,
1949         OpenGL uses the bottom-left corner being 0,0.
1950         So we need to vertically flip resultant images taken by glReadPixels().
1951         * platform/graphics/cairo/CairoUtilities.h:
1952
1953 2014-04-15  Hyowon Kim  <hw1008.kim@samsung.com>
1954
1955         Make page overlay functionality working on coordinated graphics.
1956         https://bugs.webkit.org/show_bug.cgi?id=131425
1957
1958         Reviewed by Darin Adler.
1959
1960         Page overlay functionality did not work on coordinated graphics since r166975.
1961         This patch removes deprecated code related to the PageOverlay GraphicsLayer management.
1962         and makes CoordinatedLayerTreeHost use PageOverlayController.
1963
1964         * platform/graphics/texmap/coordinated/CompositingCoordinator.cpp:
1965         (WebCore::CompositingCoordinator::setRootCompositingLayer):
1966         (WebCore::CompositingCoordinator::flushPendingLayerChanges):
1967         * platform/graphics/texmap/coordinated/CompositingCoordinator.h:
1968
1969 2014-04-10  Roger Fong  <roger_fong@apple.com>
1970
1971         Snapshotted plugins may need to be restarted if style properties are changed after initial load of plugin.
1972         https://bugs.webkit.org/show_bug.cgi?id=131553.
1973         <rdar://problem/15443375>
1974
1975         Reviewed by Timothy Horton.
1976
1977         Test: plugins/snapshotting/set-plugin-size-to-tiny.html
1978
1979         When updating embedded objects during our post layout checks, check for certain style changes
1980         that may result in the plugin needing to be restarted.
1981
1982         * html/HTMLPlugInImageElement.h: 
1983         Add m_plugInDimensionsSpecified field to keep track of whether or not dimensions on the plugin’s renderer have been specified.
1984         * html/HTMLPlugInImageElement.cpp:
1985         (WebCore::HTMLPlugInImageElement::HTMLPlugInImageElement):
1986         Initialize m_plugInDimensionsSpecified.
1987         (WebCore::isSmallerThanTinySizingThreshold):
1988         Refactoring, move check for whether or not plugin is smaller than the tiny plugin size threshold to this method.
1989         (WebCore::HTMLPlugInImageElement::isTopLevelFullPage): 
1990         Refactoring, move check for whether or not plugin is top level full page to this method.
1991         (WebCore::HTMLPlugInImageElement::checkSnapshotStatus): 
1992         Use refactored checks here as well to determine whether or not we need to restart the snapshotted plugin.
1993         (WebCore::HTMLPlugInImageElement::subframeLoaderWillCreatePlugIn): Use refactored checks.
1994         If plugin dimensions were specified, set m_plugInDimensionsSpecified to true.
1995
1996 2014-04-15  Andreas Kling  <akling@apple.com>
1997
1998         [iOS WebKit2] Listen for system memory pressure notifications.
1999         <https://webkit.org/b/131653>
2000         <rdar://problem/16208123>
2001
2002         Reviewed by Antti Koivisto.
2003
2004         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2005         (WebCore::MemoryPressureHandler::install):
2006
2007             Use the right invocation to summon the memory pressure handler.
2008
2009         (WebCore::MemoryPressureHandler::install):
2010         (WebCore::MemoryPressureHandler::uninstall):
2011         (WebCore::MemoryPressureHandler::holdOff):
2012         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
2013
2014             Make stubbed out functions !PLATFORM(COCOA)
2015
2016 2014-04-14  Morten Stenshorne  <mstensho@opera.com>
2017
2018         [New Multicolumn] Add support for column-span:all
2019         https://bugs.webkit.org/show_bug.cgi?id=129330
2020
2021         Reviewed by Dave Hyatt.
2022
2023         Column spanners are implemented as siblings of RenderMultiColumnSet
2024         objects (i.e. the regions for the column rows). This means that they
2025         are pulled out from the flow thread tree where they would otherwise
2026         live. This causes some complexity, most of which is contained within
2027         the multicol code.
2028
2029         A placeholder is put in the flow thread tree where the spanner's
2030         renderer would otherwise live. This is needed in order make sure that
2031         we interrupt line layout before after the spanner. We also need this
2032         to be able to switch from one multicol set to the next.
2033
2034         Some extra logic is required when dynamically inserting and removing
2035         flow thread descendants now, because we need to figure out if the
2036         renderer added should trigger creation of new multi column sets. If
2037         a spanner is inserted in the middle of a multi column set, we need to
2038         detect this, split the set and put the spanner in the middle.
2039
2040         Wrote a bunch of tests. A few of the tests were copied from existing
2041         (old-impl) tests and put in a separate directory. That directory can
2042         be wiped when we turn on the new multicol implementation by default.
2043
2044         Tests: fast/multicol/newmulticol/adjacent-spanners.html
2045                fast/multicol/newmulticol/block-becomes-spanner.html
2046                fast/multicol/newmulticol/change-spanner-display.html
2047                fast/multicol/newmulticol/change-spanner-parent-display.html
2048                fast/multicol/newmulticol/compare-with-old-impl/anonymous-block-split-crash.html
2049                fast/multicol/newmulticol/compare-with-old-impl/before-child-anonymous-column-block.html
2050                fast/multicol/newmulticol/compare-with-old-impl/clone-before-after-content-crash.html
2051                fast/multicol/newmulticol/compare-with-old-impl/clone-block-children-inline-mismatch-crash.html
2052                fast/multicol/newmulticol/compare-with-old-impl/clone-flexbox.html
2053                fast/multicol/newmulticol/compare-with-old-impl/clone-summary.html
2054                fast/multicol/newmulticol/compare-with-old-impl/column-span-inside-multicol-webkit-box.html
2055                fast/multicol/newmulticol/compare-with-old-impl/continuation-crash.html
2056                fast/multicol/newmulticol/compare-with-old-impl/double-merge-anonymous-block-crash.html
2057                fast/multicol/newmulticol/compare-with-old-impl/empty-anonymous-block-split-crash.html
2058                fast/multicol/newmulticol/compare-with-old-impl/float-not-removed-crash.html
2059                fast/multicol/newmulticol/compare-with-old-impl/list-multi-column-crash.html
2060                fast/multicol/newmulticol/compare-with-old-impl/positioned-child-not-removed-crash.html
2061                fast/multicol/newmulticol/compare-with-old-impl/positioned-objects-not-removed-crash.html
2062                fast/multicol/newmulticol/compare-with-old-impl/recursive-split-flow-crash.html
2063                fast/multicol/newmulticol/compare-with-old-impl/removal-of-multicol-span-crash.html
2064                fast/multicol/newmulticol/compare-with-old-impl/remove-child-split-flow-crash.html
2065                fast/multicol/newmulticol/compare-with-old-impl/runin-continuation-crash.html
2066                fast/multicol/newmulticol/compare-with-old-impl/span-as-immediate-child-complex-splitting.html
2067                fast/multicol/newmulticol/compare-with-old-impl/span-as-nested-inline-block-child.html
2068                fast/multicol/newmulticol/compare-with-old-impl/split-flow-anonymous-wrapper-crash.html
2069                fast/multicol/newmulticol/compare-with-old-impl/split-inline-wrong-post-block-crash.html
2070                fast/multicol/newmulticol/compare-with-old-impl/table-multi-column-crash.html
2071                fast/multicol/newmulticol/compare-with-old-impl/textbox-not-removed-crash.html
2072                fast/multicol/newmulticol/compare-with-old-impl/update-after-content-before-child-crash.html
2073                fast/multicol/newmulticol/insert-row-content1.html
2074                fast/multicol/newmulticol/insert-row-content2.html
2075                fast/multicol/newmulticol/insert-row-content3.html
2076                fast/multicol/newmulticol/insert-row-content4.html
2077                fast/multicol/newmulticol/insert-row-content5.html
2078                fast/multicol/newmulticol/insert-row-content6.html
2079                fast/multicol/newmulticol/insert-row-content7.html
2080                fast/multicol/newmulticol/insert-row-content8.html
2081                fast/multicol/newmulticol/insert-row-content9.html
2082                fast/multicol/newmulticol/insert-spanner-child1.html
2083                fast/multicol/newmulticol/insert-spanner-child2.html
2084                fast/multicol/newmulticol/insert-spanner-child3.html
2085                fast/multicol/newmulticol/insert-spanner1.html
2086                fast/multicol/newmulticol/insert-spanner2.html
2087                fast/multicol/newmulticol/insert-spanner3.html
2088                fast/multicol/newmulticol/insert-spanner4.html
2089                fast/multicol/newmulticol/insert-spanner5.html
2090                fast/multicol/newmulticol/insert-spanner6.html
2091                fast/multicol/newmulticol/insert-spanner7.html
2092                fast/multicol/newmulticol/insert-spanner8.html
2093                fast/multicol/newmulticol/multicol-with-spanner-becomes-regular-block.html
2094                fast/multicol/newmulticol/remove-row-content1.html
2095                fast/multicol/newmulticol/remove-row-content2.html
2096                fast/multicol/newmulticol/remove-row-content3.html
2097                fast/multicol/newmulticol/remove-row-content4.html
2098                fast/multicol/newmulticol/remove-row-content5.html
2099                fast/multicol/newmulticol/remove-row-content6.html
2100                fast/multicol/newmulticol/remove-row-content7.html
2101                fast/multicol/newmulticol/remove-row-content8.html
2102                fast/multicol/newmulticol/remove-row-content9.html
2103                fast/multicol/newmulticol/remove-spanner1.html
2104                fast/multicol/newmulticol/remove-spanner2.html
2105                fast/multicol/newmulticol/remove-spanner3.html
2106                fast/multicol/newmulticol/remove-spanner4.html
2107                fast/multicol/newmulticol/remove-spanner5.html
2108                fast/multicol/newmulticol/remove-spanner6.html
2109                fast/multicol/newmulticol/sole-spanner.html
2110                fast/multicol/newmulticol/span-between-text.html
2111                fast/multicol/newmulticol/spanner-becomes-regular-block.html
2112                fast/multicol/newmulticol/spanner-first.html
2113                fast/multicol/newmulticol/spanner-img.html
2114                fast/multicol/newmulticol/spanner-inline-block.html
2115                fast/multicol/newmulticol/spanner-last.html
2116                fast/multicol/newmulticol/spanner-nested-dynamic.html
2117                fast/multicol/newmulticol/spanner-nested.html
2118                fast/multicol/newmulticol/spanner-pseudo-after1.html
2119                fast/multicol/newmulticol/spanner-pseudo-after2.html
2120                fast/multicol/newmulticol/spanner-pseudo-after3.html
2121                fast/multicol/newmulticol/spanner-pseudo-after4.html
2122                fast/multicol/newmulticol/spanner-pseudo-before-after1.html
2123                fast/multicol/newmulticol/spanner-pseudo-before-after2.html
2124                fast/multicol/newmulticol/spanner-pseudo-before-after3.html
2125                fast/multicol/newmulticol/spanner-pseudo-before-after4.html
2126                fast/multicol/newmulticol/spanner-pseudo-before1.html
2127                fast/multicol/newmulticol/spanner-pseudo-before2.html
2128                fast/multicol/newmulticol/spanner-pseudo-before3.html
2129                fast/multicol/newmulticol/spanner-pseudo-before4.html
2130                fast/multicol/newmulticol/spanner-table.html
2131                fast/multicol/newmulticol/spanner-with-margin.html
2132                fast/multicol/newmulticol/spanner1.html
2133                fast/multicol/newmulticol/spanner2.html
2134                fast/multicol/newmulticol/spanner3.html
2135                fast/multicol/newmulticol/spanner4.html
2136                fast/multicol/newmulticol/spanner5.html
2137                fast/multicol/newmulticol/spanner6.html
2138                fast/multicol/newmulticol/spanner7.html
2139                fast/multicol/newmulticol/spanner8.html
2140                fast/multicol/newmulticol/spanner9.html
2141                fast/multicol/newmulticol/trailing-margin-with-spanner.html
2142                fast/multicol/newmulticol/trailing-margin-with-spanner2.html
2143
2144         * CMakeLists.txt:
2145         * WebCore.vcxproj/WebCore.vcxproj:
2146         * WebCore.vcxproj/WebCore.vcxproj.filters:
2147         * rendering/RenderBlock.cpp:
2148         (WebCore::RenderBlock::addChildIgnoringAnonymousColumnBlocks):
2149         Disable the old anonymous multicol container and spanner anonymous
2150         block generation machinery when the new multicol implementation is
2151         enabled.
2152         * rendering/RenderBlockFlow.cpp:
2153         (WebCore::RenderBlockFlow::createMultiColumnFlowThread):
2154         (WebCore::RenderBlockFlow::destroyMultiColumnFlowThread):
2155         (WebCore::RenderBlockFlow::layoutBlockChild): Need to notify the
2156         flow thread when a descendant's final position is known. Spanner
2157         placeholders need to know where to terminate the column set that
2158         it follows.
2159         (WebCore::RenderBlockFlow::styleDidChange): Remove old code that
2160         isn't needed anymore. The renderers in question (flow thread and
2161         column sets) set display:block on themselves already. This code
2162         caused problems for spanners, which got all their style wiped.
2163         (WebCore::RenderBlockFlow::setMultiColumnFlowThread): If setting
2164         the flow thread to nullptr, there's no need to create the "rare
2165         data" structure.
2166         (WebCore::RenderBlockFlow::relayoutForPagination):
2167         (WebCore::RenderBlockFlow::layoutSpecialExcludedChild):
2168         (WebCore::RenderBlockFlow::addChild): beforeChild is retrieved via
2169         the DOM. If it is a spanner, we need to locate the placeholder
2170         here, because that's the correct location to insert siblings,
2171         DOM-wise.
2172         (WebCore::RenderBlockFlow::removeChild): The multicol flow thread
2173         needs to know when children disappear.
2174         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
2175         Don't modify the height back and forth when calculating the
2176         multicol container's final height, as that messes up balancing.
2177         (WebCore::RenderBlockFlow::insertedIntoTree): Deleted.
2178         (WebCore::RenderBlockFlow::willBeDestroyed): Deleted.
2179         (WebCore::RenderBlockFlow::styleWillChange): Deleted.
2180         (WebCore::RenderBlockFlow::lineAtIndex): Deleted.
2181         * rendering/RenderBlockFlow.h:
2182         * rendering/RenderElement.cpp:
2183         (WebCore::RenderElement::insertedIntoTree): Set up an element's
2184         layer before notifying the flow thread. The multicol flow thread
2185         may decide to move the element (if it's a spanner), which may
2186         involve re-insertion of layers.  Calling
2187         RenderObject::insertedIntoTree() last instead of first also better
2188         matches the order we used to have prior to the introduction of
2189         RenderElement, FWIW.
2190         * rendering/RenderFlowThread.cpp:
2191         (WebCore::RenderFlowThread::layout):
2192         (WebCore::RenderFlowThread::removeRegionFromThread): Deleted.
2193         (WebCore::RenderFlowThread::invalidateRegions): Deleted.
2194         * rendering/RenderFlowThread.h:
2195         * rendering/RenderMultiColumnFlowThread.cpp:
2196         (WebCore::RenderMultiColumnFlowThread::RenderMultiColumnFlowThread):
2197         (WebCore::RenderMultiColumnFlowThread::removeFlowChildInfo): When
2198         a flow thread descendant is inserted, the multicol flow thread
2199         needs to be notified.
2200         (WebCore::RenderMultiColumnFlowThread::firstMultiColumnSet):
2201         (WebCore::RenderMultiColumnFlowThread::lastMultiColumnSet):
2202         (WebCore::RenderMultiColumnFlowThread::firstColumnSetOrSpanner):
2203         (WebCore::RenderMultiColumnFlowThread::nextColumnSetOrSpannerSiblingOf):
2204         (WebCore::RenderMultiColumnFlowThread::previousColumnSetOrSpannerSiblingOf):
2205         (WebCore::RenderMultiColumnFlowThread::layout):
2206         (WebCore::RenderMultiColumnFlowThread::findSetRendering):
2207         (WebCore::RenderMultiColumnFlowThread::populate):
2208         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
2209         (WebCore::RenderMultiColumnFlowThread::addRegionToThread):
2210         (WebCore::RenderMultiColumnFlowThread::willBeRemovedFromTree):
2211         Need to detach column sets here, since they have pointers to their
2212         flow thread.
2213         (WebCore::RenderMultiColumnFlowThread::resolveMovedChild):
2214         (WebCore::isValidColumnSpanner):
2215         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
2216         (WebCore::RenderMultiColumnFlowThread::flowThreadRelativeWillBeRemoved):
2217         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantBoxLaidOut):
2218         (WebCore::RenderMultiColumnFlowThread::autoGenerateRegionsToBlockOffset):
2219         Nothing to be done here for the time being. Column sets are now
2220         created during box creation. We are going to need to add some code
2221         here again once multicol properly supports nested fragmentation
2222         contexts (and you get adjacent column rows because of that).
2223         (WebCore::RenderMultiColumnFlowThread::regionAtBlockOffset):
2224         During layout, don't trust the region interval tree, as that one
2225         depends on the resulting layout.
2226         (WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox): With
2227         a convenience method to get the last column set, and column sets
2228         now being created during normal box creation, this young method
2229         needs an overhaul.
2230         (WebCore::RenderMultiColumnFlowThread::setRegionRangeForBox):
2231         (WebCore::RenderMultiColumnFlowThread::isPageLogicalHeightKnown):
2232         * rendering/RenderMultiColumnFlowThread.h:
2233         * rendering/RenderMultiColumnSet.cpp:
2234         (WebCore::RenderMultiColumnSet::nextSiblingMultiColumnSet):
2235         (WebCore::RenderMultiColumnSet::previousSiblingMultiColumnSet):
2236         (WebCore::RenderMultiColumnSet::firstRendererInFlowThread):
2237         (WebCore::RenderMultiColumnSet::lastRendererInFlowThread):
2238         (WebCore::precedesRenderer):
2239         (WebCore::RenderMultiColumnSet::containsRendererInFlowThread):
2240         (WebCore::RenderMultiColumnSet::setLogicalTopInFlowThread):
2241         (WebCore::RenderMultiColumnSet::setLogicalBottomInFlowThread):
2242         (WebCore::RenderMultiColumnSet::pageLogicalTopForOffset):
2243         (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
2244         (WebCore::RenderMultiColumnSet::calculateBalancedHeight):
2245         (WebCore::RenderMultiColumnSet::addForcedBreak):
2246         (WebCore::RenderMultiColumnSet::recalculateColumnHeight):
2247         Previously only needed if columns were to be balanced, now it's
2248         also needed when not balancing.
2249         (WebCore::RenderMultiColumnSet::recordSpaceShortage): Some layout
2250         elements actually have 0 height. Skip them, since they're not
2251         taking us anywhere.
2252         (WebCore::RenderMultiColumnSet::updateLogicalWidth):
2253         (WebCore::RenderMultiColumnSet::requiresBalancing): Column sets
2254         now have individual balancing needs. If they precede a spanner,
2255         they must always be balanced. For the last column set, see if
2256         height is unspecified or column-fill is 'balance' (like before).
2257         (WebCore::RenderMultiColumnSet::prepareForLayout):
2258         (WebCore::RenderMultiColumnSet::beginFlow):
2259         (WebCore::RenderMultiColumnSet::endFlow):
2260         (WebCore::RenderMultiColumnSet::layout):
2261         (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight):
2262         (WebCore::RenderMultiColumnSet::columnRectAt):
2263         (WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
2264         (WebCore::RenderMultiColumnSet::paintColumnRules):
2265         (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting):
2266         (WebCore::RenderMultiColumnSet::collectLayerFragments):
2267         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
2268         (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight): Deleted.
2269         (WebCore::RenderMultiColumnSet::findRunWithTallestColumns): Deleted.
2270         (WebCore::RenderMultiColumnSet::clearForcedBreaks): Deleted.
2271         (WebCore::RenderMultiColumnSet::repaintFlowThreadContent): Deleted.
2272         * rendering/RenderMultiColumnSet.h:
2273         * rendering/RenderMultiColumnSpannerPlaceholder.cpp: Added.
2274         (WebCore::RenderMultiColumnSpannerPlaceholder::createAnonymous):
2275         (WebCore::RenderMultiColumnSpannerPlaceholder::RenderMultiColumnSpannerPlaceholder):
2276         (WebCore::RenderMultiColumnSpannerPlaceholder::renderName):
2277         * rendering/RenderMultiColumnSpannerPlaceholder.h: Added.
2278         * rendering/RenderObject.cpp:
2279         (WebCore::RenderObject::insertedIntoTree): Need to notify the
2280         multicol flow thread when descendants are inserted. That may
2281         trigger insertion of column sets, or, in the case of spanners,
2282         they need to be moved out from the flow thread.
2283         * rendering/RenderObject.h:
2284         (WebCore::RenderObject::isRenderMultiColumnSpannerPlaceholder):
2285         (WebCore::RenderObject::isAnonymousBlock): Exclude column sets
2286         here, so that they don't get involved in anonymous block merging
2287         and other kinds of fun.
2288         * rendering/RenderRegion.h:
2289         * rendering/RenderRegionSet.h:
2290
2291 2014-04-15  Simon Fraser  <simon.fraser@apple.com>
2292
2293         LayerTreeAsTextBehavior should be in the WebCore namespace
2294         https://bugs.webkit.org/show_bug.cgi?id=131683
2295
2296         Reviewed by Andrei Bucur.
2297
2298         Move LayerTreeAsTextBehavior and the bit flags into the WebCore namespace.
2299
2300         * platform/graphics/GraphicsLayer.cpp:
2301         (showGraphicsLayerTree):
2302         * platform/graphics/GraphicsLayer.h:
2303
2304 2014-04-15  Benjamin Poulain  <bpoulain@apple.com>
2305
2306         ViewportConfiguration handles userZoom incorrectly
2307         https://bugs.webkit.org/show_bug.cgi?id=131657
2308
2309         Reviewed by Darin Adler.
2310
2311         * page/ViewportConfiguration.cpp:
2312         (WebCore::viewportArgumentUserZoomIsSet):
2313         (WebCore::ViewportConfiguration::updateConfiguration):
2314         The other viewport values must be strictly positive, userZoom is always either zero, one or minus one.
2315         As a result, the value zero was never set.
2316
2317 2014-04-15  Simon Fraser  <simon.fraser@apple.com>
2318
2319         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
2320         https://bugs.webkit.org/show_bug.cgi?id=131665
2321
2322         Reviewed by Tim Horton.
2323
2324         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
2325         was triggering a compositing layer flush when called with a null rootLayer, which happens
2326         for pages going into the page cache. This would trigger a layer flush that would clobber
2327         the root layer for the visible page, resulting in missing content.
2328         
2329         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
2330         was being added to (and then removed from) every single compositing layers.
2331         
2332         Fix both these by changing to a pull model, where RenderLayerCompositor requests
2333         the overlay layer via ChromeClient, and gets it at the end of every flush,
2334         adding to the children of the root layer.
2335
2336         * WebCore.exp.in:
2337         * page/ChromeClient.h:
2338         (WebCore::ChromeClient::documentOverlayLayerForFrame):
2339         * rendering/RenderLayerCompositor.cpp:
2340         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
2341         (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Put visibleRect
2342         into a variable for ease of debugging.
2343         (WebCore::RenderLayerCompositor::updateCompositingLayers): Asser
2344         that we're not in the page cache (this would have caught the bug).
2345         (WebCore::RenderLayerCompositor::appendOverlayLayers):
2346         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2347         (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer): Deleted.
2348         * rendering/RenderLayerCompositor.h:
2349
2350 2014-04-15  Commit Queue  <commit-queue@webkit.org>
2351
2352         Unreviewed, rolling out r167199 and r167251.
2353         https://bugs.webkit.org/show_bug.cgi?id=131678
2354
2355         Caused a DYEBench regression and does not seem to improve perf
2356         on relevant websites (Requested by rniwa on #webkit).
2357
2358         Reverted changesets:
2359
2360         "Rewrite Function.bind as a builtin"
2361         https://bugs.webkit.org/show_bug.cgi?id=131083
2362         http://trac.webkit.org/changeset/167199
2363
2364         "Update test result"
2365         http://trac.webkit.org/changeset/167251
2366
2367 2014-04-15  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
2368
2369         Remove unnecessary null checking in NavigatorContentUtils
2370         https://bugs.webkit.org/show_bug.cgi?id=131652
2371
2372         Reviewed by Darin Adler.
2373
2374         Some functions have checked if document is null. However, document is always not
2375         null when frame is existed.
2376
2377         No new tests, no behavior changes.
2378
2379         * Modules/navigatorcontentutils/NavigatorContentUtils.cpp:
2380         (WebCore::NavigatorContentUtils::registerProtocolHandler):
2381         (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered):
2382         (WebCore::NavigatorContentUtils::unregisterProtocolHandler):
2383
2384 2014-04-15  Commit Queue  <commit-queue@webkit.org>
2385
2386         Unreviewed, rolling out r167298.
2387         https://bugs.webkit.org/show_bug.cgi?id=131670
2388
2389         Broke CSS filters (17 test crashes) (Requested by ap on
2390         #webkit).
2391
2392         Reverted changeset:
2393
2394         "[iOS WK2] Pages often blank on first load if page loaded by
2395         typing the URL"
2396         https://bugs.webkit.org/show_bug.cgi?id=131665
2397         http://trac.webkit.org/changeset/167298
2398
2399 2014-04-14  Pratik Solanki  <psolanki@apple.com>
2400
2401         Unreviewed. Attempt to fix Windows build after r167277.
2402
2403         * page/FrameView.cpp:
2404         (WebCore::FrameView::willPaintContents):
2405
2406 2014-04-14  Commit Queue  <commit-queue@webkit.org>
2407
2408         Unreviewed, rolling out r167261.
2409         https://bugs.webkit.org/show_bug.cgi?id=131667
2410
2411         broke many navigation tests (Requested by ap on #webkit).
2412
2413         Reverted changeset:
2414
2415         "Web Replay: memoize fallback time values for
2416         document.lastModified"
2417         https://bugs.webkit.org/show_bug.cgi?id=131318
2418         http://trac.webkit.org/changeset/167261
2419
2420 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
2421
2422         [iOS WK2] Pages often blank on first load if page loaded by typing the URL
2423         https://bugs.webkit.org/show_bug.cgi?id=131665
2424
2425         Reviewed by Tim Horton.
2426
2427         The document overlay-related code in RemoteLayerTreeDrawingArea::setRootCompositingLayer()
2428         was triggering a compositing layer flush when called with a null rootLayer, which happens
2429         for pages going into the page cache. This would trigger a layer flush that would clobber
2430         the root layer for the visible page, resulting in missing content.
2431         
2432         Also, rebuildCompositingLayerTree() is called recursively and the m_documentOverlayRootLayer
2433         was being added to (and then removed from) every single compositing layers.
2434         
2435         Fix both these by changing to a pull model, where RenderLayerCompositor requests
2436         the overlay layer via ChromeClient, and gets it at the end of every flush,
2437         adding to the children of the root layer.
2438
2439         * WebCore.exp.in:
2440         * page/ChromeClient.h:
2441         (WebCore::ChromeClient::documentOverlayLayerForFrame):
2442         * rendering/RenderLayerCompositor.cpp:
2443         (WebCore::RenderLayerCompositor::RenderLayerCompositor):
2444         (WebCore::RenderLayerCompositor::flushPendingLayerChanges): Put visibleRect
2445         into a variable for ease of debugging.
2446         (WebCore::RenderLayerCompositor::updateCompositingLayers): Asser
2447         that we're not in the page cache (this would have caught the bug).
2448         (WebCore::RenderLayerCompositor::appendOverlayLayers):
2449         (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
2450         (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer): Deleted.
2451         * rendering/RenderLayerCompositor.h:
2452
2453 2014-04-14  Jon Honeycutt  <jhoneycutt@apple.com>
2454
2455         Assertion failure under FEImage::determineAbsolutePaintRect()
2456
2457         <https://bugs.webkit.org/show_bug.cgi?id=131660>
2458         <rdar://problem/15669294>
2459
2460         This patch merges Chromium r149536 (see
2461         <https://chromiumcodereview.appspot.com/14701012>), which moves
2462         m_absoluteTransform out of SVGFilter and into the base Filter class, so
2463         that it isn't necessary to cast a Filter to SVGFilter to get the
2464         absolute transform.
2465
2466         Reviewed by Geoffrey Garen.
2467
2468         Test: svg/filters/feImage-filter-assertion.html
2469
2470         * platform/graphics/filters/Filter.h:
2471         (WebCore::Filter::Filter):
2472         Changed to take the absolute transform.
2473         (WebCore::Filter::absoluteTransform):
2474         Moved from SVGFilter.
2475         (WebCore::Filter::mapAbsolutePointToLocalPoint):
2476         Ditto.
2477
2478         * rendering/FilterEffectRenderer.cpp:
2479         (WebCore::FilterEffectRenderer::FilterEffectRenderer):
2480         Pass a default AffineTransform() to the Filter base class.
2481
2482         * svg/graphics/filters/SVGFEImage.cpp:
2483         (WebCore::FEImage::determineAbsolutePaintRect):
2484         Use the Filter without casting it to SVGFilter.
2485         (WebCore::FEImage::platformApplySoftware):
2486         Ditto.
2487
2488         * svg/graphics/filters/SVGFilter.cpp:
2489         (WebCore::SVGFilter::SVGFilter):
2490         Pass the transform to the base class, and remove initialization of a
2491         removed member var.
2492
2493         * svg/graphics/filters/SVGFilter.h:
2494         Member var moved to Filter.h.
2495
2496 2014-04-14  Darin Adler  <darin@apple.com>
2497
2498         REGRESSION (r158617): Find on Page can get stuck in a loop when the search string occurs in an <input> in a <fieldset>
2499         https://bugs.webkit.org/show_bug.cgi?id=126322
2500
2501         Reviewed by Ryosuke Niwa.
2502
2503         One additional tweak to the fix for the bug above.
2504         Fixes crash in editing/editability/ignored-content.html test.
2505
2506         * html/HTMLObjectElement.cpp:
2507         (WebCore::HTMLObjectElement::canContainRangeEndPoint): Call through to
2508         HTMLElement::canContainRangeEndPoint, bypassing HTMLPlugInElement override
2509         that always returns false. Without this change, this function was always
2510         returning false.
2511
2512 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
2513
2514         Crash in TileController::tileRevalidationTimerFired
2515         https://bugs.webkit.org/show_bug.cgi?id=131656
2516         <rdar://problem/16583166>
2517
2518         Reviewed by Sam Weinig.
2519
2520         It's possible for the TileController revalidation timer to fire after
2521         the GraphicsLayer has been destroyed, so the PlatformCALayer no longer
2522         has an owningGraphicsLayer.
2523         
2524         Bail from the timer callback if owningGraphicsLayer() is null.
2525         
2526         Also some drive-by 0 -> nullptr changes.
2527
2528         * platform/graphics/ca/GraphicsLayerCA.cpp:
2529         (WebCore::GraphicsLayerCA::willBeDestroyed):
2530         * platform/graphics/ca/PlatformCALayer.cpp:
2531         (WebCore::PlatformCALayer::~PlatformCALayer):
2532         * platform/graphics/ca/mac/TileController.mm:
2533         (WebCore::TileController::tileRevalidationTimerFired):
2534
2535 2014-04-14  Bem Jones-Bey  <bjonesbe@adobe.com>
2536
2537         [CSS Shapes] Remove some leftover shape-inside code
2538         https://bugs.webkit.org/show_bug.cgi?id=131641
2539
2540         Reviewed by Dean Jackson.
2541
2542         I discovered that some code had been leftover from the shape-inside
2543         removal. This removes that leftover code.
2544
2545         No new tests, no behavior change.
2546
2547         * platform/text/BidiResolver.h:
2548         * rendering/BidiRun.cpp:
2549         (WebCore::BidiRun::BidiRun):
2550         * rendering/RenderBlockFlow.h:
2551         * rendering/RenderBlockLineLayout.cpp:
2552         (WebCore::RenderBlockFlow::createLineBoxes):
2553         (WebCore::RenderBlockFlow::constructLine):
2554         (WebCore::computeExpansionForJustifiedText):
2555         (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
2556
2557 2014-04-14  Jer Noble  <jer.noble@apple.com>
2558
2559         [MSE][Mac] video.currentTime is sometimes negative.
2560         https://bugs.webkit.org/show_bug.cgi?id=131644
2561
2562         Reviewed by Eric Carlson.
2563
2564         AVSampleBufferRenderSynchronizer will occasionally return slightly negative values
2565         when beginning playback. Clamp the return value to 0.
2566
2567         * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
2568         (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::currentTimeDouble):
2569
2570 2014-04-14  Bem Jones-Bey  <bjonesbe@adobe.com>
2571
2572         [CSSExclusions] Remove FIXME referencing closed bug
2573         https://bugs.webkit.org/show_bug.cgi?id=131645
2574
2575         Reviewed by Dean Jackson.
2576
2577         This is silly, but the comment is really confusing as it's entirely
2578         wrong now.
2579
2580         No new tests, no behavior change.
2581
2582         * rendering/style/RenderStyle.cpp:
2583         (WebCore::RenderStyle::changeRequiresRepaint):
2584
2585 2014-04-14  Andreas Kling  <akling@apple.com>
2586
2587         Build fixage.
2588
2589         * page/FrameView.cpp:
2590
2591 2014-04-14  Jon Honeycutt  <jhoneycutt@apple.com>
2592
2593         Assertion failure !node || node->isElementNode() in
2594         WebCore::RenderBlock::inlineElementContinuation
2595   
2596         https://bugs.webkit.org/show_bug.cgi?id=108829
2597         <rdar://problem/13666405>
2598   
2599         I can't reproduce this assertion failure, but there seems to be an
2600         invalid assumption in RenderBlock::inlineElementContinuation() that
2601         anything with the "isInline()" bit set is a RenderInline.
2602         
2603         No new test because the test case in the bug does not repro for me.
2604
2605         Reviewed by Brent Fulgham.
2606
2607         * rendering/RenderBlock.cpp:
2608         (WebCore::RenderBlock::inlineElementContinuation):
2609         Dave Hyatt says that this function should only return RenderInline
2610         objects (not non-RenderInline inline objects), so update the checks
2611         from isInline() to isRenderInline() before casting with
2612         toRenderInline().
2613
2614         * rendering/RenderInline.cpp:
2615         (WebCore::RenderInline::inlineElementContinuation):
2616         Ditto.
2617
2618 2014-04-14  Andreas Kling  <akling@apple.com>
2619
2620         Do more things under memory pressure on non-iOS platforms.
2621         <https://webkit.org/b/131625>
2622
2623         Reviewed by Antti Koivisto.
2624
2625         Rename hasReceivedMemoryPressure() to isUnderMemoryPressure() and
2626         make it use std::atomic<bool> instead of OSAtomic primitives.
2627
2628         Unmask most of the PLATFORM(IOS) blocks so all platforms can take
2629         advantage of optimizations done while under pressure. Note that
2630         isUnderMemoryPressure() will still always return false on platforms
2631         other than iOS/WK1, but this will change soon.
2632
2633         * history/PageCache.cpp:
2634         (WebCore::PageCache::canCache):
2635         * loader/FrameLoader.cpp:
2636         (WebCore::FrameLoader::commitProvisionalLoad):
2637         * page/FrameView.cpp:
2638         (WebCore::FrameView::willPaintContents):
2639         (WebCore::FrameView::didPaintContents):
2640         * platform/MemoryPressureHandler.cpp:
2641         (WebCore::MemoryPressureHandler::MemoryPressureHandler):
2642         * platform/MemoryPressureHandler.h:
2643         (WebCore::MemoryPressureHandler::isUnderMemoryPressure):
2644         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
2645         (WebCore::MemoryPressureHandler::setReceivedMemoryPressure):
2646         (WebCore::MemoryPressureHandler::clearMemoryPressure):
2647         (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded):
2648         (WebCore::MemoryPressureHandler::hasReceivedMemoryPressure): Deleted.
2649         * platform/graphics/FontCache.cpp:
2650         (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
2651         * platform/ios/LegacyTileCache.mm:
2652         (WebCore::LegacyTileCache::createTilesInActiveGrid):
2653         * platform/ios/LegacyTileGrid.mm:
2654         (WebCore::LegacyTileGrid::shouldUseMinimalTileCoverage):
2655         * platform/ios/LegacyTileLayerPool.mm:
2656         (WebCore::LegacyTileLayerPool::addLayer):
2657         * platform/ios/TileControllerMemoryHandlerIOS.cpp:
2658         (WebCore::TileControllerMemoryHandler::tileControllerGainedUnparentedTiles):
2659
2660 2014-04-14  Beth Dakin  <bdakin@apple.com>
2661
2662         RenderLayerCompositor's m_layerForOverhangAreas should be offset by the 
2663         topContentInset
2664         https://bugs.webkit.org/show_bug.cgi?id=131632
2665         -and corresponding-
2666         <rdar://problem/16609602>
2667
2668         Reviewed by Tim Horton.
2669
2670         Offset m_layerForOverhangAreas by the topContentInset. 
2671         * rendering/RenderLayerCompositor.cpp:
2672         (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
2673
2674 2014-04-14  Alexey Proskuryakov  <ap@apple.com>
2675
2676         Eliminate CachedFrame::m_mousePressNode
2677         https://bugs.webkit.org/show_bug.cgi?id=131626
2678
2679         Reviewed by Brady Eidson.
2680
2681         I couldn't find any observable effect of this change.
2682
2683         * history/CachedFrame.cpp:
2684         (WebCore::CachedFrameBase::CachedFrameBase):
2685         (WebCore::CachedFrameBase::restore):
2686         (WebCore::CachedFrame::clear):
2687         * history/CachedFrame.h:
2688         (WebCore::CachedFrame::documentLoader):
2689         (WebCore::CachedFrame::mousePressNode): Deleted.
2690         Eliminated m_mousePressNode, accessor, and code that reached out to EventHandler.
2691
2692         * page/EventHandler.cpp:
2693         (WebCore::EventHandler::mousePressNode): Deleted.
2694         (WebCore::EventHandler::setMousePressNode): Deleted.
2695         * page/EventHandler.h:
2696         (WebCore::EventHandler::setMousePressed): Deleted. This function was already unused.
2697
2698 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
2699
2700         Run filter animations in the UI process with UI-side compositing
2701         https://bugs.webkit.org/show_bug.cgi?id=131199
2702         <rdar://problem/16479487>
2703
2704         Reviewed by Sam Weinig.
2705
2706         Add FilterOperation::clone() which is used during decoding.
2707         Export some things.
2708
2709         * WebCore.exp.in:
2710         * platform/graphics/filters/FilterOperation.h:
2711
2712 2014-04-14  Jer Noble  <jer.noble@apple.com>
2713
2714         Use after free in WebCore::CachedResourceHandleBase::~CachedResourceHandleBase / WebCore::removeDetachedChildrenInContainer
2715         https://bugs.webkit.org/show_bug.cgi?id=131169
2716
2717         Reviewed by Eric Carlson.
2718
2719         Invalidate the WebCoreAVFResourceLoader owned by MediaPlayerPrivateAVFoundationObjC
2720         in its destructor, to prevent a private function being called in response to the
2721         WebCoreAVFResourceLoader being stopped.
2722
2723         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2724         (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
2725         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
2726         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2727         (WebCore::WebCoreAVFResourceLoader::invalidate):
2728
2729 2014-04-14  Simon Fraser  <simon.fraser@apple.com>
2730
2731         [WK2 iOS] Scrolling to anchor links is broken
2732         https://bugs.webkit.org/show_bug.cgi?id=131618
2733         <rdar://problem/16599144>
2734
2735         Reviewed by Tim Horton.
2736
2737         Have ScrollingTreeScrollingNode pass RequestedScrollPosition updates
2738         to the scrolling tree, so that the scrolling tree can have custom behavior
2739         for them if necessary.
2740
2741         * page/scrolling/ScrollingTree.h:
2742         (WebCore::ScrollingTree::scrollingTreeNodeRequestsScroll):
2743         * page/scrolling/ScrollingTreeScrollingNode.cpp:
2744         (WebCore::ScrollingTreeScrollingNode::updateAfterChildren):
2745         * page/scrolling/ScrollingTreeScrollingNode.h:
2746
2747 2014-04-14  Brian J. Burg  <burg@cs.washington.edu>
2748
2749         Web Replay: memoize fallback time values for document.lastModified
2750         https://bugs.webkit.org/show_bug.cgi?id=131318
2751
2752         Reviewed by Joseph Pecoraro.
2753
2754         If a document's Last-Modified header can't be found or used, then 
2755         document.lastModified is derived from the current system time or
2756         from filesystem data, which is obviously nondeterministic.
2757
2758         It's better to handle this inside Document::lastModified rather than using
2759         MemoizedDOMResult, because only the fallback case is nondeterministic.
2760
2761         Test: http/tests/inspector/replay/document-last-modified-fallback-value.html
2762
2763         * dom/Document.cpp:
2764         (WebCore::Document::lastModified): Save or reuse memoized fallback value.
2765         * replay/WebInputs.json: Add input DocumentLastModifiedDate.
2766
2767 2014-04-12  Antti Koivisto  <antti@apple.com>
2768
2769         Keep secondary tile grid for zoomed-out scale
2770         https://bugs.webkit.org/show_bug.cgi?id=131586
2771
2772         Reviewed by Darin Adler.
2773
2774         * platform/graphics/ca/GraphicsLayerCA.cpp:
2775         (WebCore::GraphicsLayerCA::updateContentsScale):
2776         
2777             Don't repaint tiled backing with setNeedsDisplay, it invalidates itself correctly in setContentsScale.
2778             Update custom child layers when tiled backing scale changes.
2779
2780         * platform/graphics/ca/mac/TileController.h:
2781         * platform/graphics/ca/mac/TileController.mm:
2782         (WebCore::TileController::TileController):
2783         (WebCore::TileController::setNeedsDisplay):
2784         
2785             Drop the whole zoomed-out grid on full repaint.
2786
2787         (WebCore::TileController::setNeedsDisplayInRect):
2788             
2789             Drop changed zoomed-out tiles. A more sophisticated strategy is possible.
2790
2791         (WebCore::TileController::setContentsScale):
2792         
2793             Swap the zoomed-out grid in and out as needed.
2794             Repaint the active grid after scale change so the client does not have to.
2795
2796         (WebCore::TileController::contentsScale):
2797         
2798             Get the content scale from the tile grid so it is not kept in two places.
2799
2800         (WebCore::TileController::zoomedOutContentsScale):
2801         (WebCore::TileController::setZoomedOutContentsScale):
2802         
2803             Drop the zoomed-out grid if it no longer matches the zoomed-out scale.
2804
2805         (WebCore::TileController::tileRevalidationTimerFired):
2806         (WebCore::TileController::retainedTileBackingStoreMemory):
2807         (WebCore::TileController::containerLayers):
2808         
2809             Return both zoomed-out tiles and the active tiles. Active tiles are on top.
2810
2811         (WebCore::TileController::numberOfUnparentedTiles):
2812         (WebCore::TileController::removeUnparentedTilesNow):
2813         * platform/graphics/ca/mac/TileGrid.h:
2814         * platform/graphics/ca/mac/TileGrid.mm:
2815         (WebCore::TileGrid::dropTilesInRect):
2816         
2817             Add a function for dropping tiles.
2818
2819         (WebCore::TileGrid::revalidateTiles):
2820
2821 2014-04-14  Oliver Hunt  <oliver@apple.com>
2822
2823         Update test result
2824
2825         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2826         (WebCore::JSTestNondeterministicConstructor::finishCreation):
2827
2828 2014-04-14  Dirk Schulze  <krit@webkit.org>
2829
2830         Optimize Canvas fill and drawImage with SourceIn, DestinationIn, SourceOut, and DestinationAtop using transparencyLayer.
2831         https://bugs.webkit.org/show_bug.cgi?id=79659
2832
2833         Reviewed by Darin Adler.
2834
2835         Optimize fill() and fillRect() operations in Canvas on composited contexts by
2836         10 to 20 times on CG.
2837
2838         Replacing the ImageBuffer code by transparency layers allows the
2839         graphics library to optimize the drawing.
2840
2841         Doing the same for drawImage() would give performance regressions.
2842
2843         An inline function will create a transparency layer for CG. Cairo graphics
2844         does not composite correctly when a transparency layer gets created. 
2845         The inline function is just a NOOP for Cairo.
2846
2847         This fixes bug 131303 as well.
2848
2849         Added performance tests with r167124 already.
2850
2851         * html/canvas/CanvasRenderingContext2D.cpp:
2852         (WebCore::CanvasRenderingContext2D::fillInternal):
2853         (WebCore::CanvasRenderingContext2D::strokeInternal):
2854         (WebCore::CanvasRenderingContext2D::beginCompositeLayer):
2855         (WebCore::CanvasRenderingContext2D::endCompositeLayer):
2856         (WebCore::CanvasRenderingContext2D::fillRect):
2857         (WebCore::CanvasRenderingContext2D::strokeRect):
2858         (WebCore::CanvasRenderingContext2D::drawTextInternal):
2859         (WebCore::CanvasRenderingContext2D::fullCanvasCompositedFill): Deleted.
2860         * html/canvas/CanvasRenderingContext2D.h:
2861
2862 2014-04-14  Tim Horton  <timothy_horton@apple.com>
2863
2864         Lots of compositing test failures after r167152
2865         https://bugs.webkit.org/show_bug.cgi?id=131574
2866
2867         Reviewed by Darin Adler.
2868
2869         * platform/graphics/GraphicsLayer.cpp:
2870         (WebCore::dumpChildren):
2871         (WebCore::GraphicsLayer::dumpProperties):
2872         Make child-dumping recursive so that we can easily skip layers up to any depth.
2873
2874 2014-04-14  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
2875
2876         Fix incorrect indentations in CodeGeneratorJS.pm introduced in r165521
2877         https://bugs.webkit.org/show_bug.cgi?id=131613
2878
2879         Reviewed by Csaba Osztrogonác.
2880
2881         * bindings/scripts/CodeGeneratorJS.pm:
2882         (GenerateImplementation):
2883         Fixed 5-space indentation.
2884         * bindings/scripts/test/JS/JSTestNondeterministic.cpp:
2885         Updated the tests accordingly.
2886
2887 2014-04-14  Manuel Rego Casasnovas  <rego@igalia.com>
2888
2889         [JSC] CSSStyleDeclaration report incorrect descriptor
2890         https://bugs.webkit.org/show_bug.cgi?id=89697
2891
2892         Reviewed by Benjamin Poulain.
2893
2894         Change descriptor of CSSStyleDeclaration properties in order to have
2895         writable and enumerable attributes set to true. Configurable is kept to
2896         false since the property is not deleteable.
2897
2898         Test: fast/dom/CSSStyleDeclaration/cssstyledeclaration-properties-descriptor.html
2899
2900         * bindings/js/JSCSSStyleDeclarationCustom.cpp:
2901         (WebCore::JSCSSStyleDeclaration::getOwnPropertySlotDelegate): Only set
2902         DontDelete attribute when creating the descriptor for
2903         CSSStyleDeclaration properties.
2904
2905 2014-04-14  Benjamin Poulain  <benjamin@webkit.org>
2906
2907         [JSC] Improve the call site of string comparison in some hot path
2908         https://bugs.webkit.org/show_bug.cgi?id=131605
2909
2910         Reviewed by Darin Adler.
2911
2912         * dom/NodeRareData.h:
2913         (WebCore::NodeListsNodeData::NodeListCacheMapEntryHash::equal):
2914         We should use the right comparison operation depending on the Hash Traits.
2915
2916 2014-04-14  Andreas Kling  <akling@apple.com>
2917
2918         Merge MemoryPressureHandler{Mac,IOS}.mm
2919         <https://webkit.org/b/131603>
2920
2921         Join the iOS and Mac platform implementations of MemoryPressureHandler
2922         under the shared Cocoa banner. Each platform still has its own quirky
2923         behavior, but this puts them in the same file so we can start sharing.
2924
2925         Reviewed by Darin Adler.
2926
2927         * WebCore.xcodeproj/project.pbxproj:
2928         * platform/cocoa/MemoryPressureHandlerCocoa.mm: Renamed from Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm.
2929         (WebCore::MemoryPressureHandler::platformReleaseMemory):
2930         (WebCore::MemoryPressureHandler::install):
2931         (WebCore::MemoryPressureHandler::uninstall):
2932         (WebCore::MemoryPressureHandler::holdOff):
2933         (WebCore::MemoryPressureHandler::respondToMemoryPressure):
2934         (WebCore::respondToMemoryPressureCallback):
2935         (WebCore::MemoryPressureHandler::installMemoryReleaseBlock):
2936         (WebCore::MemoryPressureHandler::setReceivedMemoryPressure):
2937         (WebCore::MemoryPressureHandler::hasReceivedMemoryPressure):
2938         (WebCore::MemoryPressureHandler::clearMemoryPressure):
2939         (WebCore::MemoryPressureHandler::shouldWaitForMemoryClearMessage):
2940         (WebCore::MemoryPressureHandler::respondToMemoryPressureIfNeeded):
2941         * platform/ios/MemoryPressureHandlerIOS.mm: Removed.
2942
2943 2014-04-14  Benjamin Poulain  <benjamin@webkit.org>
2944
2945         CSS JIT: compile the :nth-child() pseudo class
2946         https://bugs.webkit.org/show_bug.cgi?id=131602
2947
2948         Reviewed by Andreas Kling.
2949
2950         Tests: fast/selectors/nth-child-bounds.html
2951                fast/selectors/nth-child-with-backtracking.html
2952
2953         Compile the :nth-child() pseudo class function + some related clean up.
2954
2955         * css/CSSSelector.cpp:
2956         (WebCore::CSSSelector::nthA):
2957         (WebCore::CSSSelector::nthB):
2958         Expose the parsed value of an+b filters. Those values are used to compile
2959         the selector.
2960
2961         (WebCore::CSSSelector::RareData::parseNth):
2962         While working on the patch, I discovered some severe issues with the parsing of large
2963         values of a and/or b. The problem comes from the way the CSS parser handle the values:
2964         the values are parsed as a double then converted to an AtomicString for CSSSelector.
2965
2966         There are many problems related to large values but we never got bug reports because
2967         they are very uncommon. Fixing those problem would require changing the parser.
2968
2969         Here, CSSSelector::RareData::parseNth() is hardened a little bit to avoid absurd values
2970         of a and b.
2971
2972         * css/CSSSelector.h:
2973         * cssjit/RegisterAllocator.h:
2974         It looks like I forgot RDX in the list of register. Add it now since it is required
2975         for SelectorCodeGenerator::modulo().
2976
2977         * cssjit/SelectorCompiler.cpp:
2978         (WebCore::SelectorCompiler::addPseudoType):
2979         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2980         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
2981         (WebCore::SelectorCompiler::SelectorCodeGenerator::moduloIsZero):
2982         There is no modulo() operation exposed on the macro assemblers. This is a basic
2983         implementation on top of idiv for x86_64.
2984
2985         Since idiv works exclusively with RAX and RDX, most of the code is about getting
2986         those registers efficiently.
2987
2988         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2989         (WebCore::SelectorCompiler::setElementChildIndex):
2990         (WebCore::SelectorCompiler::setElementChildIndexAndUpdateStyle):
2991         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
2992         This is pretty much a straightforward implementation of :nth-child().
2993         The first part counts the number of previous elements.
2994         The second part updates the tree if this is style resolution.
2995         The last part compares the number of previous siblings to an+b to find if the filter matches.
2996
2997         The only part that diverges from SelectorChecker is how childIndex is used. Instead of testing it
2998         at every iteration, only the first iteration handle the cache.
2999
3000         * dom/ElementRareData.h:
3001         (WebCore::ElementRareData::childIndexMemoryOffset):
3002         * dom/Node.h:
3003         (WebCore::Node::rareDataMemoryOffset):
3004         (WebCore::Node::flagHasRareData):
3005         * rendering/style/RenderStyle.h:
3006
3007 2014-04-14  Tim Horton  <timothy_horton@apple.com>
3008
3009         Support setting a background color on page overlays
3010         https://bugs.webkit.org/show_bug.cgi?id=131600
3011
3012         Reviewed by Darin Adler.
3013
3014         * rendering/RenderLayerCompositor.cpp:
3015         (WebCore::RenderLayerCompositor::setDocumentOverlayRootLayer):
3016         Mark the compositing tree as needing a rebuild when we get a new document-relative
3017         overlay layer; otherwise we were depending on something else coming along and
3018         requiring a rebuild, which didn't always happen.
3019
3020 2014-04-14  Mihnea Ovidenie  <mihnea@adobe.com>
3021
3022         [CSS Regions] Hit testing doesn't work in video
3023         https://bugs.webkit.org/show_bug.cgi?id=131485
3024
3025         Reviewed by Andrei Bucur.
3026
3027         When hit testing flow thread layer through the region layer,
3028         we have to pass the depth sorting information and take that
3029         into account for the situation in which an ancestor of the region
3030         has preserve-3d transform style.
3031
3032         Test: fast/regions/hit-test-region-preserve3d-container.html
3033
3034         * rendering/RenderLayer.cpp:
3035         (WebCore::RenderLayer::hitTestLayer):
3036         (WebCore::RenderLayer::hitTestFlowThreadIfRegionForFragments):
3037         * rendering/RenderLayer.h:
3038
3039 2014-04-13  Darin Adler  <darin@apple.com>
3040
3041         userVisibleString should not try to "encode" host names
3042         https://bugs.webkit.org/show_bug.cgi?id=131587
3043         rdar://problem/14686849
3044
3045         Reviewed by Alexey Proskuryakov.
3046
3047         * WebCore.exp.in: Updated for WebCoreNSURLExtras argument type changes.
3048
3049         * platform/mac/WebCoreNSURLExtras.h: Removed unneeded code to make this
3050         Objective-C++ header compile in plain C++ files, which we never need to do.
3051         Added missing argument name, baseURL, and changed mysterious CFIndex arguments
3052         to the correct type, CFURLComponentType.
3053
3054         * platform/mac/WebCoreNSURLExtras.mm:
3055         (WebCore::isLookalikeCharacter): Removed the inline keyword from this, and added
3056         more lookalike characters from the Mozilla list referenced here.
3057         (WebCore::URLByTruncatingOneCharacterBeforeComponent): Updated argument type.
3058         (WebCore::dataForURLComponentType): Ditto.
3059         (WebCore::userVisibleString): Only call mapHostNames if host name decoding is
3060         needed; no encoding here.
3061
3062 2014-04-13  Darin Adler  <darin@apple.com>
3063
3064         REGRESSION (r158617): Find on Page can get stuck in a loop when the search string occurs in an <input> in a <fieldset>
3065         https://bugs.webkit.org/show_bug.cgi?id=126322
3066
3067         Reviewed by Ryosuke Niwa.
3068
3069         * dom/Element.cpp:
3070         (WebCore::Element::canContainRangeEndPoint): Now returns false when the role of the element
3071         is "img". This is the same rule that's hard-coded in isRenderReplacedElement for the same
3072         reason. Need more test coverage to make sure this role feature works consistently.
3073
3074         * dom/Element.h: Made canContainRangeEndPoint no longer inline since it's not just a
3075         return statement any more.
3076
3077         * dom/Position.cpp:
3078         (WebCore::Position::isCandidate): Took out code that calls isRendererReplacedElement
3079         that was added in r158617; not needed now that we updated canContainRangeEndPoint.
3080
3081         * dom/Range.cpp:
3082         (WebCore::Range::firstNode): Removed code here that called isRendererReplacedElement.
3083         This was the wrong level to be adding editing logic, and there's a FIXME here to that
3084         effect, which we are now deleting. This was the change that broke Find.
3085
3086         * editing/TextIterator.cpp: Added a comment about the redundancy between the
3087         isRendererReplacedElement and editingIgnoresContent functions.
3088
3089         * html/HTMLHRElement.cpp:
3090         (WebCore::HTMLHRElement::canContainRangeEndPoint): Call through to base class instead
3091         of just returning true when we have child nodes. Lets Element::canContainRangeEndPoint
3092         do its thing.
3093         * html/HTMLHRElement.h: Ditto.
3094
3095         * html/HTMLObjectElement.cpp:
3096         (WebCore::HTMLObjectElement::canContainRangeEndPoint): Call through to base class instead
3097         of just returning true when we have fallback content. Lets Element::canContainRangeEndPoint
3098         do its thing.
3099         * html/HTMLObjectElement.h: Ditto.
3100
3101         * testing/Internals.cpp:
3102         (WebCore::Internals::countMatchesForText): Set the limit to 1000 instead of infinite.
3103
3104 2014-04-12  Darin Adler  <darin@apple.com>
3105
3106         Use unique_ptr for FillLayer::m_next
3107         https://bugs.webkit.org/show_bug.cgi?id=75222
3108
3109         Reviewed by Dan Bernstein.
3110
3111         * css/DeprecatedStyleBuilder.cpp:
3112         (WebCore::ApplyPropertyFillLayer::applyInheritValue):
3113         Renamed currChild to just child and prevChild to previousChild.
3114         Changed code to pass ownership of the new FillLayer immediately.
3115         Changed some loops to be for loops.
3116         (WebCore::ApplyPropertyFillLayer::applyInitialValue): Ditto.
3117         (WebCore::ApplyPropertyFillLayer::applyValue): Ditto.
3118
3119         * rendering/RenderBox.cpp:
3120         (WebCore::RenderBox::backgroundHasOpaqueTopLayer): Use reference
3121         instead of pointer.
3122         (WebCore::RenderBox::paintFillLayers): Ditto.
3123         * rendering/RenderBoxModelObject.cpp:
3124         (WebCore::RenderBoxModelObject::paintFillLayerExtended): Ditto.
3125
3126         * rendering/style/FillLayer.cpp:
3127         (WebCore::FillLayer::FillLayer): Removed m_next initializer since it is now an
3128         OwnPtr and initializes automatically. In a couple other places, changed m_next
3129         initializer to use make_unique.
3130         (WebCore::FillLayer::~FillLayer): Wrote loop for deletion of m_next.
3131         (WebCore::FillLayer::operator=): Removed unneeded explicit deletion of m_next.
3132         (WebCore::FillLayer::cullEmptyLayers): Ditto.
3133         (WebCore::clipMax): Marked inline.
3134         (WebCore::FillLayer::computeClipMax): Rewrote to use a loop instead of recursion.
3135         (WebCore::FillLayer::containsImage): Ditto.
3136         (WebCore::FillLayer::imagesAreLoaded): Ditto.
3137         (WebCore::FillLayer::hasOpaqueImage): Rewrote to use && instead of multiple if.
3138         (WebCore::FillLayer::hasImage): Rewrote to use a loop instead of recursion.
3139         (WebCore::FillLayer::hasFixedImage): Ditto.
3140
3141         * rendering/style/FillLayer.h: Changed m_next to be a unique_ptr.
3142
3143 2014-04-13  Andy Estes  <aestes@apple.com>
3144
3145         [QuickLook] Move file system-related code into WebKit
3146         https://bugs.webkit.org/show_bug.cgi?id=131597
3147
3148         Reviewed by Dan Bernstein.
3149
3150         QuickLookHandle should not be responsible for saving a copy of the
3151         original document to disk as it might be running in a process that
3152         either can't write to disk or can only write into a sandboxed
3153         container. To account for this, we need to separate the concern of
3154         quick look conversion from that of original document saving so that
3155         each activity can run in the appropriate process.
3156
3157         Created a new interface between WebCore and WebKit by adding a client
3158         (QuickLookHandleClient) to QuickLookHandle which is notified of incoming
3159         bytes. A new function on FrameLoaderClient tells WebKit when a new
3160         QuickLookHandle is created, giving WebKit the opportunity to register a
3161         handle client. Moved the existing file system-related code as well as
3162         code only needed by WebKit1 in QuickLookHandle into a new WebKit1
3163         QuickLookHandleClient subclass.
3164
3165         * WebCore.exp.in:
3166         * WebCore.xcodeproj/project.pbxproj: Made QuickLookHandleClient.h Private.
3167         * loader/FrameLoaderClient.h:
3168         (WebCore::FrameLoaderClient::didCreateQuickLookHandle): Added.
3169         * loader/ResourceLoader.cpp:
3170         (WebCore::ResourceLoader::didCreateQuickLookHandle): Called FrameLoaderClient::didCreateQuickLookHandle().
3171         * loader/ResourceLoader.h:
3172         * platform/network/ResourceHandle.h: Made m_quickLook a unique_ptr.
3173         (WebCore::ResourceHandle::setQuickLookHandle): Changed to take a unique_ptr.
3174         * platform/network/ResourceHandleClient.h:
3175         (WebCore::ResourceHandleClient::didCreateQuickLookHandle): Added.
3176         * platform/network/ios/QuickLook.h: Added m_client, gave m_converter a stronger type, and made m_nsResponse a RetainPtr.
3177         (WebCore::QuickLookHandle::setClient): Added.
3178         (WebCore::QuickLookHandle::firstRequestURL): Added.
3179         (WebCore::QuickLookHandle::converter): Added.
3180         * platform/network/ios/QuickLook.mm:
3181         (WebCore::registerQLPreviewConverterIfNeeded):
3182         (WebCore::createTemporaryFileForQuickLook): Made non-static.
3183         (WebCore::emptyClient): Returned a shared empty QuickLookHandleClient.
3184         (WebCore::QuickLookHandle::QuickLookHandle): Removed file system and WebKit1-only code.
3185         (WebCore::QuickLookHandle::create): Changed to return a unique_ptr.
3186         (WebCore::QuickLookHandle::nsResponse):
3187         (WebCore::QuickLookHandle::didReceiveDataArray): Removed file system code and called QuickLookHandleClient::didReceiveDataArray() instead.
3188         (WebCore::QuickLookHandle::didReceiveData): Removed file system code and called QuickLookHandleClient::didReceiveData() instead.
3189         (WebCore::QuickLookHandle::didFinishLoading): Removed file system code and called QuickLookHandleClient::didFinishLoading() instead.
3190         (WebCore::QuickLookHandle::didFail): Removed file system and WebKit1-only code, calling QuickLookHandleClient::didFail() instead.
3191         (WebCore::QuickLookHandle::~QuickLookHandle): Removed file system and WebKit1-only code. Cleared our reference to m_client.
3192         (WebCore::QuickLookHandle::previewFileName): Retrieved from m_converter.
3193         (WebCore::QuickLookHandle::previewRequestURL): Ditto.
3194         * platform/network/ios/QuickLookHandleClient.h: Added.
3195         (WebCore::QuickLookHandleClient::~QuickLookHandleClient):
3196         (WebCore::QuickLookHandleClient::didReceiveDataArray):
3197         (WebCore::QuickLookHandleClient::didReceiveData):
3198         (WebCore::QuickLookHandleClient::didFinishLoading):
3199         (WebCore::QuickLookHandleClient::didFail):
3200
3201 2014-04-10  Pratik Solanki  <psolanki@apple.com>
3202
3203         Move early return out of dispatch_async() block so we can return from willSendRequest quickly
3204         https://bugs.webkit.org/show_bug.cgi?id=131478
3205         <rdar://problem/16575535>
3206
3207         Reviewed by Alexey Proskuryakov.
3208
3209         Do a quick check to see if we need to synthesize the redirect response on the dispatch queue
3210         and return from willSendRequest callback quickly instead of always doing an effectively synchronous
3211         call to the main thread. We can't call synthesizeRedirectResponseIfNecessary on the dispatch
3212         queue since that accesses the ResourceRequest.
3213
3214         No new tests because no change in functionality.
3215
3216         * platform/network/cf/ResourceHandleCFURLConnectionDelegate.h:
3217         * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
3218         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::setupRequest): Save the
3219         request scheme to use later for early return from willSendRequest.
3220         (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
3221
3222 2014-04-08  Oliver Hunt  <oliver@apple.com>
3223
3224         Rewrite Function.bind as a builtin
3225         https://bugs.webkit.org/show_bug.cgi?id=131083
3226
3227         Reviewed by Geoffrey Garen.
3228
3229         Switch WebCore to use the helper functions when defining the
3230         prototype properties on DOM constructors, and update bindings
3231         tests accordingly.
3232
3233         * bindings/js/JSImageConstructor.cpp:
3234         (WebCore::JSImageConstructor::finishCreation):
3235         * bindings/scripts/CodeGeneratorJS.pm:
3236         (GenerateConstructorHelperMethods):
3237         * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
3238         (WebCore::JSTestActiveDOMObjectConstructor::finishCreation):
3239         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3240         (WebCore::JSTestCustomNamedGetterConstructor::finishCreation):
3241         * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
3242         (WebCore::JSTestEventConstructorConstructor::finishCreation):
3243         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3244         (WebCore::JSTestEventTargetConstructor::finishCreation):
3245         * bindings/scripts/test/JS/JSTestException.cpp:
3246         (WebCore::JSTestExceptionConstructor::finishCreation):
3247         * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
3248         (WebCore::JSTestGenerateIsReachableConstructor::finishCreation):
3249         * bindings/scripts/test/JS/JSTestInterface.cpp:
3250         (WebCore::JSTestInterfaceConstructor::finishCreation):
3251         * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
3252         (WebCore::JSTestMediaQueryListListenerConstructor::finishCreation):
3253         * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
3254         (WebCore::JSTestNamedConstructorConstructor::finishCreation):
3255         (WebCore::JSTestNamedConstructorNamedConstructor::finishCreation):
3256         * bindings/scripts/test/JS/JSTestNode.cpp:
3257         (WebCore::JSTestNodeConstructor::finishCreation):
3258         * bindings/scripts/test/JS/JSTestObj.cpp:
3259         (WebCore::JSTestObjConstructor::finishCreation):
3260         * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
3261         (WebCore::JSTestOverloadedConstructorsConstructor::finishCreation):
3262         * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
3263         (WebCore::JSTestSerializedScriptValueInterfaceConstructor::finishCreation):
3264         * bindings/scripts/test/JS/JSTestTypedefs.cpp:
3265         (WebCore::JSTestTypedefsConstructor::finishCreation):
3266         * bindings/scripts/test/JS/JSattribute.cpp:
3267         (WebCore::JSattributeConstructor::finishCreation):
3268         * bindings/scripts/test/JS/JSreadonly.cpp:
3269         (WebCore::JSreadonlyConstructor::finishCreation):
3270
3271 2014-04-13  Simon Fraser  <simon.fraser@apple.com>
3272
3273         [iOS WK2] Hook up scrolling tree nodes when coming out of the page cache
3274         https://bugs.webkit.org/show_bug.cgi?id=131577
3275
3276         Reviewed by Tim Horton.
3277
3278         The call to scrollingCoordinator->frameViewRootLayerDidChange() was inside
3279         a #if !PLATFORM(IOS) block, but now that we use the ScrollingCoordinator
3280         for WK2 we want to call this.
3281
3282         * loader/HistoryController.cpp:
3283         (WebCore::HistoryController::restoreScrollPositionAndViewState):
3284
3285 2014-04-13  Zan Dobersek  <zdobersek@igalia.com>
3286
3287         Unreviewed build fix after r167196.
3288
3289         * platform/RemoteCommandListener.cpp:
3290         (WebCore::RemoteCommandListener::create): Fall back to using the new operator
3291         for allocating RemoteCommandListener object. Using std::make_unique() requires
3292         for the operator to be public, which doesn't work well with the static create()
3293         method.
3294
3295 2014-04-13  Zan Dobersek  <zdobersek@igalia.com>
3296
3297         Remove unnecessary uses of std::move() in return statements
3298         https://bugs.webkit.org/show_bug.cgi?id=131457
3299
3300         Reviewed by Darin Adler.
3301
3302         Don't use std::move() in return statements unless necessary as it inhibits
3303         named return value optimizations as performed by compilers.
3304
3305         * Modules/battery/BatteryManager.cpp:
3306         (WebCore::BatteryManager::create):
3307         * html/FormController.cpp:
3308         (WebCore::FormController::createSavedFormStateMap):
3309         * html/canvas/WebGLRenderingContext.cpp:
3310         (WebCore::WebGLRenderingContext::create):
3311         * platform/RemoteCommandListener.cpp:
3312         (WebCore::RemoteCommandListener::create):
3313         * platform/graphics/ca/GraphicsLayerCA.cpp:
3314         (WebCore::GraphicsLayer::create):
3315         * platform/ios/RemoteCommandListenerIOS.mm:
3316         (WebCore::RemoteCommandListener::create):
3317         * rendering/RenderGrid.cpp:
3318         (WebCore::RenderGrid::GridIterator::nextEmptyGridArea):
3319         * rendering/RenderLayer.cpp:
3320         (WebCore::RenderLayer::setupFilters):
3321         * rendering/style/CounterDirectives.cpp:
3322         (WebCore::clone):
3323
3324 2014-04-13  Commit Queue  <commit-queue@webkit.org>
3325
3326         Unreviewed, rolling out r167168 and r167194.
3327         https://bugs.webkit.org/show_bug.cgi?id=131589
3328
3329         Caused massive ASSERTION failures on the GTK Debug bot
3330         (Requested by philn on #webkit).
3331
3332         Reverted changesets:
3333
3334         "[GTK] Add HighDPI support for non-accelerated compositing
3335         contents"
3336         https://bugs.webkit.org/show_bug.cgi?id=131562
3337         http://trac.webkit.org/changeset/167168
3338
3339         "Unreviewed. Fix GTK+ build with recent cairo and GTK+ after
3340         r167168."
3341         http://trac.webkit.org/changeset/167194
3342
3343 2014-04-13  Youenn Fablet  <youenn.fablet@crf.canon.fr>
3344
3345         [GStreamer] No CORS support for media elements
3346         https://bugs.webkit.org/show_bug.cgi?id=99037
3347
3348         Reviewed by Philippe Normand.
3349
3350         Added CORS access control check to media sources when crossorigin attribute is set.
3351
3352         Added getter to CORS access control check status (used to compute whether the stream is tainted or not).
3353         Related test is http/tests/security/video-cross-origin-readback.html.
3354
3355         Disabled access to cross-origin streams that fail CORS check when crossorigin attribute is set.
3356         Related test is http/tests/security/video-cross-origin-accessfailure.html.
3357
3358         Tests: http/tests/security/video-cross-origin-accessfailure.html
3359                http/tests/security/video-cross-origin-accesssameorigin.html
3360
3361         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
3362         (WebCore::MediaPlayerPrivateGStreamer::didPassCORSAccessCheck): Return whether media is cross-origin (tainted) or not by querying the gstreamer source layer.
3363         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Added MediaPlayerPrivateGStreamer::didPassCORSAccessCheck declaration.
3364         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
3365         (webKitWebSrcStart): Passed CORS mode parameter to the streaming client. In case of CORS check failure, stop the resource loading.
3366         (webKitSrcPassedCORSAccessCheck): Return whether CORS access control check was done and successful.
3367         (StreamingClient::handleResponseReceived): Take a parameter to assign the CORS access control check result.
3368         (CachedResourceStreamingClient::CachedResourceStreamingClient): Updated setting of the ResourceLoaderOptions according CORS mode.
3369         (CachedResourceStreamingClient::responseReceived): Check CORS and pass result to handleResponseReceived.
3370         (ResourceHandleStreamingClient::didReceiveResponse): No CORS check.
3371         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Added webKitSrcPassedCORSAccessCheck declaration.
3372
3373 2014-04-12  Darin Adler  <darin@apple.com>
3374
3375         REGRESSION (r166860): ASSERTION FAILED: !isCalculated() on fast/css/image-set-value-not-removed-crash.html
3376         https://bugs.webkit.org/show_bug.cgi?id=131480
3377
3378         Reviewed by Andreas Kling.
3379
3380         Fixes intermittent assertion failure in fast/css/image-set-value-not-removed-crash.html.
3381
3382         * css/CSSComputedStyleDeclaration.cpp:
3383         (WebCore::valueForImageSliceSide): Added. Helper used below in valueForNinePieceImageSlice.
3384         Handles calculated values by returning 0; incorrect but predictable.
3385         (WebCore::valueForNinePieceImageSlice): Updated to call valueForImageSliceSide.
3386         (WebCore::positionOffsetValue): Use nullptr.
3387         (WebCore::ComputedStyleExtractor::propertyValue): Updated to call positionOffsetValue
3388         by its new name. Removed "get" from the name.
3389         (WebCore::positionOffsetValue): Renamed from getPositionOffsetValue.
3390
3391         * platform/Length.h: Made isCalculated public.
3392
3393 2014-04-12  Andy Estes  <aestes@apple.com>
3394
3395         Fix the iOS build after r167183.
3396
3397         * platform/network/ResourceHandle.h:
3398         * platform/network/cf/ResourceHandleCFNet.cpp:
3399         (WebCore::ResourceHandle::schedule):
3400         (WebCore::ResourceHandle::unschedule):
3401
3402 2014-04-12  Andy Estes  <aestes@apple.com>
3403
3404         [iOS] Move QuickLookHandle from ResourceLoader to WebResourceLoader
3405         https://bugs.webkit.org/show_bug.cgi?id=131580
3406
3407         Reviewed by Darin Adler.
3408
3409         There's no need to bloat WebKit1's ResourceLoader with a pointer that
3410         only WebKit2's WebResourceLoader cares about.
3411
3412         * loader/ResourceLoader.h:
3413         (WebCore::ResourceLoader::quickLookHandle): Deleted.
3414         (WebCore::ResourceLoader::setQuickLookHandle): Deleted.
3415
3416 2014-04-12  Chris Fleizach  <cfleizach@apple.com>
3417
3418         AX: Cleanup AccessibilityObject::getAttribute
3419       &