Reviewed by Mark Rowe.
[WebKit-https.git] / WebCore / ChangeLog
1 2007-12-28  Dan Bernstein  <mitz@apple.com>
2
3         Reviewed by Mark Rowe.
4
5         - fix http://bugs.webkit.org/show_bug.cgi?id=16650
6           <rdar://problem/5664872> REGRESSION (r28278-r28314): ATSUI uses LTR writing direction for all text runs
7
8         Covered by existing pixel tests.
9
10         * platform/graphics/mac/FontMac.mm:
11         (WebCore::Font::drawComplexText): Corrected to maintain the style
12         information in the adjusted text run when passing it to
13         ATSUILayoutParameters. Prior to r28298 the style was passed separately.
14
15 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
16
17         Build fix, not reviewed.
18
19         Add wtf/OwnPtr.h include, to fix --svg-fonts build.
20
21         * css/SVGCSSFontFace.h:
22
23 2007-12-29  Nikolas Zimmermann  <zimmermann@kde.org>
24
25         Reviewed by Eric.
26
27         Fixes: http://bugs.webkit.org/show_bug.cgi?id=10649 (WebKit SVG needs SVG Fonts support)
28
29         Begin implementation of SVG Fonts module. Basic documents using SVG Fonts already work.
30         Only local, in-document fonts who declare their glyphs using the <glyph d="..."> path syntax
31         are supported. (<glyph> containing arbitary SVG content as child elements, not supported yet).
32
33         Limited to single char <-> glyph mapping, no ligatures supported yet.
34         (ie. <glyph unicode='A'/> <glyph unicode='AB'/> - it ignores the 'AB' glyph definition for now)
35
36         Mark all SVG Font related classes & usages in ENABLE(SVG_FONTS) blocks.
37
38         No layout test changes for a --no-svg-fonts build, heavy changes if enabled. Because a lot of SVG Font
39         attributes are not processed yet, the rendering looks wrong - hence disabled by default.)
40
41         * DerivedSources.make: Add SVGFontElement/SVGGlyphElement/SVGMissingGlyphElement
42         * WebCore.pro: Updated build system.
43         * WebCore.vcproj/WebCore.vcproj: Ditto.
44         * WebCore.xcodeproj/project.pbxproj: Ditto.
45         * bindings/js/JSSVGElementWrapperFactory.cpp: Add JSSVGFontElement/JSSVGGlyphElement/JSSVGMissingGlyphElement
46         * bindings/objc/DOM.mm: Ditto (for DOMSVG*).
47         (WebCore::createElementClassMap):
48         * bindings/objc/DOMInternal.h: Ditto.
49         * bindings/objc/DOMSVG.h: Ditto.
50         * css/CSSFontFace.h: Mark three functions 'virtual', to be overriden by SVGCSSFontFace
51         * css/CSSFontFaceSrcValue.h: Add functionality to identify as SVG CSS font face source.
52         (WebCore::CSSFontFaceSrcValue::m_fontFaceElement): Hold a pointer to the font face which created it.
53         (WebCore::CSSFontFaceSrcValue::svgFontFaceElement):
54         (WebCore::CSSFontFaceSrcValue::setSVGFontFaceElement):
55         * css/CSSFontSelector.cpp: Build 'SVGCSSFontFace' objects for local, in-document SVG fonts.
56         (WebCore::CSSFontSelector::addFontFaceRule):
57         * css/SVGCSSFontFace.cpp: Added. (Simplified implementation for SVG Fonts)
58         (WebCore::SVGCSSFontFace::SVGCSSFontFace):
59         (WebCore::SVGCSSFontFace::~SVGCSSFontFace):
60         (WebCore::SVGCSSFontFace::isValid):
61         (WebCore::SVGCSSFontFace::addSource):
62         (WebCore::SVGCSSFontFace::getFontData):
63         * css/SVGCSSFontFace.h: Added.
64         * platform/graphics/cg/PathCG.cpp:
65         (WebCore::Path::closeSubpath): Silence a CG warning when calling closeSubpath() on empty path.
66         * platform/graphics/Font.cpp: Add some logic to call into SVG Font code when operating on SVG Fonts.
67         (WebCore::Font::ascent): Pass font size to FontData::ascent() call
68         (WebCore::Font::descent): Pass font size to FontData::descent() call
69         (WebCore::Font::canUseGlyphCache): Always return true for SVG fonts here.
70         (WebCore::Font::drawGlyphBuffer): Call drawGlyphsWithSVGFont (instead of drawGlyphs) if the primary font is a SVG font.
71         * platform/graphics/Font.h: Add (SVG-only!) ability to store a RenderObject pointer, to the element which invoked the drawText() call.
72         (WebCore::TextRun::TextRun):
73         (WebCore::TextRun::referencingRenderObject):
74         (WebCore::TextRun::setReferencingRenderObject):
75         * platform/graphics/FontData.cpp:
76         (WebCore::FontData::FontData):
77         (WebCore::FontData::ascent):
78         (WebCore::FontData::descent):
79         * platform/graphics/FontData.h: Store a pointer to the SVGFontFaceElement, which created this FontData object - needed for drawGlyphsWithSVGFont().
80         (WebCore::FontData::isSVGFont): Offer a way to determine wheter this is a FontData object, created by a SVGFontFaceElement.
81         (WebCore::FontData::svgFontFace):
82         * rendering/SVGInlineTextBox.cpp:
83         (WebCore::SVGInlineTextBox::calculateGlyphWidth): Add assertion.
84         * rendering/SVGRootInlineBox.cpp:
85         (WebCore::svgTextRunForInlineTextBox): Always call 'setReferencingRenderObject(myRenderSVGText)' on the new TextRun
86         * svg/SVGFont.cpp: Added.
87         (WebCore::Font::drawGlyphsWithSVGFont): Outsourced implementation of SVG Fonts into it's own file.
88         * svg/SVGFontElement.cpp: Added. (Note: this holds the GlyphHashMap which associates certain <glyph> objects with unicode values)
89         (WebCore::SVGFontElement::SVGFontElement):
90         (WebCore::SVGFontElement::~SVGFontElement):
91         (WebCore::SVGFontElement::parseMappedAttribute):
92         (WebCore::SVGFontElement::collectGlyphs):
93         (WebCore::SVGFontElement::glyphIdentifierForGlyphCode):
94         * svg/SVGFontElement.h: Added.
95         (WebCore::GlyphHash::hash):
96         (WebCore::GlyphHash::equal):
97         (WebCore::GlyphHashTraits::deletedValue):
98         (WebCore::SVGFontElement::rendererIsNeeded):
99         (WebCore::SVGFontElement::contextElement):
100         * svg/SVGFontElement.idl: Added.
101         * svg/SVGFontFaceElement.cpp: Build SVG specific 'FontData' object
102         (WebCore::SVGFontFaceElement::unitsPerEm):
103         (WebCore::SVGFontFaceElement::fontFamily):
104         (WebCore::SVGFontFaceElement::createFontData): Builds SVG specified 'FontData' object with the markup specified ascent/descent values etc..
105         (WebCore::SVGFontFaceElement::rebuildFontFace): Construct CSSFontFaceSrc object (marked as 'isSVGFontFaceSrc') to satisfy CSSFontSelector::addFontFaceRule.
106         (WebCore::SVGFontFaceElement::insertedIntoDocument): Rebuild font face.
107         (WebCore::SVGFontFaceElement::glyphIdentifierForGlyphCode): Allows drawGlyphsWithSVGFont to access the glyph hash map living in the SVGFontElement.
108         * svg/SVGFontFaceElement.h: Fixed code formatting issues & wrap in ENABLE(SVG_FONTS) blocks.
109         * svg/SVGFontFaceElement.idl: Ditto.
110         * svg/SVGFontFaceFormatElement.cpp: Ditto.
111         * svg/SVGFontFaceFormatElement.h: Ditto.
112         * svg/SVGFontFaceFormatElement.idl: Ditto.
113         * svg/SVGFontFaceNameElement.cpp: Ditto.
114         * svg/SVGFontFaceNameElement.h: Ditto.
115         * svg/SVGFontFaceNameElement.idl: Ditto.
116         * svg/SVGFontFaceSrcElement.cpp: Ditto.
117         * svg/SVGFontFaceSrcElement.h: Ditto.
118         * svg/SVGFontFaceSrcElement.idl: Ditto.
119         * svg/SVGFontFaceUriElement.cpp: Ditto.
120         * svg/SVGFontFaceUriElement.h: Ditto.
121         * svg/SVGFontFaceUriElement.idl: Ditto.
122         * svg/SVGDefinitionSrcElement.cpp: Ditto.
123         * svg/SVGDefinitionSrcElement.h: Ditto.
124         * svg/SVGDefinitionSrcElement.idl: Ditto.
125         * svg/SVGGlyphElement.cpp: Added.
126         (WebCore::SVGGlyphElement::SVGGlyphElement):
127         (WebCore::SVGGlyphElement::parseMappedAttribute):
128         (WebCore::SVGGlyphElement::childrenChanged):
129         * svg/SVGGlyphElement.h: Added.
130         (WebCore::SVGGlyphElement::rendererIsNeeded):
131         (WebCore::SVGGlyphIdentifier::): Structure holding all data to represent a SVG glyph (origin, advance, orientation etc..)
132         (WebCore::SVGGlyphIdentifier::SVGGlyphIdentifier):
133         * svg/SVGGlyphElement.idl: Added.
134         * svg/SVGMissingGlyphElement.cpp: Added. (stub implementation)
135         (WebCore::SVGMissingGlyphElement::SVGMissingGlyphElement):
136         (WebCore::SVGMissingGlyphElement::parseMappedAttribute):
137         (WebCore::SVGMissingGlyphElement::childrenChanged):
138         * svg/SVGMissingGlyphElement.h: Added.
139         (WebCore::SVGMissingGlyphElement::rendererIsNeeded):
140         * svg/SVGMissingGlyphElement.idl: Added.
141         * svg/svgtags.in: Wrap all SVGFont* elements in ENABLE(SVG_FONTS) block - to assure --no-svg-fonts compilation works (which is the default for now!).
142
143 2007-12-27  Dan Bernstein  <mitz@apple.com>
144
145         Reviewed by Alexey Proskuryakov.
146
147         - fix http://bugs.webkit.org/show_bug.cgi?id=16628
148           ASSERTION FAILED: m_resizeLayer (running layout tests)
149
150         * rendering/RenderLayer.cpp:
151         (WebCore::RenderLayer::~RenderLayer): Avoid calling
152         EventHandler::resizeLayerDestroyed() if the document is being destroyed.
153
154 2007-12-27  Dan Bernstein  <mitz@apple.com>
155
156         Reviewed by Oliver Hunt.
157
158         - fix http://bugs.webkit.org/show_bug.cgi?id=16603
159           <rdar://problem/5664199> Crash when resizing text field
160
161         Test: fast/layers/resize-layer-deletion-crash.html
162
163         The event handler has only a weak reference to the layer that is
164         currently in resize mode, so it is the layer's responsibility to let
165         the event handler know if it has been destroyed while in that mode.
166
167         * page/EventHandler.cpp:
168         (WebCore::EventHandler::resizeLayerDestroyed): Added. Resets
169         m_resizeLayer to 0.
170         * page/EventHandler.h:
171         * rendering/RenderLayer.cpp:
172         (WebCore::RenderLayer::~RenderLayer): Added a call to
173         EventHandler::resizeLayerDestroyed() if the layer is in resize mode.
174
175 2007-12-27  Collin Jackson  <webkit@collinjackson.com>
176
177         Reviewed by Sam Weinig.
178
179         http://bugs.webkit.org/show_bug.cgi?id=16539
180         <rdar://problem/5659269>
181
182         The same-origin check was missing in the implementation of 
183         setTimeout, setInterval, addEventListener, and removeEventListener.
184
185         Suppose <http://www.badguy.com/> contains an iframe to 
186         <http://www.goodguy.com/>. Now www.badguy.com can steal
187         www.goodguy.com cookies by running this code:
188
189         setTimeout.call(frames[0], "alert(document.cookie)", 1000);
190
191         This patch changes the behavior so that setTimeout to does 
192         nothing and returns an undefined value if the caller is not
193         permitted to script the window whose setTimeout method is being
194         called. The same applies to setInterval, addEventListener, and 
195         removeEventListener.
196
197         Tests: http/tests/security/cross-frame-access-call.html
198
199         * bindings/js/kjs_window.cpp:
200         (KJS::WindowProtoFuncSetTimeout::callAsFunction)
201         (KJS::WindowProtoFuncSetInterval::callAsFunction)
202         (KJS::WindowProtoFuncAddEventListener::callAsFunction)
203         (KJS::WindowProtoFuncRemoveEventListener::callAsFunction)
204
205 2007-12-27  Dan Bernstein  <mitz@apple.com>
206
207         Reviewed by Dave Hyatt and Sam Weinig.
208
209         - fix <rdar://problem/5605937> Inspector: Disclosure triangle not drawn in node's properties panel until click
210
211         Test: fast/layers/add-layer-with-nested-stacking.html
212         Test: fast/layers/remove-layer-with-nested-stacking.html
213
214         * rendering/RenderLayer.cpp:
215         (WebCore::RenderLayer::addChild): If the new child is overflow-only
216         but has children of its own, dirty the stacking context's z-order lists
217         since the grandchildren might need to be in them.
218         (WebCore::RenderLayer::removeChild): Similarly for the old child.
219
220 2007-12-27  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
221
222         Reviewed by Alp Toker.
223
224         http://bugs.webkit.org/show_bug.cgi?id=16353
225         [GTK] Check for deprecated API use (G_DISABLE_DEPRECATED etc.)
226
227         Added the flags mentioned in the bug only when doing 'debug'
228         builds. -DGST_DISABLE_DEPRECATED only added when video is enabled.
229
230         * GNUmakefile.am:
231         * WebCore.pro:
232
233 2007-12-27  Dan Bernstein  <mitz@apple.com>
234
235         Reviewed by Eric Seidel.
236
237         - fix http://bugs.webkit.org/show_bug.cgi?id=16490
238           ASSERT in ~FrameView while viewing/reloading WICD test case
239
240         Test: fast/dynamic/paused-event-dispatch.html
241
242         * page/FrameView.cpp:
243         (WebCore::FrameView::~FrameView):
244         (WebCore::FrameView::layout): Changed to always pause event dispatch and
245         always resume event dispatch, regardless of whether the post-layout
246         task timer is active. However, if it is active, assert that event
247         dispatch is still paused.
248
249 2007-12-27  Alexey Proskuryakov  <ap@webkit.org>
250
251         Reviewed by Maciej.
252
253         http://bugs.webkit.org/show_bug.cgi?id=14500
254         need to be more generous about charset declaration with meta tag
255         
256         http://bugs.webkit.org/show_bug.cgi?id=12526
257         <rdar://problem/4867183> Safari ignores encoding description "charset=Shift_JIS" in invalid html
258
259         <rdar://problem/4892428> Unlike other browsers, WebKit ignores <meta> charset definitions outside the head
260
261         <rdar://problem/5643774> REGRESSION: Text is garbled when clicking a link inside an Arabic website
262
263         Tests: fast/encoding/ahram-org-eg.html
264                fast/encoding/bandai-co-jp-releases.html
265                fast/encoding/floraexpress-ru.html
266                fast/encoding/hanarei-blog32-fc2-com.html
267                fast/encoding/yahoo-mail.html
268
269         * loader/TextResourceDecoder.cpp:
270         (WebCore::TextResourceDecoder::checkForHeadCharset): Don't stop looking for <meta> until we've
271         seen at least 512 bytes of input.
272
273 2007-12-26  Jan Michael Alonzo  <jmalonzo@unpluggable.com>
274
275         Reviewed by Alp Toker.
276
277         http://bugs.webkit.org/show_bug.cgi?id=16390
278         Use autotools or GNU make as the build system for the GTK port
279
280         * GNUmakefile.am: Added.
281
282 2007-12-26  Alexey Proskuryakov  <ap@webkit.org>
283
284         Reviewed by Sam Weinig.
285
286         http://bugs.webkit.org/show_bug.cgi?id=16609
287         Make manual-tests/xmlhttprequest-contenttype-empty.html test automatic
288
289         * manual-tests/xmlhttprequest-contenttype-empty.html: Removed (moved to LayoutTests/http).
290
291 2007-12-26  Mark Rowe  <mrowe@apple.com>
292
293         Windows build fix.
294
295         * platform/Threading.h:
296
297 2007-12-25  Rob Buis  <buis@kde.org>
298
299         Reviewed by Eric.
300
301         http://bugs.webkit.org/show_bug.cgi?id=15514
302         <clipPath> with <use> not respected
303         http://bugs.webkit.org/show_bug.cgi?id=16557
304         SVG circle elements have been clipped away completely, instead of partially.
305
306         Add toClipPath to get clip path data for the clipping paths. Implement it for <use>, thereby allowing clip paths using use.
307
308         * svg/SVGClipPathElement.cpp:
309         (WebCore::SVGClipPathElement::canvasResource):
310         * svg/SVGStyledTransformableElement.h:
311         (WebCore::SVGStyledTransformableElement::toClipPath):
312         * svg/SVGUseElement.cpp:
313         (WebCore::isDirectReference):
314         (WebCore::SVGUseElement::toClipPath):
315         * svg/SVGUseElement.h:
316
317 2007-12-25  Sam Weinig  <sam@webkit.org>
318
319         Reviewed by Eric Seidel.
320
321         Clean up the files relating to NodeLists.
322
323         * dom/ChildNodeList.cpp:
324         (WebCore::ChildNodeList::ChildNodeList):
325         (WebCore::ChildNodeList::length):
326         (WebCore::ChildNodeList::item):
327         (WebCore::ChildNodeList::nodeMatches):
328         * dom/ChildNodeList.h:
329         * dom/DynamicNodeList.cpp:
330         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
331         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
332         (WebCore::DynamicNodeList::itemWithName):
333         * dom/DynamicNodeList.h:
334         (WebCore::DynamicNodeList::needsNotifications):
335         * dom/NameNodeList.cpp:
336         (WebCore::NameNodeList::NameNodeList):
337         (WebCore::NameNodeList::rootNodeAttributeChanged):
338         (WebCore::NameNodeList::nodeMatches):
339         * dom/NameNodeList.h:
340         * dom/NodeList.h:
341         * dom/SelectorNodeList.h:
342
343 2007-12-25  Sam Weinig  <sam@webkit.org>
344
345         Fix non-mac builds.
346
347         * WebCore.pro:
348         * WebCore.vcproj/WebCore.vcproj:
349         * WebCoreSources.bkl:
350
351 2007-12-25  Sam Weinig  <sam@webkit.org>
352
353         Rubber stamped by Eric Seidel.
354
355         Move TagNodeList into its own file.
356
357         * WebCore.xcodeproj/project.pbxproj:
358         * dom/Node.cpp:
359         * dom/TagNodeList.cpp: Copied from dom/Node.cpp.
360         (WebCore::TagNodeList::TagNodeList):
361         * dom/TagNodeList.h: Copied from dom/Node.cpp.
362
363 2007-12-25  Sam Weinig  <sam@webkit.org>
364
365         Reviewed by Eric Seidel.
366
367         Simplify the NodeList architecture.
368         - Rename recursiveItem() to item(), since it is not recursive.
369         - Make recursiveLength() iterative and rename to length().
370         - Remove now unneeded overrides of item() and length() that used 
371           to call the recursive variants.
372
373         * dom/ClassNodeList.cpp:
374         * dom/ClassNodeList.h:
375         * dom/DynamicNodeList.cpp:
376         (WebCore::DynamicNodeList::length):
377         (WebCore::DynamicNodeList::item):
378         (WebCore::DynamicNodeList::rootNodeAttributeChanged): Move implementation 
379         into the .cpp file since virtual methods can't be inlined.
380         * dom/DynamicNodeList.h:
381         * dom/NameNodeList.cpp:
382         * dom/NameNodeList.h:
383         * dom/Node.cpp:
384
385 2007-12-25  Alp Toker  <alp@atoker.com>
386
387         More complete GTK+/Qt/Wx/Win build fixes for breakage introduced in
388         r28981.
389
390         * WebCore.pro:
391         * WebCore.vcproj/WebCore.vcproj:
392         * WebCoreSources.bkl:
393
394 2007-12-25  Alp Toker  <alp@atoker.com>
395
396         Win build fix for breakage introduced in r28981.
397
398         * WebCore.vcproj/WebCore.vcproj:
399
400 2007-12-25  Alp Toker  <alp@atoker.com>
401
402         Wx build fix for breakage introduced in r28981.
403
404         * WebCoreSources.bkl:
405
406 2007-12-25  Alp Toker  <alp@atoker.com>
407
408         GTK+/Qt build fix for breakage introduced in r28981.
409
410         * WebCore.pro:
411
412 2007-12-25  David Smith  <catfish.man@gmail.com> and Sam Weinig  <sam@webkit.org>
413
414         Reviewed by Oliver.
415         
416         - http://bugs.webkit.org/show_bug.cgi?id=16587
417         Implement the most useful part of the W3C Selectors API.
418
419         * WebCore.xcodeproj/project.pbxproj:
420         * css/CSSStyleSelector.h: Make Node a friend of CSSStyleSelector so it can use checkSelector()
421         * dom/ChildNodeList.cpp:
422         (WebCore::ChildNodeList::ChildNodeList): Change to being a DynamicNodeList
423         * dom/ChildNodeList.h:
424         * dom/ClassNodeList.cpp:
425         (WebCore::ClassNodeList::ClassNodeList): Change to being a DynamicNodeList
426         * dom/ClassNodeList.h:
427         * dom/Document.idl: Add the new functions
428         * dom/DynamicNodeList.cpp: Copied from WebCore/dom/NodeList.cpp.
429         (WebCore::DynamicNodeList::DynamicNodeList): Rename NodeList to DynamicNodeList, to differentiate it from the new StaticNodeList
430         (WebCore::DynamicNodeList::~DynamicNodeList):
431         (WebCore::DynamicNodeList::recursiveLength):
432         (WebCore::DynamicNodeList::itemForwardsFromCurrent):
433         (WebCore::DynamicNodeList::itemBackwardsFromCurrent):
434         (WebCore::DynamicNodeList::recursiveItem):
435         (WebCore::DynamicNodeList::itemWithName):
436         (WebCore::DynamicNodeList::rootNodeChildrenChanged):
437         (WebCore::DynamicNodeList::Caches::Caches):
438         (WebCore::DynamicNodeList::Caches::reset):
439         * dom/DynamicNodeList.h: Copied from WebCore/dom/NodeList.h.
440         (WebCore::DynamicNodeList::rootNodeAttributeChanged):
441         * dom/Element.idl: Add the new functions
442         * dom/NameNodeList.cpp: Change to being a DynamicNodeList
443         (WebCore::NameNodeList::NameNodeList):
444         * dom/NameNodeList.h:
445         (WebCore::NameNodeList::rootNodeAttributeChanged):
446         * dom/Node.cpp:
447         (WebCore::TagNodeList::TagNodeList): Change to being a DynamicNodeList
448         (WebCore::Node::registerDynamicNodeList):
449         (WebCore::Node::unregisterDynamicNodeList):
450         (WebCore::Node::getElementsByName):
451         (WebCore::Node::getElementsByClassName):
452         (WebCore::Node::querySelector): new
453         (WebCore::Node::querySelectorAll): new
454         * dom/Node.h:
455         * dom/NodeList.cpp: Removed.
456         * dom/NodeList.h: This is now an abstract superclass of DynamicNodeList and StaticNodeList
457         (WebCore::NodeList::NodeList):
458         (WebCore::NodeList::~NodeList):
459         * dom/SelectorNodeList.cpp: Added.
460         (WebCore::SelectorNodeList::SelectorNodeList): New StaticNodeList subclass that filters elements by CSS selector
461         * dom/SelectorNodeList.h: Added.
462         * dom/StaticNodeList.cpp: Added.
463         (WebCore::StaticNodeList::length):
464         (WebCore::StaticNodeList::item):
465         (WebCore::StaticNodeList::itemWithName):
466         * dom/StaticNodeList.h: Added.
467         (WebCore::StaticNodeList::StaticNodeList):
468         (WebCore::StaticNodeList::~StaticNodeList):
469
470 2007-12-25  Mark Rowe  <mrowe@apple.com>
471
472         Reviewed by Sam Weinig.
473
474         Implement a lock-free ThreadSafeShared for i386, x86_64, ppc and ppc64.
475         http://bugs.webkit.org/show_bug.cgi?id=16596
476
477         This is a 1.7x as fast as the lock-based implementation on x86 for a single-threaded use
478         of ThreadSafeShared but is closer to 280x as fast when there is heavy concurrent multi-threaded
479         access to a single ThreadSafeShared object.
480
481         The atomic operations are based on those used by the Boost C++ library's shared_ptr implementation.
482
483         * platform/Threading.h:
484         (WebCore::atomicIncrement):
485         (WebCore::atomicDecrement):
486         (WebCore::ThreadSafeShared::ThreadSafeShared):
487         (WebCore::ThreadSafeShared::ref): Use lock-free operations if available.
488         (WebCore::ThreadSafeShared::deref): Ditto.
489         (WebCore::ThreadSafeShared::hasOneRef):
490         (WebCore::ThreadSafeShared::refCount):
491         (WebCore::ThreadSafeShared::isThreadSafe):
492
493 2007-12-24  Darin Adler  <darin@apple.com>
494
495         * platform/text/PlatformString.h: Removed now-incorrect comment.
496         Added a comment about copy().
497         * platform/text/StringImpl.h: Added a comment about copy().
498
499 2007-12-24  Darin Adler  <darin@apple.com>
500
501         Reviewed by Maciej.
502
503         - http://bugs.webkit.org/show_bug.cgi?id=16550
504           make StringImpl immutable
505
506         I tried to keep the changes to a minimum. In some cases there is
507         room for optimization -- I didn't try to add in the "single ref count"
508         optimizations and there might be a tiny bit more string copying than
509         we had before.
510
511         * WebCore.base.exp: Updated.
512
513         * dom/CharacterData.cpp:
514         (WebCore::CharacterData::appendData): Changed to use String since
515         StringImpl doesn't have mutating functions any more.
516         (WebCore::CharacterData::insertData): Ditto.
517         (WebCore::CharacterData::deleteData): Ditto.
518         (WebCore::CharacterData::replaceData): Ditto.
519         * dom/Text.cpp:
520         (WebCore::Text::splitText): Changed to use substring instead of
521         remove since StringImpl does't have mutating functions any more.
522         * editing/CompositeEditCommand.cpp:
523         (WebCore::CompositeEditCommand::deleteInsignificantText): Changed
524         to use String instead of StringImpl so we can use remove.
525
526         * platform/text/PlatformString.h: Removed newUninitialized.
527         Added append that takes a character pointer and length.
528
529         * platform/text/String.cpp:
530         (WebCore::String::insert): Added an implementation that does not
531         rely on an underlying StringImpl function.
532         (WebCore::String::append): Ditto.
533         (WebCore::String::truncate): Ditto.
534         (WebCore::String::remove): Ditto.
535         (WebCore::String::charactersWithNullTermination): Added an
536         implementation that uses the new StringImpl null termination feature,
537         which does not require modifying a string.
538
539         * platform/text/StringImpl.cpp:
540         (WebCore::isSpace): Fix comment.
541         (WebCore::StringImpl::StringImpl): Added a new constructor that makes
542         a string with a trailing null character.
543         (WebCore::StringImpl::substring): Marked const.
544         (WebCore::StringImpl::replace): Marked const; had to add quite a few
545         const_cast. Also rewrote one of these to work without modifying the
546         existing string.
547
548         * platform/text/StringImpl.h: Fixed a mistake where the empty string had
549         m_hasTerminatingNullCharacter uninitialized. Added a type and constructor
550         for creating strings that have a trailing null character. Added a
551         hasTerminatingNullCharacter function. Removed newUninitialized,
552         charactersWithNullTermination, append, insert, truncate, and remove.
553         Marked lots of other functions const.
554
555         * platform/text/TextCodecLatin1.cpp:
556         (WebCore::TextCodecLatin1::decode): Rewrote to use a Vector instead of
557         newUninitialized.
558         * platform/text/TextCodecUTF16.cpp:
559         (WebCore::TextCodecUTF16::decode): Ditto.
560         * platform/text/TextCodecUserDefined.cpp:
561         (WebCore::TextCodecUserDefined::decode): Ditto.
562
563         * rendering/RenderStyle.cpp:
564         (WebCore::RenderStyle::setContent): Changed to use String since
565         StringImpl doesn't have mutating functions any more.
566
567 2007-12-24  Alexey Proskuryakov  <ap@webkit.org>
568
569         Reviewed by Oliver.
570
571         Fix fast/events/arrow-keys-on-body.html, failing on Windows.
572
573         * platform/win/KeyEventWin.cpp:
574         (WebCore::isKeypadEvent):
575         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
576         Use HIWORD() macro instead of shifting the value explicitly (no change in behavior).
577
578 2007-12-23  Alexey Proskuryakov  <ap@webkit.org>
579
580         Fix Debug and Release QTMovieWin bulds.
581
582         * WebCore.vcproj/QTMovieWin.vcproj:
583         * WebCore.vcproj/debug.vsprops:
584         * WebCore.vcproj/debug_internal.vsprops:
585         * WebCore.vcproj/release.vsprops:
586         Use LibraryConfigSuffix instead of WebKitConfigSuffix for pthreadVC2.
587         Build release import lib into \lib, not \bin.
588
589 2007-12-23  Alp Toker  <alp@atoker.com>
590
591         Reviewed by Holger Freyther.
592
593         http://bugs.webkit.org/show_bug.cgi?id=15382
594         [CAIRO] Canvas pattern support
595
596         http://bugs.webkit.org/show_bug.cgi?id=16577
597         Merge Cairo enhancements from Apollo project
598
599         Add support for canvas patterns.
600
601         Make Image::nativeImageForCurrentFrame() public.
602
603         Fix some typos along the way.
604
605         The globalAlpha canvas fixes are not included in this patch as
606         they're slightly more intrusive and may conflict conceptually with
607         GraphicsContext::setAlpha().
608
609         * html/CanvasPattern.cpp:
610         (WebCore::CanvasPattern::CanvasPattern):
611         (WebCore::CanvasPattern::~CanvasPattern):
612         (WebCore::CanvasPattern::createPattern):
613         * html/CanvasPattern.h:
614         (WebCore::CanvasPattern::platformImage):
615         * html/CanvasRenderingContext2D.cpp:
616         (WebCore::CanvasRenderingContext2D::setShadow):
617         (WebCore::CanvasRenderingContext2D::applyShadow):
618         (WebCore::CanvasRenderingContext2D::drawImage):
619         (WebCore::CanvasRenderingContext2D::createPattern):
620         (WebCore::CanvasRenderingContext2D::applyStrokePattern):
621         (WebCore::CanvasRenderingContext2D::applyFillPattern):
622         * platform/graphics/Image.h:
623         (WebCore::Image::nativeImageForCurrentFrame):
624
625 2007-12-23  Kevin Ollivier  <kevino@theolliviers.com>
626
627         Reviewed by Eric Seidel.
628
629         Remove getWxBitmap as we have nativeImageForCurrentFrame now,
630         and don't draw a border in fillRect.
631
632         * platform/graphics/BitmapImage.h:
633         * platform/graphics/wx/GraphicsContextWx.cpp:
634         (WebCore::GraphicsContext::fillRect):
635         * platform/graphics/wx/ImageWx.cpp:
636
637 2007-12-23  Alp Toker  <alp@atoker.com>
638
639         Reviewed by Holger Freyther.
640
641         http://bugs.webkit.org/show_bug.cgi?id=16577
642         Merge Cairo enhancements from Apollo project
643
644         This patch is based on initial merging work by Brent Fulgham. Adobe's
645         code has been modified in a few places to better suit the existing
646         coding style.
647
648         Implement more clipping and drawing functions.
649
650         Save and restore the fill rule manually when clipping.
651
652         Avoid image surface creation when the image buffer has height zero.
653
654         * platform/graphics/cairo/GraphicsContextCairo.cpp:
655         (WebCore::GraphicsContext::clip):
656         (WebCore::GraphicsContext::addInnerRoundedRectClip):
657         (WebCore::GraphicsContext::addPath):
658         (WebCore::GraphicsContext::clipOut):
659         (WebCore::GraphicsContext::clipOutEllipseInRect):
660         (WebCore::GraphicsContext::fillRoundedRect):
661         * platform/graphics/cairo/ImageSourceCairo.cpp:
662         (WebCore::ImageSource::createFrameAtIndex):
663
664 2007-12-23  Nikolas Zimmermann  <zimmermann@kde.org>
665
666         Reviewed by Mark.
667
668         Fix wrong placed ifdef - wrapping SVGDefsElement, instead of SVGDefinitionSrcElement in SVG_FONTS block.
669
670         * bindings/objc/DOM.mm:
671         (WebCore::createElementClassMap):
672
673 2007-12-22  Alp Toker  <alp@atoker.com>
674
675         GTK+ build fix
676
677         GTK_TARGET_OTHER_APP is not available in older GTK+ versions. Pass
678         empty target flags for now.
679
680         Check GTK+, not GLib versions, since they are different.
681
682         * platform/gtk/PasteboardGtk.cpp:
683         (WebCore::Pasteboard::documentFragment):
684
685 2007-12-22  Luca Bruno  <lethalman88@gmail.com>
686
687         Reviewed by Alp Toker.
688
689         http://bugs.webkit.org/show_bug.cgi?id=16311
690         [Gtk] Copy rich text to clipboard as text/plain and text/html.
691
692         Hook into the WebView to get the correct clipboard object on the
693         appropriate display. This is necessary because GTK+ does not have
694         global clipboards.
695
696         * WebCore.pro:
697         * platform/Pasteboard.h:
698         (WebCore::Pasteboard::setHelper): added for GTK
699         (WebCore::Pasteboard::m_helper): private added for GTK
700         * platform/gtk/PasteboardGtk.cpp:
701         (WebCore::PasteboardSelectionData): added to support GTK selection data callback
702         (WebCore::clipboard_get_contents_cb): added
703         (WebCore::clipboard_clear_contents_cb): added
704         (WebCore::Pasteboard::~Pasteboard):
705         (WebCore::Pasteboard::setHelper):
706         (WebCore::Pasteboard::writeSelection): copy rich text
707         (WebCore::Pasteboard::documentFragment): 
708         (WebCore::Pasteboard::plainText): 
709         * platform/gtk/PasteboardHelper.h: Added.
710
711 2007-12-22  Nikolas Zimmermann  <zimmermann@kde.org>
712
713         Reviewed by Oliver.
714
715         Fixes: http://bugs.webkit.org/show_bug.cgi?id=15966 (Crash in SVGRootInlineBox::walkTextChunks() on mouse hover)
716
717         Add new isSVGRootInlineBox() function to InlineBox to be able to differentiate between RootInlineBox/SVGRootInlineBox.
718         SVG assumed it's root inline box (for <text> elements) is always of type SVGRootInlineBox, which is not the case
719         for HTML text in <foreignObject>. Text selection doesn't work so far as line box offsets are wrong - which is visible
720         in Web Inspector.
721
722         * rendering/InlineBox.h:
723         (WebCore::InlineBox::isSVGRootInlineBox):
724         * rendering/SVGInlineTextBox.cpp:
725         (WebCore::SVGInlineTextBox::svgRootInlineBox):
726         (WebCore::SVGInlineTextBox::closestCharacterToPosition):
727         (WebCore::SVGInlineTextBox::selectionRect):
728         * rendering/SVGRenderTreeAsText.cpp:
729         (WebCore::writeSVGInlineTextBox):
730         * rendering/SVGRootInlineBox.h:
731         (WebCore::SVGRootInlineBox::isSVGRootInlineBox):
732
733 2007-12-22  Alp Toker  <alp@atoker.com>
734
735         LOW_BANDWIDTH_DISPLAY build fix
736
737         Track recent KURL DeprecatedString changes.
738
739         * loader/FrameLoader.cpp:
740         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
741
742 2007-12-22  Dan Bernstein  <mitz@apple.com>
743
744         - Windows build fix
745
746         * WebCore.vcproj/WebCore.vcproj:
747
748 2007-12-22  Xan Lopez  <xan@gnome.org>
749
750         Reviewed by Alp Toker.
751
752         Add missing return 0 to fix a compile warning.
753
754         * page/gtk/FrameGtk.cpp:
755         (WebCore::Frame::createScriptInstanceForWidget):
756
757 2007-12-21  Antti Koivisto  <antti@apple.com>
758
759         Reviewed by Darin, Adam and Steve.
760
761         Add media playback support for Windows.
762         
763         The implementation uses low level QuickTime API. DLL is
764         needed to work around CF use in both WebKit and QuickTime.
765         
766         This makes Windows build depend on the QuickTime SDK 
767         
768         http://developer.apple.com/quicktime/download/
769         
770         but not QuickTime itself.
771         
772         QTMovieWinTimer contains some copy code from SharedTimerWin. It
773         is used in the QuickTime access DLL which can't use WebCore
774         SharedTimer due to dependency problems.
775
776         * WebCore.vcproj/QTMovieWin.vcproj: Added.
777         * WebCore.vcproj/WebCore.vcproj:
778         * WebCore.vcproj/build-generated-files.sh:
779         * html/HTMLMediaElement.cpp:
780         (WebCore::HTMLMediaElement::setSrc):
781         * platform/graphics/MediaPlayer.cpp:
782         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.cpp: Added.
783         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
784         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
785         (WebCore::MediaPlayerPrivate::load):
786         (WebCore::MediaPlayerPrivate::play):
787         (WebCore::MediaPlayerPrivate::pause):
788         (WebCore::MediaPlayerPrivate::duration):
789         (WebCore::MediaPlayerPrivate::currentTime):
790         (WebCore::MediaPlayerPrivate::seek):
791         (WebCore::MediaPlayerPrivate::doSeek):
792         (WebCore::MediaPlayerPrivate::cancelSeek):
793         (WebCore::MediaPlayerPrivate::seekTimerFired):
794         (WebCore::MediaPlayerPrivate::setEndTime):
795         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
796         (WebCore::MediaPlayerPrivate::endPointTimerFired):
797         (WebCore::MediaPlayerPrivate::paused):
798         (WebCore::MediaPlayerPrivate::seeking):
799         (WebCore::MediaPlayerPrivate::naturalSize):
800         (WebCore::MediaPlayerPrivate::hasVideo):
801         (WebCore::MediaPlayerPrivate::setVolume):
802         (WebCore::MediaPlayerPrivate::setMuted):
803         (WebCore::MediaPlayerPrivate::setRate):
804         (WebCore::MediaPlayerPrivate::dataRate):
805         (WebCore::MediaPlayerPrivate::maxTimeBuffered):
806         (WebCore::MediaPlayerPrivate::maxTimeSeekable):
807         (WebCore::MediaPlayerPrivate::maxTimeLoaded):
808         (WebCore::MediaPlayerPrivate::bytesLoaded):
809         (WebCore::MediaPlayerPrivate::totalBytesKnown):
810         (WebCore::MediaPlayerPrivate::totalBytes):
811         (WebCore::MediaPlayerPrivate::cancelLoad):
812         (WebCore::MediaPlayerPrivate::updateStates):
813         (WebCore::MediaPlayerPrivate::didEnd):
814         (WebCore::MediaPlayerPrivate::setRect):
815         (WebCore::MediaPlayerPrivate::setVisible):
816         (WebCore::MediaPlayerPrivate::paint):
817         (WebCore::MediaPlayerPrivate::getSupportedTypes):
818         (WebCore::MediaPlayerPrivate::movieEnded):
819         (WebCore::MediaPlayerPrivate::movieLoadStateChanged):
820         (WebCore::MediaPlayerPrivate::movieTimeChanged):
821         (WebCore::MediaPlayerPrivate::movieNewImageAvailable):
822         * platform/graphics/win/MediaPlayerPrivateQuickTimeWin.h: Added.
823         (WebCore::MediaPlayerPrivate::networkState):
824         (WebCore::MediaPlayerPrivate::readyState):
825         * platform/graphics/win/QTMovieWin.cpp: Added.
826         (updateTaskTimer):
827         (QTMovieWinPrivate::QTMovieWinPrivate):
828         (QTMovieWinPrivate::~QTMovieWinPrivate):
829         (taskTimerFired):
830         (QTMovieWinPrivate::startTask):
831         (QTMovieWinPrivate::endTask):
832         (QTMovieWinPrivate::task):
833         (QTMovieWinPrivate::registerDrawingCallback):
834         (QTMovieWinPrivate::drawingComplete):
835         (QTMovieWinPrivate::createGWorld):
836         (QTMovieWinPrivate::setSize):
837         (QTMovieWinPrivate::deleteGWorld):
838         (QTMovieWin::QTMovieWin):
839         (QTMovieWin::~QTMovieWin):
840         (QTMovieWin::play):
841         (QTMovieWin::pause):
842         (QTMovieWin::rate):
843         (QTMovieWin::setRate):
844         (QTMovieWin::duration):
845         (QTMovieWin::currentTime):
846         (QTMovieWin::setCurrentTime):
847         (QTMovieWin::setVolume):
848         (QTMovieWin::setMuted):
849         (QTMovieWin::dataSize):
850         (QTMovieWin::maxTimeLoaded):
851         (QTMovieWin::loadState):
852         (QTMovieWin::getNaturalSize):
853         (QTMovieWin::setSize):
854         (QTMovieWin::setVisible):
855         (QTMovieWin::paint):
856         (QTMovieWin::load):
857         (movieDrawingCompleteProc):
858         (initializeSupportedTypes):
859         (QTMovieWin::countSupportedTypes):
860         (QTMovieWin::getSupportedType):
861         (QTMovieWin::initializeQuickTime):
862         (DllMain):
863         * platform/graphics/win/QTMovieWin.h: Added.
864         * platform/graphics/win/QTMovieWinTimer.cpp: Added.
865         (TimerWindowWndProc):
866         (initializeOffScreenTimerWindow):
867         (setSharedTimerFiredFunction):
868         (timerFired):
869         (setSharedTimerFireDelay):
870         (stopSharedTimer):
871         (setSharedTimerInstanceHandle):
872         (systemTime):
873         * platform/graphics/win/QTMovieWinTimer.h: Added.
874         * rendering/RenderMedia.cpp:
875         (WebCore::MediaControlPlayButtonElement::update):
876
877 2007-12-21  Brent Fulgham  <bfulgham@gmail.com>
878
879         Reviewed by Alp Toker.
880
881         http://bugs.webkit.org/show_bug.cgi?id=16558
882         Cairo WebCore Rendering Fails on arc drawing
883
884         Fix for bug reported (and patched) by Apollo team in which
885         arcs were draw in reverse (resulting in inverted images).
886         Review of the source found that the 'clockwise' term was
887         actually meant to mean 'anticlockwise' so the IDL and
888         supporting classes have been changed to match this. 
889
890         * html/CanvasRenderingContext2D.cpp:
891         (WebCore::CanvasRenderingContext2D::arc):
892         * html/CanvasRenderingContext2D.idl:
893         * platform/graphics/cairo/PathCairo.cpp:
894         (WebCore::Path::addArc):
895         (WebCore::Path::addEllipse):
896         * platform/graphics/Path.h:
897
898 2007-12-21  Alexey Proskuryakov  <ap@webkit.org>
899
900         Reviewed by Oliver.
901
902         <rdar://problem/5629995> Incorrect display of Danish characters on web site.
903
904         Test: http/tests/xmlhttprequest/response-encoding.html
905
906         * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::didReceiveData):
907         Default to UTF-8 for HTML, too. It's unfortunate that we have to use different
908         rules for main content and XHR responses, but this matches both IE and Firefox.
909
910 2007-12-20  Jon Honeycutt  <jhoneycutt@apple.com>
911
912         Reviewed by Kevin Decker.
913
914         <rdar://problem/5655797> REGRESSION(304-306A10) Safari does not find
915         shockwave plugin on freshly installed OS
916
917         Look for Director plugin in its native directory.
918
919         * plugins/win/PluginDatabaseWin.cpp:
920         (WebCore::PluginDatabaseWin::getPluginsInPaths): The Director plugin
921         doesn't start with "np," so special case its filename.
922         (WebCore::addMacromediaPluginPaths): Add Flash and "Shockwave 10"
923         directories to the plugin paths.
924         (WebCore::PluginDatabaseWin::defaultPluginPaths):
925
926 2007-12-20  Peter Kasting  <zerodpx@gmail.com>
927
928         Reviewed by Alp Toker.
929
930         http://bugs.webkit.org/show_bug.cgi?id=16508
931         Fix regression in GIFImageDecoder.cpp: "Haeberli hack" led to wrongly
932         decoded transparent areas.
933
934         * platform/image-decoders/gif/GIFImageDecoder.cpp:
935         (WebCore::GIFImageDecoder::haveDecodedRow):
936         * platform/image-decoders/gif/GIFImageDecoder.h:
937         * platform/image-decoders/gif/GIFImageReader.cpp:
938         (GIFImageReader::output_row):
939
940 2007-12-20  Justin Garcia  <justin.garcia@apple.com>
941
942         Reviewed by Oliver Hunt.
943
944         <rdar://problem/5543472> GoogleDocs: Safari hangs when creating a list from a particular selection
945         
946         Still need to fix similar issues with the other operations that iterate 
947         over selected paragraphs, like FormatBlock, Indent and Outdent (<rdar://problem/5658933>).
948
949         * editing/IndentOutdentCommand.cpp:
950         (WebCore::IndentOutdentCommand::indentRegion): Added a FIXME.
951         * editing/IndentOutdentCommand.h: Removed an unused function.
952         * editing/InsertListCommand.cpp:
953         (WebCore::InsertListCommand::modifyRange): 
954         Renamed visibleStart to startOfSelection and visibleEnd to endOfSelection.
955         Call the new selectionForParagraphIteration, which a) prevents operations like this
956         one from being performed on a table that isn't fully selected (where the selection
957         starts just before the table and ends inside it), and b) helps prevent paragraph
958         iteration from going past the end of the selection.
959         Call the new startOfNextParagraph, instead of using endOfParagraph(v).next(),
960         since when v is in the last paragraph of the last cell of a table, that expression 
961         will return the position after the table, not the start of the next paragraph.
962         * editing/htmlediting.cpp:
963         (WebCore::enclosingListChild): Don't go above a table cell, so that list operations
964         take effect inside the table cell where they are performed.
965         (WebCore::selectionForParagraphIteration): Added, see above.
966         (WebCore::indexForVisiblePosition): Moved from IndentOutdentCommand.cpp.
967         * editing/htmlediting.h:
968         * editing/visible_units.cpp:
969         (WebCore::startOfNextParagraph): Added, see above.
970         * editing/visible_units.h:
971         * editing/TextIterator.h:
972         (WebCore::TextIterator::exitNode): Added a FIXME.
973
974 2007-12-20  Alp Toker  <alp@atoker.com>
975
976         Rubber-stamped by Maciej.
977
978         http://bugs.webkit.org/show_bug.cgi?id=16542
979         [GTK] Text is missing with old Pango version
980
981         Back out commits r28880, r28876, r28865, r28864 which added Pango font
982         selection support. These changes caused a regression where no text was
983         displayed with older Pango versions.
984
985         * platform/graphics/gtk/FontCacheGtk.cpp:
986         (WebCore::FontCache::fontExists):
987         * platform/graphics/gtk/FontDataGtk.cpp:
988         (WebCore::FontData::platformDestroy):
989         (WebCore::FontData::containsCharacters):
990         * platform/graphics/gtk/FontPlatformData.h:
991         (WebCore::FontPlatformData::FontPlatformData):
992         (WebCore::FontPlatformData::hash):
993         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
994         (WebCore::FontPlatformData::FontPlatformData):
995         (WebCore::FontPlatformData::init):
996         (WebCore::FontPlatformData::~FontPlatformData):
997         (WebCore::FontPlatformData::isFixedPitch):
998         (WebCore::FontPlatformData::operator==):
999         * platform/graphics/gtk/GlyphPageTreeNodeGtk.cpp:
1000         (WebCore::GlyphPage::fill):
1001
1002 2007-12-20  Timothy Hatcher  <timothy@apple.com>
1003
1004         Reviewed by Sam Weinig.
1005
1006         <rdar://problem/5604897> Double-clicking on JavaScript console error
1007         won't show the line where it occurred
1008
1009         Make the URLs clickable in the console, since double clicking is used for
1010         word text selection. Makes the word "line" localizable. Messages that don't
1011         have a URL will no longer print "undefined". Messages that have a line number
1012         less than or equal to 0 will no longer be printed.
1013
1014         * English.lproj/InspectorLocalizedStrings.js: Add "%s (line %d)".
1015         * page/inspector/ConsolePanel.js: Tweak how the DOM nodes are created
1016           and change the click handler to look for a link with the
1017           "console-message-url" class name.
1018         * page/inspector/SourcePanel.js: Call setupSourceFrameIfNeeded() if a
1019           line row is needed. 
1020         * page/inspector/inspector.css: Update the look of the URL in the console.
1021
1022 2007-12-20  Adam Barth  <hk9565@gmail.com>
1023
1024         Reviewed and landed by Sam Weinig.
1025
1026         http://bugs.webkit.org/show_bug.cgi?id=15313
1027         <rdar://problem/5514516>
1028
1029         The same-origin check was incorrect in two cases (both fixed in this
1030         patch):
1031
1032         A) If both the source and the target have set their document.domain
1033            to the same value, the protocol must also match in order for
1034            access to be allowed.  Without this requirement, the browser is
1035            vulnerable to the following attack:
1036
1037            1) Suppose there is an HTTPS site (www.example.com) that sets
1038               document.domain = "example.com".
1039            2) A network attacker redirects the browser to http://www.example.com/
1040               a) injects script to set document.domain = "example.com", and
1041               b) opens a window to https://www.example.com/
1042            3) Now the network attacker can inject script into the HTTPS page,
1043               stealing cookies and issuing banking transactions.
1044
1045         B) If only one of the source and target has set document.domain, then
1046            access should be denied.  With this behavior, the browser is
1047            vulnerable to the following attack:
1048
1049            1) Suppose http://foo.example.com/ opens an iframe to
1050               http://foo.example.com/frame.html that
1051               a) sets document.domain = "example.com", and
1052               b) opens an iframe to http://bar.example.com/
1053               This is a common usage of document.domain for cross-domain
1054               communication, see for example:
1055                 http://www.collinjackson.com/research/papers/fp801-jackson.pdf
1056            2) The inner-most iframe, which is from bar.example.com, sets
1057               document.domain = "example.com".
1058            3) Now the inner-most iframe can inject script into the middle
1059               iframe (say via document.write).  This bar.example.com script
1060               now has access to the outer-most frame (from foo.example.com).
1061
1062         Both these changes cause WebKit to match the behavior of Firefox 2 and
1063         IE6 in these cases.  This patch includes regression tests for both
1064         issues.
1065
1066         Internet Explorer 7 and Opera 9 are more strict in that they require
1067         the port numbers to match when both pages have document.domain set.
1068         Opera 9 allows access when only one page has set document.domain, but
1069         this is a security vulnerability.
1070
1071         Tests: http/tests/security/cross-frame-access-child-explicit-domain.html
1072                http/tests/security/cross-frame-access-parent-explicit-domain.html
1073
1074         * bindings/js/kjs_window.cpp:
1075         (KJS::createWindow):
1076         (KJS::Window::allowsAccessFrom):
1077         * dom/Document.cpp:
1078         (WebCore::Document::domain):
1079         (WebCore::Document::setDomain):
1080         (WebCore::Document::initSecurityOrigin):
1081         * dom/Document.h:
1082         (WebCore::Document::securityOrigin):
1083         * loader/FrameLoader.cpp:
1084         (WebCore::FrameLoader::begin):
1085         (WebCore::FrameLoader::checkCallImplicitClose):
1086         (WebCore::FrameLoader::shouldAllowNavigation):
1087         * platform/SecurityOrigin.cpp:
1088         (WebCore::SecurityOrigin::setForURL):
1089         (WebCore::SecurityOrigin::createForFrame):
1090         (WebCore::SecurityOrigin::canAccess):
1091         * platform/SecurityOrigin.h:
1092         (WebCore::SecurityOrigin::domain):
1093         * storage/Database.cpp:
1094         (WebCore::Database::openDatabase):
1095         (WebCore::Database::Database):
1096         (WebCore::Database::securityOriginData):
1097         * storage/Database.h:
1098         (WebCore::Database::databaseDebugName):
1099         * storage/DatabaseTracker.cpp:
1100         (WebCore::DatabaseTracker::canEstablishDatabase):
1101         * storage/SQLTransaction.cpp:
1102         (WebCore::SQLTransaction::postflightAndCommit):
1103         (WebCore::SQLTransaction::cleanupAfterTransactionErrorCallback):
1104
1105 2007-12-20  Rodney Dawes  <dobey@wayofthemonkey.com>
1106
1107         Reviewed by Darin Adler.
1108
1109         Define XP_UNIX when building with plugins on X11.
1110         Use new npruntime_internal.h instead of npruntime.h.
1111         http://bugs.webkit.org/show_bug.cgi?id=15669
1112
1113         * ForwardingHeaders/bindings/npruntime_internal.h
1114         * WebCore.pro:
1115         * html/HTMLPlugInElement.h:
1116
1117 2007-12-19  johnnyding.webkit  <johnnyding.webkit@gmail.com>
1118
1119         Reviewed by Alexey. Landed by Stephanie.
1120
1121         - fix http://bugs.webkit.org/show_bug.cgi?id=16179 | <rdar://problem/5619399>
1122           Any attribute name start with a unicode which like #xx00(x could be any hex number[0-9a-f]) will cause HTMLTokenizer parse error
1123           Actually any unicode characters which great than 255 in attribute name will cause Webkit parse the attribute name wrong. So after comparing 
1124           the same scenario in IE 6/7, FireFox 2/3, Opera, we should treat those characters as part of attribute name.
1125
1126
1127         * html/HTMLTokenizer.cpp:
1128         (WebCore::HTMLTokenizer::parseEntity): Handle Unicode Entity Name by using ASCII version of findEntity.
1129         (WebCore::HTMLTokenizer::parseTag): Let type of ptr match type of cBuffer.
1130         * html/HTMLTokenizer.h: Change type of cBuffer from char to UChar.
1131
1132 2007-12-20  Eric Seidel  <eric@webkit.org>
1133
1134         Reviewed by Nikolas Zimmermann.
1135
1136         WebKit claims to support SVG feature strings it shouldn't
1137         http://bugs.webkit.org/show_bug.cgi?id=15480
1138
1139         * dom/DOMImplementation.cpp:
1140         (WebCore::isSVG10Feature):
1141         (WebCore::isSVG11Feature):
1142
1143 2007-12-20  John Sullivan  <sullivan@apple.com>
1144
1145         Reviewed by Oliver and Geoff
1146         
1147         - fix <rdar://problem/5536858> Yellow highlight for find results is sometimes shorter 
1148           than white "hole" behind it
1149
1150         * rendering/RenderText.cpp:
1151         (WebCore::RenderText::addLineBoxRects):
1152         respect useSelectionHeight in all cases; we were only respecting it in one of the two cases
1153
1154 2007-12-20  Dan Bernstein  <mitz@apple.com>
1155
1156         Reviewed by Darin Adler.
1157
1158         - fix <rdar://problem/5656368> REGRESSION(3.0.4-ToT): Acid2 test fails to render anything
1159
1160         * platform/win/ScrollViewWin.cpp:
1161         (WebCore::ScrollView::maximumScroll): Changed back to return the maximum
1162         scroll offsets even if scrolling is not allowed, because navigation and
1163         scrollTo should still work.
1164         (WebCore::ScrollView::wheelEvent): Added early return if scrolling is
1165         not allowed.
1166
1167 2007-12-17  Tony Chang  <idealisms@gmail.com>
1168
1169         Reviewed by Darin.
1170
1171         - Fix for http://bugs.webkit.org/show_bug.cgi?id=16479
1172           text selection does not always begin at mouse down point
1173           Reset the m_dragSrc object on mouse down on all platforms.
1174
1175         Test: fast/text/reset-drag-on-mouse-down.html
1176
1177         * page/EventHandler.cpp:
1178         (WebCore::EventHandler::handleMousePressEvent):
1179         * page/mac/EventHandlerMac.mm:
1180         (WebCore::EventHandler::mouseDown):
1181
1182 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
1183
1184         Reviewed by Oliver Hunt.
1185
1186         Build support:
1187         * ForwardingHeaders/kjs/SymbolTable.h: Added.
1188         * ForwardingHeaders/wtf/VectorTraits.h: Added.
1189
1190         * bindings/js/JSDOMWindowCustom.cpp:
1191         (WebCore::JSDOMWindow::customGetOwnPropertySlot): Replaced use of
1192         getDirectLocation with getOwnPropertySlot. getDirectLocation is no
1193         longer valid, since global declarations are not stored in the property
1194         map.
1195
1196         (WebCore::JSDOMWindow::customPut): Replaced use of JSObject::put with
1197         JSGlobalObject::put. JSObject::put is no longer valid, since global
1198         declarations are not stored in the property map.
1199
1200         * bindings/js/kjs_window.cpp: Replaced JSObject:: calls with Base::
1201         calls, since JSObject is not our base class. This was always a bug, but
1202         the bug is even more apparent after some of my changes.
1203
1204         (KJS::Window::clear): Removed call to clearProperties because
1205         JSGlobalObject::reset takes care of that now.
1206
1207         * history/CachedPage.cpp:
1208         * history/CachedPage.h: Added support for saving a symbol table and
1209         localStorage to the page cache, and restoring it.
1210
1211 2007-12-19  Dan Bernstein  <mitz@apple.com>
1212
1213         Reviewed by Darin Adler and Dave Hyatt.
1214
1215         - Substitute the user's preferred standard font for an unknown primary
1216           font before falling back on the platform's last resort font
1217
1218         Cannot be tested in DumpRenderTree because it sets the standard font to
1219         Times, which is also the hard-coded last resort font on Mac.
1220
1221         * css/CSSFontSelector.cpp:
1222         (WebCore::CSSFontSelector::getFontData): Changed the early bail out
1223         condition to allow getting generic font families from settings even if
1224         there are not @font-face rules. Fixed a typo that mapped fantasy to
1225         cursive. Added a mapping from -webkit-standard to the standard family.
1226         * css/CSSStyleSelector.cpp:
1227         (WebCore::CSSStyleSelector::CSSStyleSelector): Changed to always create
1228         a font selector.
1229         (WebCore::CSSRuleSet::addRulesFromSheet):
1230         (WebCore::CSSStyleSelector::applyProperty): Changed to always use the
1231         font selector.
1232         * css/CSSStyleSelector.h:
1233         (WebCore::CSSStyleSelector::fontSelector):
1234         * platform/graphics/FontCache.cpp:
1235         (WebCore::FontCache::getFontData): Try the user's preferred standard
1236         font before the platform's last resort font.
1237
1238 2007-12-19  Sven Herzberg  <sven@imendio.com>
1239
1240         Reviewed by Alp Toker.
1241
1242         Scaled font destruction takes place in FontData::platformDestroy(). No
1243         need to do it in FontPlatformData::~FontPlatformData().
1244
1245         Destroying platform data in platformDestroy() is a convention we
1246         borrow from the Mac and Win ports.
1247
1248         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
1249
1250 2007-12-19  Alice Liu  <alice.liu@apple.com>
1251
1252         build fix (Windows)
1253
1254         Changed uint to unsigned int.  uint caused Windows build breakage
1255
1256         * page/Page.cpp:
1257         (WebCore::Page::markAllMatchesForText):
1258         * page/Page.h:
1259
1260 2007-12-19  Christian Dywan  <christian@twotoasts.de> 
1261
1262         Reviewed by Alp Toker.
1263
1264         http://bugs.webkit.org/show_bug.cgi?id=16222
1265         [GTK] Implement inline search and highlighting of matching strings.
1266
1267         Implement search and highlighting logic directly in WebCore.
1268
1269         * page/Page.cpp:
1270         (WebCore::incrementFrame):
1271         (WebCore::Page::findString):
1272         (WebCore::Page::markAllMatchesForText):
1273         (WebCore::Page::unmarkAllTextMatches):
1274         * page/Page.h:
1275
1276 2007-12-19  Geoffrey Garen  <ggaren@apple.com>
1277
1278         Reviewed by Sam Weinig, Dan Bernstein.
1279
1280         Tiger build fix: restored some graphics code still needed on Tiger.
1281
1282         * platform/graphics/GraphicsTypes.h:
1283         * platform/graphics/cg/GraphicsContextCG.cpp:
1284         * platform/graphics/mac/GraphicsContextMac.mm:
1285         (WebCore::GraphicsContext::setCompositeOperation):
1286
1287 2007-12-19  Alp Toker  <alp@atoker.com>
1288
1289         Build fix for Pango < 1.18.0 breakage introduced in r28864. Use Fc and
1290         the Pango backend API in these cases.
1291
1292         * platform/graphics/gtk/FontPlatformDataGtk.cpp:
1293         (WebCore::FontPlatformData::FontPlatformData):
1294         (WebCore::FontPlatformData::~FontPlatformData):
1295
1296 2007-12-19  Alice Liu  <alice.liu@apple.com>
1297
1298         Reviewed by Darin.
1299
1300         Fixed <rdar://problem/5592485> Safari crashed trying to get a motorcycle insurance quote
1301         on Geico.com WebCore::Document::inPageCache()
1302
1303         Calling Node::willRemove on the focusedNode would immediately tell the document to remove
1304         the focused node, and trigger JS events.  This means that the document is mutated while
1305         the engine is trying to tell all child nodes that it's about to removed.  To avoid
1306         crashing, we need to hold off on mutating the document until node traversal is finished.
1307
1308         * dom/ContainerNode.cpp:
1309         (WebCore::ContainerNode::removeChild):
1310         (WebCore::ContainerNode::removeChildren):
1311         * dom/Node.cpp:
1312         * dom/Node.h:
1313         (WebCore::Node::willRemove):
1314         * loader/FrameLoader.cpp:
1315         (WebCore::FrameLoader::clear):
1316
1317 2007-12-19  Andre Boule  <aboule@apple.com>
1318
1319         Reviewed by Dan Bernstein.
1320
1321         Test: fast/canvas/canvas-composite.html
1322
1323         Fix for:
1324         <rdar://problem/5640059> GraphicsContext::setCompositeOperation should use CGContextSetBlendMode
1325
1326         This fix makes setCompositeOperation consistent across all platforms that use CG.
1327
1328         The following compositing modes don't pass however that is covered by another bug:
1329         source-in
1330         source-out
1331         destination-in
1332         destination-atop
1333         copy
1334         <rdar://problem/5651783> Some canvas tag compositing modes don't render correctly
1335
1336         * platform/graphics/GraphicsTypes.h:
1337         * platform/graphics/cg/GraphicsContextCG.cpp:
1338         (WebCore::GraphicsContext::setCompositeOperation):
1339         * platform/graphics/mac/GraphicsContextMac.mm:
1340         * platform/win/GraphicsContextWin.cpp:
1341
1342 2007-12-19  Dan Bernstein  <mitz@apple.com>
1343
1344         Reviewed by Dave Hyatt.
1345
1346         - fix <rdar://problem/5650045> REGRESSION: major layout problems in svn r28754 WebKit on Vox.com page
1347
1348         Test: fast/dynamic/subtree-boundary-percent-height.html
1349
1350         * rendering/RenderObject.cpp:
1351         (WebCore::objectIsRelayoutBoundary): Do not allow overflows with
1352         percent heights because sometimes they compute to 'auto'.
1353
1354 2007-12-19  Sam Weinig  <sam@webkit.org>
1355
1356         Reviewed by Maciej.
1357
1358         http://bugs.webkit.org/show_bug.cgi?id=16511
1359         Speed up ClassNodeList and NamedNodeList by using the caching mechanism employed by ChildNodeList.
1360         - This give a ~2.15x speedup on the native test @ http://ejohn.org/apps/classname/
1361
1362         * dom/ChildNodeList.cpp: Use the caching NodeList constructor to turn on caching.
1363         (WebCore::ChildNodeList::ChildNodeList):
1364         * dom/ClassNodeList.cpp:
1365         (WebCore::ClassNodeList::ClassNodeList):
1366         * dom/ClassNodeList.h:
1367
1368         Move getElementsByName and getElementsByClassName to Node so they
1369         can use easily employ the caching already used by ChildNodeLists.  In the case of 
1370         getElementsByClassName, this reduces code duplication in Element as well
1371         * dom/Document.cpp:
1372         * dom/Document.h:
1373
1374         Move getElementsByClassName to Node.
1375         * dom/Element.cpp:
1376         * dom/Element.h:
1377
1378         * dom/NameNodeList.cpp: Use the caching NodeList constructor to turn on caching.
1379         (WebCore::NameNodeList::NameNodeList):
1380         (WebCore::NameNodeList::item):
1381         * dom/NameNodeList.h:
1382
1383         Add maps of caches for ClassNodeLists and NameNodeList to NodeListsNodeData.
1384         * dom/Node.cpp:
1385         (WebCore::TagNodeList::TagNodeList):
1386         (WebCore::Node::Node):
1387         (WebCore::Node::~Node):
1388         (WebCore::Node::childNodes):
1389         (WebCore::Node::registerNodeList):
1390         (WebCore::Node::getElementsByName):
1391         (WebCore::Node::getElementsByClassName):
1392         * dom/Node.h: Make m_nodeLists an OwnPtr.  Moved getElementsByName and getElementsByClassName here
1393
1394         Allow subclasses to choose whether they want to receive the notifications using a new bit.
1395         * dom/NodeList.cpp:
1396         (WebCore::NodeList::NodeList):
1397         * dom/NodeList.h:
1398         (WebCore::NodeList::needsNotifications):
1399
1400 2007-12-19  Dave Hyatt  <hyatt@apple.com>
1401
1402         Add support for GDI text rendering to WebKit.
1403       
1404         Reviewed by mitz
1405         
1406         * css/CSSStyleSelector.cpp:
1407         (WebCore::CSSStyleSelector::applyProperty):
1408         * dom/Document.cpp:
1409         (WebCore::Document::recalcStyle):
1410         * page/Settings.cpp:
1411         (WebCore::Settings::setFontRenderingMode):
1412         (WebCore::Settings::fontRenderingMode):
1413         * page/Settings.h:
1414         * platform/graphics/Font.h:
1415         (WebCore::Font::renderingMode):
1416         * platform/graphics/FontCache.cpp:
1417         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
1418         (WebCore::FontPlatformDataCacheKey::operator==):
1419         (WebCore::computeHash):
1420         (WebCore::FontCache::getCachedFontPlatformData):
1421         * platform/graphics/FontDescription.h:
1422         (WebCore::):
1423         (WebCore::FontDescription::FontDescription):
1424         (WebCore::FontDescription::renderingMode):
1425         (WebCore::FontDescription::setRenderingMode):
1426         (WebCore::FontDescription::operator==):
1427         * platform/graphics/GraphicsContext.h:
1428         * platform/graphics/win/FontCacheWin.cpp:
1429         (WebCore::FontCache::fontExists):
1430         (WebCore::FontCache::createFontPlatformData):
1431         * platform/graphics/win/FontDataWin.cpp:
1432         (WebCore::FontData::platformInit):
1433         (WebCore::FontData::smallCapsFontData):
1434         (WebCore::FontData::containsCharacters):
1435         (WebCore::FontData::determinePitch):
1436         (WebCore::FontData::platformWidthForGlyph):
1437         * platform/graphics/win/FontPlatformData.h:
1438         (WebCore::FontPlatformData::FontPlatformData):
1439         (WebCore::FontPlatformData::useGDI):
1440         (WebCore::FontPlatformData::operator==):
1441         * platform/graphics/win/FontPlatformDataWin.cpp:
1442         (WebCore::FontPlatformData::FontPlatformData):
1443         * platform/graphics/win/FontWin.cpp:
1444         (WebCore::Font::drawGlyphs):
1445         * platform/graphics/win/IconWin.cpp:
1446         (WebCore::Icon::paint):
1447         * platform/win/GraphicsContextWin.cpp:
1448         (WebCore::GraphicsContext::getWindowsContext):
1449         (WebCore::GraphicsContext::releaseWindowsContext):
1450         * platform/win/UniscribeController.cpp:
1451         (WebCore::UniscribeController::shapeAndPlaceItem):
1452         * platform/win/UniscribeController.h:
1453         * plugins/win/PluginViewWin.cpp:
1454         (WebCore::PluginViewWin::paint):
1455
1456 2007-12-19  Sven Herzberg  <sven@imendio.com>
1457
1458         Reviewed by Alp Toker.
1459
1460         Replace the fontconfig/freetype based font management with a pango
1461         based one. Fixes:
1462         http://bugs.webkit.org/show_bug.cgi?id=15229
1463
1464         * platform/gtk/FontDataGtk.cpp (FontData::platformDestroy()): updated
1465         the platform specific destroy code
1466         (FontData::containsCharacters()): implemented font coverage with pango
1467         * platform/gtk/FontPlatformData.h: replaced fontconfig specific
1468         members with pango-specific ones
1469         * platform/gtk/FontPlatformDataGtk.cpp: added static members for the
1470         FontPlatformData class
1471         (FontPlatformData::FontPlatformData()): implemented the font-matching
1472         with a PangoFontDescription instead of an FcPattern; initialize the
1473         scaled font by using the API for PangoCairoFont
1474         (FontPlatformData::init()): initialize the PangoFontMap and set up a
1475         hash table to translate the font family name into a font family
1476         (FontPlatformData::isFixedPitch()): implemented by querying the
1477         PangoFontFamily
1478         (FontPlatformData::operator==): compare the FontPlatformData by
1479         comparing the font pointers or the described fonts
1480         * platform/gtk/GlyphPageTreeNodeGtk.cpp (pango_font_get_glyph()):
1481         added a function to query a glyph from a PangoFont
1482         (GlyphPage::fill()): implemented the fill function with Pango instead
1483         of fontconfig/freetype
1484
1485 2007-12-19  Alp Toker  <alp@atoker.com>
1486
1487         Reviewed by Holger Freyther.
1488
1489         Improve graphics operator approximations
1490         
1491         These changes match Cairo's own CG approximations.
1492
1493         * platform/graphics/cairo/GraphicsContextCairo.cpp:
1494         (WebCore::toCairoOperator):
1495
1496 2007-12-19  Alp Toker  <alp@atoker.com>
1497
1498         Reviewed by Holger Freyther.
1499
1500         Check the bounding box before doing a full hit test
1501
1502         * platform/graphics/cairo/PathCairo.cpp:
1503         (WebCore::Path::contains):
1504
1505 2007-12-18  Sam Weinig  <sam@webkit.org>
1506
1507         Reviewed by Geoff.
1508
1509         Fix for <rdar://problem/5646478>
1510         REGRESSION: fast/events/event-view-toString fails on Leopard
1511
1512         This fixes an issue where we were incorrectly setting the lastInPrototypeChain
1513         for the JSDOMWindow (the global object) before a call to setPrototype overwrote
1514         it. This fixes it by passing the prototype up the constructor chain so that it
1515         is set before any calls can be made.
1516
1517         * bindings/js/kjs_window.cpp:
1518         (KJS::Window::Window):
1519         * bindings/js/kjs_window.h:
1520         * bindings/scripts/CodeGeneratorJS.pm:
1521
1522 2007-12-18  Beth Dakin  <bdakin@apple.com>
1523
1524         Reviewed by Oliver.
1525
1526         Fix for <rdar://problem/5616982> SVGs with width and height 100% 
1527         fail to render when used as <img> or CSS image (16167)
1528
1529         This final part of the work fixes the <img> tag.
1530
1531         This is the real fix. 
1532         * rendering/RenderImage.cpp:
1533         (WebCore::RenderImage::calcReplacedWidth): Set the container size 
1534         on the image. Setting the container size only actually sticks if 
1535         the values are non-zero, so if the container size really was set, 
1536         use the imageSize that is calculated using the container size. If 
1537         it did not stick but the image does have relative width (meaning 
1538         that the container size is 0), set the width to 0 by hand. We want 
1539         to avoid setting the width before we have a container size or we 
1540         will end up incorrectly using the default size of 300x150.
1541         (WebCore::RenderImage::calcReplacedHeight): Same as above, but for 
1542         height.
1543
1544         A few more pieces of information have to be exposed through cached 
1545         image to make this happen.
1546         * loader/CachedImage.cpp:
1547         (WebCore::CachedImage::usesImageContainerSize): As mentioned above, 
1548         when setContainerSize() is called, the container size is only 
1549         actually set if the values are non-zero. This call tells you if it 
1550         was set.
1551         (WebCore::CachedImage::imageHasRelativeWidth):
1552         (WebCore::CachedImage::imageHasRelativeHeight):
1553         * loader/CachedImage.h:
1554         * platform/graphics/Image.h:
1555         (WebCore::Image::usesContainerSize):
1556         * svg/graphics/SVGImage.cpp:
1557         (WebCore::SVGImage::usesContainerSize):
1558         * svg/graphics/SVGImage.h:
1559
1560 2007-12-18  Mark Rowe  <mrowe@apple.com>
1561
1562         Rubber-stamped by Maciej Stachowiak.
1563
1564         Remove outdated and non-functioning project files for the Apollo port.
1565
1566         * WebCore.apolloproj: Removed.
1567
1568 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
1569
1570         <rdar://problem/5649911> REGRESSION (304-306A9): Typing 'p' in popup menu for type-to-select brings up Safari Help
1571         
1572         Need to translate the char back into a key code for posting our WM_KEYDOWN.
1573         
1574         Reviewed by Ada.
1575
1576         * platform/win/PopupMenuWin.cpp:
1577         (WebCore::PopupWndProc):
1578
1579 2007-12-18  Steve Falkenburg  <sfalken@apple.com>
1580
1581         <rdar://problem/5651534> REGRESSION(r28764-r28765): GDI leak drawing text when no appropriate font is available
1582         
1583         Our captured metafile from Uniscribe may contain multiple calls to CreateFontIndirect.
1584         Only create a font with the last one.
1585         
1586         Reviewed by Mitz, Darin.
1587
1588         * platform/graphics/win/FontCacheWin.cpp:
1589         (WebCore::metaFileEnumProc):
1590         (WebCore::FontCache::getFontDataForCharacters):
1591
1592 2007-12-17  Brent Fulgham  <bfulgham@gmail.com>
1593
1594         Reviewed by Darin.
1595
1596         http://bugs.webkit.org/show_bug.cgi?id=16464
1597         Modify WebCore to use win32 thread primitives
1598
1599         Updates to support native windows threading primitives
1600         rather than pthreads emulation library.
1601
1602         * WebCore.vcproj/WebCore.vcproj:
1603         * config.h:
1604         * platform/Threading.h:
1605         * platform/win/MutexWin.cpp: Added.
1606         (WebCore::Mutex::Mutex):
1607         (WebCore::Mutex::~Mutex):
1608         (WebCore::Mutex::lock):
1609         (WebCore::Mutex::tryLock):
1610         (WebCore::Mutex::unlock):
1611         * platform/win/ThreadConditionWin.cpp: Added.
1612         (WebCore::ThreadCondition::ThreadCondition):
1613         (WebCore::ThreadCondition::~ThreadCondition):
1614         (WebCore::ThreadCondition::wait):
1615         (WebCore::ThreadCondition::signal):
1616         (WebCore::ThreadCondition::broadcast):
1617         * platform/win/ThreadingWin.cpp:
1618         (WebCore::threadMapMutex):
1619         (WebCore::threadMap):
1620         (WebCore::storeThreadHandleByIdentifier):
1621         (WebCore::identifierByThreadHandle):
1622         (WebCore::threadHandleForIdentifier):
1623         (WebCore::clearThreadHandleForIdentifier):
1624         (WebCore::createThread):
1625         (WebCore::waitForThreadCompletion):
1626         (WebCore::detachThread):
1627         (WebCore::currentThread):
1628
1629 2007-12-18  Rodney Dawes  <dobey@wayofthemonkey.com>
1630
1631         Reviewed by Darin Adler.
1632
1633         Handle EINTR when set by select() and try the select() again
1634         http://bugs.webkit.org/show_bug.cgi?id=16071
1635
1636         * platform/network/curl/ResourceHandleManager.cpp:
1637         (ResourceHandleManager::downloadTimerCallback):
1638
1639 2007-12-18  Dan Bernstein  <mitz@apple.com>
1640
1641         Reviewed by Dave Hyatt.
1642
1643         - avoid the simplified Chinese font linking code for characters that are
1644           not in any Windows code page
1645
1646         * platform/graphics/win/FontCacheWin.cpp:
1647         (WebCore::FontCache::getFontDataForCharacters):
1648
1649 2007-12-18  Brady Eidson <beidson@apple.com>
1650
1651         Reviewed by Adele
1652
1653         <rdar://problem/5525770> REGRESSION: HTTP Auth protected favicon request results in a password sheet
1654
1655         Some http-auth protected sites have the main resource(s) unprotected, but many subresources are
1656         protected by authentication.  Occasionally one can view the main page of a site but the favicon
1657         is behind the iron curtain - in these cases, we should *not* prompt for a username and password
1658         solely for the favicon.
1659
1660         * loader/ResourceLoader.h: Make didReceiveAuthenticationChallenge virtual
1661
1662         * loader/SubresourceLoader.cpp:
1663         (WebCore::SubresourceLoader::didReceiveAuthenticationChallenge): Now that this method
1664           is virtual from ResourceLoader, SubresourceLoader can override.  First call to the 
1665           SubresourceLoaderClient.  If they cancel the resource load, return early. Otherwise, let
1666           ResourceLoader work its magic (resulting in the auth sheet coming down)
1667         * loader/SubresourceLoader.h:
1668
1669         * loader/SubresourceLoaderClient.h:
1670         (WebCore::SubresourceLoaderClient::didReceiveAuthenticationChallenge):
1671
1672         * loader/icon/IconLoader.cpp:
1673         (WebCore::IconLoader::didReceiveAuthenticationChallenge): Cancel the resource load, since we should
1674           never prompt the user for credentials just for a favicon.
1675         * loader/icon/IconLoader.h:
1676
1677 2007-12-18  John Sullivan  <sullivan@apple.com>
1678
1679         Reviewed by Brady
1680         
1681         - fixed <rdar://problem/5652380> Initial prompt shows "" for databases with no user-visible name
1682
1683         * storage/DatabaseTracker.cpp:
1684         (WebCore::DatabaseTracker::canEstablishDatabase):
1685         pass "name" instead of "displayName" if there's no displayName
1686
1687 2007-12-17  Dan Bernstein  <mitz@apple.com>
1688
1689         Reviewed by Maciej Stachowiak.
1690
1691         - restore ButtonFace and ThreeDFace to their previous values for non-Mac
1692           platforms. The Mac port also uses the same values for now instead
1693           of NSColor-based ones.
1694
1695         * rendering/RenderTheme.cpp:
1696         (WebCore::RenderTheme::systemColor):
1697
1698 2007-12-17  Rodney Dawes  <dobey@wayofthemonkey.com>
1699
1700         Reviewed by Maciej Stachowiak.
1701
1702         Define WTF_USE_NPOBJECT and WTF_USE_JAVASCRIPTCORE_BINDINGS for GTK+
1703         Add required Frame::createScriptInstanceForWidget to FrameGtk
1704
1705         * config.h:
1706         * page/gtk/FrameGtk.cpp (Frame::createScriptInstanceForWidget):
1707
1708 2007-12-17  Alice Liu  <alice.liu@apple.com>
1709
1710         Reviewed by Adam.
1711
1712         Fixed <rdar://5566435> window with no scrollbars can be scrolled
1713
1714         * platform/win/ScrollViewWin.cpp:
1715         (WebCore::ScrollView::maximumScroll):
1716         corrected maximumScroll() to account for scrolling not allowed.
1717         (WebCore::ScrollView::wheelEvent):
1718
1719 2007-12-14  Juan A. Suarez Romero  <jasuarez@igalia.com>
1720
1721         Reviewed by Alp Toker.
1722
1723         http://bugs.webkit.org/show_bug.cgi?id=16042
1724         [GTK] Eliminate webkit_init()
1725
1726         Move webkit initialization to WebView class init.
1727
1728         * WebCore.pro:
1729
1730 2007-12-17  Jon Honeycutt  <jhoneycutt@apple.com>
1731
1732         Reviewed by Darin.
1733
1734         <rdar://problem/5651291> REGRESSION: Flash content doesn't display
1735         (www.adobe.com)
1736
1737         We were passing NPEvent** instead of NPEvent* to NPP_HandleEvent.
1738
1739         * plugins/win/PluginViewWin.cpp:
1740         (WebCore::PluginViewWin::dispatchNPEvent): Changed to take NPEvent&, not
1741         NPEvent*
1742         (WebCore::PluginViewWin::paint): Pass NPEvent, not NPEvent*
1743         (WebCore::PluginViewWin::handleKeyboardEvent): same
1744         (WebCore::PluginViewWin::handleMouseEvent): same
1745         * plugins/win/PluginViewWin.h:
1746
1747 2007-12-17  Alexey Proskuryakov  <ap@webkit.org>
1748
1749         Reviewed by Darin.
1750
1751         Live to the promise of never making AppKit special character codes visible via DOM.
1752
1753         Test: fast/events/arrow-keys-on-body.html
1754
1755         * page/EventHandler.cpp:
1756         (WebCore::EventHandler::keyEvent): Check for empty keypress characters after disambiguation,
1757         to let quirks-aware code strip special charactrers.
1758         * platform/mac/KeyEventMac.mm:
1759         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): If not in keyboard event quirks
1760         mode, remove the text if it's a special character.
1761
1762 2007-12-17  Mark Rowe  <mrowe@apple.com>
1763
1764         Reviewed by Darin Adler.
1765
1766         Fix incorrect array size and incorrect array index in convertNSColorToColor.
1767
1768         * rendering/RenderThemeMac.mm:
1769         (WebCore::convertNSColorToColor):
1770
1771 2007-12-17  Darin Adler  <darin@apple.com>
1772
1773         Reviewed by Mark Rowe.
1774
1775         - fix http://bugs.webkit.org/show_bug.cgi?id=16468
1776           REGRESSION(r28781): Crash running storage/transaction_callback_exception_crash.html
1777
1778         * storage/DatabaseThread.cpp:
1779         (WebCore::DatabaseThread::dispatchNextTaskIdentifier): Use a RefPtr for the database
1780         because there's no guarantee it won't lose its last reference otherwise.
1781
1782 2007-12-17  Dan Bernstein  <mitz@apple.com>
1783
1784         Reviewed by Maciej Stachowiak.
1785
1786         - fix <rdar://problem/5333260> Some Chinese characters in Text Encoding menu are bold, others are not
1787           and <rdar://problem/5280188> Chinese text looks worse on Safari for Windows cf. Safari for Mac
1788
1789         * platform/graphics/win/FontCacheWin.cpp:
1790         (WebCore::FontCache::getFontDataForCharacters): To ensure that font
1791         linking gives consistent results for characters that are exclusive to
1792         the simplified Chinese code page and characters that belong to that
1793         code page and other code pages, always ask to map to simplified Chinese
1794         alone first.
1795
1796 2007-12-17  Christian Dywan  <christian@twotoasts.de>
1797
1798         Reviewed by Alp Toker.
1799
1800         http://bugs.webkit.org/show_bug.cgi?id=16378
1801         Implement Icon for Gtk
1802
1803         Icon provides a GdkPixbuf containing a themed icon.
1804         The icon theme is probed for an icon name according to the
1805         Icon Naming Specification or conventional Gnome icon names respectively.
1806
1807         See http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
1808
1809         * platform/graphics/Icon.h:
1810         * platform/graphics/gtk/IconGtk.cpp:
1811         (WebCore::Icon::~Icon):
1812         (WebCore::lookupIconName):
1813         (WebCore::Icon::newIconForFile):
1814         (WebCore::Icon::paint):
1815
1816 2007-12-16  Sam Weinig  <sam@webkit.org>
1817
1818         Reviewed by Mitz.
1819
1820         Fix for http://bugs.webkit.org/show_bug.cgi?id=16466
1821         Move the JS Location object to its own file
1822
1823         - Move Location into its own file and rename it JSLocation.
1824
1825         * DerivedSources.make:
1826         * WebCore.pro:
1827         * WebCore.vcproj/WebCore.vcproj:
1828         * WebCore.xcodeproj/project.pbxproj:
1829         * WebCoreSources.bkl:
1830         * bindings/js/JSDocumentCustom.cpp:
1831         * bindings/js/JSLocation.cpp: Copied from WebCore/bindings/js/kjs_window.cpp.
1832         (WebCore::):
1833         (WebCore::JSLocation::JSLocation):
1834         (WebCore::JSLocation::getValueProperty):
1835         (WebCore::JSLocation::getOwnPropertySlot):
1836         (WebCore::JSLocation::put):
1837         (WebCore::JSLocationProtoFuncReplace::callAsFunction):
1838         (WebCore::JSLocationProtoFuncReload::callAsFunction):
1839         (WebCore::JSLocationProtoFuncAssign::callAsFunction):
1840         (WebCore::JSLocationProtoFuncToString::callAsFunction):
1841         * bindings/js/JSLocation.h: Copied from WebCore/bindings/js/kjs_window.h.
1842         (WebCore::JSLocation::):
1843         (WebCore::JSLocation::frame):
1844         (WebCore::JSLocation::classInfo):
1845         * bindings/js/kjs_window.cpp:
1846         (KJS::Window::location):
1847         * bindings/js/kjs_window.h:
1848         * history/CachedPage.cpp:
1849
1850 2007-12-16  Dan Bernstein  <mitz@apple.com>
1851
1852         Reviewed by Sam Weinig.
1853
1854         - make 'cursor: copy' and 'cursor: none' work.
1855
1856         Already covered by manual-tests/cursor.html
1857
1858         * rendering/RenderStyle.h: Increase the _cursor_style field to 6 bits,
1859         needed for the 33rd and 34th cursor values.
1860
1861 2007-12-16  Mark Rowe  <mrowe@apple.com>
1862
1863         Reviewed by Maciej Stachowiak.
1864
1865         Refactor Mac plugin stream code to use the shared NetscapePlugInStreamLoader implementation.
1866
1867         * WebCore.base.exp:
1868         * WebCore.xcodeproj/project.pbxproj:
1869         * loader/NetscapePlugInStreamLoader.h:
1870         * loader/mac/NetscapePlugInStreamLoaderMac.mm: Removed.
1871         * loader/mac/WebPlugInStreamLoaderDelegate.h: Moved to WebKit.
1872
1873 2007-12-16  Sam Weinig  <sam@webkit.org>
1874
1875         Reviewed by Maciej.
1876
1877         Yet more of http://bugs.webkit.org/show_bug.cgi?id=16385
1878         Cleanup kjs_window
1879
1880         - Move ScheduledAction into its own file and put it in the WebCore namespace.
1881
1882         * WebCore.pro:
1883         * WebCore.vcproj/WebCore.vcproj:
1884         * WebCore.xcodeproj/project.pbxproj:
1885         * WebCoreSources.bkl:
1886         * bindings/js/PausedTimeouts.cpp:
1887         * bindings/js/PausedTimeouts.h:
1888         * bindings/js/ScheduledAction.cpp: Copied from bindings/js/kjs_window.cpp.
1889         (WebCore::ScheduledAction::ScheduledAction):
1890         (WebCore::ScheduledAction::execute):
1891         * bindings/js/ScheduledAction.h: Copied from bindings/js/kjs_window.h.
1892         (WebCore::ScheduledAction::ScheduledAction):
1893         * bindings/js/kjs_window.cpp:
1894         (KJS::DOMWindowTimer::DOMWindowTimer):
1895         (KJS::DOMWindowTimer::action):
1896         (KJS::DOMWindowTimer::takeAction):
1897         (KJS::Window::installTimeout):
1898         (KJS::Window::timerFired):
1899         * bindings/js/kjs_window.h:
1900
1901 2007-12-16  Alp Toker  <alp@atoker.com>
1902
1903         Reviewed by Maciej.
1904
1905         http://bugs.webkit.org/show_bug.cgi?id=16356
1906         [GTK] Integrate GStreamer video with the graphics backend
1907
1908         Integrate the GStreamer media backend with the Cairo graphics backend.
1909         There are still some issues: Data is copied more often than necessary,
1910         and repaint() is not called, causing transformed video not to update
1911         sometimes.
1912
1913         * WebCore.pro:
1914         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
1915         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
1916         (WebCore::MediaPlayerPrivate::~MediaPlayerPrivate):
1917         (WebCore::MediaPlayerPrivate::currentTime):
1918         (WebCore::MediaPlayerPrivate::setEndTime):
1919         (WebCore::MediaPlayerPrivate::seeking):
1920         (WebCore::MediaPlayerPrivate::naturalSize):
1921         (WebCore::MediaPlayerPrivate::setMuted):
1922         (WebCore::MediaPlayerPrivate::setRect):
1923         (WebCore::MediaPlayerPrivate::setVisible):
1924         (WebCore::MediaPlayerPrivate::repaint):
1925         (WebCore::MediaPlayerPrivate::paint):
1926         (WebCore::MediaPlayerPrivate::createGSTPlayBin):
1927         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
1928         * platform/graphics/gtk/VideoSinkGStreamer.cpp: Added.
1929         (webkit_video_sink_base_init):
1930         (webkit_video_sink_init):
1931         (webkit_video_sink_idle_func):
1932         (webkit_video_sink_render):
1933         (webkit_video_sink_set_caps):
1934         (webkit_video_sink_dispose):
1935         (webkit_video_sink_finalize):
1936         (webkit_video_sink_set_property):
1937         (webkit_video_sink_get_property):
1938         (webkit_video_sink_stop):
1939         (webkit_video_sink_class_init):
1940         (webkit_video_sink_new):
1941         (webkit_video_sink_set_surface):
1942         (plugin_init):
1943         * platform/graphics/gtk/VideoSinkGStreamer.h: Added.
1944
1945 2007-12-16  Mark Rowe  <mrowe@apple.com>
1946
1947         Mac build fix.
1948
1949         * WebCore.xcodeproj/project.pbxproj: Remove NetscapePlugInStreamLoader.cpp from the WebCore target.
1950         Mac currently has its own implementation in NetscapePlugInStreamLoaderMac.mm which conflicts with the
1951         new shared implementation.
1952
1953 2007-12-16  Rodney Dawes  <dobey@wayofthemonkey.com>
1954
1955         Reviewed by Maciej Stachowiak.
1956
1957         http://bugs.webkit.org/show_bug.cgi?id=16389
1958         Bug 16389: Common Implementation of NetscapePlugInStreamLoader
1959
1960         * WebCore.vcproj/WebCore.vcproj: Remove NetscapePlugInStreamLoaderWin.cpp.
1961         * loader/NetscapePlugInStreamLoader.cpp: Copy method implementations from NetscapePlugInStreamLoaderWin.cpp.
1962         * loader/win/NetscapePlugInStreamLoaderWin.cpp: Removed.
1963
1964 2007-12-16  Grace Kloba  <klobag@gmail.com>
1965
1966         Reviewed by Darin Adler.
1967
1968         Fix http://bugs.webkit.org/show_bug.cgi?id=16433.
1969         Bug 16433: LOW_BANDWIDTH_DISPLAY build is broken
1970
1971         * dom/Document.cpp:
1972         (WebCore::Document::Document):
1973         * loader/FrameLoader.cpp:
1974         (WebCore::FrameLoader::addLowBandwidthDisplayRequest):
1975         (WebCore::FrameLoader::switchOutLowBandwidthDisplayIfReady):
1976
1977 2007-12-16  Darin Adler  <darin@apple.com>
1978
1979         Reviewed by Maciej.
1980
1981         - fix <rdar://problem/5636065> First form of SQLTransaction.executeSql() fails with TYPE_ERROR dom exception
1982
1983         Test: storage/execute-sql-args.html
1984
1985         * bindings/js/JSSQLTransactionCustom.cpp:
1986         (WebCore::JSSQLTransaction::executeSql): Added exception handling code so that once an
1987         exception happens, we won't try to do any more argument processing. Changed processing
1988         of the second argument so that we allow an undefined value or null, and simply omit the
1989         array. Changed processing of the second argument so that we don't require an actual
1990         JavaScript array. Instead, as with the JavaScript array operations themselves, we use
1991         the length property and corresponding numeric properties of the object, allowing other
1992         objects to act as arrays. Changed processing of the third and fourth arguments to
1993         allow the undefined value as well as null; we check the value of the argument rather
1994         than looking at the size of the passed-in arguments list.
1995
1996 2007-12-16  Sam Weinig  <sam@webkit.org>
1997
1998         Reviewed by Darin.
1999
2000         More of http://bugs.webkit.org/show_bug.cgi?id=16385
2001         Cleanup kjs_window
2002
2003         - Move PausedTimeouts into its own file and put it in the WebCore namespace.
2004
2005         * WebCore.pro:
2006         * WebCore.vcproj/WebCore.vcproj:
2007         * WebCore.xcodeproj/project.pbxproj:
2008         * WebCoreSources.bkl:
2009         * bindings/js/PausedTimeouts.cpp: Copied from bindings/js/kjs_window.cpp.
2010         * bindings/js/PausedTimeouts.h: Copied from bindings/js/kjs_window.h.
2011         * bindings/js/kjs_window.cpp:
2012         (KJS::Window::pauseTimeouts):
2013         * bindings/js/kjs_window.h:
2014         * history/CachedPage.cpp:
2015         * history/CachedPage.h:
2016         * page/Chrome.cpp:
2017
2018 2007-12-16  Beth Dakin  <bdakin@apple.com>
2019
2020         Reviewed by Geoff.
2021
2022         Make relative-size SVGs work in border-image.
2023
2024         * rendering/RenderBox.cpp:
2025         (WebCore::RenderBox::calculateBackgroundSize):
2026         * rendering/RenderObject.cpp:
2027         (WebCore::RenderObject::paintBorderImage):
2028
2029 2007-12-16  Darin Adler  <darin@apple.com>
2030
2031         - fix Tiger build (my fault it was broken)
2032
2033         * rendering/RenderThemeMac.mm: Define NSUInteger if on Tiger.
2034
2035 2007-12-16  Andrew Wellington  <proton@wiretapped.net>
2036
2037         Reviewed by Darin.
2038         
2039         http://bugs.webkit.org/show_bug.cgi?id=6129
2040         Incomplete implementation of CSS 2.1 system colors
2041
2042         Test: fast/css/css2-system-color.html
2043         
2044         Based on original patch by Rob Buis.
2045         
2046         System colors are retrieved from NSColor as appropriate. If the color is a pattern color
2047         (and therefore NSColor won't let us retrieve a color from it) we draw a 1x1 image of the
2048         color and sample that to get a solid color.
2049
2050         * css/CSSStyleSelector.cpp:
2051         (WebCore::):
2052         (WebCore::colorForCSSValue):
2053         * rendering/RenderTheme.cpp:
2054         (WebCore::RenderTheme::systemColor):
2055         * rendering/RenderTheme.h:
2056         * rendering/RenderThemeMac.h:
2057         * rendering/RenderThemeMac.mm:
2058         (WebCore::getSystemColor):
2059         (WebCore::RenderThemeMac::platformColorsDidChange):
2060         (WebCore::RenderThemeMac::systemColor):
2061
2062 2007-12-16  Dan Bernstein  <mitz@apple.com>
2063
2064         Reviewed by Darin Adler.
2065
2066         - fix http://bugs.webkit.org/show_bug.cgi?id=16426
2067           Divs with overflow:auto: scrollbars not correctly updated when contents change
2068
2069         Test: fast/overflow/scrollbar-position-update.html
2070
2071         * platform/mac/PlatformScrollBarMac.mm:
2072         (WebCore::PlatformScrollbar::updateThumbProportion): Update the
2073         NSScroller's value for the new proportions.
2074         * rendering/RenderLayer.cpp:
2075         (WebCore::RenderLayer::updateScrollInfoAfterLayout): Removed unnecessary
2076         repaint(). Scrollbars repaint themselves as needed.
2077
2078 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
2079
2080         Reviewed by Darin.
2081
2082         http://bugs.webkit.org/show_bug.cgi?id=14140
2083         <rdar://problem/5270958> REGRESSION: Complex system KeyBindings don't work properly
2084
2085         * dom/KeyboardEvent.h:
2086         (WebCore::KeypressCommand::KeypressCommand):
2087         (WebCore::KeyboardEvent::keypressCommands):
2088         Change stored command class to preserve complete information about commands.
2089
2090         * editing/EditorCommand.cpp: (WebCore::CommandEntry::): Mark InsertText as a text insertion
2091         command, which it is. Previously, we couldn't do it because WebKit didn't really treat insertText:
2092         as a command.
2093
2094         * page/EventHandler.cpp: (WebCore::EventHandler::keyEvent): Copy commands saved while interpreting
2095         a keydown event into keypress, to avoid losing state when running interpretKeyEvents: again.
2096
2097 2007-12-16  Alexey Proskuryakov  <ap@webkit.org>
2098
2099         Reviewed by Darin.
2100
2101         http://bugs.webkit.org/show_bug.cgi?id=16462
2102         REGRESSION: access keys broken on Windows
2103
2104         * page/EventHandler.cpp:
2105         (WebCore::EventHandler::handleAccessKey):
2106         (WebCore::EventHandler::keyEvent):
2107         * page/EventHandler.h:
2108         Make handleAccessKey a class method; rely on WebKit to call it on Windows and wxWidgets.
2109
2110 2007-12-16  Xan Lopez  <xan@gnome.org>
2111
2112         Reviewed by Alexey Proskuryakov.
2113
2114         http://bugs.webkit.org/show_bug.cgi?id=16454
2115         [GTK] Text input doesn't work consistently on PPC
2116
2117         * platform/gtk/KeyEventGtk.cpp:
2118         (WebCore::singleCharacterString):
2119
2120         UChar is 2 bytes (UTF-16), so transform accordingly from
2121         gunichar (UCS-4). Fixes keyboard input on big endian systems.
2122
2123 2007-12-15  Darin Adler  <darin@apple.com>
2124
2125         Reviewed by Mark Rowe.
2126
2127         - better build fix for the problem affecting GTK and some other platforms
2128           "this time for sure"
2129
2130         * WebCore.xcodeproj/project.pbxproj:
2131         * bindings/js/JSEventTargetBase.cpp: Move the include of the .lut.h file here.
2132         * bindings/js/JSEventTargetBase.h: Instead of including the .lut.h file in the header,
2133         which won't work, declare the tables that are in the .lut.h file in the header.
2134
2135 2007-12-12  Kevin Watters  <kevin@dotsyntax.com>
2136
2137         Reviewed by Darin Adler.
2138
2139         Fixed the Wx port's FontPlatformData for use in HashTable.
2140         - FontPlatformData(Deleted) made unequal to FontPlatformData()
2141
2142         * platform/graphics/wx/FontPlatformData
2143
2144 2007-12-15  Dan Bernstein  <mitz@apple.com>
2145
2146         Reviewed by Darin Adler.
2147
2148         - fix <rdar://problem/5636090> Text in Georgia, Armenian, Inuktitut, Cree, or Cherokee (KA, HY, IU, CR, CHR) draws as all missing glyphs
2149
2150         * platform/graphics/win/FontCacheWin.cpp:
2151         (WebCore::metaFileEnumProc): Added. Called during metafile record
2152         enumeration and extracts the font from the create font record.
2153         (WebCore::FontCache::getFontDataForCharacters): If font linking fails,
2154         let Uniscribe draw the characters and see what font it chooses.
2155
2156 2007-12-15  Darin Adler  <darin@apple.com>
2157
2158         * WebCore.pro: Roll my last change out. Was wrong and didn't fix the build.
2159
2160 2007-12-15  Darin Adler  <darin@apple.com>
2161
2162         Another try at a GTK build fix.
2163
2164         * WebCore.pro: Add JSEventTargetBase.cpp to LUT_TABLE_FILES instead of LUT_FILES.
2165
2166 2007-12-15  Sam Weinig  <sam@webkit.org>
2167
2168         Force windows to regenerate COM DOM bindings.
2169
2170         * WebCore.vcproj/build-generated-files.sh: Add license. 
2171         * bindings/scripts/CodeGeneratorCOM.pm: Use shared WK_ucfirst.
2172
2173 2007-12-15  Sam Weinig  <sam@webkit.org>
2174
2175         Fix Windows and wx builds.
2176
2177         * WebCore.vcproj/WebCore.vcproj:
2178         * WebCoreSources.bkl:
2179
2180 2007-12-15  Mark Rowe  <mrowe@apple.com>
2181
2182         Gtk build fix.  Add JSEventTargetBase.cpp to SOURCES.
2183
2184         * WebCore.pro:
2185
2186 2007-12-15  Sam Weinig  <sam@webkit.org>
2187
2188         Fix wx build.
2189
2190         * WebCoreSources.bkl:
2191
2192 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
2193
2194         Not reviewed. Build fix for Qt/Gtk.
2195
2196         * WebCore.pro: Include JSEventTargetBase.lut.h in generation
2197
2198 2007-12-15  Nikolas Zimmermann  <zimmermann@kde.org>
2199
2200         Reviewed by Eric.
2201
2202         Fixes: http://bugs.webkit.org/show_bug.cgi?id=16445 (Refactor EventTargetNode & JSEventTargetNode for an upcoming SVG patch)
2203
2204         Split up JSEventTargetNode in JSEventTargetNode & JSEventTargetBase - where most functionality has been moved down
2205         in the base class. Applied the same refactorization to EventTargetNode.
2206
2207         This makes it possible for the upcoming patch implementing the EventTarget interface for SVGElementInstance
2208         to share as much code as possible with the EventTargetNode classes.
2209
2210         * DerivedSources.make:
2211         * WebCore.xcodeproj/project.pbxproj:
2212         * bindings/js/JSEventTargetBase.cpp: Added.
2213         (WebCore::retrieveEventTargetAndCorrespondingNode):
2214         (WebCore::eventNameForPropertyToken):
2215         * bindings/js/JSEventTargetBase.h: Added.
2216         (WebCore::JSEventTargetProperties::):
2217         (WebCore::JSEventTargetPrototypeFunctionBase::JSEventTargetPrototypeFunctionBase):
2218         (WebCore::JSEventTargetPrototypeFunction::JSEventTargetPrototypeFunction):
2219         (WebCore::):
2220         (WebCore::::create):
2221         (WebCore::JSEventTargetBase::JSEventTargetBase):
2222         (WebCore::JSEventTargetBase::getValueProperty):
2223         (WebCore::JSEventTargetBase::putValueProperty):
2224         (WebCore::JSEventTargetBase::getOwnPropertySlot):
2225         (WebCore::JSEventTargetBase::put):
2226         (WebCore::JSEventTargetPrototype::JSEventTargetPrototype):
2227         (WebCore::JSEventTargetPrototype::self):
2228         (WebCore::JSEventTargetPrototype::getOwnPropertySlot):
2229         (WebCore::JSEventTargetPrototype::classInfo):
2230         * bindings/js/JSEventTargetNode.cpp:
2231         (WebCore::JSEventTargetNode::getOwnPropertySlot):
2232         (WebCore::JSEventTargetNode::getValueProperty):
2233         (WebCore::JSEventTargetNode::put):
2234         (WebCore::JSEventTargetNode::putValueProperty):
2235         (WebCore::JSEventTargetNode::setListener):
2236         (WebCore::toEventTargetNode):
2237         * bindings/js/JSEventTargetNode.h:
2238         (WebCore::JSEventTargetPrototypeInformation::prototypeClassName):
2239         (WebCore::JSEventTargetPrototypeInformation::prototypeIdentifier):
2240         * dom/EventTarget.cpp:
2241         (WebCore::EventTarget::addEventListener):
2242         (WebCore::EventTarget::removeEventListener):
2243         (WebCore::EventTarget::dispatchGenericEvent):
2244         (WebCore::EventTarget::removeAllEventListeners):
2245         (WebCore::EventTarget::insertedIntoDocument):
2246         (WebCore::EventTarget::removedFromDocument):
2247         (WebCore::EventTarget::handleLocalEvents):
2248         (WebCore::EventTarget::applySVGEventTargetRules):
2249         (WebCore::forbidEventDispatch):
2250         (WebCore::allowEventDispatch):
2251         (WebCore::eventDispatchForbidden):
2252         * dom/EventTarget.h:
2253         (WebCore::EventTarget::preDispatchEventHandler):
2254         (WebCore::EventTarget::postDispatchEventHandler):
2255         (WebCore::forbidEventDispatch):
2256         (WebCore::allowEventDispatch):
2257         * dom/EventTargetNode.cpp:
2258         (WebCore::EventTargetNode::~EventTargetNode):
2259         (WebCore::EventTargetNode::insertedIntoDocument):
2260         (WebCore::EventTargetNode::removedFromDocument):
2261         (WebCore::EventTargetNode::addEventListener):
2262         (WebCore::EventTargetNode::removeEventListener):
2263         (WebCore::EventTargetNode::removeAllEventListeners):
2264         (WebCore::EventTargetNode::handleLocalEvents):
2265         (WebCore::EventTargetNode::dispatchEvent):
2266         (WebCore::EventTargetNode::dispatchWindowEvent):
2267         * dom/EventTargetNode.h:
2268         (WebCore::EventTargetNode::localEventListeners):
2269         * svg/SVGElement.cpp:
2270         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
2271         (WebCore::SVGElement::dispatchEvent):
2272
2273 2007-12-15  Eric Seidel  <eric@webkit.org>
2274
2275         Reviewed by Oliver.
2276         
2277         Width of SVG elements not applied to container elements
2278         http://bugs.webkit.org/show_bug.cgi?id=16305
2279         Added calcPrefWidths for RenderSVGRoot (copied from RenderReplaced)
2280         This is caused by poor factoring in the render tree.  RenderContainer probably should be a template.
2281
2282         svg/css/css-box-min-width.html
2283
2284         * rendering/RenderSVGRoot.cpp:
2285         (WebCore::RenderSVGRoot::calcPrefWidths): Added.
2286         * rendering/RenderSVGRoot.h:
2287         * css/SVGCSSStyleSelector::applySVGProperty: fixed ASSERT in debug builds
2288
2289 2007-12-15  David Kilzer  <ddkilzer@apple.com>
2290
2291         Fix comment after isSafeScript() was renamed to allowsAccessFrom().
2292
2293         * bindings/js/kjs_window.cpp:
2294         (KJS::createWindow):
2295
2296 2007-12-15  Alp Toker  <alp@atoker.com>
2297
2298         Reviewed by Mark Rowe.
2299
2300         http://bugs.webkit.org/show_bug.cgi?id=16449
2301         cairo_arc() functions hang or crash when passed inf as radius or start/end angle
2302
2303         Add checks. This matches a similar workaround for a CG bug in the CG
2304         graphics backend: <rdar://problem/5189233>
2305
2306         Fixes:
2307           fast/canvas/arc-crash.html
2308           fast/canvas/canvas-with-incorrect-args.html
2309
2310         * platform/graphics/cairo/PathCairo.cpp:
2311         (WebCore::Path::addArc):
2312
2313 2007-12-15  Alexey Proskuryakov  <ap@webkit.org>
2314
2315         Reviewed by Darin.
2316
2317         http://bugs.webkit.org/show_bug.cgi?id=16078
2318         Google Maps zooming via the scroll wheel (almost) always zooms IN only.
2319
2320         * dom/WheelEvent.cpp: (WebCore::WheelEvent::WheelEvent):
2321         Ensure that delta is never rounded down to zero - we are getting values less than 1 from 
2322         many mice on OS X, and Google Maps code assumes scrolling up if event.wheelDelta is zero.
2323
2324 2007-12-14  Dan Bernstein  <mitz@apple.com>
2325
2326         - Windows build fix
2327
2328         * WebCore.vcproj/WebCore.vcproj:
2329
2330 2007-12-14  Alp Toker  <alp@atoker.com>
2331
2332         GTK+/Qt build fix. Track added files in r28722.
2333
2334         * WebCore.pro:
2335
2336 2007-12-14  Sam Weinig  <sam@webkit.org>
2337
2338         Reviewed by Geoff.
2339
2340         Speed up getElementByClassName.
2341         - This makes getElementByClassName 33% faster on the stress test
2342           linked to at http://bugs.webkit.org/show_bug.cgi?id=15760.
2343
2344         * platform/text/StringImpl.cpp:
2345         (WebCore::StringImpl::foldCase): Optimize the case when all the characters are ASCII.
2346
2347 2007-12-14  Alp Toker  <alp@atoker.com>
2348
2349         Reviewed by Maciej.
2350
2351         http://bugs.webkit.org/show_bug.cgi?id=16432
2352         [GTK] Update license headers
2353
2354         Consent has been given by the authors of these files to change license
2355         to the LGPL as outlined in the bug report.
2356
2357         * platform/gtk/ClipboardGtk.cpp:
2358         * platform/gtk/ContextMenuGtk.cpp:
2359         * platform/gtk/ContextMenuItemGtk.cpp:
2360         * platform/gtk/CookieJarGtk.cpp:
2361         * platform/gtk/CursorGtk.cpp:
2362         * platform/gtk/DragDataGtk.cpp:
2363         * platform/gtk/DragImageGtk.cpp:
2364         * platform/gtk/PasteboardGtk.cpp:
2365         * platform/gtk/PlatformScreenGtk.cpp:
2366         * platform/gtk/PlatformScrollBarGtk.cpp:
2367         * platform/gtk/SearchPopupMenuGtk.cpp:
2368         * platform/gtk/WidgetGtk.cpp:
2369
2370 2007-12-14  Darin Adler  <darin@apple.com>
2371
2372         Reviewed by Adele.
2373
2374         - fix http://bugs.webkit.org/show_bug.cgi?id=16442
2375           navigation policy delegate gets called twice for each load
2376
2377         * loader/MainResourceLoader.cpp:
2378         (WebCore::MainResourceLoader::willSendRequest): Removed call to checkNavigationPolicy.
2379         That's handled by FrameLoader.
2380
2381         * loader/MainResourceLoader.h: Removed callContinueAfterNavigationPolicy
2382         and continueAfterNavigationPolicy.
2383
2384 2007-12-14  Anders Carlsson  <andersca@apple.com>
2385
2386         Reviewed by Brady.
2387
2388         Make document.open count as committing a document load, so that -[WebFrame dataSource:] won't
2389         return nil in that case.
2390         
2391         * loader/FrameLoader.cpp:
2392         (WebCore::FrameLoader::didExplicitOpen):
2393
2394 2007-12-14  David Smith  <catfish.man@gmail.com>
2395
2396         Reviewed by Mitz.
2397
2398         - fix http://bugs.webkit.org/show_bug.cgi?id=14955
2399           Implement getElementsByClassName.
2400
2401         This patch also renames AtomicStringList to ClassNames to better reflect its actual use,
2402         and takes advantage of admitting that it's class-specific to encapsulate class attribute 
2403         parsing so it can be shared.  It also changes the class to use a Vector, rather than a linked
2404         list to store the class names.
2405
2406         Tests: fast/dom/getElementsByClassName/001.html
2407                fast/dom/getElementsByClassName/002.html
2408                fast/dom/getElementsByClassName/003.html
2409                fast/dom/getElementsByClassName/004.html
2410                fast/dom/getElementsByClassName/005.html
2411                fast/dom/getElementsByClassName/006.html
2412                fast/dom/getElementsByClassName/007.html
2413                fast/dom/getElementsByClassName/008.html
2414                fast/dom/getElementsByClassName/009.html
2415                fast/dom/getElementsByClassName/010.xml
2416                fast/dom/getElementsByClassName/011.xml
2417                fast/dom/getElementsByClassName/012.html
2418                fast/dom/getElementsByClassName/013.html
2419                fast/dom/getElementsByClassName/014.html
2420                fast/dom/getElementsByClassName/array/001.html
2421                fast/dom/getElementsByClassName/array/002.html
2422                fast/dom/getElementsByClassName/array/003.html
2423                fast/dom/getElementsByClassName/array/004.html
2424                fast/dom/getElementsByClassName/dumpNodeList.html
2425
2426         * WebCore.xcodeproj/project.pbxproj:
2427         * css/CSSStyleSelector.cpp:
2428         (WebCore::CSSStyleSelector::matchRules):
2429         (WebCore::CSSStyleSelector::checkOneSelector):
2430         * dom/AtomicStringList.h: Removed.
2431         * dom/ClassNames.cpp: Added.
2432         (WebCore::ClassNames::contains):
2433         (WebCore::ClassNames::parseClassAttribute):
2434         * dom/ClassNames.h: Copied from WebCore/dom/AtomicStringList.h.
2435         (WebCore::ClassNames::ClassNames):
2436         (WebCore::ClassNames::size):
2437         (WebCore::ClassNames::clear):
2438         (WebCore::ClassNames::operator[]):
2439         (WebCore::isClassWhitespace):
2440         * dom/ClassNodeList.cpp: Added.
2441         (WebCore::ClassNodeList::ClassNodeList):
2442         (WebCore::ClassNodeList::length):
2443         (WebCore::ClassNodeList::item):
2444         (WebCore::ClassNodeList::nodeMatches):
2445         * dom/ClassNodeList.h: Added.
2446         * dom/Document.cpp:
2447         (WebCore::Document::getElementsByName):
2448         (WebCore::Document::getElementsByClassName):
2449         * dom/Document.h:
2450         * dom/Document.idl:
2451         * dom/Element.cpp:
2452         (WebCore::Element::getClassNames):
2453         (WebCore::Element::getElementsByClassName):
2454         * dom/Element.h:
2455         * dom/Element.idl:
2456         * dom/NameNodeList.cpp:
2457         (WebCore::NameNodeList::NameNodeList):
2458         (WebCore::NameNodeList::item):
2459         (WebCore::NameNodeList::nodeMatches):
2460         * dom/NameNodeList.h:
2461         * dom/NamedMappedAttrMap.cpp:
2462         (WebCore::NamedMappedAttrMap::clearAttributes):
2463         (WebCore::NamedMappedAttrMap::parseClassAttribute):
2464         * dom/NamedMappedAttrMap.h:
2465         (WebCore::NamedMappedAttrMap::getClassNames):
2466         * dom/StyledElement.cpp:
2467         (WebCore::StyledElement::getClassNames):
2468         * dom/StyledElement.h:
2469
2470 2007-12-14  Darin Adler  <darin@apple.com>
2471
2472         Reviewed by Sam.
2473
2474         - fix http://bugs.webkit.org/show_bug.cgi?id=16351
2475           FontFallbackList.h doesn't include wtf/PassRefPtr.h
2476           
2477         * platform/graphics/FontFallbackList.h: Added include of <wtf/Forward.h>
2478         * platform/graphics/GlyphPageTreeNode.h: Removed an unneeded include.
2479
2480 2007-12-14  Darin Adler  <darin@apple.com>
2481
2482         Reviewed by Alexey.
2483
2484         - http://bugs.webkit.org/show_bug.cgi?id=16420
2485           change regression tests to use document.execCommand instead of textInputController.doCommand
2486
2487         Add a few more operations to document.execCommand.
2488
2489         Finished up the transition to the new Editor::Command, including removing
2490         the Editor::execCommand function.
2491
2492         * WebCore.base.exp: Added Editor::Command::isSupported.
2493         * editing/Editor.h: Removed execCommand.
2494         * editing/EditorCommand.cpp:
2495         (WebCore::expandSelectionToGranularity): Added.
2496         (WebCore::verticalScrollDistance): Added; replaces canScroll.
2497         (WebCore::executeDeleteBackward): Added. Moved code here from WebHTMLView.
2498         (WebCore::executeDeleteBackwardByDecomposingPreviousCharacter): Ditto.
2499         (WebCore::executeDeleteForward): Ditto.
2500         (WebCore::executeDeleteToBeginningOfLine): Ditto.
2501         (WebCore::executeDeleteToBeginningOfParagraph): Ditto.
2502         (WebCore::executeDeleteToEndOfLine): Ditto.
2503         (WebCore::executeDeleteToEndOfParagraph): Ditto.
2504         (WebCore::executeMovePageDown): Renamed this command to be consistent with all the other
2505         Move commands. They all modify the caret. Reimplemented to match the Mac OS X version by
2506         removing the explicit scrolling, and letting it be done automatically by code that makes
2507         the caret visible. In some cases the old code would scroll twice which was harmless but
2508         unnecessary.
2509         (WebCore::executeMovePageDownAndModifySelection): Added. Moved code here from WebHTMLView.
2510         (WebCore::executeMovePageUp): See MovePageDown above.
2511         (WebCore::executeMovePageUpAndModifySelection): Added. Moved code here from WebHTMLView.
2512         (WebCore::executeSelectLine): Ditto.
2513         (WebCore::executeSelectParagraph): Ditto.
2514         (WebCore::executeSelectSentence): Ditto.
2515         (WebCore::executeSelectWord): Ditto.
2516         (WebCore::executeSwapWithMark): Some small tweaks.
2517
2518         * page/ContextMenuController.cpp:
2519         (WebCore::ContextMenuController::contextMenuItemSelected): Changed to use Editor::command()
2520         instead of Editor::execCommand(). This code could be changed to use Editor::Command quite a
2521         bit more, but I didn't do that this time.
2522
2523         - Removed some obsolete unused code.
2524
2525         * page/mac/EventHandlerMac.mm:
2526         (WebCore::EventHandler::passMouseDownEventToWidget): Removed the special case code for
2527         NSTextView. This was left over from when we used NSTextField and NSTextView for form
2528         elements and is no longer used at all.
2529
2530         * page/mac/WebCoreFrameBridge.h: Removed 20 unused methods that were still on one side
2531         of the bridge or another. We really need to find a time to tear down the rest of the
2532         bridge, but that's not this patch.
2533
2534         * page/mac/WebCoreFrameBridge.mm:
2535         (-[WebCoreFrameBridge addData:]): Changed to get at the _shouldCreateRenderers field directly
2536         instead of using a method.
2537         (-[WebCoreFrameBridge rangeByAlteringCurrentSelection:SelectionController::direction:SelectionController::granularity:]):
2538         Took out obsolete comment about matching enums (we use a single enum now and have for some
2539         time).
2540         (-[WebCoreFrameBridge selectionGranularity]): Ditto.
2541
2542 2007-12-14  Justin Garcia  <justin.garcia@apple.com>
2543
2544         Reviewed by Darin Adler.
2545
2546         <rdar://problem/5575101> GoogleDocs: Hang in SplitElementCommand::doApply when outdenting a list item in a particular list
2547
2548         * editing/CompositeEditCommand.cpp:
2549         (WebCore::CompositeEditCommand::splitTreeToNode): Moved here.
2550         * editing/CompositeEditCommand.h:
2551         * editing/IndentOutdentCommand.cpp: Moved splitTreeToNode.
2552         * editing/IndentOutdentCommand.h: Ditto, and removed unimplemented splitTreeTo.
2553         * editing/InsertListCommand.cpp:
2554         (WebCore::InsertListCommand::doApply): Split ancestors of listChildNode between
2555         it and listNode, if they exists, so that moving listChildNode doesn't put it out
2556         of order.  Added a test case to cover each change.
2557         * editing/SplitElementCommand.cpp:
2558         (WebCore::SplitElementCommand::doApply): Added an ASSERT to catch code that
2559         tries to split a container at a bogus child, and an early return to avoid a
2560         hang in that case.
2561
2562 2007-12-14  Anders Carlsson  <andersca@apple.com>
2563
2564         Reviewed by Darin and Geoff.
2565
2566         <rdar://problem/5619295> 
2567         REGRESSION: 303-304: Embedded YouTube video fails to render- JS errors (16150) (Flash 9)
2568
2569         _NPN_CreateScriptObject doesn't take an origin root object anymore.
2570         
2571         * html/HTMLPlugInElement.cpp:
2572         (WebCore::HTMLPlugInElement::createNPObject):
2573         * page/Frame.cpp:
2574         (WebCore::Frame::windowScriptNPObject):
2575
2576 2007-12-14  Dan Bernstein  <mitz@apple.com>
2577
2578         Reviewed by Darin Adler.
2579
2580         - fix <rdar://problem/5643663> text-shadow and box-shadow offsets 1px smaller than specified
2581           which is the root cause of:
2582           http://bugs.webkit.org/show_bug.cgi?id=12943
2583           box-shadow: small values don't affect shadow position
2584           http://bugs.webkit.org/show_bug.cgi?id=14736
2585           Safari implementation of text-shadow off by 1px
2586
2587         * platform/graphics/cg/GraphicsContextCG.cpp:
2588         (WebCore::GraphicsContext::setShadow): Slightly increase the magnitude
2589         of the offsets passed to CGContextSetShadow* to ensure that the end
2590         result after truncation is the desired integer offsets.
2591
2592 2007-12-13  Alp Toker  <alp@atoker.com>
2593
2594         curl backend build fix for breakage introduced in r28709.
2595
2596         * platform/network/ResourceHandleInternal.h:
2597         (WebCore::ResourceHandleInternal::ResourceHandleInternal):
2598
2599 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
2600
2601         Reviewed by Oliver Hunt.
2602
2603         <rdar://problem/5607069> In Mail, a crash occurs at WebCore::AppendNodeCommand() after dragging image into a <FORM> element
2604
2605         * editing/InsertLineBreakCommand.cpp:
2606         (WebCore::InsertLineBreakCommand::shouldUseBreakElement): Equip this function to
2607         handle editing positions, like [input, 0];
2608         * editing/InsertParagraphSeparatorCommand.cpp:
2609         (WebCore::InsertParagraphSeparatorCommand::doApply): Pass enclosingBlock a node peeled
2610         off of a non-editing position, to fix a bug where the enclosing block of [input, 0] was
2611         the input element itself.
2612         Insert a <br> when a <form> element is the enclosing block instead of splitting/cloning or
2613         nesting a <div>.
2614
2615 2007-12-13  Alp Toker  <alp@atoker.com>
2616
2617         Reviewed by Oliver Hunt.
2618
2619         http://bugs.webkit.org/show_bug.cgi?id=16365
2620         [cURL] Acid2 test segmentation fault
2621
2622         This patch makes the Acid2 test pass.
2623
2624         Defer the cleanup of cancelled jobs and halt further transfer as early
2625         as possible.
2626
2627         Bug found by and initial patch provided by Luca Bruno.
2628
2629         * platform/network/curl/ResourceHandleManager.cpp:
2630         (WebCore::writeCallback):
2631         (WebCore::headerCallback):
2632         (WebCore::ResourceHandleManager::downloadTimerCallback):
2633         (WebCore::ResourceHandleManager::cancel):
2634
2635 2007-12-13  Sam Weinig  <sam@webkit.org>
2636
2637         Reviewed by Mark Rowe.
2638
2639         Fix typos and rename InspectorController::moveByUnrestricted to InspectorController::moveWindowBy.
2640
2641         * page/InspectorController.cpp:
2642         (WebCore::moveByUnrestricted):
2643         (WebCore::InspectorController::windowScriptObjectAvailable):
2644         (WebCore::InspectorController::moveWindowBy):
2645         * page/InspectorController.h:
2646         * page/inspector/inspector.js:
2647
2648 2007-12-13  Dan Bernstein  <mitz@apple.com>
2649
2650         Reviewed by Dave Hyatt.
2651
2652         - fix <rdar://problem/5642426> explicit cubic-bezier curves all treated as "default" for transition-timing-function
2653
2654         Test: fast/css/transition-timing-function.html
2655
2656         * css/CSSStyleSelector.cpp: Changed the HANDLE_MULTILAYER_VALUE macro to
2657         not reject non-primitive non-list values, and instead made sure that the
2658         mapping functions rejected them if necessary. This allows non-primitive
2659         timing functions to be mapped.
2660         (WebCore::CSSStyleSelector::mapBackgroundAttachment):
2661         (WebCore::CSSStyleSelector::mapBackgroundClip):
2662         (WebCore::CSSStyleSelector::mapBackgroundComposite):
2663         (WebCore::CSSStyleSelector::mapBackgroundOrigin):
2664         (WebCore::CSSStyleSelector::mapBackgroundImage):
2665         (WebCore::CSSStyleSelector::mapBackgroundRepeat):
2666         (WebCore::CSSStyleSelector::mapBackgroundXPosition):
2667         (WebCore::CSSStyleSelector::mapBackgroundYPosition):
2668         (WebCore::CSSStyleSelector::mapTransitionDuration):
2669         (WebCore::CSSStyleSelector::mapTransitionRepeatCount):
2670         (WebCore::CSSStyleSelector::mapTransitionTimingFunction):
2671         (WebCore::CSSStyleSelector::mapTransitionProperty):
2672         * css/CSSTimingFunctionValue.cpp:
2673         (WebCore::CSSTimingFunctionValue::cssText): Implemented for use in the
2674         regression test.
2675         * css/CSSTimingFunctionValue.h:
2676         (WebCore::CSSTimingFunctionValue::isTransitionTimingFunctionValue):
2677         Added. Returns true.
2678         * css/CSSValue.h:
2679         (WebCore::CSSValue::isTransitionTimingFunctionValue): Added. Returns
2680         false.
2681
2682 2007-12-13  Steve Falkenburg  <sfalken@apple.com>
2683
2684         Move source file generation into its own vcproj to fix build dependencies.
2685
2686         Reviewed by Adam.
2687
2688         * WebCore.vcproj/WebCore.make:
2689         * WebCore.vcproj/WebCore.sln:
2690         * WebCore.vcproj/WebCore.submit.sln:
2691         * WebCore.vcproj/WebCore.vcproj:
2692         * WebCore.vcproj/WebCoreGenerated.vcproj: Added.
2693
2694 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
2695
2696         Reviewed by Oliver Hunt.
2697         
2698         <rdar://problem/4145786> Undoing a color change of text in a compose window always changes it back to black
2699         
2700         Some of the operations performed in removeHTMLFontStyle were non-undoable.
2701         
2702         I'm having trouble writing a layout test for this because I can't get DRT to
2703         perform editing operations in separate Undo steps without adding unacceptably long
2704         wait times between operations.  I filed:
2705         
2706         <rdar://problem/5646779> Can't get DRT to perform editing operations in separate Undo steps
2707
2708         * editing/ApplyStyleCommand.cpp:
2709         (WebCore::ApplyStyleCommand::removeHTMLFontStyle):
2710
2711 2007-12-13  Sam Weinig  <sam@webkit.org>
2712
2713         Reviewed by Anders.
2714
2715         Fix for http://bugs.webkit.org/show_bug.cgi?id=16352
2716         Toolbar dragged inspector cannot be moved beyond screen edges
2717
2718         * page/InspectorController.cpp:
2719         (WebCore::moveByUnrestricted):
2720         (WebCore::InspectorController::windowScriptObjectAvailable):
2721         (WebCore::InspectorController::moveByUnrestricted):
2722         * page/InspectorController.h:
2723         * page/inspector/inspector.js:
2724
2725 2007-12-13  Adam Roben  <aroben@apple.com>
2726
2727         Fix <rdar://5517707> Crash on wptv.wp.pl when "make bigger" button is clicked
2728
2729         Windows Media Player has a modal message loop that will deliver
2730         messages to us at inappropriate times and we will crash if we handle
2731         them when they are delivered. In PluginViewWin, we add a quirk for
2732         Media Player to set a flag whenever we give the plugin a chance to
2733         execute code, and in SharedTimerWin we check if the plugin is
2734         executing code and repost messages if so.
2735
2736         Reviewed by Anders.
2737
2738         * platform/win/SharedTimerWin.cpp:
2739         (WebCore::TimerWindowWndProc): Repost messages if we're calling a
2740         plugin.
2741         * plugins/win/PluginViewWin.cpp: Surround all calls to the plugin with
2742         setCallingPlugin(true/false).
2743         (WebCore::PluginViewWin::updateWindow):
2744         (WebCore::PluginViewWin::dispatchNPEvent):
2745         (WebCore::PluginViewWin::setNPWindowRect):
2746         (WebCore::PluginViewWin::start):
2747         (WebCore::PluginViewWin::stop):
2748         (WebCore::PluginViewWin::performRequest):
2749         (WebCore::PluginViewWin::bindingInstance):
2750         (WebCore::PluginViewWin::determineQuirks):
2751         (WebCore::PluginViewWin::setCallingPlugin): Added.
2752         (WebCore::PluginViewWin::isCallingPlugin): Added.
2753         * plugins/win/PluginViewWin.h: Added a new quirk.
2754
2755 2007-12-13  Alp Toker  <alp@atoker.com>
2756
2757         Add a missing DEPENDPATH. Fixes non-clean builds following networking
2758         header changes.
2759
2760         * WebCore.pro:
2761
2762 2007-12-13  Dan Bernstein  <mitz@apple.com>
2763
2764         Reviewed by Anders Carlsson.
2765
2766         - fix regression in fast/text/international/bidi-override on Tiger
2767
2768         * platform/graphics/GlyphPageTreeNode.cpp:
2769         (WebCore::GlyphPageTreeNode::initializePage): Add bidi overrides here
2770         too. I forgot to add them when I added them to treatAsZeroWidthSpace in
2771         an earlier patch.
2772
2773 2007-12-13  Justin Garcia  <justin.garcia@apple.com>
2774
2775         Reviewed by Darin Adler.
2776
2777         <rdar://problem/5601583> GMail Editor: Copied link doesn't paste as a link, just colored text
2778         
2779         The code that checks the selected Range to see if it's inside an anchor
2780         checks ancestors of the Range's commonAncestor() but not the
2781         commonAncestor() itself, and so we'd fail to add markup for the enclosing
2782         anchor to the pasteboard.
2783         
2784         Some enclosing element getters check the node passed to the getter and some
2785         don't.  There were a few places where we incorrectly assumed that enclosing 
2786         element getters check the node passed to the getter, but this is the only 
2787         case that I'm able to write a test case for at the moment.
2788         
2789         In this patch I've:
2790         Changed enclosingNodeWithType and enclosingNodeWithTag to take in positions,
2791         like the newer enclosing element getters.  This is important because we must
2792         soon add code to the getters so that they understand that some editing positions
2793         inside nodes don't actually refer to positions inside those nodes but positions
2794         before and after them.  Like [table, 0].
2795         Changed enclosingNodeWithType and enclosingNodeWithTag to check nodes starting with
2796         n where [n, o] is the position passed to the getter, instead of starting the the parent
2797         of n.  This makes all but a few of the enclosing element getters behave consistently.
2798         Changed enclosingNodeWithType and enclosingNodeWithTag to not return non-editable 
2799         nodes if the input position was editable.  This fixes a bug that that the above change
2800         exposed.
2801         Changed enclosingTableCell to simply call enclosingNodeWithType.  We should do
2802         this for the rest of the getters, or simply remove them in favor of enclosingNodeWithType
2803         unless doing so would affect readability, like it would in the case of enclosingTableCell.
2804         Ditto for enclosingBlock.
2805
2806         * editing/AppendNodeCommand.cpp:
2807         (WebCore::AppendNodeCommand::doApply):
2808         * editing/DeleteButtonController.cpp:
2809         (WebCore::enclosingDeletableElement):
2810         * editing/DeleteSelectionCommand.cpp:
2811         (WebCore::DeleteSelectionCommand::initializePositionData):
2812         (WebCore::DeleteSelectionCommand::saveFullySelectedAnchor):
2813         * editing/Editor.cpp:
2814         (WebCore::Editor::selectionUnorderedListState):
2815         (WebCore::Editor::selectionOrderedListState):
2816         * editing/IndentOutdentCommand.cpp:
2817         (WebCore::IndentOutdentCommand::prepareBlockquoteLevelForInsertion):
2818         (WebCore::IndentOutdentCommand::outdentParagraph):
2819         * editing/InsertNodeBeforeCommand.cpp:
2820         (WebCore::InsertNodeBeforeCommand::doApply):
2821         * editing/InsertParagraphSeparatorCommand.cpp:
2822         (WebCore::InsertParagraphSeparatorCommand::doApply):
2823         * editing/ReplaceSelectionCommand.cpp:
2824         (WebCore::ReplaceSelectionCommand::shouldMerge):
2825         (WebCore::ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds):
2826         (WebCore::ReplaceSelectionCommand::positionAtEndOfInsertedContent):
2827         * editing/TextIterator.cpp:
2828         * editing/htmlediting.cpp:
2829         (WebCore::enclosingBlock):
2830         (WebCore::enclosingNodeWithTag):
2831         (WebCore::enclosingNodeOfType):
2832         (WebCore::enclosingTableCell):
2833         (WebCore::isTableCell):
2834         * editing/htmlediting.h:
2835         * editing/markup.cpp:
2836         (WebCore::appendStartMarkup):
2837         (WebCore::createMarkup):
2838
2839 2007-12-13  Alexey Proskuryakov  <ap@webkit.org>
2840
2841         Reviewed by Darin.
2842
2843         Turn on keyboard event processing quirks for feed views and old applications on Mac OS X.
2844
2845         * WebCore.base.exp:
2846         * dom/KeyboardEvent.cpp:
2847         (WebCore::KeyboardEvent::charCode):
2848         * page/EventHandler.cpp:
2849         (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks):
2850         (WebCore::EventHandler::keyEvent):
2851         * page/EventHandler.h:
2852         * page/Settings.cpp:
2853         (WebCore::Settings::Settings):
2854         (WebCore::Settings::setNeedsKeyboardEventDisambiguationQuirks):
2855         * page/Settings.h:
2856         (WebCore::Settings::needsKeyboardEventDisambiguationQuirks):
2857         * page/mac/EventHandlerMac.mm:
2858         (WebCore::EventHandler::needsKeyboardEventDisambiguationQuirks):
2859         * platform/PlatformKeyboardEvent.h:
2860         * platform/mac/KeyEventMac.mm:
2861         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
2862         (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent):
2863
2864 2007-12-13  Dan Bernstein  <mitz@apple.com>
2865
2866         - build fix
2867
2868         * platform/network/cf/ResourceErrorCF.cpp:
2869
2870 2007-12-13  Antti Koivisto  <antti@apple.com>
2871
2872         Reviewed by Tim Hatcher.
2873
2874         Fix <rdar://problem/5605674> 
2875         Make <video> display WebKit context menu instead of the QTKit one.
2876     
2877         It doesn't really matter where the QTMovieView is.
2878
2879         * ChangeLog:
2880         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
2881         (WebCore::MediaPlayerPrivate::createQTMovieView):
2882         (WebCore::MediaPlayerPrivate::setRect):
2883
2884 2007-12-13  Dan Bernstein  <mitz@apple.com>
2885
2886         Reviewed by Adam Roben.
2887
2888         - ensure that Unicode bidi control characters are rendered as zero width
2889           spaces
2890
2891         Test: fast/text/international/bidi-control-chars-treated-as-ZWS.html
2892
2893         * platform/graphics/Font.h:
2894         (WebCore::Font::treatAsZeroWidthSpace):
2895         * platform/graphics/GlyphPageTreeNode.cpp:
2896         (WebCore::GlyphPageTreeNode::initializePage):
2897         * platform/text/CharacterNames.h:
2898
2899 2007-12-13  Brady Eidson  <beidson@apple.com>
2900
2901         Build fix
2902
2903         * platform/wx/TemporaryLinkStubs.cpp:
2904
2905 2007-12-12  Brady Eidson  <beidson@apple.com>
2906
2907         Build fix
2908
2909         * platform/gtk/TemporaryLinkStubs.cpp:
2910
2911 2007-12-12  Brady Eidson  <beidson@apple.com>
2912
2913         Build fix
2914
2915         * WebCore.pro:
2916         * history/qt/CachedPageQt.cpp: Removed. Whole purpose for this method being platform-specific has been removed
2917
2918 2007-12-12  Brady Eidson  <beidson@apple.com>
2919
2920         Build fix
2921
2922         * platform/win/TemporaryLinkStubs.cpp:
2923
2924 2007-12-12  Brady Eidson  <beidson@apple.com>
2925
2926         Reviewed by Sam Weinig
2927
2928         Fix for <rdar://problem/4886844> and lay groundwork for <rdar://problem/4516170> (Back/Forward Cache on Windows)
2929
2930         All back/forward list and page cache related items used to be in WebKit.
2931         When they were pushed into WebCore, some sloppy compromises were made to keep the Back/Forward cache working on Mac.
2932         Namely, a WebCore::HistoryItem had to know how to keep a WebDocumentView alive.  We accomplished this via some #ifdefs
2933         in CachedPage and having the Mac-only CachedPageMac.mm
2934
2935         To get rid of that nastiness and pave the way for adding Back/Forward cache on other platforms, this patch adds the 
2936         concept of "CachedPagePlatformData" which can contain anything the platform API wants.  
2937
2938         I also took the opportunity to do other cleanup and renaming client methods to better fit their new purposes.
2939
2940         * WebCore.base.exp:
2941         * WebCore.xcodeproj/project.pbxproj:
2942
2943         * history/CachedPage.cpp:
2944         (WebCore::CachedPage::~CachedPage): Combined "close()" and "clear()" to just "clear()" - call it from here.
2945         (WebCore::CachedPage::clear): Call clear() on the CachedPagePlatformData if it exists.  Also delete the CachedPagePlatformData.
2946         (WebCore::CachedPage::setCachedPagePlatformData):
2947         (WebCore::CachedPage::cachedPagePlatformData):
2948         * history/CachedPage.h:
2949
2950         * history/CachedPagePlatformData.h: Added.
2951         (WebCore::CachedPagePlatformData::~CachedPagePlatformData): Virtual d'tor.
2952         (WebCore::CachedPagePlatformData::clear): Virtual method for platforms that need to do cleanup at the same time as CachedPage::clear().
2953
2954         * history/PageCache.cpp:
2955         (WebCore::PageCache::releaseAutoreleasedPagesNow): Call "clear()" instead of "close()"
2956
2957         * history/mac/CachedPageMac.mm: Removed. Functionality replaced with CachedPagePlatformData.
2958
2959         * loader/FrameLoader.cpp:
2960         (WebCore::FrameLoader::transitionToCommitted): Call the new client methods.  Make some work previously done by WebKitMac cross platform 
2961           (setting the cached DocumentLoader to the Frame).
2962         (WebCore::FrameLoader::cachePageForHistoryItem):  Renamed the client methods
2963
2964         * loader/FrameLoaderClient.h:  The very Mac-centric "makeDocumentView", "setDocumentViewFromCachedPage", and "saveDocumentViewToCachedPage"
2965           become "transitionToCommittedForNewPage", "transitionToCommittedFromCachedPage", and "savePlatformDataToCachedPage" accordingly
2966
2967         * svg/graphics/SVGImageEmptyClients.h:
2968         (WebCore::SVGEmptyFrameLoaderClient::savePlatformDataToCachedPage):
2969         (WebCore::SVGEmptyFrameLoaderClient::transitionToCommittedFromCachedPage):
2970         (WebCore::SVGEmptyFrameLoaderClient::transitionToCommittedForNewPage):
2971
2972 2007-12-12  Dan Bernstein  <mitz@apple.com>
2973
2974         Reviewed by Oliver Hunt.
2975
2976         - fix <rdar://problem/5074620> text with font:initial; fails to appear (causes fast/text/font-initial.html to fail)
2977
2978         * css/CSSStyleSelector.cpp:
2979         (WebCore::CSSStyleSelector::applyProperty): When the font property is
2980         set to 'initial', set the font size to its initial value, 'medium',
2981         and the font family to the standard family.
2982
2983 2007-12-12  Justin Garcia  <justin.garcia@apple.com>
2984
2985         Reviewed by Darin Adler.
2986
2987         <rdar://problem/5433862> Mail crashes at WebCore::highestAncestor() when deleting a particular selection
2988
2989         * editing/DeleteSelectionCommand.cpp:
2990         (WebCore::DeleteSelectionCommand::removePreviouslySelectedEmptyTableRows):
2991         Don't remove the table row that contained the end of the selection if it is where we are
2992         about to place the ending selection.
2993         Don't remove all empty rows after the row that contained the start of the selection,
2994         they might come after the row that contained the end of the selection.
2995
2996 2007-12-12  Sam Weinig  <sam@webkit.org>
2997
2998         Reviewed by Anders Carlsson.
2999
3000         Add button to clear the Web Inspector's console.
3001
3002         * English.lproj/InspectorLocalizedStrings.js:
3003         * page/inspector/ConsolePanel.js:
3004         * page/inspector/inspector.css:
3005
3006 2007-12-12  Anders Carlsson  <andersca@apple.com>
3007
3008         Reviewed by Adam and Jon.
3009
3010         <rdar://problem/5349282>
3011         popup blocking is not applied to plugins on Windows.
3012         
3013         Implement popup blocking. If the plug-in supports the new 
3014         NPN_PushPopupsEnabledState/NPN_PopPopupsEnabledState API we just use that
3015         to determine if a plug-in request can open new windows.
3016         
3017         If a plug-in does not support the new API, we assume that a plug-in can open new windows
3018         in response to either mouse click or key press events.
3019         
3020         * plugins/win/PluginViewWin.cpp:
3021         (WebCore::PluginRequestWin::PluginRequestWin):
3022         (WebCore::PluginRequestWin::shouldAllowPopups):
3023         Add new shouldAllowPopups member.
3024         
3025         (WebCore::PluginViewWin::popPopupsStateTimerFired):
3026         Reset the popup state.
3027         
3028         (WebCore::isWindowsMessageUserGesture):
3029         New function that given a windows message id returns whether it's a user gesture or not.
3030         
3031         (WebCore::PluginViewWin::wndProc):
3032         Allow popups if the window message is a user gesture.
3033         
3034         (WebCore::PluginViewWin::dispatchNPEvent):
3035         New method that dispatches an NPEvent, turning on popups if necessary.
3036         
3037         (WebCore::PluginViewWin::paint):
3038         (WebCore::PluginViewWin::handleKeyboardEvent):
3039         (WebCore::PluginViewWin::handleMouseEvent):
3040         Call dispatchNPEvent().
3041         
3042         (WebCore::PluginViewWin::performRequest):
3043         (WebCore::PluginViewWin::load):
3044         Add calls to shouldAllowPopups().
3045         
3046         (WebCore::PluginViewWin::pushPopupsEnabledState):
3047         (WebCore::PluginViewWin::popPopupsEnabledState):
3048         New methods that maintain the popup state stack.
3049         
3050         (WebCore::PluginViewWin::arePopupsAllowed):
3051         New method that returns whether popups are allowed.
3052         
3053         (WebCore::PluginViewWin::PluginViewWin):
3054         * plugins/win/PluginViewWin.h:
3055         Add new instance variables.
3056         
3057         * plugins/win/npapi.cpp:
3058         (NPN_PushPopupsEnabledState):
3059         (NPN_PopPopupsEnabledState):
3060         Implement these.
3061
3062 2007-12-12  Dan Bernstein  <mitz@apple.com>
3063
3064         Reviewed by John Sullivan.
3065
3066         - fix a bug in debug builds only where selecting an earlier item in
3067           a popup selects the first item
3068
3069         Test: fast/forms/menulist-selection-reset.html
3070
3071         * html/HTMLSelectElement.cpp:
3072         (WebCore::HTMLSelectElement::recalcListItems): Added an argument that
3073         tells that function whether it should update the selected state of
3074         option elements.
3075         (WebCore::HTMLSelectElement::checkListItems): Changed to pass false
3076         as the above argument.
3077         * html/HTMLSelectElement.h:
3078
3079 2007-12-12  Adele Peterson  <adele@apple.com>
3080
3081         Reviewed by Geoff.
3082
3083         Fix for <rdar://problem/5643054> Remove cue point implementation for media elements
3084
3085         When the specification for cue ranges is more final, we will implement those.
3086
3087         * html/HTMLMediaElement.cpp:
3088         (WebCore::HTMLMediaElement::~HTMLMediaElement):
3089         (WebCore::HTMLMediaElement::load):
3090         * html/HTMLMediaElement.h:
3091         * html/HTMLMediaElement.idl:
3092         * platform/graphics/MediaPlayer.cpp:
3093         * platform/graphics/MediaPlayer.h:
3094         (WebCore::MediaPlayerClient::mediaPlayerTimeChanged):
3095         * platform/graphics/mac/MediaPlayerPrivateQTKit.h:
3096         * platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
3097         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
3098         (WebCore::MediaPlayerPrivate::load):
3099         (WebCore::MediaPlayerPrivate::play):
3100         (WebCore::MediaPlayerPrivate::pause):
3101         (WebCore::MediaPlayerPrivate::setEndTime):
3102         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
3103         (WebCore::MediaPlayerPrivate::endPointTimerFired):
3104         (WebCore::MediaPlayerPrivate::timeChanged):
3105         (WebCore::MediaPlayerPrivate::didEnd):
3106         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.cpp:
3107         (WebCore::MediaPlayerPrivate::MediaPlayerPrivate):
3108         (WebCore::MediaPlayerPrivate::startEndPointTimerIfNeeded):
3109         (WebCore::MediaPlayerPrivate::endPointTimerFired):
3110         * platform/graphics/gtk/MediaPlayerPrivateGStreamer.h:
3111
3112 2007-12-12  MorganL  <morganl.webkit@yahoo.com>
3113
3114         Reviewed by Maciej.
3115
3116         Fixes:
3117         http://bugs.webkit.org/show_bug.cgi?id=16408
3118
3119         When navigating back/forward to a http:// link, we should prefer to
3120         load from cache if possible.
3121
3122         * loader/FrameLoader.cpp:
3123
3124 2007-12-12  Anders Carlsson  <andersca@apple.com>
3125
3126         Reviewed by Sam.
3127
3128         <rdar://problem/5132003>
3129         dumpResourceLoadCallbacks is not implemented in DRT on Windows.
3130         
3131         * platform/network/cf/ResourceErrorCF.cpp:
3132         (WebCore::ResourceError::unpackPlatformError):
3133         Handle kCFErrorDomainWinSock.
3134         
3135         * platform/network/cf/ResourceHandleCFNet.cpp:
3136         (WebCore::willSendRequest):
3137         Ignore willSendRequest calls where the redirect response is null, like we do in 
3138         the Mac version.
3139
3140 2007-12-12  Steve Falkenburg  <sfalken@apple.com>
3141
3142         <rdar://problem/5643785> Fix iBench regression caused by mis-placed nested timer check.
3143         
3144         Reviewed by Anders.
3145
3146         * platform/win/SharedTimerWin.cpp:
3147         (WebCore::TimerWindowWndProc): Don't set high-resolution timer flag inside non-high-resolution timer proc.
3148
3149 2007-12-12  Beth Dakin  <bdakin@apple.com>
3150
3151         Reviewed by Oliver.
3152
3153         Fix for <rdar://problem/5643770> REGRESSION: Free-standing SVGs 
3154         with width and height 100% clip to 300 x 150
3155
3156         Though it was correct in an earlier iteration of my patch, it is 
3157         not sufficient in the final, committed version to ask if the 
3158         relativeWidthValue() or relativeHeightValue() is greater than 0 
3159         just to determine if one has been set, for, they are now 
3160         initialized to 300 and 150 respectively! This patch instead adds a 
3161         bool to keep track of whether a container size has been set, and 
3162         only used the relative value if it has.
3163
3164         * rendering/RenderSVGRoot.cpp:
3165         (WebCore::RenderSVGRoot::calcViewport):
3166         * svg/SVGSVGElement.cpp:
3167         (WebCore::SVGSVGElement::SVGSVGElement):
3168         * svg/SVGSVGElement.h:
3169         (WebCore::SVGSVGElement::setContainerSize):
3170         (WebCore::SVGSVGElement::hasSetContainerSize):
3171
3172 2007-12-12  Brady Eidson  <beidson@apple.com>
3173
3174         Reviewed by Steve Falkenburg 
3175
3176         <rdar://problem/5012636> - WebURLProtectionSpace::realm returns the hostname rather than the authentication realm
3177
3178         * platform/network/ProtectionSpace.cpp:
3179         (WebCore::ProtectionSpace::ProtectionSpace): Assign the realm to m_realm, instead of the host
3180
3181 2007-12-12  Alp Toker  <alp@atoker.com>
3182
3183         Reviewed by Maciej.
3184
3185         http://bugs.webkit.org/show_bug.cgi?id=16388
3186         [GTK] Widget::setCursor() gets called frequently
3187
3188         Cache the current cursor to avoid calling gdk_window_set_cursor() when
3189         there's no change in cursor.
3190
3191         * platform/gtk/WidgetGtk.cpp:
3192         (WebCore::Widget::Widget):
3193         (WebCore::Widget::cursor):
3194         (WebCore::Widget::setCursor):
3195
3196 2007-12-12  Rodney Dawes  <dobey@wayofthemonkey.com>
3197
3198         Reviewed by Maciej.
3199
3200         http://bugs.webkit.org/show_bug.cgi?id=16342
3201         Build Warning and Error fixes in WebCore GTK+
3202
3203         Use C-style casts for casting function pointers to gpointer
3204         Use static_cast<int> to cast a float to int to fix a warning
3205
3206         * platform/gtk/PlatformScrollBarGtk.cpp:
3207         (PlatformScrollbar::PlatformScrollbar):
3208         (PlatformScrollbar::~PlatformScrollbar):
3209         (PlatformScrollbar::gtkValueChanged):
3210         * platform/gtk/ThreadingGtk.cpp:
3211         (callFunctionOnMainThread):
3212         (callOnMainThread):
3213
3214 2007-12-12  Dan Bernstein  <mitz@apple.com>
3215
3216         Reviewed by Darin Adler.
3217
3218         - better fix for a crash when pressing a key that is not associated
3219           with a command
3220
3221         * editing/EditorCommand.cpp:
3222         (WebCore::Editor::command): Return the empty command if the command name
3223         is empty.
3224
3225 2007-12-12  Alexey Proskuryakov  <ap@webkit.org>
3226
3227         Reviewed by Darin.
3228
3229         http://bugs.webkit.org/show_bug.cgi?id=16410
3230         Implement isKeypadEvent() on Windows
3231
3232         Test: platform/win/fast/events/keyLocation-numpad.html
3233
3234         * platform/win/KeyEventWin.cpp:
3235         (WebCore::isKeypadEvent): Added.
3236         (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent): Also fixed a mistake with autorepeat.
3237
3238 2007-12-12  Oliver Hunt  <oliver@apple.com>
3239
3240         Reviewed by Maciej.
3241
3242         <rdar://problem/5071781> window.mouseout events are not sent 
3243         to window when mouse moves out of window 
3244
3245         Make PlatformMouseEvent recognise WM_MOUSELEAVE.
3246
3247         * platform/win/PlatformMouseEventWin.cpp:
3248         (WebCore::messageToEventType):
3249         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
3250
3251 2007-12-12  Sam Weinig  <sam@webkit.org>
3252
3253         Fix Mac release build.
3254
3255         * WebCore.base.exp:
3256
3257 2007-12-12  Sam Weinig  <sam@webkit.org>
3258
3259         Build fix for Qt, Gtk, and Wx.
3260
3261         * css/CSSParser.cpp:
3262         (WebCore::CSSParser::parseValue):
3263         * loader/win/FrameLoaderWin.cpp:
3264         (WebCore::FrameLoader::urlSelected):
3265         * platform/network/curl/ResourceHandleManager.cpp:
3266         (WebCore::parseDataUrl):
3267         (WebCore::ResourceHandleManager::startJob):
3268         * platform/network/win/CookieJarWin.cpp:
3269         (WebCore::setCookies):
3270         (WebCore::cookies):
3271         * platform/network/win/ResourceHandleWin.cpp:
3272         (WebCore::ResourceHandle::start):
3273         * platform/qt/PasteboardQt.cpp:
3274         (WebCore::Pasteboard::writeURL):
3275
3276 2007-12-11  Dan Bernstein  <mitz@apple.com>
3277
3278         Reviewed by Maciej Stachowiak.
3279
3280         - allow non-integer font sizes on Windows for small caps
3281
3282         * platform/graphics/win/FontDataWin.cpp:
3283         (WebCore::FontData::smallCapsFontData):
3284         * platform/graphics/win/FontPlatformData.h:
3285         (WebCore::FontPlatformData::size):
3286         (WebCore::FontPlatformData::setSize):
3287         * platform/graphics/win/FontPlatformDataWin.cpp:
3288         (WebCore::FontPlatformData::FontPlatformData):
3289
3290 2007-12-11  Sam Weinig  <sam@webkit.org>
3291
3292         Build fix for Qt, Gtk, and Wx.
3293
3294         * platform/gtk/CookieJarGtk.cpp:
3295         (WebCore::setCookies):
3296         (WebCore::cookies):
3297         * platform/qt/ClipboardQt.cpp:
3298         (WebCore::ClipboardQt::writeURL):
3299         * platform/qt/CookieJarQt.cpp:
3300         (WebCore::setCookies):
3301         (WebCore::cookies):
3302         * platform/wx/PasteboardWx.cpp:
3303         (WebCore::Pasteboard::writeURL):
3304
3305 2007-12-11  Sam Weinig  <sam@webkit.org>
3306
3307         Reviewed by Darin Adler.
3308
3309         Scrub URL out of the tree in preparation for renaming KURL to URL.
3310             - Renames Document::URL() -> Document::url()
3311             - Renames DocumentLoader::URL() -> DocumentLoader::url()
3312             - Renames KURL::url() to KURL::string() and KURL::deprecatedString()
3313             - Remove FrameLoader::URL()
3314             - Various variable renames.
3315
3316         The change from Document::URL() to Document::url() required changes
3317         to the bindings scripts as well, because URL() is the name of a DOM
3318         method.  The code generation scripts now have code to special case URL()
3319         to url().
3320
3321         * WebCore.base.exp:
3322         * bindings/js/kjs_events.cpp:
3323         (WebCore::JSLazyEventListener::parseCode):
3324         * bindings/js/kjs_navigator.cpp:
3325         (KJS::Navigator::getValueProperty):
3326         * bindings/js/kjs_proxy.cpp:
3327         (WebCore::KJSProxy::initScript):
3328         * bindings/js/kjs_window.cpp:
3329         (KJS::Window::put):
3330         (KJS::Window::allowsAccessFrom):
3331         (KJS::Location::put):
3332         (KJS::LocationProtoFuncReplace::callAsFunction):
3333         (KJS::LocationProtoFuncReload::callAsFunction):
3334         (KJS::LocationProtoFuncAssign::callAsFunction):
3335         * bindings/scripts/CodeGenerator.pm:
3336         * bindings/scripts/CodeGeneratorCOM.pm:
3337         * bindings/scripts/CodeGeneratorJS.pm:
3338         * bindings/scripts/CodeGeneratorObjC.pm:
3339         * css/CSSImportRule.cpp:
3340         (WebCore::CSSImportRule::insertedIntoParent):
3341         * css/CSSParser.cpp:
3342         (WebCore::CSSParser::parseValue):
3343         (WebCore::CSSParser::parseContent):
3344         (WebCore::CSSParser::parseBackgroundImage):
3345         (WebCore::CSSParser::parseFontFaceSrc):
3346         (WebCore::CSSParser::parseBorderImage):
3347         (WebCore::CSSParser::createImportRule):
3348         * css/CSSStyleSelector.cpp:
3349         (WebCore::CSSStyleSelector::setEncodedURL):
3350         * dom/Document.cpp:
3351         (WebCore::Document::processHttpEquiv):
3352         (WebCore::Document::cookie):
3353         (WebCore::Document::setCookie):
3354         (WebCore::Document::domain):
3355         (WebCore::Document::setDomain):
3356         (WebCore::Document::getImageMap):
3357         (WebCore::Document::completeURL):
3358         * dom/Document.h:
3359         (WebCore::Document::url):
3360         (WebCore::Document::baseURL):
3361         * dom/Element.cpp:
3362         (WebCore::Element::baseURI):
3363         * dom/ProcessingInstruction.h:
3364         * dom/StyledElement.cpp:
3365         (WebCore::StyledElement::addCSSImageProperty):
3366         * dom/StyledElement.h:
3367         * dom/XMLTokenizer.cpp:
3368         (WebCore::XMLTokenizer::endElementNs):
3369         (WebCore::XMLTokenizer::end):
3370         (WebCore::):
3371         * dom/XMLTokenizer.h:
3372         * editing/Editor.cpp:
3373         (WebCore::Editor::copy):
3374         * editing/markup.cpp:
3375         (WebCore::completeURLs):
3376         * history/CachedPage.h:
3377         (WebCore::CachedPage::url):
3378         * history/HistoryItem.cpp:
3379         (WebCore::HistoryItem::HistoryItem):
3380         (WebCore::HistoryItem::setURL):
3381         (WebCore::HistoryItem::isCurrentDocument):
3382         * html/HTMLBaseElement.cpp:
3383         (WebCore::HTMLBaseElement::process):
3384         * html/HTMLParser.cpp:
3385         (WebCore::HTMLParser::reportErrorToConsole):
3386         * html/HTMLScriptElement.cpp:
3387         (WebCore::HTMLScriptElement::childrenChanged):
3388         (WebCore::HTMLScriptElement::insertedIntoDocument):
3389         (WebCore::HTMLScriptElement::evaluateScript):
3390         * html/HTMLScriptElement.h:
3391         * html/HTMLTokenizer.cpp:
3392         (WebCore::HTMLTokenizer::scriptExecution):
3393         * loader/Cache.cpp:
3394         (WebCore::createResource):
3395         (WebCore::Cache::requestResource):
3396         * loader/CachedCSSStyleSheet.cpp:
3397         (WebCore::CachedCSSStyleSheet::checkNotify):
3398         * loader/CachedResource.cpp:
3399         (WebCore::CachedResource::CachedResource):
3400         * loader/CachedResource.h:
3401         (WebCore::CachedResource::):
3402         * loader/CachedScript.h:
3403         * loader/DocLoader.cpp:
3404         (WebCore::DocLoader::checkForReload):
3405         (WebCore::DocLoader::requestResource):
3406         * loader/DocumentLoader.cpp:
3407         (WebCore::DocumentLoader::url):
3408         (WebCore::DocumentLoader::replaceRequestURLForAnchorScroll):
3409         (WebCore::DocumentLoader::setRequest):
3410         (WebCore::DocumentLoader::startLoadingMainResource):
3411         * loader/DocumentLoader.h:
3412         * loader/FrameLoader.cpp:
3413         (WebCore::FormSubmission::FormSubmission):
3414         (WebCore::ScheduledRedirection::ScheduledRedirection):
3415         (WebCore::FrameLoader::changeLocation):
3416         (WebCore::FrameLoader::urlSelected):
3417         (WebCore::FrameLoader::requestFrame):
3418         (WebCore::FrameLoader::loadSubframe):
3419         (WebCore::FrameLoader::submitFormAgain):
3420         (WebCore::FrameLoader::submitForm):
3421         (WebCore::FrameLoader::didExplicitOpen):
3422         (WebCore::FrameLoader::replaceContentsWithScriptResult):
3423         (WebCore::FrameLoader::executeScript):
3424         (WebCore::FrameLoader::receivedFirstData):
3425         (WebCore::FrameLoader::begin):
3426         (WebCore::FrameLoader::startIconLoader):
3427         (WebCore::FrameLoader::commitIconURLToIconDatabase):
3428         (WebCore::FrameLoader::scheduleRefresh):
3429         (WebCore::FrameLoader::redirectionTimerFired):
3430         (WebCore::FrameLoader::loadPlugin):
3431         (WebCore::FrameLoader::didNotOpenURL):
3432         (WebCore::FrameLoader::updatePolicyBaseURL):
3433         (WebCore::FrameLoader::scrollToAnchor):
3434         (WebCore::FrameLoader::startRedirectionTimer):
3435         (WebCore::FrameLoader::load):
3436         (WebCore::FrameLoader::canLoad):
3437         (WebCore::FrameLoader::shouldHideReferrer):
3438         (WebCore::FrameLoader::shouldAllowNavigation):
3439         (WebCore::FrameLoader::commitProvisionalLoad):
3440         (WebCore::FrameLoader::clientRedirected):
3441         (WebCore::FrameLoader::open):
3442         (WebCore::FrameLoader::didTellBridgeAboutLoad):
3443         (WebCore::FrameLoader::haveToldBridgeAboutLoad):
3444         (WebCore::FrameLoader::post):
3445         (WebCore::FrameLoader::loadResourceSynchronously):
3446         (WebCore::FrameLoader::continueFragmentScrollAfterNavigationPolicy):
3447         (WebCore::FrameLoader::shouldTreatURLAsSameAsCurrent):
3448         (WebCore::FrameLoader::createHistoryItem):
3449         (WebCore::FrameLoader::addBackForwardItemClippedAtTarget):
3450         (WebCore::FrameLoader::loadItem):
3451         (WebCore::FrameLoader::urlsMatchItem):
3452         (WebCore::FrameLoader::recursiveGoToItem):
3453         (WebCore::FrameLoader::updateHistoryForStandardLoad):
3454         (WebCore::FrameLoader::updateHistoryForRedirectWithLockedHistory):
3455         * loader/FrameLoader.h:
3456         (WebCore::FrameLoader::url):
3457         * loader/ImageDocument.cpp:
3458         (WebCore::ImageDocument::createDocumentStructure):
3459         * loader/MainResourceLoader.cpp:
3460         (WebCore::shouldLoadAsEmptyDocument):
3461         (WebCore::MainResourceLoader::didFinishLoading):
3462         * loader/NavigationAction.cpp:
3463         (WebCore::NavigationAction::NavigationAction):
3464         * loader/NavigationAction.h:
3465         (WebCore::NavigationAction::url):
3466         * loader/PluginDocument.cpp:
3467         (WebCore::PluginTokenizer::createDocumentStructure):
3468         * loader/SubresourceLoader.cpp:
3469         (WebCore::SubresourceLoader::load):
3470         (WebCore::SubresourceLoader::create):
3471         * loader/icon/IconLoader.cpp:
3472         (WebCore::IconLoader::startLoading):
3473         (WebCore::IconLoader::finishLoading):
3474         * loader/loader.cpp:
3475         (WebCore::Loader::servePendingRequests):
3476         * loader/mac/LoaderNSURLExtras.m:
3477         (urlOriginalData):
3478         * page/Chrome.cpp:
3479         (WebCore::Chrome::setToolTip):
3480         * page/ContextMenuController.cpp:
3481         (WebCore::ContextMenuController::contextMenuItemSelected):
3482         * page/Frame.cpp:
3483         (WebCore::Frame::setUserStyleSheetLocation):
3484         * page/InspectorController.cpp:
3485         (WebCore::InspectorResource::type):
3486         (WebCore::addSourceToFrame):
3487         (WebCore::InspectorController::addScriptResource):
3488         (WebCore::InspectorController::updateScriptResourceRequest):
3489         (WebCore::InspectorController::didCommitLoad):
3490         * page/mac/WebCoreFrameBridge.mm:
3491         (-[WebCoreFrameBridge getData:andResponse:forURL:]):
3492         * platform/KURL.h:
3493         (WebCore::KURL::string):
3494         (WebCore::KURL::deprecatedString):
3495         * platform/mac/ClipboardMac.mm:
3496         (WebCore::ClipboardMac::getData):
3497         * platform/mac/CookieJar.mm:
3498         (WebCore::cookies):
3499         (WebCore::setCookies):
3500         * platform/mac/PasteboardMac.mm:
3501         (WebCore::Pasteboard::writeURL):
3502         (WebCore::fileWrapperForImage):
3503         (WebCore::Pasteboard::writeImage):
3504         (WebCore::Pasteboard::plainText):
3505         * platform/network/ResourceHandle.cpp:
3506         (WebCore::ResourceHandle::portAllowed):
3507         * platform/network/ResourceRequestBase.cpp:
3508         (WebCore::ResourceRequestBase::isNull):
3509         * platform/network/cf/ResourceHandleCFNet.cpp:
3510         (WebCore::willSendRequest):
3511         (WebCore::didReceiveResponse):
3512         (WebCore::didReceiveData):
3513         (WebCore::didFinishLoading):
3514         (WebCore::didFail):
3515         (WebCore::didReceiveChallenge):
3516         (WebCore::ResourceHandleInternal::~ResourceHandleInternal):
3517         (WebCore::ResourceHandle::~ResourceHandle):
3518         (WebCore::ResourceHandle::start):
3519         * platform/win/ClipboardUtilitiesWin.cpp:
3520         (WebCore::createGlobalData):
3521         (WebCore::urlToMarkup):
3522         * platform/win/ClipboardWin.cpp:
3523         (WebCore::writeURL):
3524         (WebCore::writeImageToDataObject):
3525         (WebCore::ClipboardWin::writeURL):
3526         (WebCore::ClipboardWin::writeRange):
3527         * platform/win/PasteboardWin.cpp:
3528         (WebCore::Pasteboard::writeSelection):
3529         (WebCore::Pasteboard::writeURL):
3530         * plugins/win/PluginDatabaseWin.cpp:
3531         (WebCore::PluginDatabaseWin::findPlugin):
3532         * plugins/win/PluginStreamWin.cpp:
3533         (WebCore::PluginStreamWin::startStream):
3534         (WebCore::PluginStreamWin::destroyStream):
3535         * plugins/win/PluginViewWin.cpp:
3536         (WebCore::scriptStringIfJavaScriptURL):
3537         (WebCore::PluginViewWin::performRequest):
3538         * svg/SVGImageLoader.cpp:
3539         (WebCore::SVGImageLoader::updateFromElement):
3540         * xml/XMLHttpRequest.cpp:
3541         (WebCore::XMLHttpRequest::getResponseXML):
3542         (WebCore::XMLHttpRequest::urlMatchesDocumentDomain):
3543         * xml/XSLImportRule.cpp:
3544         (WebCore::XSLImportRule::loadSheet):
3545         * xml/XSLTProcessor.cpp:
3546         (WebCore::XSLTProcessor::createDocumentFromSource):
3547         (WebCore::xsltStylesheetPointer):
3548         (WebCore::xmlDocPtrFromNode):
3549
3550 2007-12-11  Beth Dakin  <bdakin@apple.com>
3551
3552         Reviewed by Darin.
3553
3554         Fix for <rdar://problem/5641255> SVGs with width and height 100% 
3555         fail to render when used as background images
3556
3557         CachedImage now has a setImageContainerSize function. It is only 
3558         needed for SVG right now.
3559         * loader/CachedImage.cpp:
3560         (WebCore::CachedImage::setImageContainerSize):
3561         * loader/CachedImage.h:
3562
3563         Relatively sized SVGs have no intrinsic size. Because this call is 
3564         low-level enough that we cannot pass in the container size and get 
3565         the real size of the SVG, we need to know if it has relative 
3566         dimensions, and if so, we need to get the size from scaledTileSize.
3567         * platform/graphics/Image.cpp:
3568         (WebCore::Image::drawTiled):
3569         * platform/graphics/Image.h:
3570         (WebCore::Image::setContainerSize):
3571         (WebCore::Image::hasRelativeWidth):
3572         (WebCore::Image::hasRelativeHeight):
3573
3574         Re-factored calculateBackgroundSize a bit so that it returns an