Unreviewed, rolling out r167700.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2014-04-24  Commit Queue  <commit-queue@webkit.org>
2
3         Unreviewed, rolling out r167700.
4         https://bugs.webkit.org/show_bug.cgi?id=132142
5
6         Incorrectly reverted the change in r167547 for
7         webkit.org/b/131898 (Requested by rniwa on #webkit).
8
9         Reverted changeset:
10
11         "Cursor doesn't change back to pointer when leaving the Safari
12         window"
13         https://bugs.webkit.org/show_bug.cgi?id=132038
14         http://trac.webkit.org/changeset/167700
15
16 2014-04-24  Brady Eidson  <beidson@apple.com>
17
18         Rename "IMAGE_CONTROLS" feature to "SERVICE_CONTROLS"
19         https://bugs.webkit.org/show_bug.cgi?id=132155
20
21         Reviewed by Tim Horton.
22
23         No new tests (No change in behavior).
24
25         * Configurations/FeatureDefines.xcconfig:
26         * DerivedSources.make:
27         * WebCore.exp.in:
28         * css/CSSDefaultStyleSheets.cpp:
29         (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement):
30         * css/CSSPrimitiveValueMappings.h:
31         (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
32         * css/CSSValueKeywords.in:
33         * dom/Node.h:
34         * html/HTMLImageElement.cpp:
35         (WebCore::HTMLImageElement::HTMLImageElement):
36         (WebCore::HTMLImageElement::parseAttribute):
37         (WebCore::HTMLImageElement::didAttachRenderers):
38         * html/HTMLImageElement.h:
39         * html/shadow/ImageControlsRootElement.cpp:
40         * html/shadow/ImageControlsRootElement.h:
41         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
42         * html/shadow/mac/ImageControlsButtonElementMac.h:
43         * html/shadow/mac/ImageControlsRootElementMac.cpp:
44         * html/shadow/mac/ImageControlsRootElementMac.h:
45         * page/ContextMenuContext.cpp:
46         (WebCore::ContextMenuContext::ContextMenuContext):
47         * page/ContextMenuContext.h:
48         * page/ContextMenuController.cpp:
49         (WebCore::ContextMenuController::maybeCreateContextMenu):
50         (WebCore::ContextMenuController::populate):
51         * page/ContextMenuController.h:
52         * page/Settings.in:
53         * platform/ThemeTypes.h:
54         * rendering/RenderImage.cpp:
55         (WebCore::RenderImage::canHaveChildren):
56         * rendering/RenderTheme.cpp:
57         (WebCore::RenderTheme::adjustStyle):
58         (WebCore::RenderTheme::paint):
59         (WebCore::RenderTheme::paintBorderOnly):
60         (WebCore::RenderTheme::paintDecorations):
61         * rendering/RenderTheme.h:
62         * rendering/RenderThemeMac.h:
63         * rendering/RenderThemeMac.mm:
64         (WebCore::RenderThemeMac::servicesRolloverButtonCell):
65         (WebCore::RenderThemeMac::paintImageControlsButton):
66         (WebCore::RenderThemeMac::imageControlsButtonSize):
67
68 2014-04-24  Timothy Hatcher  <timothy@apple.com>
69
70         Web Inspector: Restore PageDebuggerAgent::enable / disable
71         https://bugs.webkit.org/show_bug.cgi?id=132156
72
73         Restore functions that were eroniously removed in r167530.
74
75         Reviewed by Joseph Pecoraro.
76
77         * inspector/PageDebuggerAgent.cpp:
78         (WebCore::PageDebuggerAgent::enable): Added.
79         (WebCore::PageDebuggerAgent::disable): Added.
80         * inspector/PageDebuggerAgent.h:
81
82 2014-04-24  Alexey Proskuryakov  <ap@apple.com>
83
84         Dropzone effects don't work in non-file documents
85         https://bugs.webkit.org/show_bug.cgi?id=131770
86
87         Reviewed by Darin Adler.
88
89         File documents have two quirks that were making dropzone work in these before:
90         1. An ancient hack for Dashboard allows pasteboard access from JS.
91         2. On Mac, sandbox doesn't prevent File object creation, as we already have the access.
92
93         * dom/DataTransfer.cpp:
94         (WebCore::DataTransfer::hasFileOfType):
95         (WebCore::DataTransfer::hasStringOfType):
96         * dom/DataTransfer.h:
97         Moved these functions from EventHandler to DataTransfer. We can't create a DataTransfer
98         with Files while dragging, security doesn't permit us to. But we can get the file name.
99
100         * fileapi/File.cpp:
101         (WebCore::createBlobDataForFile):
102         (WebCore::createBlobDataForFileWithName):
103         (WebCore::File::contentTypeFromFilePath):
104         (WebCore::getContentTypeFromFileName): Deleted.
105         * fileapi/File.h:
106         Exposed a function to get file type from path without creating a File first.
107         This is much cheaper than creating a File, and works even when sandbox disallows
108         read access to content, such as when dragging over a target.
109
110         * page/EventHandler.cpp:
111         (WebCore::hasDropZoneType):
112         (WebCore::hasFileOfType): Deleted.
113         (WebCore::hasStringOfType): Deleted.
114
115 2014-04-24  Commit Queue  <commit-queue@webkit.org>
116
117         Unreviewed, rolling out r167441.
118         https://bugs.webkit.org/show_bug.cgi?id=132152
119
120         Caused full screen regressions on vimeo, youtube, and others.
121         (Requested by jernoble on #webkit).
122
123         Reverted changeset:
124
125         "Fullscreen media controls are unusable in pagination mode"
126         https://bugs.webkit.org/show_bug.cgi?id=131705
127         http://trac.webkit.org/changeset/167441
128
129 2014-04-24  Adenilson Cavalcanti  <cavalcantii@gmail.com>
130
131         Unused class forward declarations in Page
132         https://bugs.webkit.org/show_bug.cgi?id=132141
133
134         Reviewed by Benjamin Poulain.
135
136         No new tests, no change on behavior.
137
138         * page/Page.h:
139
140 2014-04-24  Eric Carlson  <eric.carlson@apple.com>
141
142         [Mac] don't ask for AVAssetTrack properties before they are available
143         https://bugs.webkit.org/show_bug.cgi?id=131902
144         <rdar://problem/16505076>
145
146         Reviewed by Brent Fulgham.
147
148         No new tests, the behavior this changes can not be tested with a layout test.
149
150         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
151         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
152         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize
153             m_cachedTotalBytes.
154         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata): Don't report that
155             metadata has been loaded until the track properties we need have been loaded too.
156         (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes): Cache totalBytes instead
157             of recalculating it every time.
158         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Invalidate cached
159             total bytes.
160         (WebCore::assetTrackMetadataKeyNames): Array of AVAssetTrack properties we use.
161
162 2014-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
163
164         Unify platformWidthForGlyph across OS X and iOS
165         https://bugs.webkit.org/show_bug.cgi?id=132036
166
167         Reviewed by Darin Adler.
168
169         This patch creates on shared SimpleFontData::platformWidthForGlyph() function for both OS X and iOS.
170
171         No new tests are necessary because there should be no behavior changes.
172
173         * platform/graphics/SimpleFontData.h: Signatures for two helper functions
174         * platform/graphics/ios/SimpleFontDataIOS.mm: Replace iOS implementation of platformWidthForGlyph() with
175         implementations of only the two helper functions
176         (WebCore::SimpleFontData::getRenderingStyle): Compute style argument to CGFontGetGlyphAdvancesForStyle()
177         (WebCore::SimpleFontData::advanceForColorBitmapFont): iOS doesn't have color bitmap fonts
178         (WebCore::SimpleFontData::platformWidthForGlyph): Deleted.
179         * platform/graphics/mac/SimpleFontDataMac.mm:
180         (WebCore::SimpleFontData::getRenderingStyle): Compute style argument to CGFontGetGlyphAdvancesForStyle()
181         (WebCore::SimpleFontData::advanceForColorBitmapFont): Use [NSFont advancementForGlyph] to compute the advance
182         (WebCore::hasCustomTracking): Removed #if
183         (WebCore::isEmoji): Only relevant on iOS
184         (WebCore::SimpleFontData::platformWidthForGlyph): Shared implementation. Calls helper functions.
185
186 2014-04-24  Zalan Bujtas  <zalan@apple.com>
187
188         Subpixel rendering: Clipping on text areas when shifted by one device pixel.
189         https://bugs.webkit.org/show_bug.cgi?id=132008
190
191         Reviewed by Darin Adler.
192
193         Make RenderTheme paint* functions LayoutRect aware. Textarea is device pixel snapped, while
194         other theme controls are still on integral size/positions.
195
196         Test: fast/forms/hidpi-textarea-on-subpixel-position.html
197
198         * rendering/RenderBox.cpp:
199         (WebCore::RenderBox::paintBoxDecorations):
200         * rendering/RenderTheme.cpp:
201         (WebCore::RenderTheme::paint):
202         (WebCore::RenderTheme::paintBorderOnly):
203         (WebCore::RenderTheme::paintDecorations):
204         * rendering/RenderTheme.h:
205         (WebCore::RenderTheme::paintTextField):
206         (WebCore::RenderTheme::paintTextFieldDecorations):
207         (WebCore::RenderTheme::paintTextArea):
208         (WebCore::RenderTheme::paintTextAreaDecorations):
209         * rendering/RenderThemeIOS.h:
210         * rendering/RenderThemeIOS.mm:
211         (WebCore::RenderThemeIOS::paintTextFieldDecorations):
212         (WebCore::RenderThemeIOS::paintTextAreaDecorations):
213         * rendering/RenderThemeMac.h:
214         * rendering/RenderThemeMac.mm:
215         (WebCore::RenderThemeMac::paintTextField):
216         (WebCore::RenderThemeMac::paintTextArea):
217
218 2014-04-24  Myles C. Maxfield  <mmaxfield@apple.com>
219
220         FontCache::fontCache() never returns nullptr so it can be made to return a reference instead
221         https://bugs.webkit.org/show_bug.cgi?id=132110
222
223         Reviewed by Tim Horton.
224
225         Updates callers to use '.' instead of '->'.
226
227         No new tests are necessary because there should be no behavior change.
228
229         * css/CSSFontFaceSource.cpp:
230         (WebCore::CSSFontFaceSource::getFontData):
231         * css/CSSFontSelector.cpp:
232         (WebCore::CSSFontSelector::CSSFontSelector):
233         (WebCore::CSSFontSelector::~CSSFontSelector):
234         (WebCore::CSSFontSelector::addFontFaceRule):
235         (WebCore::fontDataForGenericFamily):
236         (WebCore::CSSFontSelector::getFallbackFontData):
237         * platform/MemoryPressureHandler.cpp:
238         (WebCore::MemoryPressureHandler::releaseMemory):
239         * platform/graphics/FontCache.cpp:
240         (WebCore::fontCache): Return a reference
241         * platform/graphics/FontCache.h:
242         (WebCore::FontCachePurgePreventer::FontCachePurgePreventer):
243         (WebCore::FontCachePurgePreventer::~FontCachePurgePreventer):
244         * platform/graphics/FontGlyphs.cpp:
245         (WebCore::FontGlyphs::FontGlyphs):
246         (WebCore::FontGlyphs::releaseFontData):
247         (WebCore::FontGlyphs::realizeFontDataAt):
248         (WebCore::FontGlyphs::glyphDataAndPageForCharacter):
249         * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
250         (WebCore::FontPlatformData::verticalData):
251         * platform/graphics/ios/SimpleFontDataIOS.mm:
252         (WebCore::SimpleFontData::platformCreateScaledFontData):
253         * platform/graphics/mac/ComplexTextControllerCoreText.mm:
254         (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
255         * platform/graphics/mac/FontCacheMac.mm:
256         (WebCore::invalidateFontCache):
257         (WebCore::fontCacheRegisteredFontsChangedNotificationCallback):
258         * platform/graphics/mac/SimpleFontDataMac.mm:
259         (WebCore::SimpleFontData::platformDestroy):
260         (WebCore::SimpleFontData::platformCreateScaledFontData):
261         * platform/graphics/win/FontCacheWin.cpp:
262         (WebCore::getCJKCodePageMasks):
263         * platform/graphics/win/SimpleFontDataWin.cpp:
264         (WebCore::SimpleFontData::containsCharacters):
265         * platform/graphics/wince/FontCacheWinCE.cpp:
266         (WebCore::getCJKCodePageMasks):
267         * platform/graphics/wince/FontPlatformData.cpp:
268         (WebCore::FontFamilyCodePageInfo::codePages):
269         (WebCore::FixedSizeFontData::create):
270         * platform/graphics/wince/GlyphPageTreeNodeWinCE.cpp:
271         (WebCore::GlyphPage::fill):
272         * platform/graphics/wince/SimpleFontDataWinCE.cpp:
273         (WebCore::SimpleFontData::platformCreateScaledFontData):
274         (WebCore::SimpleFontData::containsCharacters):
275
276 2014-04-24  Eric Carlson  <eric.carlson@apple.com>
277
278         [iOS] Manage AudioSession category according to media type
279         https://bugs.webkit.org/show_bug.cgi?id=132096
280
281         Reviewed by Jer Noble.
282
283         * WebCore.exp.in: Export setting.
284
285         * html/HTMLMediaSession.cpp:
286         (WebCore::HTMLMediaSession::HTMLMediaSession):
287         (WebCore::initializeAudioSession): Deleted.
288
289         * page/Settings.cpp:
290         * page/Settings.h:
291         (WebCore::Settings::setShouldManageAudioSession): New.
292         (WebCore::Settings::shouldManageAudioSession): Ditto.
293
294         * platform/audio/ios/AudioDestinationIOS.cpp:
295         (WebCore::AudioDestinationIOS::AudioDestinationIOS): Use a MediaSession instead of inheriting
296             from AudioListener and calling the AudioSession directly.
297         (WebCore::AudioDestinationIOS::~AudioDestinationIOS): Ditto.
298         (WebCore::AudioDestinationIOS::start): Notify session.
299         (WebCore::AudioDestinationIOS::stop): Ditto.
300         (WebCore::AudioDestinationIOS::beganAudioInterruption): Deleted.
301         (WebCore::AudioDestinationIOS::endedAudioInterruption): Deleted.
302         * platform/audio/ios/AudioDestinationIOS.h:
303         (WebCore::AudioDestinationIOS::mediaType):
304         (WebCore::AudioDestinationIOS::canReceiveRemoteControlCommands):
305         (WebCore::AudioDestinationIOS::didReceiveRemoteControlCommand):
306         (WebCore::AudioDestinationIOS::isPlaying): Deleted.
307
308         * platform/audio/ios/AudioSessionIOS.mm:
309         (WebCore::categoryName): Debug-only logging function.
310         (WebCore::AudioSession::setCategory): Don't stick with "media" once it is set.
311
312         * platform/audio/ios/MediaSessionManagerIOS.mm:
313         (WebCore::MediaSessionManageriOS::resetRestrictions): Set up restrictions for WebAudio.
314         (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Don't set invalid start time.
315
316         * platform/audio/mac/MediaSessionManagerMac.cpp:
317         (MediaSessionManager::updateSessionState): Manage AudioSession.active when WebAudio clients
318             come and go. Manage AudioSession.category according to the number of WebAudio and
319             HTMLMediaElement clients.
320
321 2014-04-24  David Hyatt  <hyatt@apple.com>
322
323         [New Multicolumn] Client rects don't work with column spans.
324         https://bugs.webkit.org/show_bug.cgi?id=132131
325
326         Reviewed by Dean Jackson.
327         
328         Don't factor in the offset of the multicolumn set from the top
329         of the multicolumn block. This was added already, and it doesn't
330         need to be a part of columnTranslationForOffset.
331
332         Added fast/multicol/client-rects-spanners.html
333
334         * rendering/RenderMultiColumnSet.cpp:
335         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
336
337 2014-04-24  Praveen R Jadhav  <praveen.j@samsung.com>
338
339         [EFL] WebKit build fails when MEDIA_SOURCE is enabled
340         https://bugs.webkit.org/show_bug.cgi?id=132118
341
342         Reviewed by Brent Fulgham.
343
344         Files MediaSourceGStreamer.cpp, SourceBufferPrivateGStreamer.cpp and
345         WebKitMediaSourceGStreamer.cpp are included for EFL port build.
346
347         No new tests. No change in behaviour.
348
349         * PlatformEfl.cmake: MediaSourceGStreamer.cpp, SourceBufferPrivateGStreamer.cpp
350         and WebKitMediaSourceGStreamer.cpp are included for compilation.
351
352 2014-04-24  Tamas Gergely  <tgergely.u-szeged@partner.samsung.com>
353
354         ASSERTION FAILED: !begin.isIndefinite() in WebCore::SVGSMILElement::resolveFirstInterval.
355         https://bugs.webkit.org/show_bug.cgi?id=131097
356
357         Reviewed by Darin Adler.
358
359         According to smil animation reference, max attribute cannot be 0.
360
361         Test: svg/animations/smil-animation-max-attribute-zero-crash.svg
362
363         * svg/animation/SVGSMILElement.cpp:
364         (WebCore::SVGSMILElement::maxValue):
365           changed (result < 0) to (result <= 0)
366
367 2014-04-24  Ryuan Choi  <ryuan.choi@samsung.com>
368
369         Remove screenColorProfile()
370         https://bugs.webkit.org/show_bug.cgi?id=132035
371
372         Reviewed by Darin Adler.
373
374         Only chromium used screenColorProfile() since r120789.
375
376         * platform/PlatformScreen.h:
377         * platform/efl/PlatformScreenEfl.cpp:
378         (WebCore::screenColorProfile): Deleted.
379         * platform/gtk/PlatformScreenGtk.cpp:
380         (WebCore::screenColorProfile): Deleted.
381         * platform/image-decoders/ImageDecoder.h:
382         (WebCore::ImageDecoder::qcmsOutputDeviceProfile):
383         * platform/ios/PlatformScreenIOS.mm:
384         (WebCore::screenColorProfile): Deleted.
385         * platform/mac/PlatformScreenMac.mm:
386         (WebCore::screenColorProfile): Deleted.
387         * platform/win/PlatformScreenWin.cpp:
388         (WebCore::screenColorProfile): Deleted.
389
390 2014-04-24  Zalan Bujtas  <zalan@apple.com>
391
392         One more unreviewed build fix after r167755.
393
394         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
395         (WebCore::RenderImageControlsButton::updateLogicalWidth):
396         (WebCore::RenderImageControlsButton::computeLogicalHeight):
397
398 2014-04-24  Zalan Bujtas  <zalan@apple.com>
399
400         Unreviewed build fix after r167755.
401
402         * rendering/RenderThemeMac.h:
403
404 2014-04-24  Zalan Bujtas  <zalan@apple.com>
405
406         Transition RenderTheme API from RenderObject* to const RenderObject&
407         https://bugs.webkit.org/show_bug.cgi?id=132037
408
409         Reviewed by Andreas Kling.
410
411         Using const references provides better encapsulation and improve security.
412
413         No change in behavior.
414
415         * accessibility/AccessibilityObject.cpp:
416         (WebCore::AccessibilityObject::boundingBoxForQuads):
417         * dom/Element.cpp:
418         (WebCore::Element::setActive):
419         (WebCore::Element::setHovered):
420         * editing/FrameSelection.cpp:
421         (WebCore::FrameSelection::focusedOrActiveStateChanged):
422         * html/HTMLFormControlElement.cpp:
423         (WebCore::HTMLFormControlElement::disabledStateChanged):
424         (WebCore::HTMLFormControlElement::readOnlyAttributeChanged):
425         * html/HTMLInputElement.cpp:
426         (WebCore::HTMLInputElement::setChecked):
427         (WebCore::HTMLInputElement::setIndeterminate):
428         * html/HTMLOptionElement.cpp:
429         (WebCore::HTMLOptionElement::parseAttribute):
430         * rendering/RenderBlock.cpp:
431         (WebCore::RenderBlock::addVisualOverflowFromTheme):
432         (WebCore::RenderBlock::baselinePosition):
433         * rendering/RenderBox.cpp:
434         (WebCore::RenderBox::paintBoxDecorations):
435         * rendering/RenderButton.cpp:
436         (WebCore::RenderButton::styleDidChange):
437         * rendering/RenderFileUploadControl.cpp:
438         (WebCore::RenderFileUploadControl::paintObject):
439         * rendering/RenderFlowThread.cpp:
440         (WebCore::RenderFlowThread::addRegionsVisualOverflowFromTheme):
441         * rendering/RenderObject.cpp:
442         (WebCore::RenderObject::drawLineForBoxSide):
443         * rendering/RenderObject.h:
444         * rendering/RenderProgress.cpp:
445         (WebCore::RenderProgress::computeLogicalHeight):
446         * rendering/RenderTextControlSingleLine.cpp:
447         (WebCore::RenderTextControlSingleLine::paint):
448         * rendering/RenderTheme.cpp:
449         (WebCore::RenderTheme::paint):
450         (WebCore::RenderTheme::paintBorderOnly):
451         (WebCore::RenderTheme::paintDecorations):
452         (WebCore::RenderTheme::baselinePosition):
453         (WebCore::RenderTheme::adjustRepaintRect):
454         (WebCore::RenderTheme::stateChanged):
455         (WebCore::RenderTheme::updateControlStatesForRenderer):
456         (WebCore::RenderTheme::extractControlStatesForRenderer):
457         (WebCore::RenderTheme::isActive):
458         (WebCore::RenderTheme::isChecked):
459         (WebCore::RenderTheme::isIndeterminate):
460         (WebCore::RenderTheme::isEnabled):
461         (WebCore::RenderTheme::isFocused):
462         (WebCore::RenderTheme::isPressed):
463         (WebCore::RenderTheme::isSpinUpButtonPartPressed):
464         (WebCore::RenderTheme::isReadOnlyControl):
465         (WebCore::RenderTheme::isHovered):
466         (WebCore::RenderTheme::isSpinUpButtonPartHovered):
467         (WebCore::RenderTheme::isDefault):
468         (WebCore::RenderTheme::paintInputFieldSpeechButton):
469         (WebCore::RenderTheme::paintMeter):
470         (WebCore::RenderTheme::paintSliderTicks):
471         (WebCore::RenderTheme::progressBarRectForBounds):
472         * rendering/RenderTheme.h:
473         (WebCore::RenderTheme::controlSupportsTints):
474         (WebCore::RenderTheme::paintCapsLockIndicator):
475         (WebCore::RenderTheme::paintFileUploadIconDecorations):
476         (WebCore::RenderTheme::imageControlsButtonSize):
477         (WebCore::RenderTheme::paintCheckbox):
478         (WebCore::RenderTheme::paintRadio):
479         (WebCore::RenderTheme::paintButton):
480         (WebCore::RenderTheme::paintInnerSpinButton):
481         (WebCore::RenderTheme::paintCheckboxDecorations):
482         (WebCore::RenderTheme::paintRadioDecorations):
483         (WebCore::RenderTheme::paintButtonDecorations):
484         (WebCore::RenderTheme::paintTextField):
485         (WebCore::RenderTheme::paintTextFieldDecorations):
486         (WebCore::RenderTheme::paintTextArea):
487         (WebCore::RenderTheme::paintTextAreaDecorations):
488         (WebCore::RenderTheme::paintMenuList):
489         (WebCore::RenderTheme::paintMenuListDecorations):
490         (WebCore::RenderTheme::paintMenuListButtonDecorations):
491         (WebCore::RenderTheme::paintPushButtonDecorations):
492         (WebCore::RenderTheme::paintSquareButtonDecorations):
493         (WebCore::RenderTheme::paintProgressBar):
494         (WebCore::RenderTheme::paintSliderTrack):
495         (WebCore::RenderTheme::paintSliderThumb):
496         (WebCore::RenderTheme::paintSliderThumbDecorations):
497         (WebCore::RenderTheme::paintSearchField):
498         (WebCore::RenderTheme::paintSearchFieldDecorations):
499         (WebCore::RenderTheme::paintSearchFieldCancelButton):
500         (WebCore::RenderTheme::paintSearchFieldDecorationPart):
501         (WebCore::RenderTheme::paintSearchFieldResultsDecorationPart):
502         (WebCore::RenderTheme::paintSearchFieldResultsButton):
503         (WebCore::RenderTheme::paintMediaFullscreenButton):
504         (WebCore::RenderTheme::paintMediaPlayButton):
505         (WebCore::RenderTheme::paintMediaOverlayPlayButton):
506         (WebCore::RenderTheme::paintMediaMuteButton):
507         (WebCore::RenderTheme::paintMediaSeekBackButton):
508         (WebCore::RenderTheme::paintMediaSeekForwardButton):
509         (WebCore::RenderTheme::paintMediaSliderTrack):
510         (WebCore::RenderTheme::paintMediaSliderThumb):
511         (WebCore::RenderTheme::paintMediaVolumeSliderContainer):
512         (WebCore::RenderTheme::paintMediaVolumeSliderTrack):
513         (WebCore::RenderTheme::paintMediaVolumeSliderThumb):
514         (WebCore::RenderTheme::paintMediaRewindButton):
515         (WebCore::RenderTheme::paintMediaReturnToRealtimeButton):
516         (WebCore::RenderTheme::paintMediaToggleClosedCaptionsButton):
517         (WebCore::RenderTheme::paintMediaControlsBackground):
518         (WebCore::RenderTheme::paintMediaCurrentTime):
519         (WebCore::RenderTheme::paintMediaTimeRemaining):
520         (WebCore::RenderTheme::paintMediaFullScreenVolumeSliderTrack):
521         (WebCore::RenderTheme::paintMediaFullScreenVolumeSliderThumb):
522         (WebCore::RenderTheme::paintSnapshottedPluginOverlay):
523         (WebCore::RenderTheme::paintImageControlsButton):
524         * rendering/RenderThemeIOS.h:
525         * rendering/RenderThemeIOS.mm:
526         (WebCore::RenderThemeIOS::addRoundedBorderClip):
527         (WebCore::RenderThemeIOS::paintCheckboxDecorations):
528         (WebCore::RenderThemeIOS::baselinePosition):
529         (WebCore::RenderThemeIOS::paintRadioDecorations):
530         (WebCore::RenderThemeIOS::paintTextFieldDecorations):
531         (WebCore::RenderThemeIOS::paintTextAreaDecorations):
532         (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
533         (WebCore::RenderThemeIOS::paintSliderTrack):
534         (WebCore::RenderThemeIOS::paintSliderThumbDecorations):
535         (WebCore::RenderThemeIOS::paintProgressBar):
536         (WebCore::RenderThemeIOS::paintSearchFieldDecorations):
537         (WebCore::RenderThemeIOS::paintButtonDecorations):
538         (WebCore::RenderThemeIOS::paintPushButtonDecorations):
539         (WebCore::RenderThemeIOS::paintFileUploadIconDecorations):
540         * rendering/RenderThemeMac.h:
541         (WebCore::RenderThemeMac::updateActiveState):
542         * rendering/RenderThemeMac.mm:
543         (WebCore::RenderThemeMac::documentViewFor):
544         (WebCore::RenderThemeMac::adjustRepaintRect):
545         (WebCore::RenderThemeMac::convertToPaintingRect):
546         (WebCore::RenderThemeMac::updateCheckedState):
547         (WebCore::RenderThemeMac::updateEnabledState):
548         (WebCore::RenderThemeMac::updateFocusedState):
549         (WebCore::RenderThemeMac::updatePressedState):
550         (WebCore::RenderThemeMac::controlSupportsTints):
551         (WebCore::RenderThemeMac::paintTextField):
552         (WebCore::RenderThemeMac::paintCapsLockIndicator):
553         (WebCore::RenderThemeMac::paintTextArea):
554         (WebCore::RenderThemeMac::paintMenuList):
555         (WebCore::RenderThemeMac::paintMeter):
556         (WebCore::RenderThemeMac::progressBarRectForBounds):
557         (WebCore::RenderThemeMac::paintProgressBar):
558         (WebCore::RenderThemeMac::paintMenuListButtonGradients):
559         (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
560         (WebCore::RenderThemeMac::setPopupButtonCellState):
561         (WebCore::RenderThemeMac::paintSliderTrack):
562         (WebCore::RenderThemeMac::paintSliderThumb):
563         (WebCore::RenderThemeMac::paintSearchField):
564         (WebCore::RenderThemeMac::setSearchCellState):
565         (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
566         (WebCore::RenderThemeMac::paintSearchFieldDecorationPart):
567         (WebCore::RenderThemeMac::paintSearchFieldResultsDecorationPart):
568         (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
569         (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
570         (WebCore::RenderThemeMac::paintImageControlsButton):
571         (WebCore::RenderThemeMac::imageControlsButtonSize):
572
573 2014-04-23  Carlos Garcia Campos  <cgarcia@igalia.com>
574
575         [GTK] HTML Media capture attribute is a boolean since r163958
576         https://bugs.webkit.org/show_bug.cgi?id=132061
577
578         Reviewed by Gustavo Noronha Silva.
579
580         Add new methods webkit_dom_html_input_element_get_capture_enabled
581         and webkit_dom_html_input_element_set_capture_enabled using a
582         boolean and deprecate the old methods.
583
584         * bindings/gobject/WebKitDOMDeprecated.cpp:
585         (webkit_dom_html_input_element_get_capture):
586         (webkit_dom_html_input_element_set_capture):
587         * bindings/gobject/WebKitDOMDeprecated.h:
588         * bindings/gobject/WebKitDOMDeprecated.symbols:
589         * bindings/gobject/webkitdom.symbols:
590         * bindings/scripts/CodeGeneratorGObject.pm:
591         (GetEffectiveFunctionName): Helper function to rename API methods
592         for special cases.
593         (GenerateFunction): Use GetEffectiveFunctionName().
594
595 2014-04-23  Praveen R Jadhav  <praveen.j@samsung.com>
596
597         [MediaStream] Implement MediaStream active attribute
598         https://bugs.webkit.org/show_bug.cgi?id=131973
599
600         Reviewed by Eric Carlson.
601
602         MediaStream .active attribute are introduced which will replace
603         .ended attribute. This patch implements the newly introduced attributes.
604
605         MediaStream-add-remove-tracks.html is updated to handle this scenario.
606
607         * Modules/mediastream/MediaStream.cpp:
608         (WebCore::MediaStream::active): Added.
609         (WebCore::MediaStream::setActive): Added.
610         (WebCore::MediaStream::addTrack): Propagates 'onactive' event when required.
611         (WebCore::MediaStream::removeTrack): Propagates 'oninactive' event when required.
612         (WebCore::MediaStream::trackDidEnd): Propagates 'oninactive' event when required.
613         (WebCore::MediaStream::streamDidEnd):
614         (WebCore::MediaStream::setStreamIsActive): Added.
615         * Modules/mediastream/MediaStream.h:
616         * Modules/mediastream/MediaStream.idl:
617         * dom/EventNames.h:
618         * platform/mediastream/MediaStreamPrivate.cpp:
619         (WebCore::MediaStreamPrivate::MediaStreamPrivate): Initialize .active attribute
620         (WebCore::MediaStreamPrivate::setEnded):
621         (WebCore::MediaStreamPrivate::setActive): Added.
622         * platform/mediastream/MediaStreamPrivate.h:
623         (WebCore::MediaStreamPrivate::active): Added.
624
625 2014-04-23  Darin Adler  <darin@apple.com>
626
627         [Cocoa] fix CF leaks found by code inspection
628         https://bugs.webkit.org/show_bug.cgi?id=132106
629
630         Reviewed by Andreas Kling.
631
632         * page/CaptionUserPreferencesMediaAF.cpp:
633         (WebCore::trackDisplayName): Added a missing adoptCF.
634
635         * platform/Language.cpp:
636         (WebCore::displayNameForLanguageLocale): Added a missing adoptCF.
637
638         * platform/graphics/FontPlatformData.cpp:
639         (WebCore::FontPlatformData::openTypeTable): Added a missing adoptCF.
640
641         * platform/graphics/avfoundation/cf/InbandTextTrackPrivateAVCF.cpp:
642         (WebCore::InbandTextTrackPrivateAVCF::label): Added two missing adoptCF.
643
644         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
645         (WebCore::AVFWrapper::createImageForTimeInRect): Added two missing adoptCF.
646
647         * platform/graphics/cg/PDFDocumentImage.cpp:
648         (WebCore::PDFDocumentImage::createPDFDocument): Added missing adoptCF.
649
650         * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
651         (WebCore::cascadeToLastResortFontDescriptor): Added two missing adoptCF.
652
653         * platform/graphics/mac/FontMac.mm:
654         (WebCore::Font::primaryFontDataIsSystemFont): Added missing adoptCF.
655
656         * platform/graphics/mac/SimpleFontDataMac.mm:
657         (WebCore::hasCustomTracking): Added missing adoptCF.
658
659         * platform/image-decoders/ImageDecoder.h:
660         (WebCore::ImageDecoder::qcmsOutputDeviceProfile): Added CFRelease.
661
662         * plugins/mac/PluginPackageMac.cpp:
663         (WebCore::readPListFile): Added two missing adoptCF.
664
665 2014-04-23  Ryosuke Niwa  <rniwa@webkit.org>
666
667         REGRESSION (r157328): popover to check into flight ba.com dismisses instantly when focusing form
668         https://bugs.webkit.org/show_bug.cgi?id=131949
669
670         Address the review comment.
671
672         * dom/EventDispatcher.cpp:
673         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope):
674
675 2014-04-23  Andreas Kling  <akling@apple.com>
676
677         CachedResourceLoader hoards URLs indefinitely for no good reason.
678         <https://webkit.org/b/132102>
679         <rdar://problem/16708265>
680
681         Since we don't care about CachedResourceLoader::m_validatedURL's after
682         the Document has finished dispatching its initial load event, clear the
683         set at that point, and don't add any new URLs to it.
684
685         Reviewed by Anders Carlsson.
686
687         * dom/Document.cpp:
688         (WebCore::Document::dispatchWindowLoadEvent):
689         * loader/cache/CachedResourceLoader.cpp:
690         (WebCore::CachedResourceLoader::requestResource):
691         (WebCore::CachedResourceLoader::documentDidFinishLoadEvent):
692         * loader/cache/CachedResourceLoader.h:
693
694 2014-04-23  Andreas Kling  <akling@apple.com>
695
696         Canvas cache of clean URLs can grow without bounds.
697         <https://webkit.org/b/132091>
698         <rdar://problem/16695665>
699
700         Remove a silly "optimization" that kept a cache of clean URLs
701         that can be drawn into a canvas without tainting it, all to avoid
702         the "expensive" checks to determine whether it would taint.
703
704         Reviewed by Benjamin Poulain.
705
706         * html/canvas/CanvasRenderingContext.cpp:
707         (WebCore::CanvasRenderingContext::wouldTaintOrigin):
708         * html/canvas/CanvasRenderingContext.h:
709
710 2014-04-23  Benjamin Poulain  <bpoulain@apple.com>
711
712         [iOS][WK2] Fix a few mistakes affecting the initial layout and the initial unobscured rect
713         https://bugs.webkit.org/show_bug.cgi?id=132093
714
715         Reviewed by Tim Horton.
716
717         Change the minimum layout size to float point values to account for size defined on retina displays.
718         The minimum layout size supports half-pixels, the value is rounded later when computing the layout size
719         in document coordinates.
720
721         * WebCore.exp.in:
722         * page/ViewportConfiguration.cpp:
723         (WebCore::ViewportConfiguration::ViewportConfiguration):
724         Setting the initial content size is incorrect. The layout size computation already take into account
725         empty size for the first layout.
726
727         Setting the content size upfront make the first computation incorrect when the viewport arguments specify
728         the initial scale.
729
730         (WebCore::ViewportConfiguration::setMinimumLayoutSize):
731         * page/ViewportConfiguration.h:
732         (WebCore::ViewportConfiguration::minimumLayoutSize):
733
734 2014-04-23  Brent Fulgham  <bfulgham@apple.com>
735
736         [Mac, iOS] Stop buffering media when on an inactive tab. 
737         https://bugs.webkit.org/show_bug.cgi?id=132077
738
739         Reviewed by Eric Carlson.
740
741         * html/HTMLMediaElement.cpp: Rename 'm_isDisplaySleepDisablingSuspended'
742         to 'm_elementIsHidden'.
743         (WebCore::HTMLMediaElement::HTMLMediaElement):
744         (WebCore::HTMLMediaElement::visibilityStatusChanged): Notify the
745         media session that the element is (or is not) hidden.
746         (WebCore::HTMLMediaElement::setShouldBufferData): Added.
747         * html/HTMLMediaElement.h:
748         * platform/audio/MediaSession.cpp:
749         (WebCore::MediaSession::clientWillBeginPlayback): Tell media to
750         buffer if not hidden or playing.
751         (WebCore::MediaSession::clientWillPausePlayback): Ditto.
752         (WebCore::MediaSession::visibilityChanged): Added. Client API, just relays call
753         to updateClientDataBuffering.
754         (WebCore::MediaSession::updateClientDataBuffering): Tell client it should only
755         buffer data if it's currently playing, or not hidden.
756         * platform/audio/MediaSession.h:
757         * platform/graphics/MediaPlayer.cpp:
758         (WebCore::MediaPlayer::setShouldBufferData): Added: Just relays to
759         MediaPlayerPrivate object.
760         * platform/graphics/MediaPlayer.h:
761         * platform/graphics/MediaPlayerPrivate.h:
762         (WebCore::MediaPlayerPrivateInterface::setShouldBufferData):
763         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
764         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
765         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
766         (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Added.
767         Detach the player item from the player if we don't want to continue
768         buffering or other background tasks.
769
770 2014-04-23  Alexey Proskuryakov  <ap@apple.com>
771
772         Eliminate internals.setMockScrollbarsEnabled()
773         https://bugs.webkit.org/show_bug.cgi?id=132085
774
775         Reviewed by Tim Horton.
776
777         This was essentially unused, and also didnt work.
778
779         * testing/InternalSettings.cpp:
780         (WebCore::InternalSettings::Backup::restoreTo):
781         (WebCore::InternalSettings::setMockScrollbarsEnabled): Deleted.
782         * testing/InternalSettings.h:
783         * testing/InternalSettings.idl:
784
785 2014-04-23  Anders Carlsson  <andersca@apple.com>
786
787         Don't migrate the WKView.h header from WebCore to WebKit
788         https://bugs.webkit.org/show_bug.cgi?id=132086
789
790         Reviewed by Dan Bernstein.
791
792         * WebCore.xcodeproj/project.pbxproj:
793         Add WAKViewInternal.h.
794
795         * platform/WAKViewInternal.h: Added.
796
797         * platform/ios/wak/WAKClipView.m:
798         Import WAKViewInternal.h instead of WAKViewPrivate.h.
799
800         * platform/ios/wak/WAKScrollView.mm:
801         Import WAKViewInternal.h instead of WAKViewPrivate.h.
802
803         * platform/ios/wak/WAKView.h:
804         Move ivars to a class extension in WAKViewInternal.h and remove WKView.h import.
805
806         * platform/ios/wak/WAKView.mm:
807         Import WAKViewInternal.h instead of WAKViewPrivate.h.
808
809         * platform/ios/wak/WAKViewPrivate.h:
810         Import WKViewPrivate.h.
811
812 2014-04-23  David Hyatt  <hyatt@apple.com>
813
814         [New Multicolumn] fast/multicol/fixed-column-percent-logical-height-orthogonal-writing-mode.html fails
815         https://bugs.webkit.org/show_bug.cgi?id=132078
816
817         Reviewed by Anders Carlsson.
818
819         * rendering/RenderBox.cpp:
820         (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation):
821         Add a parameter to test for orthogonal writing modes. If we're perpendicular,
822         then we should not skip the flow thread, since we resolve relative to the column width,
823         and that is always set.
824
825         (WebCore::RenderBox::computePercentageLogicalHeight):
826         Patched to pass in whether or not the box and the ancestor block are perpendicular.
827
828         * rendering/RenderBox.h:
829         Patched the signature of skipContainingBlockForPercentHeightCalculation
830
831 2014-04-23  Myles C. Maxfield  <mmaxfield@apple.com>
832
833         [OS X] Make checking if a font is the system font more robust
834         https://bugs.webkit.org/show_bug.cgi?id=132030
835
836         Reviewed by Dean Jackson.
837
838         Instead of inspecting a font's name to determine if it is a system font,
839         on OS X we can ask the system directly.
840
841         This patch also moves a platform-specific check into platform-specific
842         code, so that other platforms don't check for OS X-specific behavior.
843
844         Covered by existing tests.
845
846         * platform/graphics/Font.cpp:
847         (WebCore::Font::hasValidAverageCharWidth):
848         * platform/graphics/Font.h:
849         * platform/graphics/mac/FontMac.mm:
850         (WebCore::Font::primaryFontDataIsSystemFont):
851
852 2014-04-23  David Hyatt  <hyatt@apple.com>
853
854         [New Multicolumn] Assertion failure in huge-column-count.html
855         https://bugs.webkit.org/show_bug.cgi?id=132071
856
857         Reviewed by Dean Jackson.
858
859         * rendering/RenderBlock.cpp:
860         (WebCore::RenderBlock::regionAtBlockOffset):
861         Back out this change, since it wasn't general enough.
862
863         * rendering/RenderFlowThread.cpp:
864         (WebCore::RenderFlowThread::getRegionRangeForBox):
865         The real issue was that this loop needed to consider the actual box
866         rather than starting from the parent. This was a non-issue for normal
867         regions (which cannot have nested flow threads), but for columns, you 
868         have to consider the fact that the box could itself be a flow thread.
869
870 2014-04-23  Andreas Kling  <akling@apple.com>
871
872         [iOS] Memory pressure notification should fire on main thread.
873         <https://webkit.org/b/132074>
874
875         Rejig the memory pressure notification to fire on the main queue
876         directly instead of rerouting it manually.
877
878         Reviewed by Mark Rowe.
879
880         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
881         (WebCore::MemoryPressureHandler::install):
882
883 2014-04-23  Commit Queue  <commit-queue@webkit.org>
884
885         Unreviewed, rolling out r167720.
886         https://bugs.webkit.org/show_bug.cgi?id=132075
887
888         broke eight newmulticol tests (Requested by thorton on
889         #webkit).
890
891         Reverted changeset:
892
893         "[New Multicolumn] Assertion failure in huge-column-
894         count.html"
895         https://bugs.webkit.org/show_bug.cgi?id=132071
896         http://trac.webkit.org/changeset/167720
897
898 2014-04-23  David Hyatt  <hyatt@apple.com>
899
900         [New Multicolumn] Assertion failure in huge-column-count.html
901         https://bugs.webkit.org/show_bug.cgi?id=132071
902
903         Reviewed by Dean Jackson.
904
905         * rendering/RenderBlock.cpp:
906         (WebCore::RenderBlock::regionAtBlockOffset):
907         Remove the code that returned 0 here, since we're going to patch a lower-level
908         function to catch all cases.
909
910         * rendering/RenderFlowThread.cpp:
911         (WebCore::RenderFlowThread::getRegionRangeForBox):
912         Don't allow in-flow RenderFlowThreads to ever have a region range. The sets
913         are what should have ranges... the flow thread needs to just be ignored.
914
915 2014-04-23  David Hyatt  <hyatt@apple.com>
916
917         [New Multicolumn] Crasher when clearing out a flow thread in multicolumn layout.
918         https://bugs.webkit.org/show_bug.cgi?id=132069
919
920         Reviewed by Dean Jackson.
921
922         This is imported from a patch Morten did for Blink, but I had to change it a fair
923         bit. deleteLines() is used to handle simple line box layout instead of just calling
924         deleteLineBoxTree.
925         
926         I also had to disable the layout state to stop asserts on repaint when the children
927         get moved. Not sure why Blink didn't hit this, but it's simple enough to add a
928         LayoutStateDisabler to stop the assert.
929
930         Added fast/multicol/inline-children-crash.html
931
932         * rendering/RenderMultiColumnFlowThread.cpp:
933         (WebCore::RenderMultiColumnFlowThread::evacuateAndDestroy):
934
935 2014-04-23  Andreas Kling  <akling@apple.com>
936
937         [iOS WebKit2] IOSurfacePool should force CA to actually garbage collect surfaces.
938         <https://webkit.org/b/132065>
939         <rdar://problem/16110687>
940
941         Add a platformGarbageCollectNow() helper function to IOSurfacePool that
942         triggers a sweep of the IOSurfaces. Call this from collectionTimerFired()
943         and discardAllSurfaces().
944
945         This lets us drop all otherwise-unused 420f surfaces on memory pressure.
946
947         Reviewed by Tim Horton.
948
949         * WebCore.xcodeproj/project.pbxproj:
950         * platform/graphics/cg/IOSurfacePool.cpp:
951         (WebCore::IOSurfacePool::collectionTimerFired):
952         (WebCore::IOSurfacePool::discardAllSurfaces):
953         * platform/graphics/cg/IOSurfacePool.h:
954         * platform/graphics/cocoa/IOSurfacePoolCocoa.mm: Added.
955         (WebCore::IOSurfacePool::platformGarbageCollectNow):
956
957 2014-04-23  Morten Stenshorne  <mstensho@opera.com>
958
959         REGRESSION (Safari 6 - ToT): Incorrectly assumes that RenderStyle data can be shared
960         https://bugs.webkit.org/show_bug.cgi?id=113058
961
962         Reviewed by David Hyatt.
963
964         Before sharing CSS properties with an element in the cache, we need to
965         check that the new element is suitable for this, just like we check
966         elements before inserting them into the cache.
967
968         Test: fast/css/identical-logical-height-decl.html
969
970         * css/StyleResolver.cpp:
971         (WebCore::StyleResolver::applyMatchedProperties):
972
973 2014-04-23  Commit Queue  <commit-queue@webkit.org>
974
975         Unreviewed, rolling out r167713.
976         https://bugs.webkit.org/show_bug.cgi?id=132070
977
978         broke hundreds of tests (Requested by thorton on #webkit).
979
980         Reverted changeset:
981
982         "[OS X] Make checking if a font is the system font more
983         robust"
984         https://bugs.webkit.org/show_bug.cgi?id=132030
985         http://trac.webkit.org/changeset/167713
986
987 2014-04-22  David Hyatt  <hyatt@apple.com>
988
989         [New Multicolumn] Nested columns not working at all.
990         https://bugs.webkit.org/show_bug.cgi?id=131805
991
992         Reviewed by Dean Jackson.
993
994         Add support for nested pagination contexts, allowing for an arbitrary level
995         of nesting of multicolumn layouts. There were a number of things that had to
996         be patched in order for this to work.
997
998         * rendering/RenderBlock.cpp:
999         (WebCore::RenderBlock::regionAtBlockOffset):
1000         Make sure RenderMultiColumnFlowThreads just return null for regions at any
1001         block offset. Individual region sets will be created as you cross ancestor
1002         regions eventually, so this is just getting in the way.
1003
1004         * rendering/RenderLayer.cpp:
1005         (WebCore::RenderLayer::enclosingPaginationLayerInSubtree):
1006         Add a new helper method for obtaining an enclosingPaginationLayer when
1007         constrained by some root. This function ensures you don't accidentally
1008         cross your subtree root when looking for enclosing pagination layers.
1009
1010         (WebCore::RenderLayer::collectFragments):
1011         Patch collectFragments to know how to recur to collect ancestor fragments
1012         in order to apply nested splitting as you cross pagination boundaries.
1013
1014         (WebCore::RenderLayer::updatePaintingInfoForFragments):
1015         (WebCore::RenderLayer::calculateClipRects):
1016         * rendering/RenderLayer.h:
1017         (WebCore::LayerFragment::LayerFragment):
1018         (WebCore::LayerFragment::setRects):
1019         (WebCore::LayerFragment::moveBy):
1020         (WebCore::LayerFragment::intersect):
1021         Improve the LayerFragment so that it caches transformed bounding boxes as
1022         well. This is needed to fix intersectsDamageRect so that it doesn't grab
1023         the wrong bounding box when checking inline layers that are paginated.
1024
1025         * rendering/RenderMultiColumnFlowThread.cpp:
1026         (WebCore::RenderMultiColumnFlowThread::flowThreadDescendantInserted):
1027         Ignore inserted flow threads inside an ancestor flow thread, since we only
1028         care about what the sets do.
1029         
1030         * rendering/RenderObject.cpp:
1031         (WebCore::RenderObject::insertedIntoTree):
1032         Make sure that nested flow thread layers return themselves when a child
1033         is inserted directly under them.
1034
1035 2014-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
1036
1037         [OS X] Make checking if a font is the system font more robust
1038         https://bugs.webkit.org/show_bug.cgi?id=132030
1039
1040         Reviewed by Dean Jackson.
1041
1042         Instead of inspecting a font's name to determine if it is a system font,
1043         on OS X we can ask the system directly.
1044
1045         This patch also moves a platform-specific check into platform-specific
1046         code, so that other platforms don't check for OS X-specific behavior.
1047
1048         Covered by existing tests.
1049
1050         * platform/graphics/Font.cpp:
1051         (WebCore::Font::hasValidAverageCharWidth):
1052         * platform/graphics/Font.h:
1053         * platform/graphics/mac/FontMac.mm:
1054         (WebCore::Font::primaryFontDataIsSystemFont):
1055
1056 2014-04-23  Philippe Normand  <pnormand@igalia.com>
1057
1058         [GTK] Focus management API was moved from HTMLDocument to Document in r166668
1059         https://bugs.webkit.org/show_bug.cgi?id=132060
1060
1061         Reviewed by Carlos Garcia Campos.
1062
1063         Deprecate the removed methods in WebKitDOMHTMLDocument to keep API compatibility.
1064
1065         * bindings/gobject/WebKitDOMDeprecated.cpp:
1066         (webkit_dom_html_document_get_active_element):
1067         (webkit_dom_html_document_has_focus):
1068         * bindings/gobject/WebKitDOMDeprecated.h:
1069         * bindings/gobject/WebKitDOMDeprecated.symbols:
1070         * bindings/gobject/webkitdom.symbols:
1071
1072 2014-04-22  Andreas Kling  <akling@apple.com>
1073
1074         [iOS WebKit1] MemoryPressureHandler::respondToMemoryPressure called on wrong thread.
1075         <https://webkit.org/b/132041>
1076         <rdar://problem/16687238>
1077
1078         Always dispatch the memory pressure relief code on the main queue.
1079         This is really only needed for iOS/WK1, but we might as well share the code.
1080
1081         Reviewed by Michael Saboff.
1082
1083         * platform/cocoa/MemoryPressureHandlerCocoa.mm:
1084         (WebCore::MemoryPressureHandler::install):
1085
1086 2014-04-23  Philippe Normand  <pnormand@igalia.com>
1087
1088         [GTK] ShadowRoot API was removed in r164131
1089         https://bugs.webkit.org/show_bug.cgi?id=132059
1090
1091         Reviewed by Gustavo Noronha Silva.
1092
1093         Add ShadowRoot removed API to WebKitDOMDeprecated to keep API/ABI compatibility.
1094
1095         * bindings/gobject/WebKitDOMDeprecated.cpp:
1096         (webkit_dom_shadow_root_class_init):
1097         (webkit_dom_shadow_root_init):
1098         (webkit_dom_shadow_root_element_from_point):
1099         (webkit_dom_shadow_root_get_active_element):
1100         (webkit_dom_shadow_root_get_apply_author_styles):
1101         (webkit_dom_shadow_root_get_element_by_id):
1102         (webkit_dom_shadow_root_get_elements_by_class_name):
1103         (webkit_dom_shadow_root_get_elements_by_tag_name):
1104         (webkit_dom_shadow_root_get_elements_by_tag_name_ns):
1105         (webkit_dom_shadow_root_get_inner_html):
1106         (webkit_dom_shadow_root_get_reset_style_inheritance):
1107         (webkit_dom_shadow_root_get_selection):
1108         (webkit_dom_shadow_root_set_apply_author_styles):
1109         (webkit_dom_shadow_root_set_inner_html):
1110         (webkit_dom_shadow_root_set_reset_style_inheritance):
1111         * bindings/gobject/WebKitDOMDeprecated.h:
1112         * bindings/gobject/WebKitDOMDeprecated.symbols:
1113
1114 2014-04-23  Morten Stenshorne  <mstensho@opera.com>
1115
1116         [New Multicolumn] fast/multicol/overflow-content.html displays red
1117         https://bugs.webkit.org/show_bug.cgi?id=131809
1118
1119         Reviewed by David Hyatt.
1120
1121         Insert a break at end of content on our own in the multicol code, to make sure
1122         that overflow is accounted for, and also to make sure that we account for all
1123         content in non-final sets (i.e. those preceding spanners).
1124
1125         In other words, this will additionally fix balancing issues in sets preceding
1126         a spanner. Added a test for that.
1127
1128         Tests: fast/multicol/break-in-columns-before-spanner.html
1129                fast/multicol/newmulticol/compare-with-old-impl/overflow-content.html
1130
1131         * rendering/RenderFlowThread.cpp:
1132         (WebCore::RenderFlowThread::regionInRange): Deleted.
1133         * rendering/RenderFlowThread.h:
1134         * rendering/RenderMultiColumnSet.cpp:
1135         (WebCore::RenderMultiColumnSet::distributeImplicitBreaks):
1136         * rendering/RenderNamedFlowThread.cpp:
1137         (WebCore::RenderNamedFlowThread::applyBreakAfterContent):
1138         * rendering/RenderNamedFlowThread.h:
1139
1140 2014-04-23  Morten Stenshorne  <mstensho@opera.com>
1141
1142         Overflow propagation broken in BTT and RTL writing-modes
1143         https://bugs.webkit.org/show_bug.cgi?id=113781
1144
1145         Reviewed by David Hyatt.
1146
1147         Overflow rectangles are not quite physical, not quite logical. This
1148         means that we cannot use clientBoxRect() directly to represent a
1149         rectangle that expresses exactly no overflow. This rectangle is the
1150         padding box (relative to the border box) in vertical-lr and
1151         horizontal-tb, but the block-direction borders need to be flipped in
1152         vertical-rl and horizontal-bt.
1153
1154         Tests: fast/css/overflow-btt-border-after.html
1155                fast/css/overflow-rtl-border-after.html
1156
1157         * WebCore.exp.in:
1158         * rendering/RenderBlock.cpp:
1159         (WebCore::RenderBlock::computeOverflow):
1160         * rendering/RenderBox.cpp:
1161         (WebCore::RenderBox::addLayoutOverflow):
1162         (WebCore::RenderBox::addVisualOverflow):
1163         (WebCore::RenderBox::layoutOverflowRectForPropagation):
1164         * rendering/RenderBox.h:
1165         (WebCore::RenderBox::layoutOverflowRect):
1166
1167 2014-04-23  Andrei Bucur  <abucur@adobe.com>
1168
1169         [CSS Regions] Improve the debugging infrastructure
1170         https://bugs.webkit.org/show_bug.cgi?id=132042
1171
1172         Reviewed by Mihnea Ovidenie.
1173
1174         This patch improves the debugging code for CSS Regions.
1175
1176         Tests: No function change. No new tests.
1177
1178         * rendering/RenderObject.cpp:
1179         (WebCore::RenderObject::showRegionsInformation): Print brackets around the region range when dumping
1180         the render tree to the console.
1181         * rendering/RootInlineBox.cpp:
1182         (WebCore::RootInlineBox::containingRegion): Convert the ASSERT to an ASSERT_WITH_SECURITY_IMPLICATION.
1183
1184 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
1185
1186         Cursor doesn't change back to pointer when leaving the Safari window
1187         https://bugs.webkit.org/show_bug.cgi?id=132038
1188
1189         Reviewed by Alexey Proskuryakov.
1190
1191         r147739 incorrectly added an early exit in EventHandler::selectCursor when hit test result didn't have
1192         any node associated with it. Since we will hit this code when the cursor is outside of the WebView,
1193         we still need to take the CURSOR_AUTO path as did the code before r147739.
1194
1195         No new test is added since this behavior can't be tested in DRT or WTR.
1196
1197         * page/EventHandler.cpp:
1198         (WebCore::EventHandler::selectCursor):
1199
1200 2014-04-22  Zalan Bujtas  <zalan@apple.com>
1201
1202         Do not paint border image when the border rect is empty.
1203         https://bugs.webkit.org/show_bug.cgi?id=131988
1204
1205         Reviewed by Darin Adler.
1206
1207         http://trac.webkit.org/changeset/167351 introduced an early return when border
1208         rect is empty. This patch ensures that border image is not painted either in that case.
1209
1210         Modified padding-margin-negative-border.html to cover border-image case.
1211
1212         * rendering/RenderBoxModelObject.cpp:
1213         (WebCore::RenderBoxModelObject::paintBorder):
1214
1215 2014-04-22  Tim Horton  <timothy_horton@apple.com>
1216
1217         ASSERTION FAILED: scrollerImp == scrollbarPainterForScrollbar(_scrollbar) on two API tests
1218         https://bugs.webkit.org/show_bug.cgi?id=132034
1219         <rdar://problem/16624332>
1220
1221         Reviewed by Simon Fraser.
1222
1223         * platform/mac/ScrollAnimatorMac.mm:
1224         (-[WebScrollbarPainterDelegate shouldUseLayerPerPartForScrollerImp:]):
1225         scrollerImpWithStyle:controlSize:horizontal:replacingScrollerImp: moves the delegate
1226         from the old scrollerImp to the new one, and also happens to call shouldUseLayerPerPartForScrollerImp.
1227         Since scrollerImpWithStyle: has not returned yet, the scrollbarPainterForScrollbar still returns the old scrollerImp,
1228         so this assertion fires. It's safe to remove this because supportsUpdateOnSecondaryThread doesn't make use of the imp.
1229
1230 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
1231
1232         REGRESSION (r157328): popover to check into flight ba.com dismisses instantly when focusing form
1233         https://bugs.webkit.org/show_bug.cgi?id=131949
1234
1235         Reviewed by Darin Adler.
1236
1237         The regression was caused by two bugs:
1238         1. The event didn't stop propagating itself even when it should.
1239            If the related target is same as the event origin, the event propagation should stop when the event reaches
1240            the root of the related target's tree scope. Otherwise, it should stop when it reaches the related target.
1241
1242         2. Mouse event's related target exposed nodes inside a user-agent shadow DOM when the related target appeared
1243            inside the origin.
1244
1245         Fixed the bugs by re-introducing path shrinkage algorithm removed in r157328 into EventPath::setRelatedTarget
1246         and adding an algorithm to determine the least common ancestor of the related target and the current target
1247         in moveToParentOrShadowHost. The latter algorithm doesn't match the shadow DOM specification:
1248         http://www.w3.org/TR/2013/WD-shadow-dom-20130514/
1249         but it's good enough in terms of the Web exposed behavior as we don't support author defined insertion points.
1250
1251         Test: fast/events/shadow-event-path.html
1252
1253         * dom/EventDispatcher.cpp:
1254         (WebCore::EventRelatedNodeResolver::moveToParentOrShadowHost):
1255         (WebCore::EventRelatedNodeResolver::findHostOfTreeScopeInTargetTreeScope): Added.
1256         (WebCore::EventDispatcher::dispatchEvent):
1257         (WebCore::EventPath::setRelatedTarget):
1258
1259 2014-04-22  Ryosuke Niwa  <rniwa@webkit.org>
1260
1261         Rollout r156635 since the old behavior was intentional.
1262
1263         * page/EventHandler.cpp:
1264         (WebCore::EventHandler::selectCursor):
1265
1266 2014-04-22  Commit Queue  <commit-queue@webkit.org>
1267
1268         Unreviewed, rolling out r167674.
1269         https://bugs.webkit.org/show_bug.cgi?id=132025
1270
1271         Going a different way with this (Requested by bradee-oh on
1272         #webkit).
1273
1274         Reverted changeset:
1275
1276         "Change Image Controls replacement to use selection and paste"
1277         https://bugs.webkit.org/show_bug.cgi?id=131992
1278         http://trac.webkit.org/changeset/167674
1279
1280 2014-04-22  Brent Fulgham  <bfulgham@apple.com>
1281
1282         [Win] Support Python 2.7 in Cygwin
1283         https://bugs.webkit.org/show_bug.cgi?id=132023
1284
1285         Reviewed by Michael Saboff.
1286
1287         * DerivedSources.make: Use proper path to Cygwin on
1288         all platforms.
1289
1290 2014-04-22  Andreas Kling  <akling@apple.com>
1291
1292         REGRESSION (r151839): Subframe keeps getting mousemove events with the same coordinates after hiding a hovered element.
1293         <https://webkit.org/b/131974>
1294         <rdar://problem/15907469>
1295
1296         When the currently hovered element disappears as a result of style recalc,
1297         we send a fake mousemove event to the page, to see if anything newly added
1298         should become hovered.
1299
1300         The faking mechanism lives in EventHandler and simply synthesizes a new
1301         mousemove event using the last seen mouse location.
1302
1303         The problem here is that we were sending this fake mousemove event to the
1304         subframe where the hovered element lived. Since subframes aren't kept up
1305         to date on recent mouse locations, this could cause some strange behavior
1306         where a subframe would dispatch mousemove events with stale coordinates.
1307
1308         The solution is to always dispatch fake mousemove events from the main
1309         frame's event handler. This is how real event delivery happens, and hit
1310         testing will then find the appropriate subframe, if any.
1311
1312         Reviewed by Benjamin Poulain.
1313
1314         Test: fast/events/ghostly-mousemoves-in-subframe.html
1315
1316         * dom/Document.cpp:
1317         (WebCore::Document::recalcStyle):
1318
1319 2014-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
1320
1321         [OS X] Glyph spacing for system fonts may be incorrect
1322         https://bugs.webkit.org/show_bug.cgi?id=131967
1323
1324         Unreviewed iOS build fix after r167679.
1325
1326         * platform/graphics/mac/SimpleFontDataMac.mm:
1327
1328 2014-04-22  Myles C. Maxfield  <mmaxfield@apple.com>
1329
1330         [OS X] Glyph spacing for system fonts may be incorrect
1331         https://bugs.webkit.org/show_bug.cgi?id=131967
1332
1333         Unreviewed build fix after r167679.
1334
1335         * platform/graphics/mac/SimpleFontDataMac.mm:
1336         (WebCore::hasCustomTracking):
1337
1338 2014-04-21  Myles C. Maxfield  <mmaxfield@apple.com>
1339
1340         [OS X] Glyph spacing for system fonts may be incorrect
1341         https://bugs.webkit.org/show_bug.cgi?id=131967
1342
1343         Reviewed by Simon Fraser.
1344
1345         Covered by existing tests.
1346
1347         * platform/graphics/mac/SimpleFontDataMac.mm:
1348         (WebCore::SimpleFontData::platformWidthForGlyph): Update to use CTFontGetAdvancesForGlyphs() for system fonts
1349         (WebCore::hasCustomTracking):
1350
1351 2014-04-22  David Hyatt  <hyatt@apple.com>
1352
1353         [New Multicolumn] widows/orphans cause assertion failures.
1354         https://bugs.webkit.org/show_bug.cgi?id=131233
1355
1356         Reviewed by Dean Jackson.
1357
1358         * rendering/RenderMultiColumnSet.cpp:
1359         (WebCore::RenderMultiColumnSet::recordSpaceShortage):
1360         Fix an obvious bug where the space shortage is recorded twice (and the
1361         if statement that kept it from being negative is accidentally ignored).
1362
1363 2014-04-22  David Hyatt  <hyatt@apple.com>
1364
1365         [New Multicolumn] Make sure columnTranslationForOffset has the same column-span-aware
1366         translation that fragment collection does.
1367         https://bugs.webkit.org/show_bug.cgi?id=131738
1368
1369         Reviewed by Anders Carlsson.
1370
1371         * rendering/RenderMultiColumnSet.cpp:
1372         (WebCore::RenderMultiColumnSet::collectLayerFragments):
1373         Remove a FIXME that is no longer needed, since the translation offset of the 
1374         column set did get patched.
1375
1376         (WebCore::RenderMultiColumnSet::columnTranslationForOffset):
1377         Add the exact same fix to columnTranslationForOffset that was applied to collectLayerFragments.
1378
1379 2014-04-22  Mark Lam  <mark.lam@apple.com>
1380
1381         WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript() needs to acquire the JSLock before calling into JS.
1382         <https://webkit.org/b/132021>
1383
1384         Reviewed by Mark Hahnenberg.
1385
1386         Covered by existing layout test.
1387
1388         * html/HTMLMediaElement.cpp:
1389         (WebCore::HTMLMediaElement::parseAttribute):
1390
1391 2014-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
1392
1393         REGRESSION (r167652): Broke fast/regions/cssom/region-range-for-box-crash.html in debug mode
1394         https://bugs.webkit.org/show_bug.cgi?id=131982
1395
1396         Reviewed by David Hyatt.
1397
1398         The problem was creating the Range from the arguments received at RenderView::setSelection(). Specifically
1399         in this test endPos is 1 when the element has not children which creates an invalid Range.
1400
1401         * rendering/RenderView.cpp:
1402         (WebCore::RenderView::splitSelectionBetweenSubtrees): Pass 0 as startPos and endPos to Range::create() as we are
1403         not interested in the positions at this point.
1404
1405 2014-04-22  Brady Eidson  <beidson@apple.com>
1406
1407         Change Image Controls replacement to use selection and paste
1408         <rdar://problem/16302722> and https://bugs.webkit.org/show_bug.cgi?id=131992
1409
1410         Reviewed by Tim Horton.
1411
1412         * WebCore.exp.in: Remove deleted symbol.
1413
1414         * html/shadow/mac/ImageControlsButtonElementMac.cpp:
1415         (WebCore::ImageControlsButtonElementMac::defaultEventHandler):
1416
1417         * page/ContextMenuController.cpp:
1418         (WebCore::ContextMenuController::showImageControlsMenu): Select the image element
1419           before showing the menu.
1420         (WebCore::ContextMenuController::replaceControlledImage): Deleted.
1421         * page/ContextMenuController.h:
1422
1423 2014-04-22  David Hyatt  <hyatt@apple.com>
1424
1425         REGRESSION: Hitting asserts in new flow thread selection code.
1426         https://bugs.webkit.org/show_bug.cgi?id=132019
1427
1428         Reviewed by Anders Carlsson.
1429
1430         Null checking flowThreadController is not enough. The list of threads
1431         can be null even when the flowThreadController is not. That's why you
1432         use hasRenderNamedFlowThreads. I patched the two bad places in the code
1433         to use hasRenderNamedFlowThreads to stop the crashes.
1434         
1435         * rendering/RenderView.cpp:
1436         (WebCore::RenderView::selectionBounds):
1437         (WebCore::RenderView::repaintSelection):
1438
1439 2014-04-22  Brent Fulgham  <bfulgham@apple.com>
1440
1441         Check (rather than assume) element is a RenderTableSection before using it
1442         https://bugs.webkit.org/show_bug.cgi?id=121858
1443
1444         Reviewed by David Kilzer.
1445
1446         Test: fast/table/table-insert-object-before-td-crash.html
1447
1448         * rendering/RenderTable.cpp:
1449         (WebCore::RenderTable::addChild): Check that lastBox is a table section before
1450         using the node as if it was one.
1451
1452 2014-04-22  Alex Christensen  <achristensen@webkit.org>
1453
1454         Begin implementation of video using Media Foundation.
1455         https://bugs.webkit.org/show_bug.cgi?id=131830
1456
1457         Reviewed by Brent Fulgham.
1458
1459         * WebCore.vcxproj/WebCore.vcxproj:
1460         * WebCore.vcxproj/WebCore.vcxproj.filters:
1461         Added MediaPlayerPrivateMediaFoundation files.
1462         * platform/graphics/MediaPlayer.cpp:
1463         Include MediaPlayerPrivateMediaFoundation inside new USE(MEDIA_FOUNDATION) flag.
1464         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: Added.
1465         * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Added.
1466
1467 2014-04-22  Commit Queue  <commit-queue@webkit.org>
1468
1469         Unreviewed, rolling out r167658.
1470         https://bugs.webkit.org/show_bug.cgi?id=131993
1471
1472         Caused many crashes on media tests (Requested by ap on
1473         #webkit).
1474
1475         Reverted changeset:
1476
1477         "[Mac] don't ask for AVAssetTrack properties before they are
1478         available"
1479         https://bugs.webkit.org/show_bug.cgi?id=131902
1480         http://trac.webkit.org/changeset/167658
1481
1482 2014-04-22  David Hyatt  <hyatt@apple.com>
1483
1484         [New Multicolumn] fast/multicol/multicol-with-child-renderLayer-for-input.html puts the textfield in the wrong place
1485         https://bugs.webkit.org/show_bug.cgi?id=131808
1486
1487         Reviewed by Brady Eidson.
1488     
1489         Make sure FrameView is patched to pass in the update pagination flag when subtree layout
1490         is done on textfields. It had code for the old multicolumn system but did not have a check
1491         for the new multicolumn system.
1492
1493         Added fast/multicol/newmulticol/compare-with-old-impl/multicol-with-child-renderLayer-for-input.html
1494
1495         * page/FrameView.cpp:
1496         (WebCore::updateLayerPositionFlags):
1497
1498 2014-04-22  Zalan Bujtas  <zalan@apple.com>
1499
1500         border-style: double rendered as solid when combined with border-radius
1501         https://bugs.webkit.org/show_bug.cgi?id=131927
1502
1503         Reviewed by Simon Fraser.
1504
1505         BorderEdge::getDoubleBorderStripeWidths() should return the calculated inner, outer border widths. 
1506
1507         Test: fast/borders/hidpi-double-border-with-border-radius-always-produce-solid-line.html
1508
1509         * rendering/BorderEdge.cpp:
1510         (WebCore::BorderEdge::getDoubleBorderStripeWidths):
1511         * rendering/BorderEdge.h:
1512
1513 2014-04-22  Eric Carlson  <eric.carlson@apple.com>
1514
1515         [Mac] don't ask for AVAssetTrack properties before they are available
1516         https://bugs.webkit.org/show_bug.cgi?id=131902
1517         <rdar://problem/16505076>
1518
1519         Reviewed by Jer Noble.
1520
1521         No new tests, the behavior this changes can not be tested with a layout test.
1522
1523         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1524         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1525         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): Initialize
1526             m_cachedTotalBytes.
1527         (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata): Don't report that
1528             metadata has been loaded until the track properties we need have been loaded too.
1529         (WebCore::MediaPlayerPrivateAVFoundationObjC::totalBytes): Cache totalBytes instead
1530             of recalculating it every time.
1531         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): Invalidate cached
1532             total bytes.
1533         (WebCore::assetTrackMetadataKeyNames): Array of AVAssetTrack properties we use.
1534
1535 2014-04-22  Peter Molnar  <pmolnar.u-szeged@partner.samsung.com>
1536
1537         Buildfix after r167650 broke non-Cocoa builds
1538         https://bugs.webkit.org/show_bug.cgi?id=131980
1539
1540         Reviewed by Mario Sanchez Prada.
1541
1542         * page/EventHandler.cpp:
1543         (WebCore::EventHandler::handleWheelEvent):
1544
1545 2014-04-22  Manuel Rego Casasnovas  <rego@igalia.com>
1546
1547         [CSS Regions] Selection highlight doesn't match DOM selection
1548         https://bugs.webkit.org/show_bug.cgi?id=131511
1549
1550         Reviewed by David Hyatt.
1551
1552         This patch implements a subtrees approach to fix selection interaction in CSS Regions.
1553
1554         The idea is to divide the Render tree in subtrees. One subtree will be the RenderView (which is always present),
1555         then for each RenderNamedFlowThread (which are children of RenderView) we will have an extra subtree.
1556
1557         For each subtree it determines the start and end positions according to the DOM tree. So, every subtree will
1558         always have a start and end position, and the selection algorithm will be able to reach the end from the start
1559         without problems (this allows us to remove the changes introduced in r155058).
1560
1561         Then selection related methods in RenderView are adapted to ensure that they are called for each subtree. Making
1562         the selection highlight to match DOM selection as expected.
1563
1564         Test: fast/regions/selection/selecting-text-including-region.html
1565
1566         * CMakeLists.txt: Add new class SelectionSubtreeRoot to build file.
1567         * WebCore.vcxproj/WebCore.vcxproj: Ditto.
1568         * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
1569         * WebCore.xcodeproj/project.pbxproj: Ditto.
1570         * rendering/RenderNamedFlowThread.h: Inherit from SelectionSubtreeRoot.
1571         * rendering/RenderObject.cpp:
1572         (WebCore::RenderObject::selectionRoot): New method to return the RenderNamedFlowThread if any or the RenderView
1573         otherwise.
1574         (WebCore::RenderObject::selectionStartEnd): If it's inside a RenderNamedFlowThread use specific method instead
1575         of the RenderView's one.
1576         * rendering/RenderObject.h: Add new method signature.
1577         * rendering/RenderView.cpp:
1578         (WebCore::RenderView::selectionBounds): Adapt method to subtrees approach.
1579         (WebCore::RenderView::subtreeSelectionBounds): Modify previous method in order to use SelectionSubtreeRoot
1580         objects.
1581         (WebCore::RenderView::repaintSelection): Adapt method to subtrees approach.
1582         (WebCore::RenderView::repaintSubtreeSelection): Modify previous method in order to use SelectionSubtreeRoot
1583         objects.
1584         (getNextOrPrevRenderObjectBasedOnDirection): Deleted method from r155058 as it is not needed anymore. Each
1585         subtree will have start and end positions, so the selection algorithm will always find the end.
1586         (WebCore::RenderView::setSelection): Adapt method to subtrees approach.
1587         (WebCore::RenderView::splitSelectionBetweenSubtrees): Determine start and end positions for each subtree and
1588         call setSubtreeSelection().
1589         (WebCore::RenderView::setSubtreeSelection): Modify previous method in order to use SelectionSubtreeRoot objects.
1590         * rendering/RenderView.h: Inherit from SelectionSubtreeRoot. Add signature for new helper methods receiving
1591         SelectionSubtreeRoot objects.
1592         * rendering/SelectionSubtreeRoot.cpp: Added.
1593         (WebCore::SelectionSubtreeRoot::SelectionSubtreeRoot):
1594         (WebCore::SelectionSubtreeRoot::selectionStartEndPositions):
1595         * rendering/SelectionSubtreeRoot.h: Added. New class to identify root elements for the subtrees. With some basic
1596         attributes and methods to store the start and end positions and offsets.
1597         (WebCore::SelectionSubtreeRoot::selectionStart):
1598         (WebCore::SelectionSubtreeRoot::selectionStartPos):
1599         (WebCore::SelectionSubtreeRoot::selectionEnd):
1600         (WebCore::SelectionSubtreeRoot::selectionEndPos):
1601         (WebCore::SelectionSubtreeRoot::setSelectionStart):
1602         (WebCore::SelectionSubtreeRoot::setSelectionStartPos):
1603         (WebCore::SelectionSubtreeRoot::setSelectionEnd):
1604         (WebCore::SelectionSubtreeRoot::setSelectionEndPos):
1605
1606 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
1607
1608         [Mac] Follow-up: After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
1609         https://bugs.webkit.org/show_bug.cgi?id=131960
1610         <rdar://problem/16142100>
1611
1612         Unreviewed build fix.
1613
1614         * page/EventHandler.cpp:
1615         (WebCore::EventHandler::handleWheelEvent): The test to clear the
1616         last scrolled node was too broad. It should only follow this path
1617         if both the phase and momentum phase are 'None'.
1618
1619 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
1620
1621         [Mac] After a horizontal overflow scroll with a mechanical wheel mouse, vertical scrolling no longer works
1622         https://bugs.webkit.org/show_bug.cgi?id=131960
1623         <rdar://problem/16142100>
1624
1625         Reviewed by Darin Adler.
1626
1627         Test: platform/mac/fast/scrolling/scroll-div-no-latching.html
1628
1629         * page/EventHandler.cpp:
1630         (WebCore::EventHandler::handleWheelEvent): When not latching, always clear m_latchedWheelEventElement and m_previousWheelScrolledElement.
1631
1632 2014-04-21  Joseph Pecoraro  <pecoraro@apple.com>
1633
1634         WebProfilerAgent::disable is calling the wrong superclass method
1635         https://bugs.webkit.org/show_bug.cgi?id=131968
1636
1637         Reviewed by Simon Fraser.
1638
1639         * inspector/WebProfilerAgent.cpp:
1640         (WebCore::WebProfilerAgent::disable):
1641
1642 2014-04-21  Enrica Casucci  <enrica@apple.com>
1643
1644         Followup from http://trac.webkit.org/changeset/167624
1645
1646         Reviewed by Darin Adler.
1647
1648         Fixing incorrect use of ? : syntax.
1649
1650         * editing/VisibleUnits.cpp:
1651         (WebCore::characterBeforePosition):
1652
1653 2014-04-21  Ryuan Choi  <ryuan.choi@samsung.com>
1654
1655         Move CoordinatedGraphics related codes out of CMakeLists.txt
1656         https://bugs.webkit.org/show_bug.cgi?id=131931
1657
1658         Reviewed by Gyuyoung Kim.
1659
1660         Move CoordinatedGraphics related files to PlatformEfl.cmake because they are not common files.
1661
1662         * CMakeLists.txt: 
1663         * PlatformEfl.cmake:
1664
1665 2014-04-21  Jer Noble  <jer.noble@apple.com>
1666
1667         [MSE][Mac] AVSampleBufferDisplayLayer and AudioRenderer is overretained.
1668         https://bugs.webkit.org/show_bug.cgi?id=131963
1669
1670         Reviewed by Jon Honeycutt.
1671
1672         Adopt the results of -[[class alloc] init] rather than retaining them.
1673
1674         * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
1675         (WebCore::SourceBufferPrivateAVFObjC::hasVideo):
1676         (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
1677
1678 2014-04-21  Zalan Bujtas  <zalan@apple.com>
1679
1680         REGRESSION (r166784): Gradient at background of iCloud login page doesn’t go all the way to the bottom
1681         https://bugs.webkit.org/show_bug.cgi?id=131924
1682
1683         Computing tile dimension for contain/cover requires higher precision than what LayoutUnit has. Switching to floats.
1684
1685         Reviewed by Simon Fraser.
1686
1687         Test: fast/backgrounds/hidpi-background-image-contain-cover-scale-needs-more-precision.html
1688
1689         * rendering/RenderBoxModelObject.cpp:
1690         (WebCore::RenderBoxModelObject::calculateFillTileSize):
1691
1692 2014-04-21  Dean Jackson  <dino@apple.com>
1693
1694         Build fix for Mountain Lion.
1695
1696         * platform/mac/SerializedPlatformRepresentationMac.mm:
1697         (WebCore::SerializedPlatformRepresentationMac::deserialize):
1698
1699 2014-04-21  Dan Bernstein  <mitz@apple.com>
1700
1701         WebCore part of <rdar://problem/16631323> Page::setDefersLoading doesn’t do anything when using the Network process
1702         https://bugs.webkit.org/show_bug.cgi?id=131939
1703
1704         Reviewed by David Kilzer.
1705
1706         * WebCore.exp.in: Exported WebCore::ResourceHandle::setDefersLoading.
1707
1708         * loader/ResourceLoadScheduler.cpp:
1709         (WebCore::ResourceLoadScheduler::setDefersLoading): Added a no-op implementation.
1710         * loader/ResourceLoadScheduler.h: Declared new virtual member function setDefersLoading.
1711
1712         * loader/ResourceLoader.cpp:
1713         (WebCore::ResourceLoader::setDefersLoading): Added a call to the above function.
1714
1715 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
1716
1717         [Mac] Difficulty gesture scrolling vertically with trackpad after scrolling horizontally 
1718         https://bugs.webkit.org/show_bug.cgi?id=131959
1719         <rdar://problem/16654523>
1720
1721         Reviewed by Simon Fraser.
1722
1723         * page/mac/EventHandlerMac.mm:
1724         (WebCore::deltaIsPredominantlyVertical): Added.
1725         (WebCore::scrolledToEdgeInDominantDirection): Only consider current mouse wheel event. We don't care about
1726         overall history when deciding if we are bumping against the edge of a scrollable region. Short-circuit if
1727         the element style indicates that overflow is hidden, since this means there is no scroll possible in that
1728         direction.
1729         (WebCore::EventHandler::platformPrepareForWheelEvents): Update for new signature.
1730
1731 2014-04-21  Eric Carlson  <eric.carlson@apple.com>
1732
1733         [Mac] implement WebKitDataCue
1734         https://bugs.webkit.org/show_bug.cgi?id=131799
1735
1736         Reviewed by Dean Jackson.
1737
1738         Tests: http/tests/media/track-in-band-hls-metadata.html
1739                media/track/track-datacue-value.html
1740
1741         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
1742         * DerivedSources.make: Add ENABLE_DATACUE_VALUE to HTML_FLAGS when appropriate.
1743
1744         * CMakeLists.txt: Add JSDataCueCustom.cpp.
1745         * bindings/js/JSBindingsAllInOne.cpp:
1746         * WebCore.xcodeproj/project.pbxproj: Add new files.
1747
1748         * bindings/js/JSDataCueCustom.cpp: Added.
1749         (WebCore::JSDataCue::value): 
1750         (WebCore::JSDataCue::setValue):
1751         (WebCore::JSDataCueConstructor::constructJSDataCue): Custom constructor.
1752
1753         * html/HTMLMediaElement.cpp:
1754         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by fixes: don't schedule timeupdate
1755             events when paused, don't call sort on an Vector that can't be sorted.
1756
1757         * html/track/DataCue.cpp:
1758         (WebCore::DataCue::DataCue): Initialize m_type.
1759         (WebCore::DataCue::~DataCue): Unprotect the JSValue if necessary.
1760         (WebCore::DataCue::data): Ask the platform value for data if non-null.
1761         (WebCore::DataCue::setData): Clear m_platformValue and m_value.
1762         (WebCore::DataCue::isEqual): New.
1763         (WebCore::DataCue::value): Return a JSValue from the platform value, or the value passed
1764             to the constructor/set by script.
1765         (WebCore::DataCue::setValue): Set m_value.
1766         * html/track/DataCue.h:
1767         * html/track/DataCue.idl:
1768
1769         * html/track/InbandDataTextTrack.cpp:
1770         (WebCore::InbandDataTextTrack::addDataCue): Don't add the same cue more than once.
1771         (WebCore::InbandDataTextTrack::updateDataCue): Update a cue's duration.
1772         (WebCore::InbandDataTextTrack::removeDataCue): Remove an incomplete cue.
1773         (WebCore::InbandDataTextTrack::removeCue): Remove a cue from the incomplete cue map if necessary.
1774         * html/track/InbandDataTextTrack.h:
1775
1776         * html/track/InbandGenericTextTrack.cpp:
1777         (WebCore::InbandGenericTextTrack::addGenericCue): CueMatchRules is now in TextTrackCue instead
1778             of VTTCue.
1779         * html/track/InbandTextTrack.h:
1780
1781         * html/track/InbandWebVTTTextTrack.cpp:
1782         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto.
1783
1784         * html/track/TextTrack.cpp:
1785         (WebCore::TextTrack::hasCue): Ditto.
1786         * html/track/TextTrack.h:
1787
1788         * html/track/TextTrackCue.cpp:
1789         (WebCore::TextTrackCue::isEqual): New, test base class equality.
1790         * html/track/TextTrackCue.h:
1791
1792         * html/track/TextTrackCueGeneric.cpp:
1793         (WebCore::TextTrackCueGeneric::isEqual): Call TextTrackCue::isEqual first.
1794         * html/track/TextTrackCueGeneric.h:
1795
1796         * html/track/VTTCue.cpp:
1797         (WebCore::VTTCue::isEqual): Call TextTrackCue::isEqual first.
1798         * html/track/VTTCue.h:
1799
1800         * platform/SerializedPlatformRepresentation.h: Added.
1801         (WebCore::SerializedPlatformRepresentation::~SerializedPlatformRepresentation):
1802         (WebCore::SerializedPlatformRepresentation::SerializedPlatformRepresentation):
1803
1804         * platform/graphics/InbandTextTrackPrivateClient.h: Add methods for DataCue with SerializedPlatformRepresentation.
1805
1806         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Added.
1807         (WebCore::InbandMetadataTextTrackPrivateAVF::create):
1808         (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF):
1809         (WebCore::InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF):
1810         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
1811         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
1812         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
1813         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: Added.
1814
1815         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
1816         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): currentTrack -> currentTextTrack.
1817         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
1818         (WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Ditto.
1819         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
1820         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTextTrack):
1821         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTrack): Deleted.
1822
1823         Renamed currentTrack and setCurrentTrack to currentTextTrack and setCurrentTextTrack.
1824         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
1825         (WebCore::AVFWrapper::currentTextTrack):
1826         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTextTrack):
1827         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTextTrack):
1828         (WebCore::AVFWrapper::setCurrentTextTrack):
1829         (WebCore::AVFWrapper::AVFWrapper):
1830         (WebCore::AVFWrapper::processCue):
1831         (WebCore::AVFWrapper::currentTrack): Deleted.
1832         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTrack): Deleted.
1833         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTrack): Deleted.
1834         (WebCore::AVFWrapper::setCurrentTrack): Deleted.
1835         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
1836
1837         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
1838         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
1839         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
1840         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): currentTrack -> currentTextTrack
1841         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): currentTrack -> currentTextTrack.
1842         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): New.
1843         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): m_currentTrack -> m_currentTextTrack.
1844         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): Ditto.
1845         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): Renamed from setCurrentTextTrack.
1846         (WebCore::metadataType): Map an AVFoundation metadata key space to a metadata cue type.
1847         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Process new metadata.
1848         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
1849         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Deleted.
1850
1851         Create a JSValue representation from an AVMetadataItem.
1852         * platform/mac/SerializedPlatformRepresentationMac.h: Added.
1853         (WebCore::SerializedPlatformRepresentationMac::platformType):
1854         (WebCore::SerializedPlatformRepresentationMac::nativeValue):
1855         * platform/mac/SerializedPlatformRepresentationMac.mm: Added.
1856         (WebCore::SerializedPlatformRepresentationMac::SerializedPlatformRepresentationMac):
1857         (WebCore::SerializedPlatformRepresentationMac::~SerializedPlatformRepresentationMac):
1858         (WebCore::SerializedPlatformRepresentationMac::create):
1859         (WebCore::SerializedPlatformRepresentationMac::data):
1860         (WebCore::SerializedPlatformRepresentationMac::deserialize):
1861         (WebCore::SerializedPlatformRepresentationMac::isEqual):
1862         (WebCore::toSerializedPlatformRepresentationMac):
1863         (WebCore::jsValueWithValueInContext):
1864         (WebCore::jsValueWithDataInContext):
1865         (WebCore::jsValueWithArrayInContext):
1866         (WebCore::jsValueWithDictionaryInContext):
1867         (WebCore::jsValueWithAVMetadataItemInContext):
1868
1869 2014-04-21  Benjamin Poulain  <benjamin@webkit.org>
1870
1871         Add Element.matches, the standard name for webkitMatchesSelector
1872         https://bugs.webkit.org/show_bug.cgi?id=131922
1873
1874         Reviewed by Andreas Kling.
1875
1876         This patch just renames webkitMatchesSelector() to matches().
1877
1878         * bindings/scripts/CodeGeneratorObjC.pm:
1879         (GenerateImplementation):
1880         The Objective-C binding generator only supported ImplementedAs for getters and setters.
1881         This adds support for the option so that Element.matches can be generated for Obj-C.
1882
1883         * dom/Element.cpp:
1884         (WebCore::Element::matches):
1885         (WebCore::Element::webkitMatchesSelector): Deleted.
1886         * dom/Element.h:
1887         * dom/Element.idl:
1888         * inspector/InspectorCSSAgent.cpp:
1889         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
1890
1891 2014-04-21  Beth Dakin  <bdakin@apple.com>
1892
1893         topContentInset does not play well with fullscreen elements
1894         https://bugs.webkit.org/show_bug.cgi?id=131955
1895         -and corresponding-
1896         <rdar://problem/16651925>
1897
1898         Reviewed by Sam Weinig.
1899
1900         Calling setNeedsLayout() is not sufficient when the topContentInset has changed 
1901         dynamically. We need to perform the layout right away and update the scrollbars. 
1902         This works completely when the inset changes due to entering/exiting fullscreen, 
1903         but I left a FIXME behind because it is possible to change the inset dynamically 
1904         just through the WK2 API and end up in a situation where everything looks right 
1905         except for the scrollbars. 
1906         * page/FrameView.cpp:
1907         (WebCore::FrameView::topContentInsetDidChange):
1908         * page/FrameView.h:
1909         * page/Page.cpp:
1910         (WebCore::Page::setTopContentInset):
1911
1912 2014-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
1913
1914         Empty RenderInline objects should not be line break objects.
1915
1916         https://bugs.webkit.org/show_bug.cgi?id=131861
1917         <rdar://problem/15663617>
1918
1919         Reviewed by David Hyatt.
1920
1921         * rendering/line/BreakingContextInlineHeaders.h:
1922         (WebCore::BreakingContext::canBreakAtThisPosition):
1923         Don't break at this position if this is an empty RenderInline.
1924
1925 2014-04-21  Enrica Casucci  <enrica@apple.com>
1926
1927         [iOS WebKit2] support replacements for misspelled words.
1928         https://bugs.webkit.org/show_bug.cgi?id=131827
1929         <rdar://problem/16319657>
1930
1931         Reviewed by Darin Adler.
1932
1933         Adds utility function to return the character before the current selection
1934         and converts the nbsp to the space character.
1935
1936         * WebCore.exp.in:
1937         * editing/VisibleUnits.cpp:
1938         (WebCore::characterBeforePosition):
1939         * editing/VisibleUnits.h:
1940
1941 2014-04-21  Eric Carlson  <eric.carlson@apple.com>
1942
1943         [iOS] enable plug-in replacement
1944         https://bugs.webkit.org/show_bug.cgi?id=131947
1945
1946         Reviewed by Jer Noble.
1947
1948         * bindings/generic/RuntimeEnabledFeatures.cpp:
1949         (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): initialize m_isPluginReplacementEnabled
1950             to true on iOS.
1951
1952 2014-04-21  Rik Cabanier  <cabanier@adobe.com>
1953
1954         [CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
1955         https://bugs.webkit.org/show_bug.cgi?id=131824
1956
1957         Reviewed by Dean Jackson.
1958
1959         Removed support for non-separable blend modes from the CSS parser.
1960
1961         Covered by existing tests
1962
1963         * css/CSSParser.cpp:
1964         (WebCore::isValidKeywordPropertyAndValue):
1965         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
1966         (PlatformCAFilters::setBlendingFiltersOnLayer):
1967
1968 2014-04-21  David Hyatt  <hyatt@apple.com>
1969
1970         [New Multicolumn] Column set drawing under horizontal scrollbar.
1971         https://bugs.webkit.org/show_bug.cgi?id=131812.
1972
1973         Reviewed by Sam Weinig.
1974
1975         Added fast/multicol/newmulticol/compare-with-old-impl/LeftToRight-tb.html.
1976
1977         * rendering/RenderBlockFlow.cpp:
1978         (WebCore::RenderBlockFlow::layoutBlock):
1979         (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange):
1980         * rendering/RenderBlockFlow.h:
1981         Pass in relayoutChildren as a reference boolean to checkForPaginationLogicalHeightChange.
1982         The new columns need to be able to set it to true if the amount of available column
1983         height ever changes, so that the RenderFlowThread and the sets get a layout call.
1984
1985         * rendering/style/RenderStyle.cpp:
1986         (WebCore::RenderStyle::setColumnStylesFromPaginationMode):
1987         Make sure that the pagination mode is set up with an auto column-fill specified. You
1988         don't ever want to balance when you set a pagination mode on the RenderView.
1989
1990 2014-04-21  Tim Horton  <timothy_horton@apple.com>
1991
1992         [iOS WebKit2] Implement CSS viewport units
1993         https://bugs.webkit.org/show_bug.cgi?id=131863
1994         <rdar://problem/16279088>
1995
1996         Reviewed by Darin Adler.
1997
1998         * WebCore.exp.in:
1999         * page/FrameView.cpp:
2000         (WebCore::FrameView::setViewportSize):
2001         * page/FrameView.h:
2002         (WebCore::FrameView::viewportSize):
2003         Add setViewportSize() and viewportSize().
2004         If the viewport size changes, we have to do style recalc.
2005         If we have an overridden viewport size, use it.
2006
2007         * rendering/RenderView.cpp:
2008         (WebCore::RenderView::viewportSize):
2009         * rendering/RenderView.h:
2010         Get the size from FrameView.
2011
2012 2014-04-21  Joseph Pecoraro  <pecoraro@apple.com>
2013
2014         Remove unused WebKitSystemInterface functions
2015         https://bugs.webkit.org/show_bug.cgi?id=131938
2016
2017         Reviewed by Alexey Proskuryakov.
2018
2019         * WebCore.exp.in:
2020         * platform/ios/WebCoreSystemInterfaceIOS.mm:
2021         * platform/mac/WebCoreSystemInterface.h:
2022         * platform/mac/WebCoreSystemInterface.mm:
2023
2024 2014-04-21  Andreas Kling  <akling@apple.com>
2025
2026         Move the JSString cache from DOMWrapperWorld to VM.
2027         <https://webkit.org/b/131940>
2028
2029         Since there's no need for JSStrings to be world-specific, this patch
2030         moves the string cache to JSC::VM. This makes jsStringWithCache()
2031         a lot faster since it no longer has to jump through twenty-eleven
2032         hoops to find the DOMWrapperWorld.
2033
2034         Reviewed by Geoff Garen.
2035
2036         * bindings/js/DOMWrapperWorld.cpp:
2037         (WebCore::DOMWrapperWorld::clearWrappers):
2038         * bindings/js/DOMWrapperWorld.h:
2039         * bindings/js/JSDOMBinding.cpp:
2040         (WebCore::jsStringWithCache):
2041
2042 2014-04-21  David Hyatt  <hyatt@apple.com>
2043
2044         [New Multicolumn] Column balancing is slow on float-multicol.html
2045         https://bugs.webkit.org/show_bug.cgi?id=131801
2046
2047         Reviewed by Enrica Casucci.
2048
2049         Added fast/multicol/tall-float.html
2050
2051         * rendering/RenderBlock.cpp:
2052         (WebCore::RenderBlock::expandsToEncloseOverhangingFloats):
2053         Make RenderFlowThreads expand to encompass floats. Also from Morten's patch for
2054         Blink (#361551).
2055
2056         * rendering/RenderBlockFlow.cpp:
2057         (WebCore::RenderBlockFlow::computeOverflow):
2058         Fix a bug where the new multi-column code was adding in overflow for floats
2059         when it should not. This was resulting in the creation of scrollbars when none
2060         should exist. This is my own addition.
2061
2062         (WebCore::RenderBlockFlow::addOverhangingFloats):
2063         Make RenderFlowThreads and RenderRegions ignore overhanging float additions. This
2064         comes from Morten's patch for Blink (#361551).
2065
2066 2014-04-21  Darin Adler  <darin@apple.com>
2067
2068         REGRESSION (r160908): Safari doesn't draw rotated images properly first time
2069         https://bugs.webkit.org/show_bug.cgi?id=131930
2070
2071         Reviewed by Anders Carlsson.
2072
2073         With render tree creation sufficiently lazy, we had to put some explicit
2074         calls to updateStyleIfNeeded into the ImageDocument class.
2075
2076         * dom/DOMImplementation.cpp:
2077         (WebCore::DOMImplementation::createDocument): Pass a Frame&.
2078
2079         * html/ImageDocument.cpp:
2080         (WebCore::ImageDocument::imageSize): Added this helper function. This updates
2081         style so we can use the renderer to compute an image size taking things like
2082         orientation into account, and also passes in the zoom factor.
2083         (WebCore::ImageDocument::updateDuringParsing): Moved the body of the
2084         ImageDocumentParser::appendBytes function into this function. Since it's a
2085         member of ImageDocument, it has better access to appropriate private members,
2086         and we don't have to expose as many functions to the public. Also changed to
2087         not use the frame so much. Also merged in the code that creates the document
2088         instead of having it be a side effect in the cachedImage helper function; all
2089         the other call sites were checking for null before calling cachedImage.
2090         (WebCore::ImageDocument::finishedParsing): Moved the body of the
2091         ImageDocumentParser::finish function here. Added a call to updateStyleIfNeeded
2092         before using the renderer to get the image size.
2093         (WebCore::ImageDocumentParser::document): Made this return a reference. It's
2094         just a convenience function used in the two functions below.
2095         (WebCore::ImageDocumentParser::appendBytes): Just call updateDuringParsing.
2096         (WebCore::ImageDocumentParser::finish): Just call finishedParsing.
2097         (WebCore::ImageDocument::ImageDocument): Take a reference for the argument,
2098         use nullptr, and also initialize m_shouldShrinkImage directly instead of using
2099         a shouldShrinkToFit() helper function to do it.
2100         (WebCore::ImageDocument::createDocumentStructure): Removed unneeded check of
2101         null for the frame, since the caller does it. Removed some unneeded
2102         IGNORE_EXCEPTON and a stray semicolon. Use m_shouldShrinkImage instead of
2103         calling shouldShrinkToFit since at this early point they will be identical.
2104         (WebCore::ImageDocument::scale): Make non-const so we can call the new
2105         imageSize helper. Use Document::view instead of Frame::view. Improved the
2106         conversion to floating point so it doesn't involve a static_cast and an extra
2107         conversion from int to LayoutUnit.
2108         (WebCore::ImageDocument::resizeImageToFit): Ditto.
2109         (WebCore::ImageDocument::imageClicked): Ditto.
2110         (WebCore::ImageDocument::imageUpdated): Ditto. Also use m_shouldShrinkImage
2111         ibnstead of shouldShrinkToFit.
2112         (WebCore::ImageDocument::restoreImageSize): Ditto.
2113         (WebCore::ImageDocument::imageFitsInWindow): Ditto.
2114         (WebCore::ImageDocument::windowSizeChanged): Ditto.
2115         (WebCore::ImageDocument::cachedImage): Deleted. Moved logic into updateDuringParsing.
2116         (WebCore::ImageDocument::shouldShrinkToFit): Deleted. Moved logic into constructor.
2117         (WebCore::ImageEventListener::handleEvent): Updated for changes above.
2118         (WebCore::ImageEventListener::operator==): Simplified. No reason this has to check
2119         whether both listeners are in the same document.
2120         (WebCore::ImageDocumentElement::didMoveToNewDocument): Use nullptr.
2121
2122         * html/ImageDocument.h: Deleted some unused things, updated for changes above,
2123         and made some memer functions private.
2124
2125         * loader/FrameLoaderClient.h: Deleted the allowScriptFromSource, allowPlugins,
2126         allowImage, and allowDisplayingInsecureContent functions. These were only used in
2127         Chromium and are now unneeded complexity. We could bring them back if anyone wants them.
2128
2129         * loader/MixedContentChecker.cpp:
2130         (WebCore::MixedContentChecker::canDisplayInsecureContent): Removed call to
2131         allowDisplayingInsecureContent, just use the setting directly.
2132         (WebCore::MixedContentChecker::canRunInsecureContent): Removed call to
2133         allowRunningInsecureContent, just use the setting directly.
2134
2135         * loader/SubframeLoader.cpp:
2136         (WebCore::SubframeLoader::allowPlugins): Removed call to allowPlugins, just
2137         use the arePluginsEnabled setting directly.
2138
2139         * loader/cache/CachedResourceLoader.cpp:
2140         (WebCore::CachedResourceLoader::canRequest): Removed call to allowScriptFromSource, just
2141         use the isScriptEnabled setting directly.
2142         (WebCore::CachedResourceLoader::clientDefersImage): Removed call to allowImage.
2143
2144 2014-04-21  David Hyatt  <hyatt@apple.com>
2145
2146         [New Multicolumn] Pagination mode messed up with non-inline axis and reversed direction.
2147         https://bugs.webkit.org/show_bug.cgi?id=131811
2148
2149         Reviewed by Dean Jackson.
2150
2151         Added fast/multicol/newmulticol/compare-with-old-impl/BottomToTop-tb.html
2152         
2153         With block axis pagination mode, it is possible to set a column height that is not the same
2154         as the available fill height for a block. The new multi-column code had the assumption that
2155         the column height was the same as the amount of fill room you had available. This is not
2156         the case.
2157         
2158         To correct the issue, I added a member variable to RenderMultiColumnSet that stores the
2159         available column height as a separate variable from the computed column height. This allows
2160         the pagination API to specify a different column height that is not the same as the view's
2161         content height.
2162
2163         Even though it isn't involved in the solution, I also patched pageOrViewLogicalHeight on
2164         RenderView to work with the new column code as well.
2165
2166         To address the layout test failures (that caused the previous rollout), I made sure to
2167         initialize m_availableHeight to 0 when m_computedColumnHeight also gets reset to 0.
2168         
2169         The assertion is not something I could reproduce on any machine, but I can see the problem.
2170         I patched Page's pageCount method to not have column code directly in Page.cpp, 
2171         and to make a new pageCount() method on RenderView that Page calls
2172         into. This method is now patched to handle the new column code as well as the old. I have
2173         no real way of testing this method though, since I can't reproduce the assertion that the
2174         bots were experiencing.
2175
2176         * page/Page.cpp:
2177         (WebCore::Page::pageCount):
2178         * rendering/RenderMultiColumnSet.cpp:
2179         (WebCore::RenderMultiColumnSet::RenderMultiColumnSet):
2180         (WebCore::RenderMultiColumnSet::setAndConstrainColumnHeight):
2181         (WebCore::RenderMultiColumnSet::prepareForLayout):
2182         (WebCore::RenderMultiColumnSet::computeLogicalHeight):
2183         * rendering/RenderMultiColumnSet.h:
2184         * rendering/RenderView.cpp:
2185         (WebCore::RenderView::pageOrViewLogicalHeight):
2186         (WebCore::RenderView::pageCount):
2187         * rendering/RenderView.h:
2188
2189 2014-04-18  Dean Jackson  <dino@apple.com>
2190
2191         [Media] Clean up localized strings in controls
2192         https://bugs.webkit.org/show_bug.cgi?id=131857
2193         <rdar://problem/16663005>
2194
2195         Reviewed by Eric Carlson.
2196
2197         There is no need for separate localization files
2198         on OS X and iOS. Move the small number of iOS-specific
2199         localizations into a shared file.
2200
2201         We also don't need a function to return a static table.
2202         Ultimately I think we want a top-level WebKit object that
2203         hold the table, but for now use a global variable
2204         called UIStringTable. Since we're in an isolated world, we
2205         won't clash with anything.
2206
2207         I noticed a few cases were we grab a localized string and
2208         then instantly run a replacement on it. This should be
2209         supported directly in the UIString() accessor.
2210
2211         * English.lproj/mediaControlsLocalizedStrings.js: Add iOS strings. Just
2212         use a static table.
2213         (mediaControlsLocalizedStrings): Deleted.
2214         * English.lproj/mediaControlsLocalizedStringsiOS.js: Removed.
2215         * Modules/mediacontrols/mediaControlsApple.js:
2216         (Controller.prototype.extend): Fix braces.
2217         (Controller.prototype.UIString): Use the string table, and allow replacement.
2218         (Controller.prototype.createControls): Use new UIString replacement.
2219         * Modules/mediacontrols/mediaControlsiOS.js:
2220         (ControllerIOS.prototype.updateWirelessPlaybackStatus): Use new UIString.
2221         (ControllerIOS.prototype.UIString): Deleted. Use the parent class version.
2222         * WebCore.xcodeproj/project.pbxproj: Remove file from Resources.
2223         * rendering/RenderThemeIOS.mm:
2224         (WebCore::RenderThemeIOS::mediaControlsScript): No need to include the iOS
2225         specific localization file.
2226
2227 2014-04-21  Brent Fulgham  <bfulgham@apple.com>
2228
2229         [Win] Unreviewed build fix.
2230
2231         * inspector/TimelineRecordFactory.cpp: Add missing include.
2232
2233 2014-04-21  Zan Dobersek  <zdobersek@igalia.com>
2234
2235         Move cross-port Source/WebCore/page/ code to std::unique_ptr
2236         https://bugs.webkit.org/show_bug.cgi?id=130534
2237
2238         Reviewed by Darin Adler.
2239
2240         Replace uses of OwnPtr and PassOwnPtr in cross-port code under Source/WebCore/page/ with
2241         std::unique_ptr. Unnecessary OwnPtr.h and PassOwnPtr.h header inclusions are removed as well.
2242
2243         * dom/Document.cpp:
2244         (WebCore::Document::initSecurityContext):
2245         * dom/SecurityContext.cpp:
2246         (WebCore::SecurityContext::setContentSecurityPolicy):
2247         * dom/SecurityContext.h:
2248         * page/CaptionUserPreferences.h:
2249         * page/ContentSecurityPolicy.cpp:
2250         (WebCore::CSPDirectiveList::create):
2251         (WebCore::CSPDirectiveList::checkEvalAndReportViolation):
2252         (WebCore::CSPDirectiveList::checkInlineAndReportViolation):
2253         (WebCore::CSPDirectiveList::checkSourceAndReportViolation):
2254         (WebCore::CSPDirectiveList::setCSPDirective):
2255         (WebCore::ContentSecurityPolicy::didReceiveHeader):
2256         * page/ContentSecurityPolicy.h:
2257         * page/DOMSecurityPolicy.h:
2258         * page/DOMWindow.cpp:
2259         (WebCore::PostMessageTimer::fired):
2260         (WebCore::DOMWindow::postMessageTimerFired):
2261         * page/DOMWindow.h:
2262         * page/EventHandler.cpp:
2263         (WebCore::EventHandler::EventHandler):
2264         * page/EventHandler.h:
2265         * page/Frame.cpp:
2266         (WebCore::Frame::Frame):
2267         (WebCore::createRegExpForLabels):
2268         (WebCore::Frame::searchForLabelsAboveCell):
2269         (WebCore::Frame::searchForLabelsBeforeElement):
2270         (WebCore::matchLabelsAgainstString):
2271         (WebCore::Frame::setTiledBackingStoreEnabled):
2272         * page/Frame.h:
2273         * page/FrameView.cpp:
2274         (WebCore::FrameView::addEmbeddedObjectToUpdate):
2275         (WebCore::FrameView::addSlowRepaintObject):
2276         (WebCore::FrameView::addViewportConstrainedObject):
2277         (WebCore::FrameView::addScrollableArea):
2278         * page/FrameView.h:
2279         * page/Page.cpp:
2280         (WebCore::Page::Page):
2281         * page/Page.h:
2282         * page/PageConsole.h:
2283         * page/PageThrottler.h:
2284         * page/SecurityPolicy.cpp:
2285         (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
2286         * page/animation/AnimationController.h:
2287         * page/animation/CSSPropertyAnimation.cpp:
2288         (WebCore::PropertyWrapperVisitedAffectedColor::PropertyWrapperVisitedAffectedColor):
2289         (WebCore::CSSPropertyAnimationWrapperMap::instance):
2290         (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
2291         * page/mac/PageMac.cpp:
2292         (WebCore::Page::addSchedulePair):
2293         * workers/WorkerGlobalScope.cpp:
2294         (WebCore::WorkerGlobalScope::applyContentSecurityPolicyFromString):
2295
2296 2014-04-21  Darin Adler  <darin@apple.com>
2297
2298         Add HashSet::takeAny
2299         https://bugs.webkit.org/show_bug.cgi?id=131928
2300
2301         Reviewed by Benjamin Poulain.
2302
2303         * dom/Document.cpp:
2304         (WebCore::Document::takeAnyMediaCanStartListener): Use HashSet::takeAny.
2305         * dom/ScriptExecutionContext.cpp:
2306         (WebCore::takeAny): Deleted.
2307         (WebCore::ScriptExecutionContext::~ScriptExecutionContext): Use HashSet::takeAny.
2308
2309 2014-04-21  Zan Dobersek  <zdobersek@igalia.com>
2310
2311         iOS and non-iOS RemoteCommandListener::create() functions should use std::make_unique<>()
2312         https://bugs.webkit.org/show_bug.cgi?id=131916
2313
2314         Reviewed by Darin Adler.
2315
2316         A follow-up to r167197. Make RemoteCommandListener ctor public and use std::make_unique<>()
2317         in both versions of RemoteCommandListener::create() functions (iOS and non-iOS).
2318
2319         * platform/RemoteCommandListener.cpp:
2320         (WebCore::RemoteCommandListener::create):
2321         * platform/RemoteCommandListener.h:
2322         (WebCore::RemoteCommandListener::RemoteCommandListener):
2323         * platform/ios/RemoteCommandListenerIOS.mm:
2324         (WebCore::RemoteCommandListener::create):
2325
2326 2014-04-21  Andreas Kling  <akling@apple.com>
2327
2328         Micro-optimize the way we hand NodeLists to JSC.
2329         <https://webkit.org/b/131932>
2330
2331         Use HashMap::fastAdd() when returning cached node lists and collections.
2332         10.9% progression on Bindings/get-elements-by-tag-name.html
2333
2334         Reviewed by Antti Koivisto.
2335
2336         * dom/NodeRareData.h:
2337         (WebCore::NodeListsNodeData::addCacheWithAtomicName):
2338         (WebCore::NodeListsNodeData::addCacheWithName):
2339         (WebCore::NodeListsNodeData::addCacheWithQualifiedName):
2340         (WebCore::NodeListsNodeData::addCachedCollection):
2341
2342 2014-04-21  Commit Queue  <commit-queue@webkit.org>
2343
2344         Unreviewed, rolling out r167584.
2345         https://bugs.webkit.org/show_bug.cgi?id=131929
2346
2347         Broke Objective-C bindings test (Requested by ap on #webkit).
2348
2349         Reverted changeset:
2350
2351         "Add Element.matches, the standard name for
2352         webkitMatchesSelector"
2353         https://bugs.webkit.org/show_bug.cgi?id=131922
2354         http://trac.webkit.org/changeset/167584
2355
2356 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
2357
2358         Compile the :root pseudo class and fix a related issue with :nth-child()
2359         https://bugs.webkit.org/show_bug.cgi?id=131926
2360
2361         Reviewed by Andreas Kling.
2362
2363         Add the :root pseudo class. This is another trivial selector, we just need to compare
2364         the element pointer with the documentElement.
2365
2366         I discovered some issues with :nth-child(n) through the layout tests for ":root".
2367         When the pseudo class nth-child could match anything, no code was generated. That decision
2368         was taken when generating the fragments.
2369
2370         The specification of :nth-child() has two tests: the parent test and the counter test.
2371         Since some fragments would not generate any code for :nth-child(n), they would succeed on the root,
2372         which is incorrect since the root should fail the parent test.
2373
2374         This was fixed by moving the filtering of non-counting :nth-child() after we generate the parent
2375         check.
2376         We still don't generate any counter test unless required.
2377
2378         Test: fast/selectors/nth-child-on-root.html
2379
2380         * cssjit/SelectorCompiler.cpp:
2381         (WebCore::SelectorCompiler::addPseudoClassType):
2382         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2383         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild):
2384         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsRoot):
2385         * dom/Document.h:
2386         (WebCore::Document::documentElementMemoryOffset):
2387
2388 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
2389
2390         Add Element.matches, the standard name for webkitMatchesSelector
2391         https://bugs.webkit.org/show_bug.cgi?id=131922
2392
2393         Reviewed by Andreas Kling.
2394
2395         This patch just renames webkitMatchesSelector() to matches().
2396
2397         * bindings/scripts/CodeGeneratorObjC.pm:
2398         (GenerateImplementation):
2399         The Objective-C binding generator only supported ImplementedAs for getters and setters.
2400         This adds support for the option so that Element.matches can be generated for Obj-C.
2401
2402         * dom/Element.cpp:
2403         (WebCore::Element::matches):
2404         (WebCore::Element::webkitMatchesSelector): Deleted.
2405         * dom/Element.h:
2406         * dom/Element.idl:
2407         * inspector/InspectorCSSAgent.cpp:
2408         (WebCore::InspectorCSSAgent::buildArrayForMatchedRuleList):
2409
2410 2014-04-20  Zalan Bujtas  <zalan@apple.com>
2411
2412         Subpixel rendering: RenderLayer's size is set using enclosingRect() which can result in cruft.
2413         https://bugs.webkit.org/show_bug.cgi?id=131468
2414
2415         Reviewed by Darin Adler.
2416
2417         Layers marked opaque may not paint edge pixels, when RenderLayer bounds are non-integral and
2418         get device pixel snapped.
2419         For details see this: https://trac.webkit.org/r159463
2420
2421         Test: compositing/hidpi-non-simple-compositing-layer-with-fractional-size-and-background.html
2422
2423         * rendering/RenderLayerBacking.cpp:
2424         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
2425
2426 2014-04-19  Darin Adler  <darin@apple.com>
2427
2428         Simple layout can get confused by coordinate overflow
2429         https://bugs.webkit.org/show_bug.cgi?id=131890
2430         rdar://problem/15558510
2431
2432         Reviewed by Andreas Kling.
2433
2434         Test: fast/css/simple-layout-overflow.html
2435
2436         * rendering/SimpleLineLayoutResolver.h:
2437         (WebCore::SimpleLineLayout::RunResolver::rangeForRect):
2438         If lastLine is smaller than firstLine, just ignore it.
2439
2440 2014-04-20  Darin Adler  <darin@apple.com>
2441
2442         ScriptExecutionContext::stopActiveDOMObjects iterates a hash map that can change during iteration (for multiple reasons, including GC)
2443         https://bugs.webkit.org/show_bug.cgi?id=52719
2444
2445         Reviewed by Alexey Proskuryakov.
2446
2447         At least two specific ways this can happen:
2448
2449         1) XMLHttpRequest::stop can trigger a JavaScript garbage collection.
2450         2) NotificationCenter::stop can delete the last references to notifications;
2451            those notifications are also active DOM objects.
2452
2453         Besides fixing the iteration in that function, did some other fixes for the
2454         ScriptExecutionContext class, including some coding style changes. Many uses
2455         of nullptr instead of 0, without listing each function separately below.
2456
2457         * Modules/webdatabase/DatabaseContext.cpp:
2458         (WebCore::DatabaseContext::contextDestroyed): Call through to the base class
2459         version of contextDestroyed rather than repeating what it does (with a large
2460         comment that doesn't acknowledge the base class alread does it).
2461         * Modules/webdatabase/DatabaseContext.h: Removed some unneeded includes.
2462         Wrote out "private" explicitly for deriving from ActiveDOMObject. Made the
2463         ActiveDOMObject function overrides private, and marked them override and final.
2464
2465         * dom/ActiveDOMObject.h: Updated comments. Replaced suspendIfNeededCalled with
2466         assertSuspendIfNeededWasCalled, which has an empty inline version in the header.
2467         Renamed m_suspendIfNeededCalled to m_suspendIfNeededWasCalled.
2468
2469         * dom/ActiveDOMObject.cpp:
2470         (WebCore::ActiveDOMObject::ActiveDOMObject): Pass a reference instead of a pointer.
2471         (WebCore::ActiveDOMObject::~ActiveDOMObject): Ditto.
2472         (WebCore::ActiveDOMObject::suspendIfNeeded): Ditto.
2473
2474         * dom/ContextDestructionObserver.cpp:
2475         (WebCore::ContextDestructionObserver::observeContext): Pass a reference instead of a pointer.
2476
2477         * dom/MessagePort.cpp:
2478         (WebCore::MessagePort::MessagePort): Pass a reference instead of a pointer.
2479         (WebCore::MessagePort::~MessagePort): Ditto.
2480         (WebCore::MessagePort::disentangle): Ditto.
2481
2482         * dom/ScriptExecutionContext.cpp:
2483         (WebCore::ScriptExecutionContext::ScriptExecutionContext): Updated flags used
2484         for assertions so they are conditional and updated their names.
2485         (WebCore::takeAny): Added. Helper function that we can consider for HashSet in
2486         the future; makes loop below easier to read.
2487         (WebCore::checkConsistency): Added. Assertions that were done multiple places below,
2488         and should not be written over and over again.
2489         (WebCore::ScriptExecutionContext::~ScriptExecutionContext): Changed to use C++11
2490         for loops and the takeAny function above.
2491         (WebCore::ScriptExecutionContext::dispatchMessagePortEvents): Ditto.
2492         (WebCore::ScriptExecutionContext::createdMessagePort): Changed to take a reference
2493         for clarity and so it doesn't have to do an assert the pointer is non-null.
2494         (WebCore::ScriptExecutionContext::destroyedMessagePort): Ditto.
2495         (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjects): Changed to use
2496         C++11 for loop and reworded comment and redid assertions.
2497         (WebCore::ScriptExecutionContext::suspendActiveDOMObjects): Ditto.
2498         (WebCore::ScriptExecutionContext::resumeActiveDOMObjects): Ditto.
2499         (WebCore::ScriptExecutionContext::stopActiveDOMObjects): Changed to support
2500         removal of an active DOM object during the stop function. Included new comments
2501         to clarify what the rules are.
2502         (WebCore::ScriptExecutionContext::suspendActiveDOMObjectIfNeeded): Changed to take
2503         a reference for clarity and so it doesn't have to assert a pointer is non-null.
2504         (WebCore::ScriptExecutionContext::didCreateActiveDOMObject): Ditto. Also changed to
2505         use RELEASE_ASSERT instead of CRASH.
2506         (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject): Ditto.
2507         (WebCore::ScriptExecutionContext::didCreateDestructionObserver): Ditto.
2508         (WebCore::ScriptExecutionContext::willDestroyDestructionObserver): Ditto.
2509         (WebCore::ScriptExecutionContext::closeMessagePorts): Moved the body of this
2510         function into its one call site, ScriptExecutionContext::stopActiveDOMObjects,
2511         since it's simple enough when written as a C++11 for loop.
2512         (WebCore::ScriptExecutionContext::hasPendingActivity): Added. This function was
2513         already exported for workers, and implementing it outside this class required
2514         exposing the private HashSet members; more sensible to implement it here and
2515         simply make it public in WorkerGlobalScope.
2516
2517         * dom/ScriptExecutionContext.h: Removed unnecessary includes and forward declarations.
2518         Removed a long-ago-fixed FIXME. Changed various functions to take references instead of
2519         pointers. Added a protected hasPendingActivity function, deleted the closeMessagePorts
2520         function, deleted the ActiveDOMObjectsSet typedef, made the assertion flags be
2521         !ASSERT_DISABLED only, and deleted the messagePorts and activeDOMObjects functions.
2522
2523         * workers/WorkerGlobalScope.cpp:
2524         (WebCore::WorkerGlobalScope::hasPendingActivity): Deleted. This is now implemented
2525         in the base class.
2526
2527         * workers/WorkerGlobalScope.h: Make hasPendingActivity function from the base class
2528         public instead of declaring it in this class.
2529
2530 2014-04-20  Brent Fulgham  <bfulgham@apple.com>
2531
2532         [Mac] Unable to select 'Off' or 'Auto' from track menu when tracks consist of unsupported track types
2533         https://bugs.webkit.org/show_bug.cgi?id=131908
2534         <rdar://problem/15999882>
2535
2536         Reviewed by Eric Carlson.
2537
2538         * html/HTMLMediaElement.cpp:
2539         (WebCore::HTMLMediaElement::setSelectedTextTrack): When the user selects 'Off', make sure the currently 'showing'
2540         track is switched to 'disabled'.
2541
2542 2014-04-20  Andreas Kling  <akling@apple.com>
2543
2544         Speed up jsStringWithCache() through WeakGCMap inlining.
2545         <https://webkit.org/b/131923>
2546
2547         Inline the common path of WeakGCMap::add() in jsStringWithCache().
2548         26% progression on Bindings/id-getter.html
2549
2550         Reviewed by Darin Adler.
2551
2552         * WebCore.exp.in:
2553         * bindings/js/JSDOMBinding.h:
2554         * bindings/js/JSDOMBinding.cpp:
2555         (WebCore::jsStringWithCache):
2556
2557             Move jsStringWithCache() out of line since we're now blowing up
2558             its size quite a bit.
2559
2560 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
2561
2562         Fix the build after r167574
2563
2564         * cssjit/SelectorCompiler.cpp:
2565         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2566
2567 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
2568
2569         Compile the pseudo class :target
2570         https://bugs.webkit.org/show_bug.cgi?id=131904
2571
2572         Reviewed by Andreas Kling.
2573
2574         The pseudo class :target is trivial, it just compare the current element with
2575         Document::cssTarget().
2576
2577         * cssjit/SelectorCompiler.cpp:
2578         (WebCore::SelectorCompiler::addPseudoType):
2579         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2580         (WebCore::SelectorCompiler::getDocument):
2581         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementAttributeValueExactMatching):
2582         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsTarget):
2583         * dom/Document.h:
2584         (WebCore::Document::cssTargetMemoryOffset):
2585
2586 2014-04-20  Benjamin Poulain  <benjamin@webkit.org>
2587
2588         Rename the CSSSelector PseudoType to PseudoClassType
2589         https://bugs.webkit.org/show_bug.cgi?id=131907
2590
2591         Reviewed by Andreas Kling.
2592
2593         Pseudo Elements and Page Pseudo Classes have been moved out of PseudoType in previous patches.
2594         The remaining values in the PseudoType enumeration are the pseudo classes.
2595
2596         This patch is the final clean up, PseudoType is renamed to PseudoClassType.
2597
2598         * css/CSSGrammar.y.in:
2599         * css/CSSParserValues.cpp:
2600         (WebCore::CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector):
2601         * css/CSSParserValues.h:
2602         (WebCore::CSSParserSelector::pseudoClassType):
2603         (WebCore::CSSParserSelector::pseudoType): Deleted.
2604         * css/CSSSelector.cpp:
2605         (WebCore::CSSSelector::specificityForOneSelector):
2606         (WebCore::appendPseudoClassFunctionTail):
2607         (WebCore::CSSSelector::selectorText):
2608         * css/CSSSelector.h:
2609         (WebCore::CSSSelector::pseudoClassType):
2610         (WebCore::CSSSelector::pseudoElementType):
2611         (WebCore::CSSSelector::pagePseudoClassType):
2612         (WebCore::pseudoClassIsRelativeToSiblings):
2613         (WebCore::CSSSelector::isSiblingSelector):
2614         (WebCore::CSSSelector::CSSSelector):
2615         (WebCore::CSSSelector::pseudoType): Deleted.
2616         * css/RuleSet.cpp:
2617         (WebCore::RuleSet::findBestRuleSetAndAdd):
2618         * css/SelectorChecker.cpp:
2619         (WebCore::SelectorChecker::checkOne):
2620         (WebCore::SelectorChecker::checkScrollbarPseudoClass):
2621         (WebCore::SelectorChecker::determineLinkMatchType):
2622         (WebCore::SelectorChecker::matchesFocusPseudoClass):
2623         * css/SelectorChecker.h:
2624         (WebCore::SelectorChecker::isCommonPseudoClassSelector):
2625         * css/SelectorCheckerFastPath.cpp:
2626         (WebCore::SelectorCheckerFastPath::commonPseudoClassSelectorMatches):
2627         * css/SelectorPseudoClassAndCompatibilityElementMap.in:
2628         * css/SelectorPseudoTypeMap.h:
2629         * css/StyleResolver.cpp:
2630         (WebCore::StyleResolver::styleForElement):
2631         * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
2632         (enumerablePseudoType):
2633         * cssjit/SelectorCompiler.cpp:
2634         (WebCore::SelectorCompiler::addPseudoClassType):
2635         (WebCore::SelectorCompiler::SelectorCodeGenerator::SelectorCodeGenerator):
2636         (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementMatching):
2637         (WebCore::SelectorCompiler::addPseudoType): Deleted.
2638         * inspector/InspectorCSSAgent.cpp:
2639         (WebCore::computePseudoClassMask):
2640         (WebCore::InspectorCSSAgent::forcePseudoState):
2641         * inspector/InspectorCSSAgent.h:
2642         * inspector/InspectorInstrumentation.cpp:
2643         (WebCore::InspectorInstrumentation::forcePseudoStateImpl):
2644         * inspector/InspectorInstrumentation.h:
2645         (WebCore::InspectorInstrumentation::forcePseudoState):
2646
2647 2014-04-19  Alexey Proskuryakov  <ap@apple.com>
2648
2649         Crashes in HTMLFormElement::submit.
2650         https://bugs.webkit.org/show_bug.cgi?id=131910
2651         <rdar://problem/15661790>
2652
2653         Based on a patch by Kent Tamura.
2654
2655         Reviewed by Anders Carlsson.
2656
2657         Tests: fast/forms/form-submission-crash-2.html
2658                fast/forms/form-submission-crash.html
2659
2660         Code that executes arbitrary JS needs to protect objects that it uses afterwards.
2661
2662         * html/HTMLFormElement.cpp:
2663         (WebCore::HTMLFormElement::prepareForSubmission):
2664         (WebCore::HTMLFormElement::submit):
2665         * loader/FrameLoader.cpp:
2666         (WebCore::FrameLoader::submitForm):
2667
2668 2014-04-20  Antti Koivisto  <antti@apple.com>
2669
2670         Text bounding box computation for simple line layout is wrong
2671         https://bugs.webkit.org/show_bug.cgi?id=131912
2672
2673         Reviewed by Andreas Kling.
2674
2675         Top-left is currently the first line top-left which is not always correct.
2676
2677         * WebCore.exp.in:
2678         * rendering/RenderText.cpp:
2679         (WebCore::RenderText::firstRunLocation):
2680         (WebCore::RenderText::firstRunOrigin): Deleted.
2681         (WebCore::RenderText::firstRunX): Deleted.
2682         (WebCore::RenderText::firstRunY): Deleted.
2683         
2684             Keep just one accessor and rename it.
2685             Encapsulate the line box and simple line versions.
2686
2687         * rendering/RenderText.h:
2688         * rendering/RenderTextLineBoxes.cpp:
2689         (WebCore::RenderTextLineBoxes::firstRunLocation):
2690
2691             Line box version.
2692
2693         * rendering/RenderTextLineBoxes.h:
2694         * rendering/RenderTreeAsText.cpp:
2695         
2696             Simplify RenderText dumping.
2697
2698         (WebCore::RenderTreeAsText::writeRenderObject):
2699         * rendering/SimpleLineLayoutFunctions.cpp:
2700         (WebCore::SimpleLineLayout::computeTextBoundingBox):
2701         
2702             Return the correct x position.
2703
2704         (WebCore::SimpleLineLayout::computeTextFirstRunLocation):
2705         
2706             Simple line version.
2707
2708         * rendering/SimpleLineLayoutFunctions.h:
2709         * rendering/svg/SVGRenderTreeAsText.cpp:
2710         (WebCore::writeSVGInlineText):
2711
2712 2014-04-19  Zalan Bujtas  <zalan@apple.com>
2713
2714         Subpixel rendering: RenderLayer's clipping should snap to device pixel boundaries.
2715         https://bugs.webkit.org/show_bug.cgi?id=131466
2716
2717         Reviewed by Simon Fraser.
2718
2719         Fractional pixel clipping can produce cruft on RenderLayers. Since RenderLayer
2720         sizing and painting are snapped, painting clip rect needs to be snapped the same way.
2721
2722         Test: fast/clip/clip-when-rect-has-fractional-pixel-value.html
2723
2724         * rendering/RenderLayer.cpp:
2725         (WebCore::RenderLayer::clipToRect):
2726
2727 2014-04-19  Brent Fulgham  <bfulgham@apple.com>
2728
2729         Latched scrolling may interact badly with custom programmatic scrolling
2730         https://bugs.webkit.org/show_bug.cgi?id=131869
2731         <rdar://problem/16249557>
2732
2733         Reviewed by Darin Adler.
2734
2735         * dom/Element.cpp:
2736         (WebCore::Element::setScrollLeft): Mark scrollable area as having
2737         been scrolled programmatically.
2738         (WebCore::Element::setScrollTop): Ditto.
2739         * page/EventHandler.cpp:
2740         (WebCore::EventHandler::handleWheelEvent): Check for programmatic scroll, and
2741         clear latched state if the handler manually scrolled. Clear programmatic
2742         scroll state at the end of event handling.
2743         (WebCore::EventHandler::clearLatchedState): Refactored code.
2744         * page/EventHandler.h:
2745         * page/mac/EventHandlerMac.mm:
2746         (WebCore::EventHandler::platformPrepareForWheelEvents): Check
2747         if scrollable area was scrolled programmatically. If it was, do
2748         not honor latching behavior.
2749         * platform/ScrollableArea.cpp:
2750         (WebCore::ScrollableArea::ScrollableArea): Initialize new member.
2751         * platform/ScrollableArea.h:
2752         (WebCore::ScrollableArea::isScrolledProgrammatically): Added.
2753         (WebCore::ScrollableArea::setScrolledProgrammatically): Added.
2754
2755 2014-04-19  Chris Fleizach  <cfleizach@apple.com>
2756
2757         AX: grid rows are not recognized do to lack of explicit role="row", role="gridcell"
2758         https://bugs.webkit.org/show_bug.cgi?id=131819
2759
2760         Reviewed by Darin Adler.
2761
2762         Test: accessibility/table-with-missing-aria-role-rows.html
2763
2764         If a table is using role="grid", and it has <tr> elements that do not have
2765         role="row", we should still treat them as row elements.
2766
2767         * accessibility/AccessibilityARIAGrid.cpp:
2768         (WebCore::AccessibilityARIAGrid::addTableCellChild):
2769
2770 2014-04-19  Chris Fleizach  <cfleizach@apple.com>
2771
2772         AX: Malformed tables exposing incorrect col and colSpans
2773         https://bugs.webkit.org/show_bug.cgi?id=131796
2774
2775         Reviewed by Darin Adler.
2776
2777         Test: accessibility/table-incorrect-colspan-cell.html
2778
2779         When a developer has specified malformed colspans, accessibility is reporting those values instead of the effective column information.
2780
2781         * accessibility/AccessibilityTableCell.cpp:
2782         (WebCore::AccessibilityTableCell::columnIndexRange):
2783
2784 2014-04-19  Benjamin Poulain  <bpoulain@apple.com>
2785
2786         Make the CSS JIT compile for ARM64
2787         https://bugs.webkit.org/show_bug.cgi?id=131834
2788
2789         Reviewed by Gavin Barraclough.
2790
2791         Add the CPU specific code required to compile SelectorCompiler on ARM64.
2792         The code is absolutely non-functional, it would crash immediately, but it compiles.
2793
2794         * cssjit/FunctionCall.h:
2795         (WebCore::FunctionCall::FunctionCall):
2796         (WebCore::FunctionCall::callAndBranchOnCondition):
2797         * cssjit/RegisterAllocator.h:
2798         What am I supposed to do with all those registers? There are so many of them :)
2799         The array calleeSavedRegisters is defined for compatibility but it cannot be reached at the moment.
2800
2801         (WebCore::RegisterAllocator::isValidRegister):
2802         * cssjit/SelectorCompiler.cpp:
2803         (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
2804         Implement modulo by doing dividend - (divisor * int(dividend/divisor)).
2805
2806         * cssjit/StackAllocator.h:
2807         StackAllocator will need a small redesign to handle the 16 bytes alligned stack of
2808         ARM64.
2809         The code has been modified to build but it is pretty useless.
2810
2811         (WebCore::StackAllocator::allocateUninitialized):
2812         (WebCore::StackAllocator::push):
2813         (WebCore::StackAllocator::pop):
2814         (WebCore::StackAllocator::popAndDiscard):
2815         (WebCore::StackAllocator::popAndDiscardUpTo):
2816         (WebCore::StackAllocator::alignStackPreFunctionCall):
2817         (WebCore::StackAllocator::unalignStackPostFunctionCall):
2818
2819 2014-04-19  Simon Fraser  <simon.fraser@apple.com>
2820
2821         [UI-side compositing] Implement blend modes
2822         https://bugs.webkit.org/show_bug.cgi?id=131891
2823         <rdar://problem/16490085>
2824
2825         Reviewed by Tim Horton.
2826
2827         Implement blend modes with UI-side compositing.
2828         
2829         PlatformCALayer::setBlendMode() becomes pure virtual, and overridden in
2830         PlatformCALayerMac and PlatformCALayerRemote.
2831         PlatformCAFilters::setBlendingFiltersOnLayer() now takes a raw platform
2832         layer, so it can be called from the UI process on a CALayer*.
2833         
2834         Fix an issue with GraphicsLayerCA::LayerChange flags. 1 << 31 shifts
2835         a signed integer, so it ended up setting all the high bits in m_uncommittedChanges,
2836         causing us to push blend modes to the UI process for every layer. Fix by shifting
2837         an unsigned long long (1LLU << 31). This should also fix a build warning on Windows.
2838
2839         * WebCore.exp.in:
2840         * platform/graphics/ca/GraphicsLayerCA.h:
2841         * platform/graphics/ca/PlatformCAFilters.h:
2842         * platform/graphics/ca/PlatformCALayer.h:
2843         * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
2844         (PlatformCAFilters::setBlendingFiltersOnLayer):
2845         * platform/graphics/ca/mac/PlatformCALayerMac.h:
2846         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2847         (PlatformCALayerMac::setFilters):
2848         (PlatformCALayerMac::setBlendMode):
2849         (PlatformCALayer::setBlendMode): Deleted.
2850
2851 2014-04-19  Joseph Pecoraro  <pecoraro@apple.com>
2852
2853         Fix AVPlayerController leak on pages with video
2854         https://bugs.webkit.org/show_bug.cgi?id=131878
2855
2856         Reviewed by Eric Carlson.
2857
2858         * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
2859         (-[WebAVPlayerController init]):
2860         Assigning to the retain property will increment the count,
2861         so balance the alloc with an autorelease.
2862
2863 2014-04-19  Andreas Kling  <akling@apple.com>
2864
2865         Slap ALWAYS_INLINE on Element attribute lookup things.
2866         <https://webkit.org/b/131892>
2867
2868         Most of the "inline" helpers for setting/getting attributes were not
2869         actually getting inlined by the compiler, so let's make that happen.
2870
2871         Reviewed by Geoffrey Garen.
2872
2873         * dom/Element.cpp:
2874         (WebCore::Element::synchronizeAttribute):
2875         * dom/ElementData.h:
2876         (WebCore::ElementData::findAttributeByName):
2877         (WebCore::ElementData::findAttributeIndexByName):
2878
2879 2014-04-19  Darin Adler  <darin@apple.com>
2880
2881         Telephone number detection should respect its setting consistently
2882         https://bugs.webkit.org/show_bug.cgi?id=131893
2883         rdar://problem/16597639
2884
2885         Reviewed by Tim Horton.
2886
2887         * editing/Editor.cpp:
2888         (WebCore::Editor::respondToChangedSelection): Only start the timer
2889         if shouldDetectTelephoneNumbers returns true.
2890         (WebCore::Editor::shouldDetectTelephoneNumbers): Added. Calls both
2891         isTelephoneNumberParsingEnabled and TelephoneNumberDetector::isSupported.
2892         (WebCore::Editor::scanSelectionForTelephoneNumbers): Use
2893         shouldDetectTelephoneNumbers.
2894         (WebCore::Editor::clearDataDetectedTelephoneNumbers): Use document()
2895         instead of m_frame.document().
2896
2897         * editing/Editor.h: Added declaration of shouldDetectTelephoneNumbers.
2898
2899 2014-04-19  Andrei Bucur  <abucur@adobe.com>
2900
2901         [CSS Regions] Harden the layout in case there are no regions
2902         https://bugs.webkit.org/show_bug.cgi?id=131517
2903
2904         Reviewed by Mihnea Ovidenie.
2905
2906         The patch fixes the cases when the content of a flow thread is not
2907         properly invalidated when all the regions of its chain are removed.
2908
2909         Test: fast/regions/simplified-layout-no-regions.html
2910
2911         * rendering/RenderFlowThread.cpp:
2912         (WebCore::RenderFlowThread::logicalWidthChangedInRegionsForBlock):
2913         * rendering/RenderRegion.cpp:
2914         (WebCore::RenderRegion::ensureOverflowForBox):
2915
2916 2014-04-19  Zalan Bujtas  <zalan@apple.com>
2917
2918         https://bugs.webkit.org/show_bug.cgi?id=131594
2919         Subpixel rendering: WK1: Wrong repaint rect is calculated when layer has non-compositing transform.
2920
2921         Reviewed by Simon Fraser.
2922
2923         We need to snap the repaint rect for transformed object the same way when we paint them.
2924
2925         Test: fast/repaint/hidpi-wrong-repaint-rect-when-parent-has-noncompositing-transform.html
2926
2927         * rendering/RenderBox.cpp:
2928         (WebCore::RenderBox::computeRectForRepaint):
2929
2930 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
2931
2932         Use 'override' in GraphicsLayerCA
2933         https://bugs.webkit.org/show_bug.cgi?id=131882
2934
2935         Reviewed by Tim Horton.
2936
2937         Add 'override' to all overridden functions. Found a few that need
2938         not have been virtual. Removed "allowTiledLayer" stuff that was
2939         never called.
2940
2941         * WebCore.exp.in:
2942         * platform/graphics/ca/GraphicsLayerCA.cpp:
2943         (WebCore::GraphicsLayerCA::GraphicsLayerCA):
2944         (WebCore::GraphicsLayerCA::requiresTiledLayer):
2945         (WebCore::GraphicsLayerCA::setAllowTiledLayer): Deleted.
2946         * platform/graphics/ca/GraphicsLayerCA.h:
2947         (WebCore::GraphicsLayerCA::platformCALayer):
2948         (WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
2949         (WebCore::GraphicsLayerCA::allowTiledLayer): Deleted.
2950         (WebCore::GraphicsLayerCA::isGraphicsLayerCA): Deleted.
2951         (WebCore::GraphicsLayerCA::platformCALayerLayoutSublayersOfLayer): Deleted.
2952         (WebCore::GraphicsLayerCA::platformCALayerRespondsToLayoutChanges): Deleted.
2953         (WebCore::GraphicsLayerCA::platformCALayerContentsOrientation): Deleted.
2954         (WebCore::GraphicsLayerCA::platformCALayerShowDebugBorders): Deleted.
2955         (WebCore::GraphicsLayerCA::platformCALayerIncrementRepaintCount): Deleted.
2956         (WebCore::GraphicsLayerCA::platformCALayerContentsOpaque): Deleted.
2957         (WebCore::GraphicsLayerCA::platformCALayerDrawsContent): Deleted.
2958         (WebCore::GraphicsLayerCA::platformCALayerLayerDidDisplay): Deleted.
2959
2960 2014-04-18  Timothy Hatcher  <timothy@apple.com>
2961
2962         Web Inspector: Move InspectorProfilerAgent to JavaScriptCore
2963         https://bugs.webkit.org/show_bug.cgi?id=131673
2964
2965         Passes existing profiler and inspector tests.
2966
2967         Reviewed by Joseph Pecoraro.
2968
2969         * CMakeLists.txt:
2970         * DerivedSources.make:
2971         * ForwardingHeaders/inspector/agents/InspectorProfilerAgent.h: Added.
2972         * WebCore.exp.in:
2973         * WebCore.vcxproj/WebCore.vcxproj:
2974         * WebCore.vcxproj/WebCore.vcxproj.filters:
2975         * WebCore.xcodeproj/project.pbxproj:
2976         * bindings/js/ScriptProfile.cpp: Removed.
2977         * bindings/js/ScriptProfile.h:
2978         * bindings/js/ScriptProfiler.cpp: Removed.
2979         * bindings/js/ScriptProfiler.h: Removed.
2980         * inspector/InspectorAllInOne.cpp:
2981         * inspector/InspectorConsoleInstrumentation.h:
2982         (WebCore::InspectorInstrumentation::profilerEnabled):
2983         (WebCore::InspectorInstrumentation::startProfiling):
2984         (WebCore::InspectorInstrumentation::stopProfiling):
2985         * inspector/InspectorController.cpp:
2986         (WebCore::InspectorController::InspectorController):
2987         * inspector/InspectorController.h:
2988         * inspector/InspectorInstrumentation.cpp:
2989         (WebCore::InspectorInstrumentation::didCommitLoadImpl):
2990         (WebCore::InspectorInstrumentation::startProfilingImpl):
2991         (WebCore::InspectorInstrumentation::stopProfilingImpl):
2992         (WebCore::InspectorInstrumentation::consoleTimeStampImpl): Deleted.
2993         * inspector/InspectorInstrumentation.h:
2994         * inspector/InspectorProfilerAgent.cpp: Removed.
2995         * inspector/InspectorProfilerAgent.h: Removed.
2996         * inspector/InspectorTimelineAgent.cpp:
2997         (WebCore::startProfiling):
2998         (WebCore::stopProfiling):
2999         (WebCore::InspectorTimelineAgent::willCallFunction):
3000         (WebCore::InspectorTimelineAgent::didCallFunction):
3001         (WebCore::InspectorTimelineAgent::willEvaluateScript):
3002         (WebCore::InspectorTimelineAgent::didEvaluateScript):
3003         (WebCore::InspectorTimelineAgent::didDispatchXHRLoadEvent): Deleted.
3004         * inspector/InstrumentingAgents.h:
3005         (WebCore::InstrumentingAgents::inspectorProfilerAgent):
3006         (WebCore::InstrumentingAgents::setInspectorProfilerAgent):
3007         * inspector/PageDebuggerAgent.cpp:
3008         (WebCore::PageDebuggerAgent::sourceMapURLForScript): Deleted.
3009         * inspector/PageDebuggerAgent.h:
3010         * inspector/PageProfilerAgent.cpp: Added.
3011         (WebCore::PageProfilerAgent::PageProfilerAgent):
3012         (WebCore::PageProfilerAgent::profilingGlobalExecState):
3013         * inspector/PageProfilerAgent.h: Added.
3014         (WebCore::PageProfilerAgent::~PageProfilerAgent):
3015         * inspector/ScriptProfile.idl:
3016         * inspector/TimelineRecordFactory.cpp:
3017         (WebCore::TimelineRecordFactory::appendProfile):
3018         * inspector/TimelineRecordFactory.h:
3019         * inspector/WebConsoleAgent.cpp:
3020         * inspector/WebProfilerAgent.cpp: Added.
3021         (WebCore::WebProfilerAgent::WebProfilerAgent):
3022         (WebCore::WebProfilerAgent::enable):
3023         (WebCore::WebProfilerAgent::disable):
3024         * inspector/WebProfilerAgent.h: Added.
3025         (WebCore::WebProfilerAgent::~WebProfilerAgent):
3026         * inspector/WorkerInspectorController.cpp:
3027         (WebCore::WorkerInspectorController::WorkerInspectorController):
3028         * inspector/WorkerProfilerAgent.cpp: Added.
3029         (WebCore::WorkerProfilerAgent::WorkerProfilerAgent):
3030         (WebCore::WorkerProfilerAgent::profilingGlobalExecState):
3031         * inspector/WorkerProfilerAgent.h: Added.
3032         (WebCore::WorkerProfilerAgent::~WorkerProfilerAgent):
3033         * loader/appcache/ApplicationCacheGroup.cpp:
3034         * page/PageConsole.cpp:
3035         (WebCore::PageConsole::profile):
3036         (WebCore::PageConsole::profileEnd):
3037         (WebCore::PageConsole::time): Deleted.
3038         (WebCore::PageConsole::timeEnd): Deleted.
3039         (WebCore::PageConsole::timeStamp): Deleted.
3040         * page/PageConsole.h:
3041         * testing/Internals.cpp:
3042         * testing/Internals.h:
3043         * xml/XMLHttpRequest.cpp:
3044
3045 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
3046
3047         Contents of directly composited image layers are sometimes missing
3048         https://bugs.webkit.org/show_bug.cgi?id=131880
3049
3050         Reviewed by Tim Horton.
3051         
3052         RenderLayerBacking::updateGraphicsLayerGeometry() tested whether a
3053         GraphicsLayer had a contents layer to determine whether to call code
3054         that updates the contents rect. However, on Mac, we don't make a contents
3055         layer until later at layer flush time. That would result in an empty
3056         contentsRect being set.
3057         
3058         Fix by renaming GraphicsLayer::hasContentsLayer() to usesContentsLayer(),
3059         and on Mac consulting the m_contentsLayerPurpose flag, which is set
3060         at the appropriate time.
3061
3062         Test: compositing/images/update-content-rect.html
3063
3064         * platform/ScrollView.cpp:
3065         (WebCore::positionScrollbarLayer):
3066         * platform/graphics/GraphicsLayer.cpp:
3067         (WebCore::GraphicsLayer::getDebugBorderInfo):
3068         * platform/graphics/GraphicsLayer.h:
3069         (WebCore::GraphicsLayer::usesContentsLayer):
3070         (WebCore::GraphicsLayer::hasContentsLayer): Deleted.
3071         * platform/graphics/ca/GraphicsLayerCA.h:
3072         (WebCore::GraphicsLayerCA::hasContentsLayer): Deleted.
3073         * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
3074         (WebCore::GraphicsLayerTextureMapper::usesContentsLayer):
3075         (WebCore::GraphicsLayerTextureMapper::hasContentsLayer): Deleted.
3076         * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
3077         * rendering/RenderLayerBacking.cpp:
3078         (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
3079         (WebCore::RenderLayerBacking::positionOverflowControlsLayers):
3080         (WebCore::RenderLayerBacking::compositingLayerType):
3081
3082 2014-04-18  Commit Queue  <commit-queue@webkit.org>
3083
3084         Unreviewed, rolling out r167527.
3085         https://bugs.webkit.org/show_bug.cgi?id=131883
3086
3087         Broke 32-bit build (Requested by ap on #webkit).
3088
3089         Reverted changeset:
3090
3091         "[Mac] implement WebKitDataCue"
3092         https://bugs.webkit.org/show_bug.cgi?id=131799
3093         http://trac.webkit.org/changeset/167527
3094
3095 2014-04-18  Eric Carlson  <eric.carlson@apple.com>
3096
3097         [Mac] implement WebKitDataCue
3098         https://bugs.webkit.org/show_bug.cgi?id=131799
3099
3100         Reviewed by Dean Jackson.
3101
3102         Tests: http/tests/media/track-in-band-hls-metadata.html
3103                media/track/track-datacue-value.html
3104
3105         * Configurations/FeatureDefines.xcconfig: Define ENABLE_DATACUE_VALUE.
3106         * DerivedSources.make: Add ENABLE_DATACUE_VALUE to HTML_FLAGS when appropriate.
3107
3108         * CMakeLists.txt: Add JSDataCueCustom.cpp.
3109         * bindings/js/JSBindingsAllInOne.cpp:
3110         * WebCore.xcodeproj/project.pbxproj: Add new files.
3111
3112         * bindings/js/JSDataCueCustom.cpp: Added.
3113         (WebCore::JSDataCue::value): 
3114         (WebCore::JSDataCue::setValue):
3115         (WebCore::JSDataCueConstructor::constructJSDataCue): Custom constructor.
3116
3117         * html/HTMLMediaElement.cpp:
3118         (WebCore::HTMLMediaElement::updateActiveTextTrackCues): Drive-by fixes: don't schedule timeupdate
3119             events when paused, don't call sort on an Vector that can't be sorted.
3120
3121         * html/track/DataCue.cpp:
3122         (WebCore::DataCue::DataCue): Initialize m_type.
3123         (WebCore::DataCue::~DataCue): Unprotect the JSValue if necessary.
3124         (WebCore::DataCue::data): Ask the platform value for data if non-null.
3125         (WebCore::DataCue::setData): Clear m_platformValue and m_value.
3126         (WebCore::DataCue::isEqual): New.
3127         (WebCore::DataCue::value): Return a JSValue from the platform value, or the value passed
3128             to the constructor/set by script.
3129         (WebCore::DataCue::setValue): Set m_value.
3130         * html/track/DataCue.h:
3131         * html/track/DataCue.idl:
3132
3133         * html/track/InbandDataTextTrack.cpp:
3134         (WebCore::InbandDataTextTrack::addDataCue): Don't add the same cue more than once.
3135         (WebCore::InbandDataTextTrack::updateDataCue): Update a cue's duration.
3136         (WebCore::InbandDataTextTrack::removeDataCue): Remove an incomplete cue.
3137         (WebCore::InbandDataTextTrack::removeCue): Remove a cue from the incomplete cue map if necessary.
3138         * html/track/InbandDataTextTrack.h:
3139
3140         * html/track/InbandGenericTextTrack.cpp:
3141         (WebCore::InbandGenericTextTrack::addGenericCue): CueMatchRules is now in TextTrackCue instead
3142             of VTTCue.
3143         * html/track/InbandTextTrack.h:
3144
3145         * html/track/InbandWebVTTTextTrack.cpp:
3146         (WebCore::InbandWebVTTTextTrack::newCuesParsed): Ditto.
3147
3148         * html/track/TextTrack.cpp:
3149         (WebCore::TextTrack::hasCue): Ditto.
3150         * html/track/TextTrack.h:
3151
3152         * html/track/TextTrackCue.cpp:
3153         (WebCore::TextTrackCue::isEqual): New, test base class equality.
3154         * html/track/TextTrackCue.h:
3155
3156         * html/track/TextTrackCueGeneric.cpp:
3157         (WebCore::TextTrackCueGeneric::isEqual): Call TextTrackCue::isEqual first.
3158         * html/track/TextTrackCueGeneric.h:
3159
3160         * html/track/VTTCue.cpp:
3161         (WebCore::VTTCue::isEqual): Call TextTrackCue::isEqual first.
3162         * html/track/VTTCue.h:
3163
3164         * platform/SerializedPlatformRepresentation.h: Added.
3165         (WebCore::SerializedPlatformRepresentation::~SerializedPlatformRepresentation):
3166         (WebCore::SerializedPlatformRepresentation::SerializedPlatformRepresentation):
3167
3168         * platform/graphics/InbandTextTrackPrivateClient.h: Add methods for DataCue with SerializedPlatformRepresentation.
3169
3170         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: Added.
3171         (WebCore::InbandMetadataTextTrackPrivateAVF::create):
3172         (WebCore::InbandMetadataTextTrackPrivateAVF::InbandMetadataTextTrackPrivateAVF):
3173         (WebCore::InbandMetadataTextTrackPrivateAVF::~InbandMetadataTextTrackPrivateAVF):
3174         (WebCore::InbandMetadataTextTrackPrivateAVF::addDataCue):
3175         (WebCore::InbandMetadataTextTrackPrivateAVF::updatePendingCueEndTimes):
3176         (WebCore::InbandMetadataTextTrackPrivateAVF::flushPartialCues):
3177         * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.h: Added.
3178
3179         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
3180         (WebCore::MediaPlayerPrivateAVFoundation::seekWithTolerance): currentTrack -> currentTextTrack.
3181         (WebCore::MediaPlayerPrivateAVFoundation::seekCompleted): Ditto.
3182         (WebCore::MediaPlayerPrivateAVFoundation::configureInbandTracks): Ditto.
3183         * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
3184         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTextTrack):
3185         (WebCore::MediaPlayerPrivateAVFoundation::setCurrentTrack): Deleted.
3186
3187         Renamed currentTrack and setCurrentTrack to currentTextTrack and setCurrentTextTrack.
3188         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
3189         (WebCore::AVFWrapper::currentTextTrack):
3190         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTextTrack):
3191         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTextTrack):
3192         (WebCore::AVFWrapper::setCurrentTextTrack):
3193         (WebCore::AVFWrapper::AVFWrapper):
3194         (WebCore::AVFWrapper::processCue):
3195         (WebCore::AVFWrapper::currentTrack): Deleted.
3196         (WebCore::MediaPlayerPrivateAVFoundationCF::setCurrentTrack): Deleted.
3197         (WebCore::MediaPlayerPrivateAVFoundationCF::currentTrack): Deleted.
3198         (WebCore::AVFWrapper::setCurrentTrack): Deleted.
3199         * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
3200
3201         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
3202         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
3203         (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
3204         (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): currentTrack -> currentTextTrack
3205         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): currentTrack -> currentTextTrack.
3206         (WebCore::MediaPlayerPrivateAVFoundationObjC::processMetadataTrack): New.
3207         (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): m_currentTrack -> m_currentTextTrack.
3208         (WebCore::MediaPlayerPrivateAVFoundationObjC::flushCues): Ditto.
3209         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): Renamed from setCurrentTextTrack.
3210         (WebCore::metadataType): Map an AVFoundation metadata key space to a metadata cue type.
3211         (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): Process new metadata.
3212         (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
3213         (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTrack): Deleted.
3214
3215         Create a JSValue representation from an AVMetadataItem.
3216         * platform/mac/SerializedPlatformRepresentationMac.h: Added.
3217         (WebCore::SerializedPlatformRepresentationMac::platformType):
3218         (WebCore::SerializedPlatformRepresentationMac::nativeValue):
3219         * platform/mac/SerializedPlatformRepresentationMac.mm: Added.
3220         (WebCore::SerializedPlatformRepresentationMac::SerializedPlatformRepresentationMac):
3221         (WebCore::SerializedPlatformRepresentationMac::~SerializedPlatformRepresentationMac):
3222         (WebCore::SerializedPlatformRepresentationMac::create):
3223         (WebCore::SerializedPlatformRepresentationMac::data):
3224         (WebCore::SerializedPlatformRepresentationMac::deserialize):
3225         (WebCore::SerializedPlatformRepresentationMac::isEqual):
3226         (WebCore::toSerializedPlatformRepresentationMac):
3227         (WebCore::jsValueWithValueInContext):
3228         (WebCore::jsValueWithDataInContext):
3229         (WebCore::jsValueWithArrayInContext):
3230         (WebCore::jsValueWithDictionaryInContext):
3231         (WebCore::jsValueWithAVMetadataItemInContext):
3232
3233 2014-04-18  Jon Honeycutt  <jhoneycutt@apple.com>
3234
3235         Harden RenderInline::inlineElementContinuation()
3236
3237         <https://bugs.webkit.org/show_bug.cgi?id=131858>
3238
3239         Reviewed by Sam Weinig.
3240
3241         No new tests, as there are no known cases of this happening.
3242
3243         * rendering/RenderInline.cpp:
3244         (WebCore::RenderInline::inlineElementContinuation):
3245         Return nullptr if the continuation is neither a RenderInline nor a
3246         RenderBlock.
3247
3248 2014-04-18  Stephanie Lewis  <slewis@apple.com>
3249
3250         We shouldn’t create page throttlers for other pages than WebKit2 pages.
3251         Part of <rdar://problem/16473045> Visibility state counters are often incorrect
3252         https://bugs.webkit.org/show_bug.cgi?id=131696
3253
3254         Reviewed by Gavin Barraclough.
3255
3256         No new test since not web exposed.
3257
3258         Page throttlers were being created for SVG images and other page instances that
3259         were not accurately tracking the states that enable and disable page throttling.
3260         Make the throttler an unique ptr and only initialize it for WebKit2.
3261
3262         This also fixes an inefficiency where we would throttle a new page on creation because 
3263         we assumed it was visible even if that was not the case.
3264
3265         * WebCore.exp.in:
3266         * html/HTMLMediaElement.cpp:
3267         (WebCore::HTMLMediaElement::parseAttribute): Check page throttler exists.
3268         * loader/FrameLoader.cpp:
3269         (WebCore::FrameLoader::started): ditto
3270         * page/Page.cpp:
3271         (WebCore::Page::Page): Don’t automatically create page throttler.
3272         (WebCore::Page::createPageThrottler): Create page throttler.
3273         (WebCore::Page::setViewState): Check page throttler exists.
3274         * page/Page.h:
3275         (WebCore::Page::pageThrottler): Make the page throttler a unique ptr.
3276         * page/PageThrottler.h:
3277         * page/Settings.cpp: 
3278         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled): Check page throttler exists.
3279
3280 2014-04-18  Stephanie Lewis  <slewis@apple.com>
3281
3282         Move DOM throttling out of the page throttler
3283         <rdar://problem/16473004>
3284         https://bugs.webkit.org/show_bug.cgi?id=131697
3285
3286         Reviewed by Gavin Barraclough.
3287
3288         No new tests since it's not web exposed.
3289
3290         DOM timer throttling is currently part of the page throttler which uses per process 
3291         state and per page state to determine when to throttle.  This led us to being overly 
3292         conservative when turning DOM throttling off.  It should only respond to view state changes.
3293
3294         Additionally since creating extra page throttlers SVG images caused bugs 
3295         in tracking state we'll reserve the page throttler for WebKit2 views.  To avoid regressing 
3296         WebKit1 we should move DOM timer throttling back to the page.
3297
3298         * page/Page.cpp:
3299         (WebCore::Page::Page): set DOM timer throttling.
3300         (WebCore::Page::setIsVisuallyIdleInternal): ditto.
3301         (WebCore::Page::hiddenPageDOMTimerThrottlingStateChanged): ditto.
3302         (WebCore::Page::setIsVisible): Update view state masks for WebKit1 to include IsVisibleOrOccluded and IsVisuallyIdle
3303         * page/Page.h:
3304         * page/PageThrottler.cpp:
3305         (WebCore::PageThrottler::PageThrottler): remove DOM timer throttling.
3306         (WebCore::PageThrottler::started): ditto.
3307         (WebCore::PageThrottler::stopped): ditto.
3308         (WebCore::PageThrottler::hiddenPageDOMTimerThrottlingStateChanged): Deleted.
3309         * page/PageThrottler.h:
3310         * page/Settings.cpp:
3311         (WebCore::Settings::setHiddenPageDOMTimerThrottlingEnabled):
3312
3313 2014-04-18  Dean Jackson  <dino@apple.com>
3314
3315         [WebGL] Limit maximum texture sizes on older Intel hardware
3316         https://bugs.webkit.org/show_bug.cgi?id=131867
3317
3318         Reviewed by Geoffrey Garen.
3319
3320         Both Chrome and Firefox limit the MAX_TEXTURE_SIZE on
3321         older Intel hardware to be at most 4096. This does the
3322         same for WebKit.
3323
3324         * platform/graphics/Extensions3D.h: Add requiresRestrictedMaximumTextureSize() accessor.
3325         * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
3326         (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon): Record the value of GL_RENDERER
3327         and test for "Intel HD Graphics 3000", which is the problematic hardware.
3328         * platform/graphics/opengl/Extensions3DOpenGLCommon.h:
3329         (WebCore::Extensions3DOpenGLCommon::requiresRestrictedMaximumTextureSize): Getter.
3330         * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
3331         (WebCore::GraphicsContext3D::getIntegerv): If you're asking for MAX_TEXTURE_SIZE or
3332         MAX_CUBE_MAP_TEXTURE_SIZE, and you're on problematic hardware, return a clamped value
3333         (4096 and 1024 respectively).
3334
3335 2014-04-18  Hans Muller  <hmuller@adobe.com>
3336
3337         [CSS Shapes] Add parsing support for gradients
3338         https://bugs.webkit.org/show_bug.cgi?id=131444
3339
3340         Reviewed by Bem Jones-Bey.
3341
3342         Added support for shape-outside gradient values.
3343
3344         Test: fast/shapes/shape-outside-floats/shape-outside-linear-gradient.html
3345
3346         * css/DeprecatedStyleBuilder.cpp:
3347         (WebCore::ApplyPropertyShape::applyValue): Accept generated images as shape-outside values.
3348         * rendering/shapes/ShapeOutsideInfo.cpp:
3349         (WebCore::checkShapeImageOrigin): Generated images get a pass, others do not.
3350         (WebCore::getShapeImageAndRect): Use StyleImage::image() to get a generated image.
3351         (WebCore::ShapeOutsideInfo::isEnabledFor):
3352         * rendering/style/ShapeValue.h:
3353         (WebCore::ShapeValue::isImageValid): Generated images are always considered valid.
3354
3355 2014-04-18  Brady Eidson  <beidson@apple.com>
3356
3357         REGRESSION (r155700): Pasting an image into content-editable regions is broken.
3358         <rdar://problem/16654156> and https://bugs.webkit.org/show_bug.cgi?id=131844
3359
3360         Reviewed by Enrica Casucci.
3361
3362         * editing/mac/EditorMac.mm:
3363         (WebCore::Editor::createFragmentForImageResourceAndAddResource): Add the ArchiveResource before
3364           creating the element that uses it.
3365
3366 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
3367
3368         [iOS WK2] Make window.scroll() and window.scrollBy() work
3369         https://bugs.webkit.org/show_bug.cgi?id=131848
3370         <rdar://problem/16638319>
3371
3372         Reviewed by Beth Dakin.
3373
3374         The scrolling-related functions in DOMWindow were #ifdeffed for iOS
3375         to use the hacky WK1-specific "actual scroll" functions, which do nothing
3376         in WK2.
3377         
3378         Fix by adding a scroll position wrapper (contentsScrollPosition) which does
3379         the right thing on WK1 and WK2, and change almost all the places that used "actualScrollPosition"
3380         to us it (with the exception of contentsScrollOffset() in MouseRelatedEvent.cpp, which has
3381         confusing scaling behavior).
3382
3383         * dom/MouseRelatedEvent.cpp:
3384         (WebCore::MouseRelatedEvent::MouseRelatedEvent):
3385         * dom/TreeScope.cpp:
3386         (WebCore::nodeFromPoint): Remove #ifdefs. 
3387         * html/HTMLBodyElement.cpp:
3388         (WebCore::HTMLBodyElement::scrollLeft):
3389         (WebCore::HTMLBodyElement::scrollTop):
3390         * page/DOMWindow.cpp:
3391         (WebCore::DOMWindow::scrollX):
3392         (WebCore::DOMWindow::scrollY):
3393         (WebCore::DOMWindow::scrollBy):
3394         (WebCore::DOMWindow::scrollTo):
3395         * platform/ScrollView.cpp:
3396         (WebCore::ScrollView::contentsScrollPosition):
3397         (WebCore::ScrollView::setContentsScrollPosition):
3398         * platform/ScrollView.h:
3399
3400 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
3401
3402         Worse animation performance on pages with 3D transforms
3403         https://bugs.webkit.org/show_bug.cgi?id=131838
3404         <rdar://problem/16428630&15705876>
3405
3406         Reviewed by Dean Jackson.
3407         
3408         r155977 added logic to adjust the contentsScale of compositing layers
3409         based on a root-relative transform. However, this resulted in
3410         the contentsScale continually changing on layers whose transforms
3411         are changed dynamically, which caused lots of expensive painting.
3412         
3413         Fix by bucketing the part of the scale computed from the root-relative transform
3414         into buckets of 0.25 via rounding.
3415
3416         Test: compositing/contents-scale/rounded-contents-scale.html
3417
3418         * platform/graphics/ca/GraphicsLayerCA.cpp:
3419         (WebCore::clampedContentsScaleForScale):
3420         (WebCore::GraphicsLayerCA::updateContentsOpaque):
3421         (WebCore::GraphicsLayerCA::updateContentsScale):
3422         (WebCore::GraphicsLayerCA::updateContentsVisibility): Deleted.
3423         (WebCore::GraphicsLayerCA::animatedLayerClones): Deleted.
3424
3425 2014-04-18  Simon Fraser  <simon.fraser@apple.com>
3426
3427         Remove some includes from image-related headers, and Document.h
3428         https://bugs.webkit.org/show_bug.cgi?id=131797
3429
3430         Reviewed by Martin Robinson.
3431
3432         Remove some #includes from Document.h, DragImage.h, GradientImage.h,
3433         Image.h, and ImageBuffer.h and deal with the fallout.
3434
3435         * dom/ContainerNode.h:
3436         * dom/Document.cpp:
3437         (WebCore::Document::setInputCursor):
3438         * dom/Document.h:
3439         (WebCore::Document::inputCursor):
3440         * dom/MutationObserverRegistration.cpp:
3441         * html/canvas/WebGLRenderingContext.cpp:
3442         * page/FrameSnapshotting.cpp:
3443         * page/Page.cpp:
3444         * platform/DragImage.h:
3445         * platform/graphics/BitmapImage.cpp:
3446         * platform/graphics/GradientImage.cpp:
3447         (WebCore::GradientImage::GradientImage):
3448         (WebCore::GradientImage::~GradientImage):
3449         * platform/graphics/GradientImage.h:
3450         * platform/graphics/Image.h:
3451         * platform/graphics/ImageBuffer.cpp:
3452         * platform/graphics/ImageBuffer.h:
3453         (WebCore::ImageBuffer::create):
3454         (WebCore::ImageBuffer::internalSize):
3455         (WebCore::ImageBuffer::logicalSize):
3456         (WebCore::ImageBuffer::baseTransform):
3457         (WebCore::ImageBuffer::spaceSize):
3458