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