Another Windows build fix attempt after r153978.
[WebKit-https.git] / Source / WebCore / ChangeLog
1 2013-08-13  Ryosuke Niwa  <rniwa@webkit.org>
2
3         Another Windows build fix attempt after r153978.
4
5         * page/win/DragControllerWin.cpp:
6
7 2013-08-12  Ryosuke Niwa  <rniwa@webkit.org>
8
9         Windows build fix attempt after r153978.
10
11         * page/win/DragControllerWin.cpp:
12
13 2013-08-12  Zan Dobersek  <zdobersek@igalia.com>
14
15         ASSERTION FAILED: type() == Percent in WebCore::Length::percent
16         https://bugs.webkit.org/show_bug.cgi?id=116715
17
18         Reviewed by Darin Adler.
19
20         Allow the Calculated type in the Length::percent method that returns the Length's
21         float value. This reflects the changes in r110148 that adjusted the Length::isPercent
22         method to return true for Length objects of either Percent or Calculated type.
23
24         Test: fast/css/calculated-length-as-percent-crash.html
25
26         * platform/Length.h:
27         (WebCore::Length::percent): Assert that Length::isPercent is true when Length::percent
28         is called, ensuring the Length's type is either Percent or Calculated.
29
30 2013-06-16  Darin Adler  <darin@apple.com>
31
32         Move Clipboard::declareAndWriteDragImage to DragController
33         https://bugs.webkit.org/show_bug.cgi?id=117683
34
35         Reviewed by Brent Fulgham.
36
37         * dom/Clipboard.h: Removed declareAndWriteDragImage.
38
39         * page/DragController.cpp:
40         (WebCore::selectImageBeforeDragging): Half of the old prepareClipboardForImageDrag
41         is now refactored into this function.
42         (WebCore::DragController::startDrag): Where we called prepareClipboardForImageDrag,
43         instead call selectImageBeforeDragging and declareAndWriteDragImage. This is needed
44         because declareAndWriteDragImage needs to be a member function, for Mac at least.
45
46         * page/DragController.h: Added declareAndWriteDragImage.
47
48         * page/efl/DragControllerEfl.cpp:
49         (WebCore::DragController::declareAndWriteDragImage): Added empty placeholder.
50         It would be better to delete this file rather than having these placeholders.
51         I don't think EFL actually has drag support, and it makes work to have to keep
52         source files up to date that are really unused.
53
54         * page/gtk/DragControllerGtk.cpp:
55         (WebCore::DragController::declareAndWriteDragImage): Added. Calls Pasteboard::writeImage.
56         * page/mac/DragControllerMac.mm:
57         (WebCore::DragController::declareAndWriteDragImage): Added. Calls to DragClient, which
58         does the work.
59         * page/qt/DragControllerQt.cpp:
60         (WebCore::DragController::declareAndWriteDragImage): Added. Calls Pasteboard::writeImage.
61         * page/win/DragControllerWin.cpp:
62         (WebCore::DragController::declareAndWriteDragImage): Added. Uses Pasteboard functions to
63         do the work.
64
65         * platform/Clipboard.h: Changed the pasteboard function to return a non-const reference.
66         For now, it's not clear what const will mean for pasteboards, and it's currently not
67         possible to write to a const pasteboard, which we need to do in the new
68         DragController::declareAndWriteDragImage functions.
69
70         * platform/Pasteboard.h: Added a new writeMarkup function, implemented only for Windows
71         at this time.
72
73         * platform/efl/ClipboardEfl.cpp: Deleted declareAndWriteDragImage.
74         * platform/gtk/ClipboardGtk.cpp: Ditto.
75         * platform/ios/ClipboardIOS.h: Ditto.
76         * platform/ios/ClipboardIOS.mm: Ditto.
77         * platform/mac/ClipboardMac.mm: Ditto.
78         * platform/qt/ClipboardQt.cpp: Ditto.
79         * platform/win/ClipboardWin.cpp: Ditto.
80
81         * platform/win/PasteboardWin.cpp:
82         (WebCore::Pasteboard::writePlainTextToDataObject): Took out a pointless line of code.
83         (WebCore::Pasteboard::writeMarkup): Added. Currently implemented only for Windows.
84         This factors out a significant piece of DragController::declareAndWriteDragImage,
85         and will probably be handy for other platforms later.
86
87 2013-08-12  Ryosuke Niwa  <rniwa@webkit.org>
88
89         Fix NULL de-refernce in HTMLAnchorElement::sendPings when settings doesn't exist
90         https://bugs.webkit.org/show_bug.cgi?id=119716
91
92         Reviewed by Darin Adler.
93
94         Merge https://chromium.googlesource.com/chromium/blink/+/d5783da353ab783e9994b8fbecd91880be5192a1
95
96         No new tests since the test in the Blink change doesn't reproduce crash on WebKit.
97
98         * html/HTMLAnchorElement.cpp:
99         (WebCore::HTMLAnchorElement::sendPings):
100
101 2013-08-12  Seokju Kwon  <seokju@webkit.org>
102
103         Use the correct preprocessor in shouldRepaintFixedBackgroundsOnScroll()
104         https://bugs.webkit.org/show_bug.cgi?id=119710
105
106         Reviewed by Darin Adler.
107
108         No behavior change, no new tests needed.
109
110         * rendering/RenderObject.cpp: Remove unused parameter warning.
111         (WebCore::shouldRepaintFixedBackgroundsOnScroll):
112
113 2013-08-12  Alexey Proskuryakov  <ap@apple.com>
114
115         http/tests/security/sandboxed-iframe-invalid.html is flaky on Mac
116         https://bugs.webkit.org/show_bug.cgi?id=85522
117
118         Reviewed by Andy Estes.
119
120         Drive-by FIXMEs and trivial fixes for WebCore issues I noticed while working
121         on this bug. No behavior change expected.
122
123         * loader/FrameLoader.cpp:
124         (WebCore::FrameLoader::submitForm):
125         (WebCore::FrameLoader::findFrameForNavigation):
126         * loader/NavigationScheduler.cpp:
127         (WebCore::ScheduledFormSubmission::fire):
128
129 2013-08-13  Ryosuke Niwa  <rniwa@webkit.org>
130
131         Fix variable name |end| -> |size| in EventTarget::fireEventListeners
132         https://bugs.webkit.org/show_bug.cgi?id=119715
133
134         Reviewed by Benjamin Poulain.
135
136         Merge https://chromium.googlesource.com/chromium/blink/+/f58b017539c48059bb2b88d18ee0ee3d14decb01
137         and also fix variable names in FiringEventIterator.
138
139         * dom/EventTarget.cpp:
140         (WebCore::EventTarget::removeEventListener):
141         (WebCore::EventTarget::fireEventListeners):
142         (WebCore::EventTarget::removeAllEventListeners):
143         * dom/EventTarget.h:
144         (WebCore::FiringEventIterator::FiringEventIterator):
145
146 2013-08-12  Ryosuke Niwa  <rniwa@webkit.org>
147
148         Encapsulate access to documentNamedItemMap and windowNamedItemMap
149         https://bugs.webkit.org/show_bug.cgi?id=119701
150
151         Reviewed by Darin Adler.
152
153         Encapsulate m_documentNamedItem and m_windowNamedItem by adding various methods on HTMLDocument.
154         This will help us doing more refactorings in the future.
155
156         * bindings/js/JSDOMWindowCustom.cpp:
157         (WebCore::namedItemGetter):
158         (WebCore::JSDOMWindow::getOwnPropertySlot):
159         (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
160         (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
161         * bindings/js/JSHTMLDocumentCustom.cpp:
162         (WebCore::JSHTMLDocument::canGetItemsForName):
163         (WebCore::JSHTMLDocument::nameGetter):
164         * dom/Element.cpp:
165         (WebCore::Element::updateNameForDocument):
166         (WebCore::Element::updateIdForDocument):
167         * html/HTMLDocument.cpp:
168         (WebCore::HTMLDocument::addDocumentNamedItem): Added.
169         (WebCore::HTMLDocument::removeDocumentNamedItem): Added.
170         (WebCore::HTMLDocument::addWindowNamedItem): Added.
171         (WebCore::HTMLDocument::removeWindowNamedItem): Added.
172         * html/HTMLDocument.h:
173         (WebCore::HTMLDocument::documentNamedItem): Added.
174         (WebCore::HTMLDocument::hasDocumentNamedItem): Added.
175         (WebCore::HTMLDocument::documentNamedItemContainsMultipleElements): Added.
176         (WebCore::HTMLDocument::windowNamedItem): Added.
177         (WebCore::HTMLDocument::hasWindowNamedItem): Added.
178         (WebCore::HTMLDocument::windowNamedItemContainsMultipleElements): Added.
179         * html/HTMLImageElement.cpp:
180         (WebCore::HTMLImageElement::parseAttribute):
181         * html/HTMLObjectElement.cpp:
182         (WebCore::HTMLObjectElement::updateDocNamedItem):
183
184 2013-08-12  Patrick Gansterer  <paroga@webkit.org>
185
186         [CMake] Use the correct list of files when compiling ANGLESupport on Windows
187         https://bugs.webkit.org/show_bug.cgi?id=119439
188
189         Reviewed by Gyuyoung Kim.
190
191         * CMakeLists.txt: Use ossource_win.cpp instead of ossource_posix.cpp on Windows platforms.
192
193 2013-08-12  Arnaud Renevier  <a.renevier@samsung.com>
194
195         [cairo] memory corruption with putImageData and accelerated canvas.
196         https://bugs.webkit.org/show_bug.cgi?id=118621
197
198         Reviewed by Martin Robinson.
199
200         When we have an accelerated imageBuffer, and we putByteArray with a
201         non zero destPoint, we create temporary surface of sourceSize. Then,
202         we write to image data with an offset. This results in an out of bound
203         write.
204
205         In order to avoid that, we use a 0 offset when writing data.
206
207         In addition, we also create image with the minimal needed size in
208         getImageData, and also use a 0 offset. This decrease data transfer
209         between cpu and gpu
210
211         Instead of the map/unmap mechanism, perform an explicit surface copy
212         when needed. This change also removes an unneeded glReadPixels at the
213         start of putByteArray
214
215         Add two parameters to copyRectFromOneSurfaceToAnother: destination
216         offset, and cairo drawing operator.
217
218         No new tests. Accelerated canvas is not enabled for testing yet.
219
220         * platform/graphics/cairo/CairoUtilities.cpp:
221         (WebCore::copyRectFromOneSurfaceToAnother):
222         * platform/graphics/cairo/CairoUtilities.h:
223         * platform/graphics/cairo/ImageBufferCairo.cpp:
224         (WebCore::copySurfaceToImageAndAdjustRect):
225         (WebCore::getImageData):
226         (WebCore::ImageBuffer::putByteArray):
227
228 2013-08-12  Ryosuke Niwa  <rniwa@webkit.org>
229
230         Use const AtomicStringImpl* in DocumentOrderedMap
231         https://bugs.webkit.org/show_bug.cgi?id=119700
232
233         Reviewed by Benjamin Poulain.
234
235         Use const AtomicStringImpl* in DocumentOrderedMap. It caught at least one bug that HTMLNameCollection'
236         subclasses' nodeMatches were taking const AtomicString& instead of AtomicStringImpl*. This was forcing
237         DocumentOrderedMap::getElementByWindowNamedItem and DocumentOrderedMap::getElementByDocumentNamedItem
238         to create temporary AtomicStrings.
239
240         * dom/DocumentOrderedMap.cpp:
241         (WebCore::keyMatchesId):
242         (WebCore::keyMatchesName):
243         (WebCore::keyMatchesMapName):
244         (WebCore::keyMatchesLowercasedMapName):
245         (WebCore::keyMatchesLabelForAttribute):
246         (WebCore::keyMatchesWindowNamedItem):
247         (WebCore::keyMatchesDocumentNamedItem):
248         (WebCore::DocumentOrderedMap::add):
249         (WebCore::DocumentOrderedMap::remove):
250         (WebCore::DocumentOrderedMap::get):
251         (WebCore::DocumentOrderedMap::getElementById):
252         (WebCore::DocumentOrderedMap::getElementByName):
253         (WebCore::DocumentOrderedMap::getElementByMapName):
254         (WebCore::DocumentOrderedMap::getElementByLowercasedMapName):
255         (WebCore::DocumentOrderedMap::getElementByLabelForAttribute):
256         (WebCore::DocumentOrderedMap::getElementByWindowNamedItem):
257         (WebCore::DocumentOrderedMap::getElementByDocumentNamedItem):
258         (WebCore::DocumentOrderedMap::getAllElementsById):
259         * dom/DocumentOrderedMap.h:
260         (WebCore::DocumentOrderedMap::containsSingle):
261         (WebCore::DocumentOrderedMap::contains):
262         (WebCore::DocumentOrderedMap::containsMultiple):
263         * html/HTMLNameCollection.cpp:
264         (WebCore::WindowNameCollection::nodeMatches):
265         (WebCore::DocumentNameCollection::nodeMatches):
266         * html/HTMLNameCollection.h:
267         (WebCore::WindowNameCollection::nodeMatches):
268         (WebCore::DocumentNameCollection::nodeMatches):
269
270 2013-08-12  Beth Dakin  <bdakin@apple.com>
271
272         The LayoutMilestones didLayout callback should only fire for the main frame
273         https://bugs.webkit.org/show_bug.cgi?id=119457
274
275         Reviewed by Sam Weinig.
276
277         This patch makes it so that FrameLoader::didLayout(LayoutMilestones) is only ever 
278         called for the main frame. Technically this will change existing API for 
279         didFirstVisuallyNonEmptyLayoutInFrame and didFirstLayoutInFrame. Clients used to 
280         be able to register for those callbacks for any frame they wanted, however, now 
281         they will only ever get the callback when it applies to the main frame. We think 
282         that this is acceptable since we don’t know of any clients that ever used those 
283         APIs for a non-main frame. This change also makes nothing but sense for the 
284         didLayout(LayoutMilestones) callback, since that is a Page-level concept, so it 
285         should only fire for the main frame.
286
287         Only call didLayout for the main frame.
288         * dom/Document.cpp:
289         (WebCore::Document::setVisualUpdatesAllowed):
290
291         Assert that this is the main frame.
292         * loader/FrameLoader.cpp:
293         (WebCore::FrameLoader::didLayout):
294
295         Only call didLayout for the main frame.
296         * page/FrameView.cpp:
297         (WebCore::FrameView::performPostLayoutTasks):
298
299 2013-08-12  Christophe Dumez  <ch.dumez@sisa.samsung.com>
300
301         Define DOM_KEY_LOCATION_* constants on KeyboardEvent
302         https://bugs.webkit.org/show_bug.cgi?id=119341
303
304         Reviewed by Ryosuke Niwa.
305
306         Add support for the DOM_KEY_LOCATION_* constants on KeyboardEvent as per
307         the specification:
308         http://www.w3.org/TR/DOM-Level-3-Events/#events-KeyboardEvent
309
310         Those constants are already supported by IE10, Firefox 22 and since
311         recently Blink.
312
313         Note that the following constants are not supported / exposed yet:
314         DOM_KEY_LOCATION_MOBILE and DOM_KEY_LOCATION_JOYSTICK.
315
316         Test: fast/events/keyboardevent-location-constants.html
317
318         * dom/KeyboardEvent.cpp:
319         (WebCore::keyLocationCode):
320         (WebCore::KeyboardEvent::KeyboardEvent):
321         * dom/KeyboardEvent.h:
322         * dom/KeyboardEvent.idl:
323
324 2013-08-12  Tim Horton  <timothy_horton@apple.com>
325
326         dataLog dumpers for WebCore's basic geometry types
327         https://bugs.webkit.org/show_bug.cgi?id=119636
328
329         Reviewed by Filip Pizlo.
330
331         * platform/graphics/FloatPoint.cpp:
332         (WebCore::FloatPoint::dump):
333         * platform/graphics/FloatPoint.h:
334         * platform/graphics/FloatRect.cpp:
335         (WebCore::FloatRect::dump):
336         * platform/graphics/FloatRect.h:
337         * platform/graphics/FloatSize.cpp:
338         (WebCore::FloatSize::dump):
339         * platform/graphics/FloatSize.h:
340         * platform/graphics/IntPoint.h:
341         (WebCore::IntPoint::dump):
342         * platform/graphics/IntRect.cpp:
343         (WebCore::IntRect::dump):
344         * platform/graphics/IntRect.h:
345         * platform/graphics/IntSize.h:
346         (WebCore::IntSize::dump):
347
348 2013-08-12  Dean Jackson  <dino@apple.com>
349
350         Shadows don't support viewport units
351         https://bugs.webkit.org/show_bug.cgi?id=119649
352
353         Reviewed by Darin Adler.
354
355         We don't yet support viewport units in shadows, so
356         fail parsing if we see one. The bug to fix this
357         completely is: https://webkit.org/b/119650
358
359         Test: fast/css/shadow-viewport-units.html
360
361         * css/CSSParser.cpp:
362         (WebCore::CSSParser::parseShadow): Fail if we get one of
363         vh, vw, vmin, vmax.
364
365 2013-08-12  peavo@outlook.com  <peavo@outlook.com>
366
367         [Curl] Cookie is not set when url string is unicode.
368         https://bugs.webkit.org/show_bug.cgi?id=119545
369
370         Reviewed by Brent Fulgham.
371
372         When the method setCookiesFromDOM is called with an unicode url parameter, the cookie is not correctly set.
373         We need to convert the cookie string to 8 bit, before passing it to the Curl api function.
374
375         * platform/network/curl/CookieJarCurl.cpp:
376         (WebCore::setCookiesFromDOM): Convert cookie string to 8 bit, if needed.
377
378 2013-08-12  Eric Carlson  <eric.carlson@apple.com>
379
380         Revert r153912 because it broke some track tests.
381
382         Rubber-stamped by Antti Koivisto.
383
384         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
385         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
386         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack):
387
388 2013-08-12  Antti Koivisto  <antti@apple.com>
389
390         Add ElementTraversal::next/previousSibling
391         https://bugs.webkit.org/show_bug.cgi?id=119681
392
393         Reviewed by Andreas Kling.
394
395         Add nextSibling/previousSibling/lastWithin to ElementTraversal namespace.
396         
397         - Use them to replace internal use of Element::next/previousElementSibling DOM API for traversal.
398         - Replace some Node::nextSibling() usage with ElementTraversal::nextSibling() for tighter code.
399         - Replace ElementTraversal::nextSkippingChildren where it is used to traverse over immediate children only.
400
401         * css/SelectorChecker.cpp:
402         (WebCore::isFirstChildElement):
403         (WebCore::isLastChildElement):
404         (WebCore::isFirstOfType):
405         (WebCore::isLastOfType):
406         (WebCore::countElementsBefore):
407         (WebCore::countElementsOfTypeBefore):
408         (WebCore::countElementsAfter):
409         (WebCore::countElementsOfTypeAfter):
410         * dom/Element.cpp:
411         (WebCore::Element::lastElementChild):
412         (WebCore::Element::previousElementSibling):
413         (WebCore::Element::nextElementSibling):
414         * dom/Element.h:
415         * dom/ElementTraversal.h:
416         (WebCore::ElementTraversal::lastElementWithinTemplate):
417         (WebCore::ElementTraversal::lastWithin):
418         (WebCore::ElementTraversal::traverseNextSiblingElementTemplate):
419         (WebCore::ElementTraversal::nextSibling):
420         (WebCore::ElementTraversal::traversePreviousSiblingElementTemplate):
421         (WebCore::ElementTraversal::previousSibling):
422         * editing/ApplyStyleCommand.cpp:
423         (WebCore::isSpanWithoutAttributesOrUnstyledStyleSpan):
424         (WebCore::ApplyStyleCommand::cleanupUnstyledAppleStyleSpans):
425         * editing/CompositeEditCommand.cpp:
426         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem):
427         * editing/IndentOutdentCommand.cpp:
428         (WebCore::IndentOutdentCommand::tryIndentingAsListItem):
429         * editing/InsertListCommand.cpp:
430         (WebCore::InsertListCommand::mergeWithNeighboringLists):
431         * editing/markup.cpp:
432         (WebCore::createContextualFragment):
433         * html/HTMLCollection.cpp:
434         (WebCore::firstMatchingChildElement):
435         (WebCore::nextMatchingSiblingElement):
436         (WebCore::HTMLCollection::traverseNextElement):
437         (WebCore::HTMLCollection::traverseForwardToOffset):
438         * html/HTMLFieldSetElement.cpp:
439         (WebCore::HTMLFieldSetElement::childrenChanged):
440         (WebCore::HTMLFieldSetElement::legend):
441         * html/HTMLMediaElement.cpp:
442         (WebCore::HTMLMediaElement::finishParsingChildren):
443         * html/HTMLObjectElement.cpp:
444         (WebCore::HTMLObjectElement::containsJavaApplet):
445         * rendering/FilterEffectRenderer.cpp:
446         (WebCore::FilterEffectRenderer::buildReferenceFilter):
447         * style/StyleResolveTree.cpp:
448         (WebCore::Style::resolveTree):
449         * svg/SVGStyledElement.cpp:
450         (WebCore::SVGStyledElement::title):
451
452 2013-08-12  Allan Sandfeld Jensen  <allan.jensen@digia.com>
453
454         [Qt] Add Support for canvas blend modes
455         https://bugs.webkit.org/show_bug.cgi?id=100072
456
457         Reviewed by Jocelyn Turcotte.
458
459         Implement basic support for the blend-modes supported by QPainter.
460
461         Covered by existing tests.
462
463         * platform/graphics/qt/GraphicsContextQt.cpp:
464         (WebCore::toQtCompositionMode):
465         (WebCore::GraphicsContext::setPlatformCompositeOperation):
466         * platform/graphics/qt/ImageBufferQt.cpp:
467         (WebCore::ImageBuffer::draw):
468         * platform/graphics/qt/ImageQt.cpp:
469         (WebCore::BitmapImage::draw):
470         * platform/graphics/qt/StillImageQt.cpp:
471         (WebCore::StillImage::draw):
472
473 2013-08-12  Gabor Abraham  <abrhm@inf.u-szeged.hu>
474
475         Buildfix for !ENABLE(SVG). Fix warning by adding guard after r153901:
476         void WebCore::addString(WebCore::FeatureSet&, const char*)'
477         defined but not used [-Werror=unused-function]
478
479         Reviewed by Csaba Osztrogonác.
480
481         * dom/DOMImplementation.cpp:
482
483 2013-08-12  Antti Koivisto  <antti@apple.com>
484
485         Move ElementTraversal to ElementTraversal.h
486         https://bugs.webkit.org/show_bug.cgi?id=119678
487
488         Rubber-stamped by Andreas Kling.
489
490         Move ElementTraversal namespace from NodeTraversal.h to a correctly named file.
491
492         * GNUmakefile.list.am:
493         * Target.pri:
494         * WebCore.vcxproj/WebCore.vcxproj:
495         * WebCore.xcodeproj/project.pbxproj:
496         * accessibility/AccessibilityRenderObject.cpp:
497         * css/StyleInvalidationAnalysis.cpp:
498         * dom/Document.cpp:
499         * dom/DocumentOrderedMap.cpp:
500         * dom/Element.cpp:
501         * dom/ElementTraversal.h: Added.
502         (WebCore::ElementTraversal::firstElementWithinTemplate):
503         (WebCore::ElementTraversal::firstWithin):
504         (WebCore::ElementTraversal::traverseNextElementTemplate):
505         (WebCore::ElementTraversal::next):
506         (WebCore::ElementTraversal::traverseNextElementSkippingChildrenTemplate):
507         (WebCore::ElementTraversal::nextSkippingChildren):
508         (WebCore::ElementTraversal::previousIncludingPseudo):
509         (WebCore::ElementTraversal::nextIncludingPseudo):
510         (WebCore::ElementTraversal::nextIncludingPseudoSkippingChildren):
511         (WebCore::ElementTraversal::pseudoAwarePreviousSibling):
512         * dom/Node.cpp:
513         * dom/NodeTraversal.h:
514         * dom/SelectorQuery.cpp:
515         * dom/TreeScope.cpp:
516         * dom/VisitedLinkState.cpp:
517         * editing/FrameSelection.cpp:
518         * editing/markup.cpp:
519         * html/HTMLCollection.cpp:
520         * html/HTMLFieldSetElement.cpp:
521         * html/HTMLFormElement.cpp:
522         * html/HTMLLabelElement.cpp:
523         * html/HTMLLegendElement.cpp:
524         * html/HTMLMapElement.cpp:
525         * html/HTMLObjectElement.cpp:
526         * html/HTMLSelectElement.cpp:
527         * html/shadow/ContentDistributor.cpp:
528         * page/FocusController.cpp:
529         * rendering/RenderCounter.cpp:
530         * rendering/RenderListItem.cpp:
531         * svg/SVGSVGElement.cpp:
532         * svg/SVGStyledElement.cpp:
533         * svg/SVGUseElement.cpp:
534         * svg/animation/SMILTimeContainer.cpp:
535         * svg/graphics/SVGImage.cpp:
536
537 2013-08-12  Antti Koivisto  <antti@apple.com>
538
539         Move some Document recalcStyle code to StyleResolveTree
540         https://bugs.webkit.org/show_bug.cgi?id=119676
541
542         Reviewed by Andreas Kling.
543
544         Move the code that resolves the document and child styles to Style::resolveTree(Document*).
545
546         * dom/Document.cpp:
547         (WebCore::Document::recalcStyle):
548         * style/StyleResolveTree.cpp:
549         (WebCore::Style::resolveTree):
550         * style/StyleResolveTree.h:
551
552 2013-08-12  Allan Sandfeld Jensen  <allan.jensen@digia.com>
553
554         Resource leak related to gstreamer and videos
555         https://bugs.webkit.org/show_bug.cgi?id=109350
556
557         Reviewed by Eric Carlson.
558
559         Since active DOM object are only stopped once and can not be restarted, we can
560         unreference the media player there, instead of waiting for garbage collection.
561
562         If the r152778 is rolled back, this also breaks a circular reference between
563         GStreamer and WebKit which prevented garbage collecting from triggering.
564
565         * html/HTMLMediaElement.cpp:
566         (WebCore::HTMLMediaElement::stop):
567
568 2013-08-12  Gabor Rapcsanyi  <rgabor@webkit.org>
569
570         [Qt] Unreviewed buildfix for webaudio.
571
572         * Target.pri: Add missing files
573
574 2013-08-12  Andreas Kling  <akling@apple.com>
575
576         Some build juice for the Windows bots after r153926 + r153927.
577
578         * html/shadow/MediaControlElements.cpp:
579         * platform/graphics/win/MediaPlayerPrivateQuickTimeVisualContext.cpp:
580         (WebCore::MediaPlayerPrivateQuickTimeVisualContext::supportsFullscreen):
581         (WebCore::MediaPlayerPrivateQuickTimeVisualContext::setUpCookiesForQuickTime):
582
583 2013-08-11  Sam Weinig  <sam@webkit.org>
584
585         Move RenderMathMLSpace.h/cpp to the right group in the Xcode project.
586
587         Reviewed by Dean Jackson.
588
589         * WebCore.xcodeproj/project.pbxproj:
590
591 2013-08-11  Andreas Kling  <akling@apple.com>
592
593         Make Page::settings() return a reference.
594         <http://webkit.org/b/119662>
595
596         Reviewed by Anders Carlsson.
597
598         ...and remove some pointless null checks that were exposed by doing this.
599
600 2013-08-11  Andreas Kling  <akling@apple.com>
601
602         Make some things that return never-null pointers return references instead.
603         <http://webkit.org/b/119660>
604
605         Reviewed by Antti Koivisto.
606
607         These functions never return null anyway, so remove any ambiguity by letting
608         them return references instead of pointers.
609
610         - Node::ensureRareData()
611         - Element::ensureUniqueElementData()
612         - Element::ensureShadow()
613         - Element::ensureUserAgentShadowRoot()
614         - StyledElement::ensureMutableInlineStyle()
615         - NodeRareData::ensureNodeLists()
616         - NodeRareData::ensureMutationObserverData()
617         - EventTarget::ensureEventTargetData()
618         - Document::ensureStyleResolver()
619         - Document::selectorQueryCache()
620         - Document::mediaQueryMatcher()
621         - FlowThreadController::ensureRenderFlowThreadWithName()
622         - HTMLTrackElement::ensureTrack()
623         - SVGElement::ensureSVGRareData()
624         - AnimationControllerPrivate::ensureCompositeAnimation()
625
626 2013-08-11  Sam Weinig  <sam@webkit.org>
627
628         Cleanup MediaQueryListListener
629         https://bugs.webkit.org/show_bug.cgi?id=119664
630
631         Reviewed by Andreas Kling.
632
633         Make MediaQueryListListener a proper WebIDL callback.
634
635         * CMakeLists.txt:
636         * DerivedSources.cpp:
637         * DerivedSources.make:
638         * DerivedSources.pri:
639         * GNUmakefile.list.am:
640         * Target.pri:
641         * WebCore.vcxproj/WebCore.vcxproj:
642         * WebCore.vcxproj/WebCore.vcxproj.filters:
643         * WebCore.xcodeproj/project.pbxproj:
644         Update project files.
645
646         * bindings/scripts/CodeGeneratorJS.pm:
647         (GenerateCallbackHeader):
648         (GenerateCallbackImplementation):
649         (JSValueToNative):
650         * bindings/scripts/IDLAttributes.txt:
651         Add support for CallbackNeedsOperatorEqual, which adds an operator==.
652
653         * css/MediaAllInOne.cpp:
654         Remove MediaQueryListListener.cpp.
655
656         * css/MediaQueryListListener.cpp:
657         Removed.
658
659         * css/MediaQueryListListener.h:
660         (WebCore::MediaQueryListListener::~MediaQueryListListener):
661         (WebCore::MediaQueryListListener::MediaQueryListListener):
662         * css/MediaQueryListListener.idl:
663         Convert to a proper WebIDL callback.
664
665         * css/MediaQueryMatcher.cpp:
666         (WebCore::MediaQueryMatcher::Listener::evaluate):
667         (WebCore::MediaQueryMatcher::styleResolverChanged):
668         * css/MediaQueryMatcher.h:
669         Remove all traces of the ScriptState.
670
671 2013-08-11  Carlos Garcia Campos  <cgarcia@igalia.com>
672
673         Unreviewed. Fix make distcheck.
674
675         * GNUmakefile.list.am: Remove unexistent header file.
676
677 2013-08-09  Gustavo Noronha Silva  <gns@gnome.org>
678
679         [GObject] Wrap KeyboardEvent
680         https://bugs.webkit.org/show_bug.cgi?id=119651
681
682         Reviewed by Christophe Dumez.
683
684         This exposes KeyboardEvent to our GObject API. It is required for handling
685         keyboard events, such as keydown, keypress, and so on.
686
687         * bindings/gobject/GNUmakefile.am:
688         * bindings/gobject/WebKitDOMPrivate.cpp:
689         (WebKit::wrap): make sure we create a WebKitDOMKeyboardEvent for a DOM event that
690         is a KeyboardEvent.
691         * bindings/scripts/CodeGeneratorGObject.pm:
692         (GetBaseClass): make WebKitDOMEvent be WebKitDOMKeyboardEvent's parent, like we do
693         for WebKitDOMMouseEvent.
694         * dom/KeyboardEvent.idl: generate a single initialization method.
695
696 2013-08-09  Jer Noble  <jer.noble@apple.com>
697
698         Crash in com.apple.WebKit.WebContent at com.apple.MediaToolbox.
699         https://bugs.webkit.org/show_bug.cgi?id=119645
700
701         Reviewed by Eric Carlson.
702
703         Work around crash caused by <rdar://problem/14688471> by releasing
704         m_request as soon as keys have been added to it.
705
706         * Modules/encryptedmedia/CDMPrivateAVFoundation.mm:
707         (WebCore::CDMSessionAVFoundation::update):
708
709 2013-08-09  Anders Carlsson  <andersca@apple.com>
710
711         Artifacts seen sometimes with layer backed WebKit1 plug-in
712         https://bugs.webkit.org/show_bug.cgi?id=119647
713         <rdar://problem/14002715>
714
715         Reviewed by Beth Dakin.
716
717         Don't try to paint layer backed views - they will be painted by Core Animation.
718
719         * platform/mac/WidgetMac.mm:
720         (WebCore::Widget::paint):
721
722 2013-08-09  Rob Buis  <rwlbuis@webkit.org>
723
724         ASSERTION FAILED: stroke->opacity != other->stroke->opacity in WebCore::SVGRenderStyle::diff
725         https://bugs.webkit.org/show_bug.cgi?id=119623
726
727         Reviewed by Dirk Schulze.
728
729         Include all the stroke attributes in the style diff comparison, the visited links ones were missing.
730
731         Test: svg/animations/animate-stroke-crasher.html
732
733         * rendering/style/SVGRenderStyle.cpp:
734         (WebCore::SVGRenderStyle::diff):
735
736 2013-08-09  Alexey Proskuryakov  <ap@apple.com>
737
738         REGRESSION (r142755): window.open creates an invisible window when width and height are 0
739         https://bugs.webkit.org/show_bug.cgi?id=119633
740
741         Reviewed by Darin Adler.
742
743         Test: fast/dom/Window/open-zero-size-as-default.html
744
745         Relying on each WebKit to refuse setting size to zero was fragile - because this
746         required each one to have the check, and because by the time the client was called,
747         the initially zero size was not necessarily zero.
748
749         * loader/FrameLoader.cpp: (WebCore::createWindow): When sizes are zero, keep the
750         size the window was created with, because that's the default one by definition.
751
752         * page/DOMWindow.cpp: (WebCore::DOMWindow::adjustWindowRect): It's too late to
753         check for zero size now, it's been mangled to adjust for the difference between
754         window and viewport size.
755
756 2013-08-09  Eric Carlson  <eric.carlson@apple.com>
757
758         [Mac] some track language tags are not recognized
759         https://bugs.webkit.org/show_bug.cgi?id=119643
760
761         Reviewed by Dean Jackson.
762
763         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
764         (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged): Always call languageOfPrimaryAudioTrack(),
765             a track may have changed so we may have a new language.
766         (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack): Call [AVAssetTrack languageCode]
767             if [AVAssetTrack extendedLanguageTag] returns NULL in case the media file has an old
768             QuickTime language code.
769
770 2013-08-09  Dean Jackson  <dino@apple.com>
771
772         Captions menu needs to reset text-align
773         https://bugs.webkit.org/show_bug.cgi?id=119637
774
775         Reviewed by Eric Carlson.
776
777         Reset the text-align property on the menu so that it
778         doesn't get the inherited value. The full fix for all
779         controls is http://webkit.org/b/116100.
780
781         * css/mediaControlsQuickTime.css:
782         (video::-webkit-media-controls-closed-captions-container):
783
784 2013-08-09  Beth Dakin  <bdakin@apple.com>
785
786         AX: Not able to use arrow keys to read text in a WK2 app
787         https://bugs.webkit.org/show_bug.cgi?id=119605
788         -and corresponding-
789         <rdar://problem/14281275>
790
791         Reviewed by Darin Adler.
792
793         This code from defaultKeyboardEventHandler() is the magic that makes this AX 
794         functionality work. This patch moves that into a separate function so that we can 
795         call it from WK2.
796         * WebCore.exp.in:
797         * page/EventHandler.cpp:
798         (WebCore::EventHandler::handleKeyboardSelectionMovementForAccessibility):
799         (WebCore::EventHandler::defaultKeyboardEventHandler):
800         * page/EventHandler.h:
801
802 2013-08-09  Antti Koivisto  <antti@apple.com>
803
804         Move static StyleResolver functions to Style namespace
805         https://bugs.webkit.org/show_bug.cgi?id=119629
806
807         Reviewed by Sam Weinig and Andreas Kling.
808
809         - Move static font size computation functions to StyleFontSizeFunctions.h/.cpp
810         - Move StyleResolver::styleForDocument to Style::resolveForDocument
811
812         * WebCore.xcodeproj/project.pbxproj:
813         * css/DeprecatedStyleBuilder.cpp:
814         (WebCore::ApplyPropertyFontFamily::applyInitialValue):
815         (WebCore::ApplyPropertyFontFamily::applyValue):
816         (WebCore::ApplyPropertyFontSize::applyInitialValue):
817         (WebCore::ApplyPropertyFontSize::applyValue):
818         * css/StyleResolver.cpp:
819         (WebCore::StyleResolver::adjustRenderStyle):
820         (WebCore::checkForOrientationChange):
821         (WebCore::StyleResolver::applyProperty):
822         (WebCore::StyleResolver::checkForGenericFamilyChange):
823         (WebCore::StyleResolver::initializeFontStyle):
824         (WebCore::StyleResolver::setFontSize):
825         * css/StyleResolver.h:
826         * dom/Document.cpp:
827         (WebCore::Document::recalcStyle):
828         * editing/EditingStyle.cpp:
829         (WebCore::legacyFontSizeFromCSSValue):
830         * html/HTMLLinkElement.cpp:
831         (WebCore::HTMLLinkElement::process):
832         * rendering/style/RenderStyle.cpp:
833         (WebCore::RenderStyle::getFontAndGlyphOrientation):
834         
835             Moved from StyleResolver.cpp so it can be used by Style::resolveForDocument().
836             This depends on RenderStyle only so it is a natural member function.
837
838         * rendering/style/RenderStyle.h:
839         * rendering/svg/RenderSVGInlineText.cpp:
840         (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):
841         * style/StyleFontSizeFunctions.cpp: Copied from Source/WebCore/css/StyleResolver.cpp.
842         (WebCore::Style::computedFontSizeFromSpecifiedSize):
843         (WebCore::Style::computedFontSizeFromSpecifiedSizeForSVGInlineText):
844         (WebCore::Style::fontSizeForKeyword):
845         (WebCore::Style::legacyFontSizeForPixelSize):
846         * style/StyleFontSizeFunctions.h: Added.
847         * style/StyleResolveForDocument.cpp: Added.
848         (WebCore::Style::resolveForDocument):
849         * style/StyleResolveForDocument.h: Added.
850
851 2013-08-09  Christophe Dumez  <ch.dumez@sisa.samsung.com>
852
853         Add support for KeyboardEvent.location attribute
854         https://bugs.webkit.org/show_bug.cgi?id=119326
855
856         Reviewed by Benjamin Poulain.
857
858         Add support for KeyboardEvent.location attribute as per the latest specification:
859         http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#events-KeyboardEvent
860
861         IE10, Firefox 22 and recently Blink all support KeyboardEvent.location already.
862
863         The deprecated 'keyLocation' attribute was not removed to maintain backward
864         compatibility.
865
866         No new tests, covered by existing tests.
867
868         * bindings/objc/PublicDOMInterfaces.h:
869         * bindings/scripts/CodeGeneratorJS.pm:
870         (GenerateConstructorDefinition):
871         * dom/KeyboardEvent.cpp:
872         (WebCore::KeyboardEventInit::KeyboardEventInit):
873         (WebCore::KeyboardEvent::KeyboardEvent):
874         (WebCore::KeyboardEvent::initKeyboardEvent):
875         * dom/KeyboardEvent.h:
876         (WebCore::KeyboardEvent::location):
877         * dom/KeyboardEvent.idl:
878
879 2013-08-09  Christophe Dumez  <ch.dumez@sisa.samsung.com>
880
881         Make atob() throw an InvalidCharacterError on excess padding characters
882         https://bugs.webkit.org/show_bug.cgi?id=118898
883
884         Reviewed by Darin Adler.
885
886         According to the latest specification, window.atob() should throw an
887         InvalidCharacterError on excess padding characters:
888         http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#dom-windowbase64-atob
889
890         This behavior is consistent with both Firefox, IE10 and recently Blink.
891
892         No new tests, already covered by:
893         fast/dom/Window/atob-btoa.html
894
895         * page/DOMWindow.cpp:
896         (WebCore::DOMWindow::atob):
897
898 2013-08-09  Christophe Dumez  <ch.dumez@sisa.samsung.com>
899
900         Make DOMImplementation::hasFeature() behave according to specification
901         https://bugs.webkit.org/show_bug.cgi?id=119329
902
903         Reviewed by Ryosuke Niwa.
904
905         Make DOMImplementation::hasFeature() behave according to the latest specification:
906         http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
907
908         Specifically, the function should now return true unconditionally for any non-SVG feature.
909         This behavior is consistent with Firefox and since recently Blink.
910
911         hasFeature() originally would report whether the user agent claimed to support a
912         given DOM feature, but experience proved it was not nearly as reliable or granular
913         as simply checking whether the desired interfaces, attributes, or methods existed.
914         As such, it should no longer be used, but continues to exist (and simply returns
915         true) so that old pages don't stop working.
916
917         No new tests, covered by existing tests.
918
919         * dom/DOMImplementation.cpp:
920         (WebCore::isSupportedSVG10Feature):
921         (WebCore::isSupportedSVG11Feature):
922         (WebCore::DOMImplementation::hasFeature):
923
924 2013-08-09  Alejandro G. Castro  <alex@igalia.com>
925
926         [GTK] [EFL] Enable tiled shadow blur for the inset shadows.
927         https://bugs.webkit.org/show_bug.cgi?id=119078
928
929         Reviewed by Martin Robinson.
930
931         Already covered in the tests.
932
933         * platform/graphics/GraphicsContext.cpp:
934         * platform/graphics/cairo/GraphicsContextCairo.cpp:
935         (WebCore::fillCurrentCairoPath): Added to allow fill the path
936         without the shadow.
937         (WebCore::shadowAndFillCurrentCairoPath):
938         (WebCore::GraphicsContext::fillRectWithRoundedHole): Added cairo
939         implementation.
940
941 2013-08-09  Jakob Petsovits  <jpetsovits@blackberry.com>
942
943         [BlackBerry] Don't release the canvas Drawable, flush it directly instead.
944         https://bugs.webkit.org/show_bug.cgi?id=119589
945         https://jira.bbqnx.net/browse/BRWSR-12531
946         JIRA 444857
947
948         Reviewed by George Staikos.
949
950         The previous code here used releaseBufferDrawable() to
951         flush painted ImageBuffer contents, but then proceeded
952         to use that released Drawable for further painting
953         without ever locking a new one.
954
955         In an implementation that actually releases the Drawable
956         rather than keeping it around and just flushing it,
957         this will wreak havoc as bad as black screens or crashes.
958
959         As a solution that doesn't require the ImageBuffer object
960         to swap out its m_canvas member for a new Drawable, we can
961         access the PlatformGraphicsContext::flush() method directly
962         to achieve the same effect as was previously intended by
963         calling releaseBufferDrawable(). All it needs is letting
964         the canvas layer know about the Drawable so it can call
965         that flush() method by itself.
966
967         No new tests, verified by not crashing with an aforementioned
968         implementation of releaseBufferDrawable().
969
970         * platform/graphics/blackberry/CanvasLayerWebKitThread.cpp:
971         (WebCore::CanvasLayerCompositingThreadClient::CanvasLayerCompositingThreadClient):
972         (WebCore::CanvasLayerCompositingThreadClient::commitPendingTextureUploads):
973         (WebCore::CanvasLayerWebKitThread::CanvasLayerWebKitThread):
974         * platform/graphics/blackberry/CanvasLayerWebKitThread.h:
975         (WebCore::CanvasLayerWebKitThread::create):
976         * platform/graphics/blackberry/ImageBufferBlackBerry.cpp:
977         (WebCore::ImageBuffer::ImageBuffer):
978         (WebCore::ImageBuffer::~ImageBuffer):
979
980 2013-08-08  Allan Sandfeld Jensen  <allan.jensen@digia.com>
981
982         [Qt][WK2] Composited and transformed links asserts in tap highlight
983         https://bugs.webkit.org/show_bug.cgi?id=94345
984
985         Reviewed by Jocelyn Turcotte.
986
987         Use a mapping that does not assert when hitting transforms. We still skip
988         transforms that produces non-rectangular areas.
989
990         * page/GestureTapHighlighter.cpp:
991
992 2013-08-09  Gabor Abraham  <abrhm@inf.u-szeged.hu>
993
994         Buildfix. Fix warning after r153887:
995         control reaches end of non-void function [-Werror=return-type]
996
997         Reviewed by Csaba Osztrogonác.
998
999         * svg/SVGAnimateElement.cpp:
1000         (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition):
1001
1002 2013-08-09  Bruno de Oliveira Abinader  <bruno.d@partner.samsung.com>
1003
1004         Text decorations should be listed as non-inheritable
1005         https://bugs.webkit.org/show_bug.cgi?id=119608
1006
1007         Reviewed by Andreas Kling.
1008
1009         Both "text-decoration" specs (CSS 2.1, CSS 3) and "text-decoration-line"
1010         spec (CSS 3) states these properties are not inherited (w/ exceptions,
1011         which are currently handled by -in-effect property), however those were
1012         listed as inherited for no reason - thus preserving behavior as shown by
1013         layout test results.
1014
1015         Backported from Blink: https://codereview.chromium.org/20751008
1016
1017         Updated getComputedStyle tests for both 'text-decoration' and
1018         'text-decoration-line' properties to check that both are not implicitly
1019         inherited.
1020
1021         * css/CSSProperty.cpp:
1022         (WebCore::CSSProperty::isInheritedProperty):
1023
1024 2013-08-09  Andreas Kling  <akling@apple.com>
1025
1026         I wish we had a Windows EWS. :(
1027
1028         * css/ElementRuleCollector.cpp:
1029         (WebCore::ElementRuleCollector::doCollectMatchingRulesForList): No range-based for today.
1030
1031 2013-08-09  Rob Buis  <rwlbuis@webkit.org>
1032
1033         ASSERT_NOT_REACHED() touched in WebCore::SVGAnimatedStringAnimator::addAnimatedTypes
1034         https://bugs.webkit.org/show_bug.cgi?id=113224
1035
1036         Reviewed by Darin Adler.
1037
1038         Do not perform from-by animations for non-additive attributes.
1039
1040         Test: svg/animations/non-additive-type-from-by-animation.html
1041
1042         * svg/SVGAnimateElement.cpp:
1043         (WebCore::SVGAnimateElement::calculateFromAndByValues):
1044         (WebCore::SVGAnimateElement::animatedPropertyTypeSupportsAddition):
1045         (WebCore::SVGAnimateElement::isAdditive):
1046         * svg/SVGAnimateElement.h:
1047
1048 2013-08-09  Rob Buis  <rwlbuis@webkit.org>
1049
1050         ASSERT(m_type == toSVGTransform.type())
1051         https://bugs.webkit.org/show_bug.cgi?id=113217
1052
1053         Reviewed by Darin Adler.
1054
1055         For to animations clear the transform list while animating and reset to it after the animation is done.
1056         This matches Firefox and Opera 12 behavior.
1057
1058         Tests: svg/animations/animateTransform-to-scale-expected.svg
1059                svg/animations/animateTransform-to-scale.svg
1060
1061         * svg/SVGAnimatedTransformList.cpp:
1062         (WebCore::SVGAnimatedTransformListAnimator::calculateAnimatedValue):
1063
1064 2013-08-09  Arunprasad Rajkumar  <arurajku@cisco.com>
1065
1066         [Qt] QtWebKit should allow sending domain specific keycode to HTML applications
1067         https://bugs.webkit.org/show_bug.cgi?id=118445
1068
1069         Reviewed by Allan Sandfeld Jensen.
1070
1071         No new test required, it is covered by QtWebKit API test.
1072
1073         This fix allows sending QKeyEvent::nativeVirtualKey as the DOM KeyboardEvent keyCode value instead
1074         of Windows virtual key code. It can be enabled/disabled using "_q_useNativeVirtualKeyAsDOMKey"
1075         dynamic property present in QWebPage.
1076
1077         * platform/PlatformKeyboardEvent.h:
1078         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1079         * platform/qt/PlatformKeyboardEventQt.cpp:
1080         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
1081         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
1082
1083 2013-08-09  Renata Hodovan  <reni@webkit.org>
1084
1085         Missing NULL check in ApplyStyleCommand::applyInlineStyleToNodeRange()
1086         https://bugs.webkit.org/show_bug.cgi?id=119570
1087
1088         Reviewed by Ryosuke Niwa.
1089
1090         The m_mutableStyleSet of EditingStyle can be NULL in ApplyStyleCommand::applyInlineStyleToNodeRange but
1091         this scenario was not checked earlier.
1092
1093         Test: editing/execCommand/null-style-crash.html
1094
1095         * css/StylePropertySet.cpp:
1096         (WebCore::MutableStylePropertySet::mergeAndOverrideOnConflict):
1097         * css/StylePropertySet.h:
1098         * css/ViewportStyleResolver.cpp:
1099         (WebCore::ViewportStyleResolver::addViewportRule):
1100         * editing/ApplyStyleCommand.cpp:
1101         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
1102         * editing/EditingStyle.cpp:
1103         (WebCore::styleFromMatchedRulesForElement):
1104         (WebCore::EditingStyle::mergeStyleFromRules):
1105         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
1106
1107 2013-08-09  Andreas Kling  <akling@apple.com>
1108
1109         ElementRuleCollector: Use range-based for syntax in rule collection loop.
1110         <http://webkit.org/b/119617>
1111         <rdar://problem/14695311>
1112
1113         Reviewed by Antti Koivisto.
1114
1115         * css/ElementRuleCollector.cpp:
1116         (WebCore::ElementRuleCollector::doCollectMatchingRulesForList):
1117
1118 2013-08-09  Andreas Kling  <akling@apple.com>
1119
1120         StyleRule*::properties() should return const references.
1121         <http://webkit.org/b/119596>
1122
1123         Reviewed by Antti Koivisto.
1124
1125         Make StyleRule::properties() & friends return const-references instead of
1126         pointers. This exposed some pointless null checking, since rules should
1127         always have properties.
1128
1129         All rule objects that contain properties now require a StylePropertySet at
1130         the time of construction instead having you call setProperties() later.
1131
1132         The only rules that could ever have null properties were the default-inserted
1133         animation keyframe rules for 0% and 100% that we'd conjure up if the author
1134         didn't provide them. Now they just have an empty property set instead.
1135
1136         * css/CSSFontFaceRule.cpp:
1137         (WebCore::CSSFontFaceRule::cssText):
1138         * css/CSSFontSelector.cpp:
1139         (WebCore::CSSFontSelector::addFontFaceRule):
1140         * css/CSSPageRule.cpp:
1141         (WebCore::CSSPageRule::cssText):
1142         * css/CSSParser.cpp:
1143         (WebCore::CSSParser::createFilterRule):
1144         (WebCore::CSSParser::createStyleRule):
1145         (WebCore::CSSParser::createFontFaceRule):
1146         (WebCore::CSSParser::rewriteSpecifiers):
1147         * css/CSSStyleRule.cpp:
1148         (WebCore::CSSStyleRule::cssText):
1149         * css/ElementRuleCollector.cpp:
1150         (WebCore::leftToRightDeclaration):
1151         (WebCore::rightToLeftDeclaration):
1152         (WebCore::ElementRuleCollector::addElementStyleProperties):
1153         (WebCore::ElementRuleCollector::doCollectMatchingRulesForList):
1154         * css/PageRuleCollector.cpp:
1155         (WebCore::PageRuleCollector::matchPageRulesForList):
1156         * css/StylePropertySet.cpp:
1157         (WebCore::MutableStylePropertySet::mergeAndOverrideOnConflict):
1158         * css/StylePropertySet.h:
1159         * css/StyleResolver.cpp:
1160         (WebCore::StyleResolver::MatchResult::addMatchedProperties):
1161         (WebCore::StyleResolver::styleForKeyframe):
1162         (WebCore::StyleResolver::keyframeStylesForAnimation):
1163         * css/StyleResolver.h:
1164         * css/StyleRule.cpp:
1165         (WebCore::StyleRule::StyleRule):
1166         (WebCore::StyleRule::create):
1167         (WebCore::StyleRulePage::StyleRulePage):
1168         (WebCore::StyleRuleFontFace::StyleRuleFontFace):
1169         (WebCore::StyleRuleViewport::StyleRuleViewport):
1170         (WebCore::StyleRuleViewport::mutableProperties):
1171         (WebCore::StyleRuleFilter::StyleRuleFilter):
1172         * css/StyleRule.h:
1173         (WebCore::StyleRule::create):
1174         (WebCore::StyleRule::properties):
1175         (WebCore::StyleRuleFontFace::create):
1176         (WebCore::StyleRuleFontFace::properties):
1177         (WebCore::StyleRulePage::create):
1178         (WebCore::StyleRulePage::properties):
1179         (WebCore::StyleRuleViewport::create):
1180         (WebCore::StyleRuleViewport::properties):
1181         (WebCore::StyleRuleFilter::create):
1182         (WebCore::StyleRuleFilter::properties):
1183         * css/StyleSheetContents.cpp:
1184         (WebCore::StyleSheetContents::addSubresourceStyleURLs):
1185         (WebCore::childRulesHaveFailedOrCanceledSubresources):
1186         * css/WebKitCSSFilterRule.cpp:
1187         (WebCore::WebKitCSSFilterRule::cssText):
1188         * css/WebKitCSSKeyframeRule.cpp:
1189         (WebCore::StyleKeyframe::StyleKeyframe):
1190         (WebCore::StyleKeyframe::mutableProperties):
1191         * css/WebKitCSSKeyframeRule.h:
1192         (WebCore::StyleKeyframe::create):
1193         (WebCore::StyleKeyframe::properties):
1194         * css/WebKitCSSViewportRule.cpp:
1195         (WebCore::WebKitCSSViewportRule::cssText):
1196         * editing/ApplyStyleCommand.cpp:
1197         (WebCore::ApplyStyleCommand::applyInlineStyleToNodeRange):
1198         * editing/EditingStyle.cpp:
1199         (WebCore::EditingStyle::mergeStyleFromRules):
1200         (WebCore::EditingStyle::mergeStyleFromRulesForSerialization):
1201         * inspector/InspectorStyleSheet.cpp:
1202         (WebCore::InspectorStyleSheet::revalidateStyle):
1203         * page/PageSerializer.cpp:
1204         (WebCore::PageSerializer::retrieveResourcesForRule):
1205         * svg/SVGFontFaceElement.cpp:
1206         (WebCore::SVGFontFaceElement::SVGFontFaceElement):
1207         (WebCore::SVGFontFaceElement::fontFamily):
1208         (WebCore::SVGFontFaceElement::rebuildFontFace):
1209
1210 2013-08-09  Julien Brianceau  <jbrianceau@nds.com>
1211
1212         [Qt] Fix build (broken by changeset r153826).
1213         https://bugs.webkit.org/show_bug.cgi?id=119616
1214
1215         Reviewed by Andreas Kling.
1216
1217         * xml/parser/XMLDocumentParserQt.cpp:
1218         (WebCore::XMLDocumentParser::XMLDocumentParser):
1219
1220 2013-08-08  Tim Horton  <timothy_horton@apple.com>
1221
1222         navigator.plugins has plugins in it when plugins are disabled
1223         https://bugs.webkit.org/show_bug.cgi?id=119607
1224         <rdar://problem/14678030>
1225
1226         Reviewed by Anders Carlsson.
1227
1228         Test: plugins/navigator-plugins-disabled.html
1229
1230         * page/Settings.cpp:
1231         (WebCore::Settings::setPluginsEnabled):
1232         Refresh the plugin database when plugins are enabled or disabled.
1233         This is necessary to ensure that navigator.plugins will have the
1234         correct set of plugins after dynamically changing whether plugins
1235         are enabled, which makes the test for this patch possible (but it
1236         makes sense in the browser as well).
1237
1238 2013-08-08  Timothy Hatcher  <timothy@apple.com>
1239
1240         Allow SVG images to be drawn into canvas without tainting.
1241         https://bugs.webkit.org/show_bug.cgi?id=119492
1242
1243         Reviewed by Darin Adler.
1244
1245         Tests: svg/as-image/svg-canvas-not-tainted.html
1246                svg/as-image/svg-canvas-link-not-colored.html
1247                svg/as-image/svg-canvas-xhtml-tainted.html
1248
1249         * html/HTMLAnchorElement.cpp:
1250         (WebCore::HTMLAnchorElement::parseAttribute): Call shouldProhibitLinks.
1251         (WebCore::shouldProhibitLinks): Added.
1252         * html/HTMLAnchorElement.h:
1253         * html/HTMLImageElement.cpp:
1254         (WebCore::HTMLImageElement::parseAttribute): Call shouldProhibitLinks.
1255         * rendering/svg/RenderSVGRoot.cpp:
1256         (WebCore::RenderSVGRoot::isEmbeddedThroughSVGImage): Use isInSVGImage.
1257         * svg/SVGAElement.cpp:
1258         (WebCore::SVGAElement::svgAttributeChanged): Call shouldProhibitLinks.
1259         * svg/graphics/SVGImage.cpp:
1260         (WebCore::SVGImage::hasSingleSecurityOrigin): Added.
1261         (WebCore::isInSVGImage): Added.
1262         * svg/graphics/SVGImage.h:
1263
1264 2013-08-08  Simon Fraser  <simon.fraser@apple.com>
1265
1266         Fix ASSERT(m_contentsSolidColor.isValid()) assertion on iOS at nytimes.com
1267         https://bugs.webkit.org/show_bug.cgi?id=119603
1268
1269         Reviewed by Dean Jackson.
1270
1271         On iOS it's possible for a GraphicsLayer to transition between having
1272         a solid background color, and containing media. This happens on nytimes.com
1273         when playing video.
1274         
1275         In this case, GraphicsLayerCA::updateContentsColorLayer() would assert
1276         because m_contentsLayer had been already set up to contain media, but
1277         it would be trying to update the color.
1278         
1279         Fix by bailing from all the updateContents* functions if there is no
1280         contents layer, or that layer exists for a different purpose.
1281
1282         * platform/graphics/ca/GraphicsLayerCA.cpp:
1283         (WebCore::GraphicsLayerCA::updateContentsMediaLayer):
1284         (WebCore::GraphicsLayerCA::updateContentsCanvasLayer):
1285         (WebCore::GraphicsLayerCA::updateContentsColorLayer):
1286
1287 2013-08-08  Commit Queue  <commit-queue@webkit.org>
1288
1289         Unreviewed, rolling out r153847.
1290         http://trac.webkit.org/changeset/153847
1291         https://bugs.webkit.org/show_bug.cgi?id=119609
1292
1293         caused new SVG animation test failures (Requested by smfr on
1294         #webkit).
1295
1296         * svg/SVGAnimateElement.cpp:
1297         (WebCore::SVGAnimateElement::calculateFromAndByValues):
1298
1299 2013-08-08  Simon Fraser  <simon.fraser@apple.com>
1300
1301         Kill updateStyleForAllDocuments()
1302         https://bugs.webkit.org/show_bug.cgi?id=118093
1303
1304         Reviewed by Geoff Garen.
1305
1306         We should never have to eagerly update style, especially for all documents
1307         that the process knows about. The WebKit model is to update style when
1308         required for layout etc, not to update it eagerly.
1309         
1310         This is historical code whose origins are lost in the mists of KHTML.
1311         r42384 makes it possible to do away with this eager updating, and
1312         r55568 removed some calls. Discussion in bug 32580 suggests that
1313         form control code still need this, but tests still pass without it.
1314
1315         * bindings/js/JSCallbackData.cpp:
1316         (WebCore::JSCallbackData::invokeCallback):
1317         * bindings/js/JSCustomXPathNSResolver.cpp:
1318         (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
1319         * dom/Document.cpp:
1320         (WebCore::Document::scheduleStyleRecalc):
1321         (WebCore::Document::unscheduleStyleRecalc):
1322         * dom/Document.h:
1323         * dom/Element.cpp:
1324         (WebCore::Element::setActive):
1325
1326 2013-08-08  Jer Noble  <jer.noble@apple.com>
1327
1328         [EME] MediaKey APIs should be prefixed.
1329         https://bugs.webkit.org/show_bug.cgi?id=119606
1330
1331         Reviewed by Anders Carlsson.
1332
1333         No new tests; updated exsisting tests with new names.
1334
1335         Prefix all new classes with "WebKit" and new methods on existing unprefixed
1336         classes with "webkit"
1337
1338         * Modules/encryptedmedia/MediaKeyMessageEvent.idl: MediaKeyMessageEvent -> WebKitMediaKeyMessageEvent
1339         * Modules/encryptedmedia/MediaKeySession.idl: MediaKeySession -> WebKitMediaKeySession
1340         * Modules/encryptedmedia/MediaKeys.idl: MediaKeys -> WebKitMediaKeys
1341         * html/HTMLMediaElement.idl: keys -> webkitKeys, setMediaKeys -> webkitSetMediaKeys
1342         * html/MediaKeyError.idl: MediaKeyError -> WebKitMediaKeyError
1343
1344 2013-08-08  Jer Noble  <jer.noble@apple.com>
1345
1346         [EME] setMediaKeys function as defined in the EME specification does not work
1347         https://bugs.webkit.org/show_bug.cgi?id=119597
1348
1349         Reviewed by Anders Carlsson.
1350
1351         No new tests; updated media/encrypted-media/encrypted-media-v2-syntax.html
1352
1353         Rename the mediaKeys attribute 'keys' and make readonly, and add an explicit
1354         setMediaKeys() method in HTMLMediaElement's IDL.
1355
1356         * html/HTMLMediaElement.h:
1357         (WebCore::HTMLMediaElement::keys):
1358         * html/HTMLMediaElement.idl:
1359
1360 2013-08-06  Sam Weinig  <sam@webkit.org>
1361
1362         Hashing SecurityOrigin's can lead to trouble if you mutate them :(
1363         https://bugs.webkit.org/show_bug.cgi?id=119533
1364         <rdar://problem/12978338>
1365
1366         Reviewed by Andreas Kling.
1367
1368         We are getting into trouble in the following circumstance:
1369         - You have a HashMap<RefPtr<SecurityOrigin>, Value> map.
1370         - You add security origin A (http, www.webkit.org, 80) to the map.
1371         - You mutate security origin A by domain relaxation, so that it has the domain webkit.org.
1372         - You add security origin B (http, www.webkit.org, 80) to the map.
1373         - You mutate security origin B by domain relaxation, so that it has the domain webkit.org.
1374             You now have two identical keys in the map.
1375         - Add few more items to the map causing a rehash.
1376         - When you try to add A and B back into the map, you will have a collision, because they now equal each other.
1377
1378         We should probably stop using SecurityOrigins as keys in HashMaps (and move to using a non-mutable SecurityOriginTuple,
1379         or something), but for now, we can just only use the scheme / host / port part for equality, which is what all the users
1380         really want.
1381
1382         * page/SecurityOriginHash.h:
1383         (WebCore::SecurityOriginHash::equal):
1384         Switch to using isSameSchemeHostPort() for SecurityOriginHash::equal().
1385
1386 2013-08-08  Rob Buis  <rwlbuis@webkit.org>
1387
1388         ASSERT_NOT_REACHED() touched in WebCore::SVGAnimatedStringAnimator::addAnimatedTypes
1389         https://bugs.webkit.org/show_bug.cgi?id=113224
1390
1391         Reviewed by Dirk Schulze.
1392
1393         Do not perform from-by animations for non-additive attributes.
1394
1395         Test: svg/animations/non-additive-type-from-by-animation.html
1396
1397         * svg/SVGAnimateElement.cpp:
1398         (WebCore::SVGAnimateElement::calculateFromAndByValues):
1399
1400 2013-08-08  Brent Fulgham  <bfulgham@apple.com>
1401
1402         [Windows] Improper Caption Button Displayed to Users
1403         https://bugs.webkit.org/show_bug.cgi?id=119593 
1404
1405         Reviewed by Eric Carlson.
1406
1407         Remove the custom drawing code for the Windows port, and
1408         have it render using the CSS/SVG markup like we do on OS X.
1409
1410         * rendering/RenderThemeWin.cpp: Remove drawing code.
1411         * rendering/RenderThemeWin.h: Remove declaration.
1412
1413 2013-08-08  Alex Christensen  <achristensen@apple.com>
1414
1415         Work towards WebGL on AppleWin port.
1416         https://bugs.webkit.org/show_bug.cgi?id=119562
1417
1418         Reviewed by Brent Fulgham.
1419
1420         * WebCore.vcxproj/WebCore.vcxproj:
1421         Build GLContext.cpp and GraphicsContext3DPrivate.cpp on AppleWin port.
1422         * WebCore.vcxproj/WebCore.vcxproj.filters:
1423         Moved GLContext and GraphicsContext3DPrivate from Cairo filter to graphics.
1424         * platform/graphics/GraphicsContext3D.h:
1425         Added m_webGLLayer for AppleWin port.
1426         * platform/graphics/GraphicsContext3DPrivate.cpp:
1427         Protected inclusion of PlatformContextCairo.h in USE(CAIRO) macro for non-cairo ports.
1428         * platform/graphics/win/GraphicsContext3DWin.cpp:
1429         Removed stub GraphicsContext3DPrivate implementation in favor of GraphicsContext3DPrivate.cpp.
1430         (WebCore::GraphicsContext3D::GraphicsContext3D):
1431         Added GraphicsContext3DPrivate and PlatformCALayer initialization.
1432         (WebCore::GraphicsContext3D::makeContextCurrent):
1433         (WebCore::GraphicsContext3D::platformGraphicsContext3D):
1434         Added implementation based on Cairo ports' to be refactored soon.
1435         (WebCore::GraphicsContext3D::platformLayer):
1436         Return PlatformCALayer's PlatformLayer instead of 0.
1437
1438 2013-08-08  Jer Noble  <jer.noble@apple.com>
1439
1440         [EME] Implement MediaKeys.isTypeSupported()
1441         https://bugs.webkit.org/show_bug.cgi?id=119586
1442
1443         Reviewed by Eric Carlson.
1444
1445         Test: media/encrypted-media/encrypted-media-is-type-supported.html
1446
1447         The EME spec has removed the extra keySystem parameter from
1448         HTMLMediaElement.canPlayType() in favor of a new isTypeSupported()
1449         method on MediaKeys.
1450
1451         To implement this method, the CDMFactory needs to know whether the
1452         registered CDM supports the specified mime type.  CDMs must register
1453         this new factory method, which requires changes to CDMPrivateAVFoundation
1454         and MockCDM.
1455
1456         Add the new MediaKeys.isTypeSupported() method:
1457         * Modules/encryptedmedia/MediaKeys.cpp:
1458         (WebCore::MediaKeys::isTypeSupported):
1459         * Modules/encryptedmedia/MediaKeys.h:
1460         * Modules/encryptedmedia/MediaKeys.idl:
1461
1462         Add the new factory CDMSupportsKeySystemAndMimeType method:
1463         * Modules/encryptedmedia/CDM.cpp:
1464         (WebCore::CDMFactory::CDMFactory): Now takes a third parameter.
1465         (WebCore::installedCDMFactories): When adding the AVFoundation CDM, pass its new method.
1466         (WebCore::CDM::registerCDMFactory): Now takes a third parameter.
1467         (WebCore::CDM::keySystemSupportsMimeType): Added.
1468         * Modules/encryptedmedia/CDM.h:
1469         * WebCore.exp.in:
1470
1471         Register this new method with the factory for all concrete CDMs:
1472         * Modules/encryptedmedia/CDMPrivateAVFoundation.h:
1473         * Modules/encryptedmedia/CDMPrivateAVFoundation.mm:
1474         (WebCore::CDMPrivateAVFoundation::supportsKeySystem):
1475         (WebCore::CDMPrivateAVFoundation::supportsKeySystemAndMimeType):
1476         * testing/Internals.cpp:
1477         (WebCore::Internals::initializeMockCDM):
1478         * testing/MockCDM.cpp:
1479         (WebCore::MockCDM::supportsKeySystem):
1480         (WebCore::MockCDM::supportsKeySystemAndMimeType):
1481         * testing/MockCDM.h:
1482
1483 2013-08-08  Rob Buis  <rwlbuis@webkit.org>
1484
1485         Crash in WTF::RefPtr<WebCore::SpaceSplitStringData>::operator UnspecifiedBoolType
1486         https://bugs.webkit.org/show_bug.cgi?id=118839
1487
1488         Reviewed by Darin Adler.
1489
1490         Take into account that elementData() can be null in classAttributeChanged.
1491
1492         Test: svg/animations/classAttributeSettingCrash.html
1493
1494         * dom/Element.cpp:
1495         (WebCore::Element::classAttributeChanged):
1496
1497 2013-08-08  Robert Hogan  <robert@webkit.org>
1498
1499         REGRESSION(r147019): Page has extra space
1500         https://bugs.webkit.org/show_bug.cgi?id=119424
1501
1502         Reviewed by David Hyatt.
1503
1504         Clear the overflow rect before recomputing it in table sections.
1505
1506         No new tests: the reduction uses jquery and I was unable to simulate the reduction without it.
1507
1508         * rendering/RenderTableSection.cpp:
1509         (WebCore::RenderTableSection::layoutRows):
1510         (WebCore::RenderTableSection::computeOverflowFromCells):
1511
1512 2013-08-08  Andreas Kling  <akling@apple.com>
1513
1514         Inserting multiple rules into an empty style sheet should avoid style recalc if possible.
1515         <http://webkit.org/b/119568>
1516
1517         Reviewed by Antti Koivisto.
1518
1519         As a follow-up to <http://webkit.org/b/119475>, where I added a hack for inserting
1520         a single rule into an empty style sheet, this broadens the optimization to support
1521         any number of rules.
1522
1523         This optimizes the scenario where a style sheet is added to the DOM and then populated
1524         rule-by-rule via CSSOM insertRule()/addRule() calls. Previously we'd do a full style
1525         recalc for this case, but now we'll treat it the same as a full sheet added at once.
1526
1527         * css/CSSStyleSheet.h:
1528         * css/CSSStyleSheet.cpp:
1529         (WebCore::CSSStyleSheet::willMutateRules):
1530
1531             Made willMutateRules() return whether the style sheet contents were cloned by the
1532             copy-on-write mechanism.
1533
1534         * dom/Document.h:
1535         (WebCore::CSSStyleSheet::didMutateRules):
1536         (WebCore::CSSStyleSheet::insertRule):
1537
1538             Replaced the InsertionIntoEmptySheet mutation type by a general RuleInsertion.
1539             The mutation callback checks if we're inserting into a rule that's not (yet) part
1540             of the document's active sheet set. In that case, we defer doing the style sheet
1541             until all the insertions are done (or something forces us to style+layout.)
1542
1543             Note that this optimization only happens if the style sheet had a single client.
1544             Shared style sheets that just got cloned before mutation may have pointers into
1545             them from the Document's StyleResolver, so we're forced to do an immediate sheet
1546             update in that case.
1547
1548         (WebCore::CSSStyleSheet::RuleMutationScope::RuleMutationScope):
1549         (WebCore::CSSStyleSheet::RuleMutationScope::~RuleMutationScope):
1550
1551             Moved these out-of-line.
1552
1553         (WebCore::CSSStyleSheet::didMutateRuleFromCSSStyleDeclaration):
1554         * css/PropertySetCSSStyleDeclaration.cpp:
1555         (WebCore::StyleRuleCSSStyleDeclaration::didMutate):
1556
1557             Made a separate mutation callback for CSSStyleDeclaration since its needs are
1558             so simple compared to the mutation callback from CSSStyleSheet. Seems better
1559             than adding yet another mode to the enum.
1560
1561         * dom/Document.cpp:
1562         (WebCore::Document::Document):
1563         (WebCore::Document::recalcStyle):
1564         (WebCore::Document::styleResolverChanged):
1565         (WebCore::Document::optimizedStyleSheetUpdateTimerFired):
1566         (WebCore::Document::scheduleOptimizedStyleSheetUpdate):
1567
1568             Added mechanism to defer doing a RecalcStyleIfNeeded.
1569
1570         (WebCore::Document::updateStyleIfNeeded):
1571
1572             Synchronize the optimized style sheet update if there's one scheduled.
1573             This ensures that stuff like layout-dependent property access won't operate
1574             on stale style.
1575
1576         * dom/DocumentStyleSheetCollection.h:
1577         (WebCore::DocumentStyleSheetCollection::pendingUpdateType):
1578         (WebCore::DocumentStyleSheetCollection::setPendingUpdateType):
1579         (WebCore::DocumentStyleSheetCollection::flushPendingUpdates):
1580         * dom/DocumentStyleSheetCollection.cpp:
1581         (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection):
1582         (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets):
1583
1584             Have DSSC track the kind of style sheet update it needs to do (instead of just
1585             a boolean "needs update.") This is used by Document::recalcStyle() to make sure
1586             the right kind of update happens if there's one scheduled.
1587
1588         (WebCore::DocumentStyleSheetCollection::activeStyleSheetsContains):
1589
1590             Added helper to check if a CSSStyleSheet is part of the active set.
1591
1592 2013-08-08  Allan Sandfeld Jensen  <allan.jensen@digia.com>
1593
1594         [WK1] NPStream::headers not initialized
1595         https://bugs.webkit.org/show_bug.cgi?id=119574
1596
1597         Reviewed by Alexey Proskuryakov.
1598
1599         Initialize the header field. According to user feedback that should solve some
1600         cases of random crashes when loading plugins on Mac and Windows.
1601
1602         * plugins/PluginStream.cpp:
1603         (WebCore::PluginStream::PluginStream):
1604
1605 2013-08-08  Andreas Kling  <akling@apple.com>
1606
1607         Element: Modernize attribute storage accessor functions.
1608         <http://webkit.org/b/119578>
1609
1610         Reviewed by Antti Koivisto.
1611
1612         Rename these functions to more WebKit-style names.
1613
1614         - const Attribute* attributeItem(index) => const Attribute& attributeAt(index)
1615         - const Attribute* getAttributeItem(name) => const Attribute* findAttributeByName(name)
1616         - unsigned getAttributeItemIndex(name) => unsigned findAttributeIndexByName(name)
1617
1618         Note that attributeAt() now returns a reference instead of a pointer. That's right.
1619
1620         * css/SelectorChecker.cpp:
1621         (WebCore::attributeValueMatches):
1622         (WebCore::anyAttributeMatches):
1623         * css/SelectorChecker.h:
1624         (WebCore::SelectorChecker::checkExactAttribute):
1625         * dom/Attr.cpp:
1626         (WebCore::Attr::elementAttribute):
1627         * dom/DatasetDOMStringMap.cpp:
1628         (WebCore::DatasetDOMStringMap::getNames):
1629         (WebCore::DatasetDOMStringMap::item):
1630         (WebCore::DatasetDOMStringMap::contains):
1631         * dom/Element.cpp:
1632         (WebCore::Element::detachAttribute):
1633         (WebCore::Element::removeAttribute):
1634         (WebCore::Element::getAttribute):
1635         (WebCore::Element::setAttribute):
1636         (WebCore::Element::setSynchronizedLazyAttribute):
1637         (WebCore::Element::setAttributeInternal):
1638         (WebCore::Element::setAttributeNode):
1639         (WebCore::Element::removeAttributeNode):
1640         (WebCore::Element::removeAttributeInternal):
1641         (WebCore::Element::getAttributeNode):
1642         (WebCore::Element::getAttributeNodeNS):
1643         (WebCore::Element::hasAttribute):
1644         (WebCore::Element::hasAttributeNS):
1645         (WebCore::Element::computeInheritedLanguage):
1646         (WebCore::Element::normalizeAttributes):
1647         (WebCore::Element::getURLAttribute):
1648         (WebCore::Element::getNonEmptyURLAttribute):
1649         (WebCore::Element::detachAllAttrNodesFromElement):
1650         (WebCore::Element::cloneAttributesFromElement):
1651         (WebCore::ElementData::isEquivalent):
1652         (WebCore::ElementData::findAttributeIndexByNameSlowCase):
1653         (WebCore::ElementData::findAttributeIndexByNameForAttributeNode):
1654         (WebCore::UniqueElementData::findAttributeByName):
1655         (WebCore::UniqueElementData::attributeAt):
1656         * dom/Element.h:
1657         (WebCore::Element::findAttributeIndexByName):
1658         (WebCore::Element::fastHasAttribute):
1659         (WebCore::Element::fastGetAttribute):
1660         (WebCore::Element::attributeAt):
1661         (WebCore::Element::findAttributeByName):
1662         (WebCore::ElementData::findAttributeByName):
1663         (WebCore::ElementData::findAttributeIndexByName):
1664         (WebCore::ElementData::attributeAt):
1665         * dom/NamedNodeMap.cpp:
1666         (WebCore::NamedNodeMap::removeNamedItem):
1667         (WebCore::NamedNodeMap::removeNamedItemNS):
1668         (WebCore::NamedNodeMap::item):
1669         * dom/Node.cpp:
1670         (WebCore::Node::dumpStatistics):
1671         (WebCore::Node::isDefaultNamespace):
1672         (WebCore::Node::lookupNamespaceURI):
1673         (WebCore::Node::lookupNamespacePrefix):
1674         (WebCore::Node::compareDocumentPosition):
1675         * dom/StyledElement.cpp:
1676         (WebCore::StyledElement::makePresentationAttributeCacheKey):
1677         (WebCore::StyledElement::rebuildPresentationAttributeStyle):
1678         * editing/MarkupAccumulator.cpp:
1679         (WebCore::MarkupAccumulator::appendElement):
1680         * editing/markup.cpp:
1681         (WebCore::completeURLs):
1682         (WebCore::StyledMarkupAccumulator::appendElement):
1683         * html/HTMLEmbedElement.cpp:
1684         (WebCore::HTMLEmbedElement::parametersForPlugin):
1685         * html/HTMLInputElement.cpp:
1686         (WebCore::HTMLInputElement::updateType):
1687         * html/HTMLObjectElement.cpp:
1688         (WebCore::HTMLObjectElement::parametersForPlugin):
1689         * html/HTMLSelectElement.cpp:
1690         (WebCore::HTMLSelectElement::parseAttribute):
1691         * html/parser/HTMLConstructionSite.cpp:
1692         (WebCore::HTMLConstructionSite::mergeAttributesFromTokenIntoElement):
1693         * inspector/DOMPatchSupport.cpp:
1694         (WebCore::DOMPatchSupport::innerPatchNode):
1695         (WebCore::DOMPatchSupport::createDigest):
1696         * inspector/InspectorDOMAgent.cpp:
1697         (WebCore::InspectorDOMAgent::setAttributesAsText):
1698         (WebCore::InspectorDOMAgent::performSearch):
1699         (WebCore::InspectorDOMAgent::buildArrayForElementAttributes):
1700         * page/PageSerializer.cpp:
1701         (WebCore::isCharsetSpecifyingNode):
1702         * svg/SVGStyledElement.cpp:
1703         (WebCore::SVGStyledElement::getPresentationAttribute):
1704         * xml/XPathFunctions.cpp:
1705         (WebCore::XPath::FunLang::evaluate):
1706         * xml/XPathNodeSet.cpp:
1707         (WebCore::XPath::NodeSet::traversalSort):
1708         * xml/XPathStep.cpp:
1709         (WebCore::XPath::Step::nodesInAxis):
1710         * xml/parser/XMLDocumentParserLibxml2.cpp:
1711         (WebCore::XMLDocumentParser::XMLDocumentParser):
1712         * xml/parser/XMLDocumentParserQt.cpp:
1713         (WebCore::XMLDocumentParser::XMLDocumentParser):
1714
1715 2013-08-08  Mark Lam  <mark.lam@apple.com>
1716
1717         Restoring use of StackIterator instead of Interpreter::getStacktrace().
1718         https://bugs.webkit.org/show_bug.cgi?id=119575.
1719
1720         Reviewed by Oliver Hunt.
1721
1722         No new tests.
1723
1724         * bindings/js/ScriptCallStackFactory.cpp:
1725         (WebCore::createScriptCallStack):
1726
1727 2013-08-08  Zalan Bujtas  <zalan@apple.com>
1728
1729         REGRESSION (r121551) Incorrect handling of invalid media query list.
1730         https://bugs.webkit.org/show_bug.cgi?id=119164
1731
1732         Reviewed by Antti Koivisto.
1733
1734         Differentiate between syntactically invalid media queries and media queries with empty expressions.
1735
1736         Introduce a dedicated function for valid, but empty expression queries, so that passing NULL MediaQuerySet
1737         object to CSSParser::createMediaRule() can indicate invalid media query.
1738
1739         Test: fast/media/invalid-media-query-list.html
1740
1741         * css/CSSGrammar.y.in:
1742         * css/CSSParser.cpp:
1743         (WebCore::CSSParser::createMediaRule):
1744         (WebCore::CSSParser::createEmptyMediaRule):
1745         * css/CSSParser.h:
1746
1747 2013-08-08  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
1748
1749         Introduce toSVGMPathElement(), and use it
1750         https://bugs.webkit.org/show_bug.cgi?id=119566
1751
1752         Reviewed by Andreas Kling.
1753
1754         As a step to change static_cast with toSVGXXX, static_cast<SVGMPathElement*> can
1755         be changed with toSVGMPathElement().
1756
1757         * svg/SVGAnimateMotionElement.cpp:
1758         (WebCore::SVGAnimateMotionElement::updateAnimationPath):
1759         * svg/SVGMPathElement.h:
1760         (WebCore::toSVGMPathElement):
1761         * svg/SVGPathElement.cpp:
1762         (WebCore::SVGPathElement::invalidateMPathDependencies):
1763
1764 2013-08-08  Antti Koivisto  <antti@apple.com>
1765
1766         Move more style recalc code to StyleResolveTree.cpp
1767         https://bugs.webkit.org/show_bug.cgi?id=119553
1768
1769         Reviewed by Andreas Kling.
1770
1771         * css/StyleResolver.cpp:
1772         * css/StyleResolver.h:
1773         
1774             Remove now unused StyleResolver::styleForText.
1775
1776         * dom/ElementShadow.cpp:
1777         * dom/ElementShadow.h:
1778         
1779             Remove ElementShadow::recalcStyle.
1780
1781         * dom/ShadowRoot.cpp:
1782         (WebCore::ShadowRoot::setResetStyleInheritance):
1783         
1784             Use Style::resolveTree instead of ElementShadow::recalcStyle.
1785
1786         * dom/ShadowRoot.h:
1787         
1788             Remove ShadowRoot::recalcStyle.
1789
1790         * dom/Text.cpp:
1791         * dom/Text.h:
1792         
1793             Remove Text::recalcTextStyle.
1794
1795         * style/StyleResolveTree.cpp:
1796         (WebCore::Style::updateTextStyle):
1797         
1798             Moved from Text::recalcTextStyle. Speed up by just setting the parent style on common case.
1799
1800         (WebCore::Style::resolveShadowTree):
1801         
1802             Moved from ShadowRoot::recalcStyle. 
1803             Simplified to cover only cases that can occur with the current shadow DOM support.
1804
1805         (WebCore::Style::resolveTree):
1806
1807 2013-08-08  Andreas Kling  <akling@apple.com>
1808
1809         REGRESSION(r139282): Old caret sometimes gets "stuck" (not repainted) in contenteditable elements.
1810         <http://webkit.org/b/119520>
1811         <rdar://problem/14658929>
1812
1813         Reviewed by Simon Fraser.
1814
1815         When computing a new caret rect, don't forget to repaint the old rect if the caret jumped
1816         from one node to another.
1817         We were being a little too clever, assuming that oldRect==newRect meant that no repaint was
1818         necessary, but moving from (0,0) in one node to (0,0) in another would cause a ghost caret
1819         in the old node.
1820
1821         Test: fast/repaint/caret-jump-between-nodes.html
1822
1823         * editing/FrameSelection.cpp:
1824         (WebCore::FrameSelection::recomputeCaretRect):
1825
1826             Fall through all the way down to caret repaints if the selection's new anchor node is not
1827             the same as m_previousCaretNode.
1828
1829 2013-08-07  Andrei Bucur  <abucur@adobe.com>
1830
1831         [CSS Regions] Propagate overflow from the flow thread to the first and last region
1832         https://bugs.webkit.org/show_bug.cgi?id=118526
1833
1834         Reviewed by David Hyatt.
1835
1836         The patch implements layout overflow propagation for the first and last regions. The approach
1837         taken is triggering a simple layout on the regions after the named flows are laid out
1838         that extracts the layout overflow from the flow thread and adds it to the regions.
1839
1840         The process is based on adding two new layout phases: the overflow phase and the final phase.
1841         The overflow phase is set after the flow threads are laid out and it marks the regions as
1842         needing to extract the overflow from the flow thread. In case there are blocks with auto overflow
1843         it's possible the overflow to create scrollbars that shrink the regions. In this case the flow
1844         thread is relaid out and set in the final phase, forcing the regions to recollect the layout
1845         overflow. In theory this would be an N-step layout because scrollbars can force content to change
1846         regions and create overflow for other blocks (and thus creating more scrollbars). For now, we are
1847         limiting this to the first pass by inserting this new final layout phase.
1848
1849         A short description of the processing model for a document:
1850         - layout the document (all the flow threads should be in the constrained layout phase after this step)
1851         - reverse iterate through the flow threads and mark the regions for simplified layout (we need to
1852         reverse iterate so the overflow can correctly propagate with nested regions)
1853         - if the layout changes the size of a region, invalidate the flow thread and when laying it out mark
1854         it as needing a new pass
1855         - make a secondary pass through the flow threads that changed after scrollbars have been added and
1856         recompute the overflow for their regions; mark the flow threads in the final phase (flow threads can't
1857         be invalidated in the final phase)
1858         - after the overflow was propagated update all the flow threads in the normal layout phase
1859
1860         There are some issues with the patch:
1861         - the simplified layout doesn't compute correct overflow values for inline blocks
1862         - the layout overflow from the flow thread doesn't take the region size into account
1863
1864         The first issue is not related to regions and will be fixed in a future patch. The second issue
1865         will be fixed when box overflow will be region bound.
1866
1867         Tests: fast/regions/overflow-scrollable-1.html
1868                fast/regions/overflow-scrollable-2.html
1869                fast/regions/overflow-scrollable-3.html
1870                fast/regions/overflow-scrollable-fit-complex.html
1871                fast/regions/overflow-scrollable-fit.html
1872                fast/regions/overflow-scrollable-nested.html
1873
1874         * rendering/FlowThreadController.cpp: Flow threads layout driver functions.
1875         (WebCore::FlowThreadController::updateFlowThreadsNeedingLayout):
1876         (WebCore::FlowThreadController::updateFlowThreadsIntoConstrainedPhase):
1877         (WebCore::FlowThreadController::updateFlowThreadsIntoOverflowPhase):
1878         (WebCore::FlowThreadController::updateFlowThreadsIntoMeasureContentPhase):
1879         (WebCore::FlowThreadController::updateFlowThreadsIntoFinalPhase):
1880         * rendering/FlowThreadController.h:
1881         * rendering/RenderBlock.cpp:
1882         (WebCore::RenderBlock::simplifiedNormalFlowLayout):
1883         * rendering/RenderFlowThread.cpp:
1884         (WebCore::RenderFlowThread::RenderFlowThread):
1885         (WebCore::RenderFlowThread::invalidateRegions):
1886         (WebCore::RenderFlowThread::validateRegions):
1887         (WebCore::RenderFlowThread::layout):
1888         (WebCore::RenderFlowThread::firstRegion): This getter should work even though the region chain is invalid.
1889         (WebCore::RenderFlowThread::lastRegion): This getter should work even though the region chain is invalid.
1890         (WebCore::RenderFlowThread::initializeRegionsComputedAutoHeight):
1891         (WebCore::RenderFlowThread::markRegionsForOverflowLayoutIfNeeded): If the flow thread has no overflow do nothing.
1892         (WebCore::RenderFlowThread::updateRegionsFlowThreadPortionRect):
1893         (WebCore::RenderFlowThread::addForcedRegionBreak):
1894         * rendering/RenderFlowThread.h:
1895         * rendering/RenderMultiColumnSet.cpp:
1896         (WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
1897         * rendering/RenderRegion.cpp:
1898         (WebCore::RenderRegion::pageLogicalHeight):
1899         (WebCore::RenderRegion::maxPageLogicalHeight):
1900         (WebCore::RenderRegion::logicalHeightOfAllFlowThreadContent):
1901         (WebCore::RenderRegion::flowThreadPortionOverflowRect):
1902         (WebCore::RenderRegion::overflowRectForFlowThreadPortion): Used to get the flow thread visual or layout overflow.
1903         (WebCore::RenderRegion::layoutBlock):
1904         (WebCore::RenderRegion::computeOverflowFromFlowThread):
1905         (WebCore::RenderRegion::updateLogicalHeight):
1906         * rendering/RenderRegion.h:
1907         * rendering/RenderView.cpp:
1908         (WebCore::RenderView::layoutContentToComputeOverflowInRegions):
1909         (WebCore::RenderView::layout):
1910         * rendering/RenderView.h:
1911
1912 2013-08-07  Simon Fraser  <simon.fraser@apple.com>
1913
1914         Avoid spurious "all repaint" layouts when scrolling WebViews on Retina displays
1915         https://bugs.webkit.org/show_bug.cgi?id=119564
1916
1917         Reviewed by Beth Dakin.
1918
1919         When scrolling WebViews on Macs with Retina displays, AppKit uses
1920         device pixels for the scroll offset, so [scrollView() documentVisibleRect]
1921         can return a CGRect with non-integral origin. This rect is used by layout,
1922         via layoutSize(), to decide whether the view size changed, which prompts
1923         a full repaint. However, FrameView gets a value which has been rounded
1924         by enclosingIntRect(), which increases the height or width by 1px if the 
1925         y or x offset is on a half-pixel, causing spurious full repaints.
1926         
1927         Fix by plumbing through platformVisibleContentSize(), which just
1928         gets the size of the -documentVisibleRect.
1929         
1930         * page/FrameView.cpp:
1931         (WebCore::FrameView::layout): Don't get layoutHeight and layoutWidth
1932         separately, since that is two calls down into platformVisibleContentSize.
1933         * platform/ScrollView.cpp:
1934         (WebCore::ScrollView::unscaledVisibleContentSize):
1935         (WebCore::ScrollView::platformVisibleContentSize):
1936         * platform/ScrollView.h:
1937         * platform/mac/ScrollViewMac.mm:
1938         (WebCore::ScrollView::platformVisibleContentSize):
1939
1940 2013-08-07  Simon Fraser  <simon.fraser@apple.com>
1941
1942         Be more aggressive about sending fake mouse events less frequently
1943         https://bugs.webkit.org/show_bug.cgi?id=119563
1944         <rdar://problem/14669029>
1945
1946         Reviewed by Tim Horton.
1947
1948         r109151 added code that throttles back the fake mouse events that we
1949         send during scrolling, but in such a way that a page could take up to
1950         100ms to handle a single mousemove, and we'd still send fake mousemove
1951         events every 100ms. This could cause serious scrolling stutter.
1952         
1953         Fix by changing when we drop back to sending events every 250ms, rather than every
1954         100ms: if the slowest mousemove takes 10ms or more (less than one frame), drop back
1955         to a 250ms fake move interval.
1956
1957         * page/EventHandler.cpp:
1958         (WebCore::EventHandler::dispatchFakeMouseMoveEventSoon):
1959
1960 2013-08-07  Adenilson Cavalcanti  <cavalcantii@gmail.com>
1961
1962         [rendering] Implement PaintInfo interfaces
1963         https://bugs.webkit.org/show_bug.cgi?id=119388
1964
1965         Reviewed by Benjamin Poulain.
1966
1967         In discussion in IRC, it was decided to remove this comment since implementing such change
1968         would have a vast impact on rendering classes.
1969
1970         * rendering/PaintInfo.h:
1971
1972 2013-08-07  Dean Jackson  <dino@apple.com>
1973
1974         Don't remove contents layer from its parent unless necessary
1975         https://bugs.webkit.org/show_bug.cgi?id=119560
1976
1977         Reviewed by Simon Fraser.
1978
1979         RenderLayerBacking::updateInternalHierarchy() is called in some
1980         instances where there doesn't need to be a complete reparenting of the
1981         the m_graphicsLayer. For example, on OS X when the user changes the
1982         scrollbar styles to/from always visible. We don't need to always
1983         remove the graphics layer from its parent - any reparenting does that
1984         automatically.
1985
1986         Unfortunately we can't trigger this situation in an automated test.
1987
1988         * rendering/RenderLayerBacking.cpp:
1989         (WebCore::RenderLayerBacking::updateInternalHierarchy): Don't call removeFromParent().
1990
1991 2013-08-07  Tim Horton  <timothy_horton@apple.com>
1992
1993         Fall out of simple image layer optimization if the image has EXIF rotation
1994         https://bugs.webkit.org/show_bug.cgi?id=119535
1995         <rdar://problem/14071174>
1996
1997         Reviewed by Simon Fraser.
1998
1999         Test: fast/images/exif-orientation-composited.html
2000
2001         * platform/graphics/BitmapImage.cpp:
2002         (WebCore::BitmapImage::frameOrientationAtIndex):
2003         Ensure that the frame is cached if we're requesting the orientation,
2004         so we can acquire orientation information at any given time.
2005
2006         * platform/mac/DragImageMac.mm:
2007         (WebCore::createDragImageFromImage):
2008         * platform/graphics/BitmapImage.h:
2009         Rename currentFrameOrientation to frameOrientationForCurrentFrame to match
2010         the similarly-behaving nativeImageForCurrentFrame.
2011
2012         * platform/graphics/Image.h:
2013         (WebCore::Image::orientationForCurrentFrame): Added. Virtual, overriden by BitmapImage.
2014
2015         * rendering/RenderLayerBacking.cpp:
2016         (WebCore::RenderLayerBacking::isDirectlyCompositedImage):
2017         If the given image has a non-default image orientation, don't use direct compositing.
2018
2019 2013-08-07  Antti Koivisto  <antti@apple.com>
2020
2021         fast/frames/seamless/seamless-custom-font-pruning-crash.html asserts
2022         https://bugs.webkit.org/show_bug.cgi?id=119557
2023
2024         Rubber-stamped by Eric Carlson.
2025         
2026         Pass Style::Detach style change to seamless document as Style::Force. Style::resolveTree does not expect to be called with Detach.
2027
2028         * html/HTMLIFrameElement.cpp:
2029         (WebCore::HTMLIFrameElement::didRecalcStyle):
2030
2031 2013-08-07  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
2032
2033         Disable HTTP request "Accept-Encoding:" header field on gstreamer source element to avoid receiving the wrong size when retrieving data
2034         https://bugs.webkit.org/show_bug.cgi?id=115354
2035
2036         Reviewed by Philippe Normand.
2037
2038         The default value for the HTTP "Accept-Encoding:" header field in the request allows
2039         compressed data to be received on requests.
2040         While this works fine for most cases, it can break the webkit source that needs to rely on the
2041         the proper data size when receiving the response (even though the received data is already
2042         uncompressed the size reported in ResourceResponse::expectedContentLength() is the same
2043         represented by the HTTP header field "Content-Length" which is the size of the compressed data).
2044
2045         This patch disables the HTTP "Accept-Encoding:" header field when using the request
2046         as we don't want the received response to be encoded in any way, as we need to rely on the proper
2047         size of the returned data on ResourceHandle::didReceiveResponse().
2048
2049         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2050         (webKitWebSrcStart):
2051         * platform/network/soup/ResourceRequest.h:
2052         (ResourceRequestBase):
2053         (WebCore::ResourceRequest::acceptEncoding):
2054         (WebCore::ResourceRequest::setAcceptEncoding):
2055         (WebCore::ResourceRequest::ResourceRequestBase):
2056         * platform/network/soup/ResourceRequestSoup.cpp:
2057         (WebCore::ResourceRequest::updateSoupMessage):
2058         (WebCore::ResourceRequest::toSoupMessage):
2059
2060 2013-08-07  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2061
2062         [Qt] REGRESSION(r) Two pixel result fail after r153522
2063         https://bugs.webkit.org/show_bug.cgi?id=119392
2064
2065         Reviewed by Jocelyn Turcotte.
2066
2067         Consider scaling transform on the painter to determine final destination size.
2068
2069         Covered by existing tests.
2070
2071         * platform/graphics/qt/ImageQt.cpp:
2072         (WebCore::prescaleImageIfRequired):
2073         (WebCore::BitmapImage::draw):
2074
2075 2013-08-07  Antti Koivisto  <antti@apple.com>
2076
2077         2.5% regression on page cycler moz
2078         https://bugs.webkit.org/show_bug.cgi?id=102822
2079
2080         Reviewed by Andreas Kling.
2081
2082         DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache() triggers a style recalc for quirks mode
2083         documents in the beginning of document parsing via Document::setCompatibilityMode. This often coalesces 
2084         with style recalc triggered by stylesheet loading. However on very simple documents it can generate genuinely
2085         unnecessary work.
2086
2087         * dom/DocumentStyleSheetCollection.cpp:
2088         (WebCore::DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache):
2089         
2090             Check that we actually have cached injected stylesheets before triggering style recalc.
2091             
2092         * page/PageGroup.cpp:
2093         (WebCore::PageGroup::addUserStyleSheetToWorld):
2094         (WebCore::PageGroup::removeUserStyleSheetFromWorld):
2095         (WebCore::PageGroup::removeUserStyleSheetsFromWorld):
2096         (WebCore::PageGroup::removeAllUserContent):
2097         
2098             Fix a misspelling.
2099
2100         (WebCore::PageGroup::invalidateInjectedStyleSheetCacheInAllFrames):
2101         
2102             Always invalidate style when user sheets change since we don't do that in
2103             DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache anymore.
2104
2105         * page/PageGroup.h:
2106
2107 2013-08-07  Andre Moreira Magalhaes   <andre.magalhaes@collabora.co.uk>
2108
2109         Do no check seek offset against internal size on gstreamer source element
2110         https://bugs.webkit.org/show_bug.cgi?id=116533
2111
2112         Reviewed by Philippe Normand.
2113
2114         The internal size on gstreamer source element may be wrong in case the received size in
2115         didReceiveResponse is not accurate. Lets just try to seek and let it fail if necessary.
2116
2117         * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
2118         (webKitWebSrcSeekDataCb):
2119
2120 2013-08-07  Antti Koivisto  <antti@apple.com>
2121
2122         Create WebCore/style and move StyleResolveTree there
2123         https://bugs.webkit.org/show_bug.cgi?id=119543
2124
2125         Reviewed by Andreas Kling.
2126
2127         WebCore/css is bloated. We should move the internal style representation and the style resolver
2128         related code to a directory of their own. CSS language related code including parser and 
2129         CSSOM stays under css.
2130
2131         Things named StyleFoo should generally move under WebCore/style. They should also be moved to
2132         the Style namespace at the same time.
2133
2134         * CMakeLists.txt:
2135         * GNUmakefile.am:
2136         * GNUmakefile.list.am:
2137         * WebCore.pri:
2138         * Target.pri:
2139         * WebCore.vcxproj/WebCore.vcxproj:
2140         * WebCore.vcxproj/WebCoreCommon.props:
2141         * WebCore.vcxproj/copyForwardingHeaders.cmd:
2142         * WebCore.xcodeproj/project.pbxproj:
2143         * css/StyleResolveTree.cpp: Removed.
2144         * css/StyleResolveTree.h: Removed.
2145         * style: Added.
2146         * style/StyleResolveTree.cpp: Copied from Source/WebCore/css/StyleResolveTree.cpp.
2147         * style/StyleResolveTree.h: Copied from Source/WebCore/css/StyleResolveTree.h.
2148
2149 2013-08-07  Antti Koivisto  <antti@apple.com>
2150
2151         Move style recalculation out from Element
2152         https://bugs.webkit.org/show_bug.cgi?id=119497
2153
2154         Reviewed by Andreas Kling.
2155
2156         Element currently does too much. Element::recalcStyle() and the related functions can be turned into
2157         standalone functions that operate on DOM tree. This will also give more freedom for future refactoring,
2158         for example making style recalculation non-recursive.
2159
2160         * WebCore.xcodeproj/project.pbxproj:
2161         * css/StyleResolveTree.cpp: Added.
2162         (WebCore::Style::determineChange):
2163                 
2164             - moved and renamed from Node::diff
2165             - factored to use early return style
2166             - simplifield the null input logic
2167
2168         (WebCore::Style::pseudoStyleCacheIsInvalid):
2169         
2170             - moved from Element::pseudoStyleCacheIsInvalid
2171             - narrowed to take RenderObject rather than operate on Element
2172
2173         (WebCore::Style::resolveLocal):
2174         
2175             - split from Element::recalcStyle
2176             - factored to use early return style
2177
2178         (WebCore::Style::resolveTree):
2179         
2180             - moved and renamed from Element::recalcStyle
2181
2182         * css/StyleResolveTree.h: Added.
2183         
2184             - introcuduce Style namespace for style related classes and functions
2185             - move and rename Node::StyleChange -> Style::Change
2186
2187         * css/StyleResolver.h:
2188         (WebCore::StyleResolverParentPusher::StyleResolverParentPusher):
2189         (WebCore::StyleResolverParentPusher::push):
2190         (WebCore::StyleResolverParentPusher::~StyleResolverParentPusher):
2191         
2192             Moved this stack helper to StyleResolver.h for now since it is needed by both
2193             StyleRecalculation and Element.
2194
2195         * dom/Document.cpp:
2196         (WebCore::Document::recalcStyle):
2197         (WebCore::Document::updateStyleIfNeeded):
2198         (WebCore::Document::updateLayoutIgnorePendingStylesheets):
2199         (WebCore::Document::attach):
2200         (WebCore::Document::styleResolverChanged):
2201         (WebCore::Document::webkitWillEnterFullScreenForElement):
2202         * dom/Document.h:
2203         * dom/Element.cpp:
2204         (WebCore::shouldIgnoreAttributeCase):
2205         (WebCore::Element::updatePseudoElement):
2206         (WebCore::Element::resetComputedStyle):
2207         (WebCore::Element::willRecalcStyle):
2208         (WebCore::Element::didRecalcStyle):
2209         * dom/Element.h:
2210         
2211             - remove Element::recalcStyle
2212             - make a few private functions needed by StyleRecalculation public
2213
2214         * dom/ElementShadow.cpp:
2215         (WebCore::ElementShadow::recalcStyle):
2216         * dom/ElementShadow.h:
2217         * dom/Node.cpp:
2218         * dom/Node.h:
2219
2220             - remove Node::StyleChange
2221             - remove Node::diff
2222
2223         * dom/PseudoElement.cpp:
2224         (WebCore::PseudoElement::didRecalcStyle):
2225         * dom/PseudoElement.h:
2226         * dom/ShadowRoot.cpp:
2227         (WebCore::ShadowRoot::recalcStyle):
2228         (WebCore::ShadowRoot::setResetStyleInheritance):
2229         * dom/ShadowRoot.h:
2230         * dom/Text.cpp:
2231         (WebCore::Text::recalcTextStyle):
2232         * dom/Text.h:
2233         * html/HTMLFormControlElement.cpp:
2234         (WebCore::HTMLFormControlElement::didRecalcStyle):
2235         * html/HTMLFormControlElement.h:
2236         * html/HTMLFrameSetElement.cpp:
2237         (WebCore::HTMLFrameSetElement::willRecalcStyle):
2238         * html/HTMLFrameSetElement.h:
2239         * html/HTMLIFrameElement.cpp:
2240         (WebCore::HTMLIFrameElement::didRecalcStyle):
2241         * html/HTMLIFrameElement.h:
2242         * html/HTMLMediaElement.cpp:
2243         (WebCore::HTMLMediaElement::didRecalcStyle):
2244         * html/HTMLMediaElement.h:
2245         * html/HTMLOptionElement.cpp:
2246         (WebCore::HTMLOptionElement::didRecalcStyle):
2247         * html/HTMLOptionElement.h:
2248         * html/HTMLPlugInImageElement.cpp:
2249         (WebCore::HTMLPlugInImageElement::willRecalcStyle):
2250         (WebCore::HTMLPlugInImageElement::documentWillSuspendForPageCache):
2251         (WebCore::HTMLPlugInImageElement::documentDidResumeFromPageCache):
2252         * html/HTMLPlugInImageElement.h:
2253         * inspector/InspectorOverlay.cpp:
2254         (WebCore::InspectorOverlay::update):
2255         * loader/DocumentWriter.cpp:
2256         (WebCore::DocumentWriter::reportDataReceived):
2257         * page/Frame.cpp:
2258         (WebCore::Frame::setPageAndTextZoomFactors):
2259         * page/Page.cpp:
2260         (WebCore::Page::setPageScaleFactor):
2261         * rendering/RenderBlock.cpp:
2262         (WebCore::RenderBlock::updateFirstLetterStyle):
2263         * svg/SVGElement.cpp:
2264         (WebCore::SVGElement::willRecalcStyle):
2265         * svg/SVGElement.h:
2266         * svg/SVGUseElement.cpp:
2267         (WebCore::SVGUseElement::willRecalcStyle):
2268         * svg/SVGUseElement.h:
2269
2270 2013-08-07  Mihnea Ovidenie  <mihnea@adobe.com>
2271
2272         [CSSRegions] Wrong auto-height region computation for nested named flows
2273         https://bugs.webkit.org/show_bug.cgi?id=119517
2274
2275         Reviewed by David Hyatt.
2276
2277         Test: fast/regions/abspos-autoheight-nested-region.html
2278
2279         In the case of an (inner) auto-height region that is absolutely positioned in a named flow that is displayed in an (outer) auto-height region,
2280         when we are doing the layout for the named flow we need to add a "forced region break" also for the case of simplified layout, otherwise
2281         the outer auto-height region will not get the chance to compute its auto-height, ending up with a huge value that was used to initialize
2282         the auto-height computed value before the start of the layout algorithm.
2283
2284         * rendering/RenderBlock.cpp:
2285         (WebCore::RenderBlock::simplifiedLayout):
2286
2287 2013-08-06  Stephanie Lewis  <slewis@apple.com>
2288
2289         Update Order Files for Safari
2290         <rdar://problem/14517392>
2291
2292         Unreviewed.
2293
2294         No change in functionality.
2295
2296         * WebCore.order:
2297
2298 2013-08-04  Sam Weinig  <sam@webkit.org>
2299
2300         Remove support for HTML5 Microdata
2301         https://bugs.webkit.org/show_bug.cgi?id=119480
2302
2303         Reviewed by Anders Carlsson.
2304
2305         * CMakeLists.txt:
2306         * Configurations/FeatureDefines.xcconfig:
2307         * DerivedSources.cpp:
2308         * DerivedSources.make:
2309         * DerivedSources.pri:
2310         * GNUmakefile.list.am:
2311         * Target.pri:
2312         * UseJSC.cmake:
2313         * WebCore.vcxproj/WebCore.vcxproj:
2314         * WebCore.vcxproj/WebCore.vcxproj.filters:
2315         * WebCore.xcodeproj/project.pbxproj:
2316         * bindings/gobject/GNUmakefile.am:
2317         * bindings/js/JSBindingsAllInOne.cpp:
2318         * bindings/js/JSHTMLCollectionCustom.cpp:
2319         (WebCore::JSHTMLCollection::nameGetter):
2320         * bindings/js/JSHTMLElementCustom.cpp:
2321         * bindings/js/JSMicroDataItemValueCustom.cpp: Removed.
2322         * bindings/scripts/CodeGeneratorJS.pm:
2323         (GenerateImplementation):
2324         * dom/Document.cpp:
2325         * dom/Document.h:
2326         * dom/Document.idl:
2327         * dom/Element.cpp:
2328         (WebCore::Element::ensureCachedHTMLCollection):
2329         * dom/LiveNodeList.cpp:
2330         (WebCore::LiveNodeListBase::rootNode):
2331         (WebCore::LiveNodeListBase::invalidateCache):
2332         (WebCore::LiveNodeList::namedItem):
2333         * dom/LiveNodeList.h:
2334         (WebCore::LiveNodeListBase::shouldInvalidateTypeOnAttributeChange):
2335         * dom/MicroDataItemList.cpp: Removed.
2336         * dom/MicroDataItemList.h: Removed.
2337         * dom/Node.cpp:
2338         * dom/Node.h:
2339         * dom/NodeRareData.cpp:
2340         * dom/NodeRareData.h:
2341         * dom/PropertyNodeList.cpp: Removed.
2342         * dom/PropertyNodeList.h: Removed.
2343         * dom/PropertyNodeList.idl: Removed.
2344         * html/CollectionType.h:
2345         * html/HTMLAnchorElement.cpp:
2346         * html/HTMLAnchorElement.h:
2347         * html/HTMLAreaElement.cpp:
2348         * html/HTMLAreaElement.h:
2349         * html/HTMLCollection.cpp:
2350         (WebCore::shouldOnlyIncludeDirectChildren):
2351         (WebCore::rootTypeFromCollectionType):
2352         (WebCore::invalidationTypeExcludingIdAndNameAttributes):
2353         (WebCore::isMatchingElement):
2354         (WebCore::LiveNodeListBase::item):
2355         * html/HTMLElement.cpp:
2356         (WebCore::HTMLElement::parseAttribute):
2357         (WebCore::HTMLElement::isURLAttribute):
2358         * html/HTMLElement.h:
2359         * html/HTMLElement.idl:
2360         * html/HTMLEmbedElement.cpp:
2361         * html/HTMLEmbedElement.h:
2362         * html/HTMLIFrameElement.cpp:
2363         * html/HTMLIFrameElement.h:
2364         * html/HTMLImageElement.cpp:
2365         * html/HTMLImageElement.h:
2366         * html/HTMLLinkElement.cpp:
2367         * html/HTMLLinkElement.h:
2368         * html/HTMLMediaElement.cpp:
2369         * html/HTMLMediaElement.h:
2370         * html/HTMLMetaElement.cpp:
2371         * html/HTMLMetaElement.h:
2372         * html/HTMLObjectElement.cpp:
2373         * html/HTMLObjectElement.h:
2374         * html/HTMLPropertiesCollection.cpp: Removed.
2375         * html/HTMLPropertiesCollection.h: Removed.
2376         * html/HTMLPropertiesCollection.idl: Removed.
2377         * html/HTMLSourceElement.cpp:
2378         * html/HTMLSourceElement.h:
2379         * html/HTMLTrackElement.cpp:
2380         * html/HTMLTrackElement.h:
2381         * html/MicroDataAttributeTokenList.cpp: Removed.
2382         * html/MicroDataAttributeTokenList.h: Removed.
2383         * html/MicroDataItemValue.cpp: Removed.
2384         * html/MicroDataItemValue.h: Removed.
2385         * html/MicroDataItemValue.idl: Removed.
2386
2387 2013-08-06  Tim Horton  <timothy_horton@apple.com>
2388
2389         Remove PlatformCALayer::contentsTransform and ::setContentsTransform
2390         https://bugs.webkit.org/show_bug.cgi?id=119529
2391
2392         Reviewed by Sam Weinig.
2393
2394         No new tests, removing dead code.
2395
2396         These methods are not used and are currently unimplemented.
2397
2398         * platform/graphics/ca/PlatformCALayer.h:
2399         * platform/graphics/ca/mac/PlatformCALayerMac.mm:
2400         * platform/graphics/ca/win/PlatformCALayerWin.cpp:
2401
2402 2013-08-06  Alex Christensen  <achristensen@apple.com>
2403
2404         Moved GraphicsContext3DPrivate out of cairo directory to be used by the AppleWin port.
2405         https://bugs.webkit.org/show_bug.cgi?id=119525
2406
2407         Reviewed by Dean Jackson.
2408
2409         * GNUmakefile.list.am:
2410         * PlatformGTK.cmake:
2411         * WebCore.vcxproj/WebCore.vcxproj:
2412         * WebCore.vcxproj/WebCore.vcxproj.filters:
2413         Changed location of GraphicsContext3DPrivate.cpp and GraphicsContext3DPrivate.h.
2414         * platform/graphics/GraphicsContext3DPrivate.cpp: Copied from WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp.
2415         * platform/graphics/GraphicsContext3DPrivate.h: Copied from WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.h.
2416         * platform/graphics/cairo/GraphicsContext3DPrivate.cpp: Removed.
2417         * platform/graphics/cairo/GraphicsContext3DPrivate.h: Removed.
2418
2419 2013-08-06  Brent Fulgham  <bfulgham@apple.com>
2420
2421         [Windows] Unreviewed build correction after r153754 and r153757.
2422
2423         * page/animation/CSSPropertyAnimation.cpp:
2424         (WebCore::blendFunc): Don't force std::remainder, since we are using our own
2425         custom implementation on Windows.
2426
2427 2013-08-06  Brent Fulgham  <bfulgham@apple.com>
2428
2429         Improper Calculation of In-band Cue Colors
2430         https://bugs.webkit.org/show_bug.cgi?id=119523
2431
2432         Reviewed by Eric Carlson.
2433
2434         * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp:
2435         (WebCore::makeRGBA32FromARGBCFArray): Remove redundant multiplication by
2436         255.  The internal conversion logic already converts to bytes.
2437
2438 2013-08-06  Rob Buis  <rwlbuis@webkit.org>
2439
2440         Speculative build fix after r153754.
2441
2442         * page/animation/CSSPropertyAnimation.cpp:
2443         (WebCore::blendFunc):
2444
2445 2013-07-23  David Farler  <dfarler@apple.com>
2446
2447         Provide optional OTHER_CFLAGS, OTHER_CPPFLAGS, OTHER_LDFLAGS additions for building with ASAN
2448         https://bugs.webkit.org/show_bug.cgi?id=117762
2449
2450         Reviewed by Mark Rowe.
2451
2452         No new tests necessary.
2453
2454         * Configurations/DebugRelease.xcconfig:
2455         Add ASAN_OTHER_CFLAGS, CPLUSPLUSFLAGS, LDFLAGS.
2456         * Configurations/WebCore.xcconfig:
2457         Add ASAN_OTHER_LDFLAGS.
2458         * Configurations/WebCoreTestShim.xcconfig:
2459         Add ASAN_OTHER_LDFLAGS.
2460         * Configurations/WebCoreTestSupport.xcconfig:
2461         Add ASAN_OTHER_LDFLAGS.
2462         * WebCore.xcodeproj/project.pbxproj:
2463         Don't use ASAN for build tools.
2464
2465 2013-08-05  Rob Buis  <rwlbuis@webkit.org>
2466
2467         SVG stroke-dasharray is not animatable
2468         https://bugs.webkit.org/show_bug.cgi?id=118574
2469
2470         Reviewed by Dirk Schulze.
2471
2472         Make stroke-dasharray a property that can be animated using CSS transitions.
2473
2474         * page/animation/CSSPropertyAnimation.cpp:
2475         (WebCore::blendFunc):
2476         (WebCore::CSSPropertyAnimation::ensurePropertyMap):
2477         * rendering/style/RenderStyle.h:
2478
2479 2013-08-06  Sergio Villar Senin  <svillar@igalia.com>
2480
2481         [CSS Grid Layout] Allow defining named grid lines on the grid element
2482         https://bugs.webkit.org/show_bug.cgi?id=118255
2483
2484         Reviewed by Andreas Kling.
2485
2486         From Blink r149798 by <jchaffraix@chromium.org>
2487
2488         This change adds parsing, style resolution and getComputedStyle
2489         support for named grid lines at the grid element level
2490         (i.e. extends our <track-list> support). Per the specification, we
2491         allow multiple grid lines with the same name.
2492
2493         To fully support resolving the grid lines to a position on our
2494         grid, we need to add the parsing at the grid item's level (which
2495         means extending our <grid-line> support). This will be done in a
2496         follow-up change.
2497
2498         Test: fast/css-grid-layout/named-grid-line-get-set.html
2499
2500         * css/CSSComputedStyleDeclaration.cpp:
2501         (WebCore::addValuesForNamedGridLinesAtIndex):
2502         (WebCore::valueForGridTrackList):
2503         (WebCore::ComputedStyleExtractor::propertyValue):
2504         * css/CSSParser.cpp:
2505         (WebCore::CSSParser::parseGridTrackList):
2506         * css/StyleResolver.cpp:
2507         (WebCore::createGridTrackList):
2508         (WebCore::StyleResolver::applyProperty):
2509         * rendering/style/RenderStyle.h:
2510         * rendering/style/StyleGridData.cpp:
2511         (WebCore::StyleGridData::StyleGridData):
2512         * rendering/style/StyleGridData.h:
2513         (WebCore::StyleGridData::operator==):
2514
2515 2013-08-06  Allan Sandfeld Jensen  <allan.jensen@digia.com>
2516
2517         [Qt] Fix minimal build.
2518
2519         Unreviewed build fix.
2520
2521         Fix build witt XSLT disabled
2522
2523         * xml/parser/XMLDocumentParserLibxml2.cpp:
2524         (WebCore::hasNoStyleInformation):
2525
2526 2013-08-06  Zan Dobersek  <zdobersek@igalia.com>
2527
2528         webkit-gtk fails to build with bison-3.0
2529         https://bugs.webkit.org/show_bug.cgi?id=119373
2530
2531         Reviewed by Gustavo Noronha Silva.
2532
2533         * GNUmakefile.am: Remove rules for generating ANGLE's glslang source files with Bison.
2534
2535 2013-06-26  Sergio Villar Senin  <svillar@igalia.com>
2536
2537         [CSS Grid Layout] Add support for parsing <grid-line> that includes a 'span'
2538         https://bugs.webkit.org/show_bug.cgi?id=118051
2539
2540         Reviewed by Andreas Kling.
2541
2542         From Blink r148766 by <jchaffraix@chromium.org>
2543
2544         This adds the parsing, style resolution and getComputedStyle bits
2545         to our code. The rendering code was not made aware of the new type
2546         of GridPosition yet.
2547
2548         * css/CSSComputedStyleDeclaration.cpp:
2549         (WebCore::valueForGridPosition):
2550         * css/CSSParser.cpp:
2551         (WebCore::CSSParser::parseValue):
2552         (WebCore::CSSParser::parseGridPosition):
2553         * css/CSSParser.h:
2554         * css/CSSValueKeywords.in:
2555         * css/StyleResolver.cpp:
2556         (WebCore::StyleResolver::adjustRenderStyle):
2557         (WebCore::StyleResolver::adjustGridItemPosition):
2558         (WebCore::createGridPosition):
2559         * css/StyleResolver.h:
2560         * rendering/RenderGrid.cpp:
2561         (WebCore::RenderGrid::resolveGridPositionFromStyle):
2562         * rendering/style/GridPosition.h:
2563         (WebCore::GridPosition::isInteger):
2564         (WebCore::GridPosition::isSpan):
2565         (WebCore::GridPosition::setSpanPosition):
2566         (WebCore::GridPosition::spanPosition):
2567
2568 2013-06-25  Sergio Villar Senin  <svillar@igalia.com>
2569
2570         [CSS Grid Layout] Rename grid placement properties
2571         https://bugs.webkit.org/show_bug.cgi?id=117878
2572
2573         Reviewed by Andreas Kling.
2574
2575         Renamed the grid placement properties to match the latest version
2576         of the spec. The new names are -webkit-grid-column-{start|end} and
2577         -webkit-grid-row-{start|end}.
2578
2579         No new tests needed as we're just renaming some properties,
2580         functionality already covered by existing tests in
2581         fast/css-grid-layout.
2582
2583         * css/CSSComputedStyleDeclaration.cpp:
2584         (WebCore::ComputedStyleExtractor::propertyValue):
2585         * css/CSSParser.cpp:
2586         (WebCore::CSSParser::parseValue):
2587         * css/CSSProperty.cpp:
2588         (WebCore::CSSProperty::isInheritedProperty):
2589         * css/CSSPropertyNames.in:
2590         * css/StylePropertyShorthand.cpp:
2591         (WebCore::webkitGridColumnShorthand):
2592         (WebCore::webkitGridRowShorthand):
2593         * css/StyleResolver.cpp:
2594         (WebCore::StyleResolver::applyProperty):
2595         * rendering/RenderGrid.cpp:
2596         (WebCore::RenderGrid::maximumIndexInDirection):
2597         (WebCore::RenderGrid::resolveGridPositionsFromStyle):
2598         (WebCore::RenderGrid::resolveGridPositionFromStyle):
2599         * rendering/RenderGrid.h:
2600         * rendering/style/RenderStyle.h:
2601         * rendering/style/StyleGridItemData.cpp:
2602         (WebCore::StyleGridItemData::StyleGridItemData):
2603         * rendering/style/StyleGridItemData.h:
2604         (WebCore::StyleGridItemData::operator==):
2605
2606 2013-08-05  Przemyslaw Szymanski  <p.szymanski3@samsung.com>
2607
2608         [WebGL] validateRenderingState method name change
2609         https://bugs.webkit.org/show_bug.cgi?id=119485
2610
2611         According to validateRenderingState method functionality its name should be
2612         changed. This method validates only vertex attributes.
2613
2614         Reviewed by Dean Jackson.
2615
2616         No new tests. Covered by existing tests. No changes in functionality.
2617
2618         * html/canvas/WebGLRenderingContext.cpp:
2619         (WebCore::WebGLRenderingContext::validateVertexAttributes):
2620         (WebCore::WebGLRenderingContext::drawArrays):
2621         (WebCore::WebGLRenderingContext::drawElements):
2622         * html/canvas/WebGLRenderingContext.h:
2623
2624 2013-07-27  Mark Rowe  <mrowe@apple.com>
2625
2626         Logging should be configurable using human-readable channel names rather than crazy bitmasks
2627         <http://webkit.org/b/119031>
2628
2629         Implement shared logic for initializing logging channels based on human-readable channel names in WTF,
2630         and rework the WebCore, WebKit and WebKit2 logging initialization on top of it.
2631
2632         Logging channels may now be enabled by providing a comma-separated list of channel names, with the special
2633         "all" name enabling all channels. Channel names prefixed with a leading "-" will result in the named channel
2634         being disabled. For instance, specifying "all,-history,-loading" will result in all logging channels except
2635         for history and loading being enabled.
2636
2637         For OS X developers, this also changes the name of the user defaults used to enable logging. This is done to allow
2638         the old user defaults to remain set for those people that need to switch between version of WebKit before and
2639         after this change. Where the old user default keys were WebCoreLogLevel, WebKitLogLevel and WebKit2LogLevel,
2640         the new user default keys are WebCoreLogging, WebKitLogging and WebKit2Logging.
2641
2642         For GTK developers, this changes the separator used in the WEBKIT_DEBUG environment variable to a comma for
2643         consistency with the other platforms and to enable more code sharing.
2644
2645         While doing this work I've also taken the opportunity to eliminate the need to touch multiple files when
2646         adding a new logging channel. Now only the header in the relevant project needs to be updated.
2647
2648         Reviewed by Sam Weinig.
2649
2650         * GNUmakefile.list.am: Remove the now-unused InitializeLogging.h
2651         * Target.pri: Ditto.
2652         * WebCore.xcodeproj/project.pbxproj: Ditto.
2653         * platform/InitializeLogging.h: Removed. Ditto.
2654         * platform/Logging.cpp: Use WEBCORE_LOG_CHANNELS to define all of the channels.
2655         (WebCore::logChannelByName): Renamed to match our naming conventions. Calls through to the new WTF function
2656         to find a log channel rather than repeating the names of the log channels a further two times each.
2657         (WebCore::initializeLoggingChannelsIfNecessary): Pass the channels and the log level string to the new
2658         WTF function that handles the initialization.
2659         * platform/Logging.h: Declare a WEBCORE_LOG_CHANNELS macro that can be used to apply a preprocessor macro
2660         across the set of all logging channels. Use this macro to declare the logging channels.
2661         * platform/blackberry/LoggingBlackBerry.cpp:
2662         (WebCore::logLevelString): Pull the value out of the WEBKIT_DEBUG environment variable.
2663         * platform/efl/LoggingEfl.cpp:
2664         (WebCore::logLevelString): Pull the value out of the WEBKIT_DEBUG environment variable, and then prepend
2665         NotYetImplemented to it so that that channel will be enabled by default.
2666         * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
2667         (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink): Accommodate the rename to logChannelByName.
2668         * platform/gtk/LoggingGtk.cpp:
2669         (WebCore::logLevelString): Pull the value out of the WEBKIT_DEBUG environment variable, and then prepend
2670         NotYetImplemented to it so that that channel will be enabled by default.
2671         * platform/mac/LoggingMac.mm:
2672         (WebCore::logLevelString): Pull the value out of the WebCoreLogging user default key.
2673         * platform/qt/LoggingQt.cpp:
2674         (WebCore::logLevelString): Pull the value out of the QT_WEBKIT_LOG environment variable, and then prepend
2675         NotYetImplemented to it so that the channel will be enabled by default.
2676         * platform/win/LoggingWin.cpp:
2677         (WebCore::logLevelString): Pull the value out of the WebCoreLogging environment variable.
2678
2679 2013-08-05  Ryosuke Niwa  <rniwa@webkit.org>
2680
2681         Editor::updateMarkersForWordsAffectedByEditing(bool) shouldn't compute start and end of words when there are nor markers
2682         https://bugs.webkit.org/show_bug.cgi?id=119501
2683
2684         Reviewed by Enrica Casucci.
2685
2686         Exit early in updateMarkersForWordsAffectedByEditing before calling startOfWord and endOfWord if there are no document markers.
2687
2688         * dom/DocumentMarkerController.h:
2689         (WebCore::DocumentMarkerController::hasMarkers): Added.
2690         * editing/Editor.cpp:
2691         (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
2692
2693 2013-08-05  Dean Jackson  <dino@apple.com>
2694
2695         Update HTMLPreloadScanner to handle img srcset
2696         https://bugs.webkit.org/show_bug.cgi?id=119360
2697
2698         Reviewed by Sam Weinig.
2699
2700         This patch is a merge of similar patches from Yoav Weiss <yoav@yoav.ws>
2701         and Dean Jackson.
2702
2703         Test: fast/preloader/image-srcset.html
2704
2705         * html/HTMLImageElement.cpp:
2706         (WebCore::HTMLImageElement::parseAttribute): Move srcset parsing into
2707         HTMLParserIdioms, and call it when we hit src or srcset.
2708         * html/HTMLImageElement.h: Remove code that was moved to HTMLParserIdioms.
2709
2710         * html/parser/HTMLDocumentParser.cpp:
2711         (WebCore::HTMLDocumentParser::pumpTokenizer): Pass device scale into preloader.
2712         (WebCore::HTMLDocumentParser::insert):
2713
2714         * html/parser/HTMLPreloadScanner.cpp:
2715         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner): Takes device scale as a parameter.
2716         (WebCore::TokenPreloadScanner::StartTagScanner::processAttributes): Resolve between src and srcSet if necessary.
2717         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute): Add support for srcset attribute.
2718         (WebCore::TokenPreloadScanner::StartTagScanner::setUrlToLoad): New flag to indicate if we should
2719         replace any existing value.
2720         (WebCore::TokenPreloadScanner::TokenPreloadScanner): Takes device scale.
2721         (WebCore::TokenPreloadScanner::scanCommon): Pass device scale.
2722         (WebCore::HTMLPreloadScanner::HTMLPreloadScanner):
2723         * html/parser/HTMLPreloadScanner.h: New attribute to constructor for device scale. New member
2724         variable on TokenPreloadScanner that holds the srcset value.
2725
2726         * html/parser/HTMLParserIdioms.cpp:
2727         (WebCore::ImageWithScale::operator==): Used for sorting.
2728         (WebCore::compareByScaleFactor): Used for sorting.
2729         (WebCore::bestFitSourceForImageAttributes): New method that takes the code from HTMLImageElement
2730         for parsing src and srcset attributes, and finding the best match.
2731         * html/parser/HTMLParserIdioms.h:
2732
2733 2013-08-05  Oliver Hunt  <oliver@apple.com>
2734
2735         Move TypedArray implementation into JSC
2736         https://bugs.webkit.org/show_bug.cgi?id=119489
2737
2738         Reviewed by Filip Pizlo.
2739
2740         Update WebCore for new location of TypedArray implementation.
2741
2742         * ForwardingHeaders/runtime/ArrayBuffer.h: Added.
2743         * ForwardingHeaders/runtime/ArrayBufferView.h: Added.
2744         * ForwardingHeaders/runtime/Float32Array.h: Added.
2745         * ForwardingHeaders/runtime/Float64Array.h: Added.
2746         * ForwardingHeaders/runtime/Int16Array.h: Added.
2747         * ForwardingHeaders/runtime/Int32Array.h: Added.
2748         * ForwardingHeaders/runtime/Int8Array.h: Added.
2749         * ForwardingHeaders/runtime/IntegralTypedArrayBase.h: Added.
2750         * ForwardingHeaders/runtime/TypedArrayBase.h: Added.
2751         * ForwardingHeaders/runtime/Uint16Array.h: Added.
2752         * ForwardingHeaders/runtime/Uint32Array.h: Added.
2753         * ForwardingHeaders/runtime/Uint8Array.h: Added.
2754         * ForwardingHeaders/runtime/Uint8ClampedArray.h: Added.
2755         * Modules/webaudio/AnalyserNode.h:
2756         (WebCore::AnalyserNode::getFloatFrequencyData):
2757         (WebCore::AnalyserNode::getByteFrequencyData):
2758         (WebCore::AnalyserNode::getByteTimeDomainData):
2759         * Modules/webaudio/AsyncAudioDecoder.cpp:
2760         * Modules/webaudio/AsyncAudioDecoder.h:
2761         (WebCore::AsyncAudioDecoder::DecodingTask::audioData):
2762         * Modules/webaudio/AudioBuffer.h:
2763         * Modules/webaudio/AudioContext.cpp:
2764         * Modules/webaudio/AudioParam.h:
2765         * Modules/webaudio/AudioParamTimeline.h:
2766         * Modules/webaudio/PeriodicWave.h:
2767         * Modules/webaudio/RealtimeAnalyser.cpp:
2768         * Modules/webaudio/RealtimeAnalyser.h:
2769         * Modules/webaudio/ScriptProcessorNode.cpp:
2770         * Modules/webaudio/WaveShaperProcessor.h:
2771         * Modules/websockets/ThreadableWebSocketChannel.h:
2772         * Modules/websockets/WebSocket.cpp:
2773         * Modules/websockets/WebSocket.h:
2774         * Modules/websockets/WebSocketChannel.cpp:
2775         * Modules/websockets/WebSocketChannel.h:
2776         * Modules/websockets/WorkerThreadableWebSocketChannel.cpp:
2777         * Modules/websockets/WorkerThreadableWebSocketChannel.h:
2778         * WebCore.exp.in:
2779         * bindings/js/JSArrayBufferCustom.cpp:
2780         * bindings/js/JSArrayBufferViewHelper.h:
2781         * bindings/js/JSAudioContextCustom.cpp:
2782         * bindings/js/JSCryptoCustom.cpp:
2783         * bindings/js/JSDictionary.h:
2784         * bindings/js/JSFileReaderCustom.cpp:
2785         * bindings/js/JSWebGLRenderingContextCustom.cpp:
2786         * bindings/js/JSXMLHttpRequestCustom.cpp:
2787         * bindings/js/SerializedScriptValue.cpp:
2788         (WebCore::SerializedScriptValue::transferArrayBuffers):
2789         * bindings/js/SerializedScriptValue.h:
2790         * bindings/scripts/CodeGeneratorJS.pm:
2791         (AddIncludesForType):
2792         (GenerateHeader):
2793         (NativeToJSValue):
2794         * dom/MessageEvent.h:
2795         * fileapi/FileReader.cpp:
2796         * fileapi/FileReader.h:
2797         * fileapi/FileReaderLoader.cpp:
2798         * fileapi/FileReaderLoader.h:
2799         * fileapi/FileReaderSync.cpp:
2800         * fileapi/FileReaderSync.h:
2801         * fileapi/WebKitBlobBuilder.cpp:
2802         * fileapi/WebKitBlobBuilder.h:
2803         * html/HTMLMediaElement.cpp:
2804         * html/ImageData.h:
2805         * html/canvas/ArrayBuffer.idl:
2806         * html/canvas/ArrayBufferView.idl:
2807         * html/canvas/CanvasRenderingContext2D.cpp:
2808         * html/canvas/DataView.h:
2809         * html/canvas/Float32Array.idl:
2810         * html/canvas/Float64Array.idl:
2811         * html/canvas/Int16Array.idl:
2812         * html/canvas/Int32Array.idl:
2813         * html/canvas/Int8Array.idl:
2814         * html/canvas/Uint16Array.idl:
2815         * html/canvas/Uint32Array.idl:
2816         * html/canvas/Uint8Array.idl:
2817         * html/canvas/Uint8ClampedArray.idl:
2818         * html/canvas/WebGLBuffer.h:
2819         (WebCore::WebGLBuffer::elementArrayBuffer):
2820         * html/canvas/WebGLGetInfo.cpp:
2821         * html/canvas/WebGLGetInfo.h:
2822         * html/canvas/WebGLRenderingContext.cpp:
2823         * html/canvas/WebGLRenderingContext.h:
2824         * inspector/InspectorMemoryAgent.cpp:
2825         * page/Crypto.cpp:
2826         * page/Crypto.h:
2827         * platform/graphics/GraphicsContext3D.cpp:
2828         * platform/graphics/ImageBuffer.h:
2829         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2830         * platform/graphics/cg/ImageBufferDataCG.h:
2831         * platform/graphics/filters/FEBlend.cpp:
2832         * platform/graphics/filters/FEColorMatrix.cpp:
2833         * platform/graphics/filters/FEComponentTransfer.cpp:
2834         * platform/graphics/filters/FEComposite.cpp:
2835         * platform/graphics/filters/FEConvolveMatrix.cpp:
2836         * platform/graphics/filters/FECustomFilter.cpp:
2837         * platform/graphics/filters/FEDisplacementMap.cpp:
2838         * platform/graphics/filters/FEDropShadow.cpp:
2839         * platform/graphics/filters/FEGaussianBlur.cpp:
2840         * platform/graphics/filters/FELighting.h:
2841         * platform/graphics/filters/FEMorphology.cpp:
2842         * platform/graphics/filters/FETurbulence.cpp:
2843         * platform/graphics/filters/FilterEffect.cpp:
2844         * platform/graphics/filters/FilterEffect.h:
2845         * platform/graphics/mac/GraphicsContext3DMac.mm:
2846         * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
2847         * testing/Internals.h:
2848         * xml/XMLHttpRequest.cpp:
2849         * xml/XMLHttpRequest.h:
2850         (WebCore::XMLHttpRequest::optionalResponseArrayBuffer):
2851
2852 2013-08-05  Alexey Proskuryakov  <ap@apple.com>
2853
2854         <rdar://problem/14637103> REGRESSION (r153060?): Microphone appears in the way
2855         of text when dictating an e-mail
2856         https://bugs.webkit.org/show_bug.cgi?id=119496
2857
2858         Reviewed by Ryosuke Niwa.
2859
2860         Test: platform/mac/editing/input/firstrectforcharacterrange-caret-in-br.html
2861
2862         * rendering/RenderObject.cpp: (WebCore::RenderObject::absoluteBoundingBoxRectForRange):
2863         FloatRect::unite() doesn't preserve empty rects, which we need here.
2864         We alrady handle the case of collapsed range in Editor::firstRectForRange(), and
2865         this is similar, but we can't currently cover both with one simple fix.
2866
2867 2013-08-05  Morten Stenshorne  <mstensho@opera.com>
2868
2869         Region based columns not painted correctly in non-default writing-modes
2870         https://bugs.webkit.org/show_bug.cgi?id=118506
2871
2872         Reviewed by David Hyatt.
2873
2874         The column translation offset was calculated incorrectly.
2875         The dirty rect intersection check was also wrong.
2876
2877         Added some documentation, to make it clear what's going on.
2878
2879         Tests: fast/multicol/newmulticol/hide-box-horizontal-bt.html
2880                fast/multicol/newmulticol/hide-box-vertical-lr.html
2881                fast/multicol/newmulticol/hide-box-vertical-rl.html
2882
2883         * rendering/RenderMultiColumnSet.cpp:
2884         (WebCore::RenderMultiColumnSet::collectLayerFragments):
2885
2886 2013-08-05  Morten Stenshorne  <mstensho@opera.com>
2887
2888         Region based columns not clipped properly
2889         https://bugs.webkit.org/show_bug.cgi?id=118499
2890
2891         Reviewed by David Hyatt.
2892
2893         Need to call RenderRegion::overflowRectForFlowThreadPortion() first,
2894         and THEN clip in the column gaps. overflowRectForFlowThreadPortion()
2895         expands the logical left and right to the flow thread's overflow
2896         rectangle, effectively defeating inline direction clipping completely.
2897
2898         Tests: fast/multicol/newmulticol/clipping-overflow-hidden.html
2899                fast/multicol/newmulticol/clipping-top-overflow.html
2900                fast/multicol/newmulticol/clipping.html
2901
2902         * rendering/RenderMultiColumnSet.cpp:
2903         (WebCore::RenderMultiColumnSet::flowThreadPortionOverflowRect):
2904
2905 2013-08-05  Vivek Galatage  <vivek.vg@samsung.com>
2906
2907         XMLTreeViewer should be created only in the XML viewer mode
2908         https://bugs.webkit.org/show_bug.cgi?id=119483
2909
2910         Reviewed by Alexey Proskuryakov.
2911
2912         XMLTreeViewer is created even for the XSL transform which is avoided by the patch.
2913         The XMLTreeViewer::hasNoStyleInformation() is moved to XMLDocumentParserLibxml2.cpp
2914         as static inline method as XMLTreeViewer should not have the responsibility for it.
2915         Also removes an unnecessary conditional check while deciding for XML viewer mode.
2916
2917         Blink patch review links:
2918         https://codereview.chromium.org/19552003/
2919         https://codereview.chromium.org/22150003/
2920
2921         No new tests as the patch is about code refactoring.
2922
2923         * xml/XMLTreeViewer.cpp:
2924         * xml/XMLTreeViewer.h:
2925         * xml/parser/XMLDocumentParserLibxml2.cpp:
2926         (WebCore::hasNoStyleInformation):
2927         (WebCore::XMLDocumentParser::doEnd):
2928
2929 2013-08-03  Jer Noble  <jer.noble@apple.com>
2930
2931         Loading a video with a custom URL scheme will result in stalling playback
2932         https://bugs.webkit.org/show_bug.cgi?id=119469
2933
2934         Reviewed by Eric Carlson.
2935
2936         Break the assumption that only one AVAssetResourceRequest will be outstanding simultaneously
2937         by storing a HashMap of AVAssetResourceRequests and their resulting WebCoreAVFResourceLoader.
2938         When loading is stopped (due to completion or error), notify the MediaPlayerPrivateAVFoundation
2939         parent so that the map can be emptied.
2940
2941         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
2942         * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
2943         (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): Store the request
2944             in m_resourceLoaderMap.
2945         (WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Pull the request from
2946             m_resourceLoaderMap.
2947         (WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Remove the requset from
2948             m_resourceLoaderMap.
2949         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.h:
2950         * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
2951         (WebCore::WebCoreAVFResourceLoader::create): Return a PassRefPtr, rather than a PassOwnPtr.
2952         (WebCore::WebCoreAVFResourceLoader::stopLoading): Call didStopLoadingRequest.
2953
2954 2013-08-05  Abhijeet Kandalkar  <abhijeet.k@samsung.com>
2955
2956         Spatial Navigation should avoid unwanted calculation while deciding focus candidate.
2957         https://bugs.webkit.org/show_bug.cgi?id=117265
2958
2959         Reviewed by Antonio Gomes.
2960
2961         Spatial Navigation should consider only those nodes as candidate which are exactly in the focus-direction.
2962         e.g. If we are moving down then the nodes that are above CURRENT focused node should be considered as invalid.
2963         Added isValidCandidate() which checks whether node is exactly in the focus-direction.
2964
2965         Test: fast/spatial-navigation/snav-search-optimization.html
2966
2967         * page/FocusController.cpp:
2968         (WebCore::FocusController::findFocusCandidateInContainer):
2969         (WebCore::FocusController::advanceFocusDirectionally):
2970         * page/Page.cpp:
2971         (WebCore::Page::Page):
2972         * page/Page.h:
2973         (WebCore::Page::setLastSpatialNavigationCandidateCount):
2974         (WebCore::Page::lastSpatialNavigationCandidateCount):
2975         * page/SpatialNavigation.cpp:
2976         (WebCore::isValidCandidate):
2977         * page/SpatialNavigation.h:
2978         * testing/Internals.cpp:
2979         (WebCore::Internals::lastSpatialNavigationCandidateCount):
2980         * testing/Internals.h:
2981         * testing/Internals.idl:
2982
2983 2013-08-05  Mihai Tica  <mitica@adobe.com>
2984
2985         [CSS Background Blending] Specifying background-image and background-color
2986         with opaque image doesn't trigger blending. The fix consists of adding a
2987         check whether blend mode is set in hasOpaqueImage.
2988
2989         https://bugs.webkit.org/show_bug.cgi?id=119434
2990
2991         Reviewed by Dirk Schulze.
2992
2993         Test: css3/compositing/background-blend-mode-separate-layer-declaration.html
2994
2995         * rendering/style/FillLayer.cpp:
2996         (WebCore::FillLayer::hasOpaqueImage):
2997
2998 2013-08-04  Zalan Bujtas  <zalan@apple.com>
2999
3000         Background doesn't fully repaint when body has margins.
3001         https://bugs.webkit.org/show_bug.cgi?id=119033
3002
3003         Reviewed by Simon Fraser.
3004
3005         Ensure that background-color changes do not leave unpainted areas when
3006         body has margins.
3007
3008         Both <body> and <html> background-color get propagated up to the viewport.
3009         If <body> has background-color attribute set, while <html> doesn't, the color is
3010         applied not only on the <body> but on both the <html> and the viewport. However,
3011         it's not enough to mark the RenderView dirty because with tiles backing on,
3012         there could be areas outside of the viewport that need repaint. By marking
3013         the RenderView's graphics layer dirty instead, we ensure that all the related
3014         tiles get marked dirty too and the new background color covers all areas.
3015
3016         Manual test added. When forcing top-level composition on (even with embedded iframe to
3017         make sure we don't do paintsIntoWindow rendering), the test case execution changes so much,
3018         that the repaint rects don't reflect the functionality difference anymore.
3019
3020         * page/FrameView.cpp:
3021         (WebCore::FrameView::reset):
3022         (WebCore::FrameView::layout):
3023         * page/FrameView.h:
3024         (WebCore::FrameView::needsFullRepaint):
3025         * rendering/RenderBox.cpp:
3026         (WebCore::RenderBox::styleWillChange):
3027         * rendering/RenderObjectChildList.cpp:
3028         (WebCore::RenderObjectChildList::removeChildNode):
3029         * rendering/RenderView.cpp:
3030         (WebCore::RenderView::repaintRootContents):
3031         (WebCore::RenderView::repaintViewAndCompositedLayers):
3032         * rendering/RenderView.h:
3033
3034 2013-08-04  Andreas Kling  <akling@apple.com>
3035
3036         Document needn't expose its active element.
3037         <http://webkit.org/b/119466>
3038
3039         Reviewed by Antonio Gomes.
3040
3041         The Document::m_activeElement pointer is only used inside updateHoverActiveState(),
3042         so we can remove the activeElement()/setActiveElement() accessors.
3043
3044         * dom/Document.h:
3045         * dom/Document.cpp:
3046         (WebCore::Document::updateHoverActiveState):
3047
3048 2013-08-04  Andreas Kling  <akling@apple.com>
3049
3050         Inserting a rule into an empty style sheet shouldn't trigger style recalc unless necessary.
3051         <http://webkit.org/b/119475>
3052         <rdar://problem/14643481>
3053
3054         Reviewed by Antti Koivisto.
3055
3056         This is kind of a cheesy optimization, but it turns out that the use case is quite common.
3057         The pattern goes like this:
3058
3059             (1) Create <style> element.
3060             (2) Add it to the document's <head>.
3061             (3) .addRule() one rule through the CSSOM API.
3062
3063         Prior to this patch, (3) would always cause a full (deferred) style recalc.
3064
3065         Now that we exclude empty style sheets from the document's (effective) active set,
3066         we can piggyback on the style invalidation analysis when transitioning from an empty
3067         sheet to a single-rule sheet.
3068
3069         In other words, add a special code path for the first rule insertion into an empty,
3070         in-document style sheet to minimize the amount of invalidation that happens.
3071
3072         * css/CSSStyleSheet.cpp:
3073         (WebCore::CSSStyleSheet::didMutateRules):
3074         (WebCore::CSSStyleSheet::insertRule):
3075         * css/CSSStyleSheet.h:
3076         (WebCore::CSSStyleSheet::RuleMutationScope::RuleMutationScope):
3077         (WebCore::CSSStyleSheet::RuleMutationScope::~RuleMutationScope):
3078
3079 2013-08-04  Claudio Saavedra  <csaavedra@igalia.com>
3080
3081         [GTK] Fix a C++11 warning.
3082
3083         Rubber-stamped by Martin Robinson.
3084
3085         * platform/gtk/FileSystemGtk.cpp:
3086         (WebCore::sharedResourcesPath): Fix a C++11 warning.
3087
3088 2013-08-04  Diego Pino Garcia  <dpino@igalia.com>
3089
3090         [GTK] Remove legacy hack in CodeGeneratorGObject.pm
3091         https://bugs.webkit.org/show_bug.cgi?id=117545
3092
3093         Reviewed by Carlos Garcia Campos.
3094
3095         There's a checking that sets gtype to uint in case it's ushort. gtype 
3096         is a value obtained from GetGValueTypeName(), which never returns 
3097         ushort.
3098
3099         * bindings/scripts/CodeGeneratorGObject.pm:
3100         (GenerateProperty): remove unnecessary glitch
3101
3102 2013-08-04  Andreas Kling  <akling@apple.com>
3103
3104         [Mac] Disable screen font substitution at WebCore-level in OS X 10.9+
3105         <http://webkit.org/b/119474>
3106         <rdar://problem/14643349>
3107
3108         Reviewed by Dan Bernstein.
3109
3110         Disable screen font substitution by default in Settings so internal WebCore clients
3111         such as SVG-as-image will get the right default setting.
3112
3113         * page/Settings.cpp:
3114         (WebCore::Settings::Settings):
3115         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault):
3116         (WebCore::Settings::setScreenFontSubstitutionEnabled):
3117         * page/Settings.h:
3118         (WebCore::Settings::screenFontSubstitutionEnabled):
3119         * page/Settings.in:
3120         * page/mac/SettingsMac.mm:
3121         (WebCore::Settings::shouldEnableScreenFontSubstitutionByDefault):
3122
3123 2013-08-03  Tim Horton  <timothy_horton@apple.com>
3124
3125         Refine the unavailable plug-in indicator
3126         https://bugs.webkit.org/show_bug.cgi?id=119400
3127         <rdar://problem/14616012>
3128
3129         Reviewed by Oliver Hunt.
3130
3131         Add a border, flip the text and background colors, and make the indicator
3132         much higher contrast, to be more visible on a variety of sites.
3133         Also, refine the arrow to be less blocky and inlaid inside a circle.
3134
3135         * rendering/RenderEmbeddedObject.cpp:
3136         (WebCore::replacementTextRoundedRectPressedColor):
3137         (WebCore::replacementTextRoundedRectColor):
3138         (WebCore::replacementTextColor):
3139         (WebCore::unavailablePluginBorderColor):
3140         (WebCore::drawReplacementArrow):
3141         (WebCore::RenderEmbeddedObject::paintReplaced):
3142         (WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
3143         (WebCore::RenderEmbeddedObject::unavailablePluginIndicatorBounds):
3144         (WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
3145         * rendering/RenderEmbeddedObject.h:
3146
3147 2013-08-03  Yoav Weiss  <yoav@yoav.ws>
3148
3149         PreloadScanner preloads external CSS with non-matching media attribute
3150         https://bugs.webkit.org/show_bug.cgi?id=106198
3151
3152         Reviewed by Dean Jackson.
3153
3154         Test: http/tests/loading/preload-css-test.html
3155
3156         * html/parser/HTMLPreloadScanner.cpp:
3157         Remove m_linkMediaAttributeIsScreen
3158         Remove MediaQueryEvaluator calls
3159         Add m_mediaAttribute that gets the value of the "media" attribute
3160         Pass m_mediaAttribute to PreloadRequest
3161         (WebCore::TokenPreloadScanner::StartTagScanner::StartTagScanner):
3162         (WebCore::TokenPreloadScanner::StartTagScanner::createPreloadRequest):
3163         (WebCore::TokenPreloadScanner::StartTagScanner::processAttribute):
3164         (WebCore::TokenPreloadScanner::StartTagScanner::resourceType):
3165         (WebCore::TokenPreloadScanner::StartTagScanner::shouldPreload):
3166         * html/parser/HTMLResourcePreloader.cpp:
3167         Add MediaQueryEvaluator calls to see if "media" matches
3168         Perform preload only to resource with a matching media (if media exists)
3169         (WebCore::PreloadRequest::isSafeToSendToAnotherThread):
3170         (WebCore::mediaAttributeMatches):
3171         (WebCore::HTMLResourcePreloader::preload):
3172         * html/parser/HTMLResourcePreloader.h:
3173         Add a constructor with a mediaAttribute value
3174         Add m_mediaAttribute & its getter.
3175         (WebCore::PreloadRequest::create):
3176         (WebCore::PreloadRequest::media):
3177         (WebCore::PreloadRequest::PreloadRequest):
3178
3179 2013-08-03  Andreas Kling  <akling@apple.com>
3180
3181         RenderBoxModelObject::firstLetterRemainingText should be a RenderTextFragment*.
3182         <http://webkit.org/b/119181>
3183
3184         Reviewed by Sam Weinig.
3185
3186         De-generalize this code a bit since we know that the firstLetterRemainingText() is always
3187         going to be a RenderTextFragment.
3188
3189         * rendering/RenderBoxModelObject.h:
3190         * rendering/RenderBoxModelObject.cpp:
3191         (WebCore::RenderBoxModelObject::firstLetterRemainingText):
3192         (WebCore::RenderBoxModelObject::setFirstLetterRemainingText):
3193
3194             Make these two deal in RenderTextFragment*.
3195
3196         * rendering/RenderBlock.cpp:
3197         (WebCore::RenderBlock::updateFirstLetterStyle):
3198
3199             Tighten up some pointer types so we don't have to cast as much.
3200
3201 2013-08-02  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
3202
3203         Introduce toSVGMaskElement(), and use it
3204         https://bugs.webkit.org/show_bug.cgi?id=119443
3205
3206         Reviewed by Andreas Kling.
3207
3208         As a step to change static_cast with toSVGXXX, static_cast<SVGMaskElement*> can
3209         be changed with toSVGMaskElement().
3210
3211         Blink merge from https://src.chromium.org/viewvc/blink?view=rev&revision=155432
3212
3213         * rendering/svg/RenderSVGResourceMasker.cpp:
3214         (WebCore::RenderSVGResourceMasker::applyResource):
3215         (WebCore::RenderSVGResourceMasker::resourceBoundingBox):
3216         * rendering/svg/RenderSVGResourceMasker.h:
3217         * svg/SVGMaskElement.h:
3218         (WebCore::toSVGMaskElement):
3219
3220 2013-08-02  Benjamin Poulain  <bpoulain@apple.com>
3221
3222         REGRESSION (r153005): Crash in SpaceSplitString::spaceSplitStringContainsValue on Facebook
3223         https://bugs.webkit.org/show_bug.cgi?id=119384
3224
3225         Reviewed by Alexey Proskuryakov.
3226
3227         When removing the "rel" attribute from HTMLAnchorElement, we parse the attribute for no value.
3228         Following r153005, we no longer checked for null String, which caused a crash in that case.
3229
3230         Creating a SpaceSplitString from a null string causes the SpaceSplitString to be null. In that case
3231         SpaceSplitString::contains() would always return false.
3232         This patch modify SpaceSplitString::spaceSplitStringContainsValue() to follow the exact same
3233         behavior.
3234
3235         Test: fast/dom/HTMLAnchorElement/remove-rel-attribute.html
3236
3237         * dom/SpaceSplitString.cpp:
3238         (WebCore::SpaceSplitString::spaceSplitStringContainsValue):
3239
3240 2013-08-02  Dean Jackson  <dino@apple.com>
3241
3242         Force elements with perspective or preserve-3d to disallow direct composited backgrounds
3243         https://bugs.webkit.org/show_bug.cgi?id=119462
3244         <rdar://problem/14607548>
3245
3246         Reviewed by Simon Fraser.
3247
3248         Bug 119461 (http://wkb.ug/119461) describes how a directly composited
3249         background color can intersect with its children. It's not clear exactly
3250         what the best way to fix that is, but for the moment we should disallow
3251         any element that has perspective or a preserve-3d transform style from
3252         getting a directly composited background.
3253
3254         Test: compositing/background-color/no-composited-background-color-when-perspective.html
3255
3256         * rendering/RenderLayerBacking.cpp:
3257         (WebCore::hasPerspectiveOrPreserves3D): New static helper.
3258         (WebCore::supportsDirectBoxDecorationsComposition): Return false if the above function is true.
3259
3260 2013-08-02  Oliver Hunt  <oliver@apple.com>
3261
3262         Update binding test results
3263
3264         * bindings/scripts/test/JS/JSFloat64Array.cpp:
3265         (WebCore::JSFloat64Array::getOwnPropertySlot):
3266         (WebCore::JSFloat64Array::getOwnPropertySlotByIndex):
3267         * bindings/scripts/test/JS/JSTestCustomNamedGetter.cpp:
3268         (WebCore::JSTestCustomNamedGetter::getOwnPropertyDescriptor):
3269         * bindings/scripts/test/JS/JSTestEventTarget.cpp:
3270         (WebCore::JSTestEventTarget::getOwnPropertyDescriptor):
3271
3272 2013-08-02  Gavin Barraclough  <barraclough@apple.com>
3273
3274         Remove no-arguments constructor to PropertySlot
3275         https://bugs.webkit.org/show_bug.cgi?id=119460
3276
3277         Reviewed by Geoff Garen.
3278
3279         This constructor was unsafe if getValue is subsequently called,
3280         and the property is a getter. Simplest to just remove it.
3281
3282         * bindings/js/JSDOMWindowCustom.cpp:
3283         (WebCore::JSDOMWindow::getOwnPropertyDescriptor):
3284         (WebCore::DialogHandler::returnValue):
3285         * bindings/js/JSHistoryCustom.cpp:
3286         (WebCore::JSHistory::getOwnPropertyDescriptorDelegate):
3287         * bindings/js/JSLocationCustom.cpp:
3288         (WebCore::JSLocation::getOwnPropertyDescriptorDelegate):
3289         * bindings/js/JSPluginElementFunctions.cpp:
3290         (WebCore::runtimeObjectCustomGetOwnPropertyDescriptor):
3291         * bindings/js/JSStorageCustom.cpp:
3292         (WebCore::JSStorage::deleteProperty):
3293         (WebCore::JSStorage::putDelegate):
3294         * bindings/scripts/CodeGeneratorJS.pm:
3295         (GenerateGetOwnPropertyDescriptorBody):
3296         * bridge/runtime_array.cpp:
3297         (JSC::RuntimeArray::getOwnPropertyDescriptor):
3298         * bridge/runtime_method.cpp:
3299         (JSC::RuntimeMethod::getOwnPropertyDescriptor):
3300         * bridge/runtime_object.cpp:
3301         (JSC::Bindings::RuntimeObject::getOwnPropertyDescriptor):
3302
3303 2013-08-02  Andreas Kling  <akling@apple.com>
3304
3305         Removing a <link> element with an empty stylesheet shouldn't trigger style recalc.
3306         <http://webkit.org/b/119442>
3307         <rdar://problem/14631785>
3308
3309         Reviewed by Antti Koivisto.
3310
3311         Let Document decide whether or not to do a style recalc after a <link> element is removed.
3312         This avoids unnecessary work when removing a <link> that refers to an empty style sheet.
3313
3314         Some Facebook pages have a <link rel="stylesheet" href="data:text/css;base64,"> that gets
3315         removed during the initial page load, causing style recalc.
3316
3317         * html/HTMLLinkElement.cpp:
3318         (WebCore::HTMLLinkElement::removedFrom):
3319
3320             Use DeferRecalcStyleIfNeeded. Since the style sheet is being removed, it will either
3321             cause a recalc (because it's no longer in the set of active sheets) or do nothing.
3322
3323 2013-08-02  Patrick Gansterer  <paroga@webkit.org>
3324
3325         Remove WebCore folder from include statements
3326         https://bugs.webkit.org/show_bug.cgi?id=119438
3327
3328         Reviewed by Darin Adler.
3329
3330         This aligns the style of the changed files with the other WebCore code.
3331
3332         * platform/network/curl/CurlDownload.cpp:
3333         * platform/network/curl/CurlDownload.h:
3334
3335 2013-08-02  Ryosuke Niwa  <rniwa@webkit.org>
3336
3337         FormAssociatedElement shouldn't create out-of-tree FormAttributeTargetObserver
3338         https://bugs.webkit.org/show_bug.cgi?id=119309
3339
3340         Reviewed by Kent Tamura.
3341
3342         Merge https://chromium.googlesource.com/chromium/blink/+/6fbdcbf311de539107bc28711b3f7a527176e97b.
3343
3344         I'm not merging the test since the attached test case only works when the shadow DOM API is enabled.
3345
3346         * html/FormAssociatedElement.cpp:
3347         (WebCore::FormAssociatedElement::formAttributeChanged):
3348         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
3349
3350 2013-08-02  Christophe Dumez  <ch.dumez@sisa.samsung.com>
3351
3352         compareDocumentPosition() should report PRECEDING or FOLLOWING information even if nodes are disconnected
3353         https://bugs.webkit.org/show_bug.cgi?id=119316
3354
3355         Reviewed by Ryosuke Niwa.
3356
3357         As per the latest specification, compareDocumentPosition() should report PRECEDING or FOLLOWING
3358         information even if nodes are disconnected:
3359         - http://dom.spec.whatwg.org/#dom-node-comparedocumentposition
3360
3361         This behavior is consistent with both IE10, Firefox 22 and since recently Blink.
3362
3363         No new tests, covered by existing tests.
3364
3365         * dom/Node.cpp:
3366         (WebCore::compareDetachedElementsPosition):
3367         (WebCore::Node::compareDocumentPosition):
3368
3369 2013-08-02  Simon Fraser  <simon.fraser@apple.com>
3370
3371         Revert r153632, since it caused fast/forms/change-form-element-document-crash.html
3372         to assert.
3373
3374         * html/FormAssociatedElement.cpp:
3375         (WebCore::FormAssociatedElement::formAttributeChanged):
3376         (WebCore::FormAssociatedElement::resetFormAttributeTargetObserver):
3377
3378 2013-08-02  Mario Sanchez Prada  <mario.prada@samsung.com>
3379
3380         Implement atk_text_get_text_*_offset for WORD
3381         https://bugs.webkit.org/show_bug.cgi?id=114871
3382
3383         Reviewed by Martin Robinson.
3384
3385         Re-implement this functions without using GailTextUtil nor Pango.
3386
3387         * accessibility/atk/WebKitAccessibleInterfaceText.cpp:
3388         (textForObject): Made the parameter a const, to avoid warnings.
3389         (getSelectionOffsetsForObject): Add special cases for END boundaries.
3390         (emptyTextSelectionAtOffset): Convenience function to be used in
3391         early returns from functions returning both text and offsets.
3392         (webkitAccessibleTextGetChar): Use emptyTextSelectionAtOffset(),
3393         and remove checks that are now done outside of this function, in
3394         webkitAccessibleTextGetTextForOffset().
3395         (nextWordStartPosition): Helper function to reliably find the
3396         start of the next word as and user would do it by navigating with
3397         Ctrl and the arrows (considering spaces and punctuation).
3398         (previousWordEndPosition): Similar to nextWordStartPosition, but
3399         written to help find the end of the previous one.
3400         (wordAtPositionForAtkBoundary): Helper function to find the word
3401         at a given position considering values of AtkTextBoundary.
3402         (numberOfReplacedElementsBeforeOffset): Helper function to help
3403         figure out how many embedded objects we have exposed for an
3404         AtkText object, used to adjust offsets coming from outside.
3405         (webkitAccessibleTextGetWordForBoundary): New function,
3406         implementing atk_text_get_text_*_offset for WORD.
3407         (webkitAccessibleTextGetTextForOffset): Replace usage of Gail for
3408         WORD boundaries with webkitAccessibleTextGetWordForBoundary().
3409         Also, moved the initialization of the start and end offsets to the
3410         bottom, into the gail/pango section, since those values will be
3411         from now on initialized in getSelectionOffsetsForObject().
3412         (webkitAccessibleTextGetSelection): Removed the initialization of
3413         the start and end offsets, since those values will be from now on
3414         initialized in getSelectionOffsetsForObject().
3415
3416 2013-08-02  Zoltan Arvai  <zarvai@inf.u-szeged.hu>
3417
3418         Buildfix for !ENABLE(SVG) platforms after r153581.
3419         https://bugs.webkit.org/show_bug.cgi?id=119444
3420
3421         Reviewed by Andreas Kling.
3422
3423         Adding missing guards.
3424
3425         * css/StylePropertyShorthand.cpp:
3426         (WebCore::matchingShorthandsForLonghand):
3427         * css/StylePropertyShorthand.h:
3428
3429 2013-08-02  Brady Eidson  <beidson@apple.com>
3430
3431         REGRESSION (r130783): Scrolling is broken going back to a cached page from a page that still has outstanding subresources.
3432         <rdar://problem/14601124> and https://bugs.webkit.org/show_bug.cgi?id=119416
3433
3434         Reviewed by Darin Adler.
3435
3436         Test: http/tests/loading/unfinished-load-back-to-cached-page-callbacks.html
3437
3438         * loader/DocumentLoader.cpp:
3439         (WebCore::DocumentLoader::stopLoading): Always explicitly cancel the Document parser when stopLoading is called.
3440
3441 2013-08-02  Antoine Quint  <graouts@apple.com>
3442
3443         <input type="search"> doesn't correctly handle the "size" attribute
3444         https://bugs.webkit.org/show_bug.cgi?id=119174
3445
3446         We weren't taking into account the decorations for search fields (results and close buttons)
3447         when computing the preferred logical width for these fields based on the "size" attribute
3448         and as a result we would not guarantee that we could show the number of characters set by
3449         the "size" attribute.
3450
3451         To make the process of reporting extra width due to decorations cleaner, we add a new decorationWidth()
3452         method for InputType subclasses to override and called through HTMLInputElement::decorationWidth()
3453         and have NumberInputType and SearchInputType return custom decoration widths.
3454
3455         Reviewed by Darin Adler.
3456
3457         Test: fast/forms/search/search-size-with-decorations.html
3458
3459         * html/HTMLInputElement.cpp:
3460         (WebCore::HTMLInputElement::decorationWidth):
3461         * html/HTMLInputElement.h:
3462         * html/InputType.cpp:
3463         (WebCore::InputType::decorationWidth):
3464         * html/InputType.h:
3465         Expose a new method to get the width for the input's decoration through the InputType.
3466
3467         * html/NumberInputType.cpp:
3468         (WebCore::NumberInputType::decorationWidth):
3469         * html/NumberInputType.h:
3470         Override InputType::decorationWidth() to return the decoration width for a number input
3471         using the same code previously used in RenderTextControlSingleLine::preferredContentLogicalWidth().
3472
3473         * html/SearchInputType.cpp: