2006-07-30 Eric Seidel <eric@eseidel.com>
[WebKit-https.git] / WebCore / ChangeLog
1 2006-07-30  Eric Seidel  <eric@eseidel.com>
2
3         Reviewed by gramps!
4
5         Remove some unused SVG code.
6
7         * ksvg2/ecma/Ecma.cpp: Removed.
8         * ksvg2/ecma/Ecma.h: Removed.
9         * ksvg2/ecma/GlobalObject.cpp: remove a couple dead functions.
10         * ksvg2/ecma/GlobalObject.h: add a comment about this dead code.
11         * ksvg2/ecma/SVGLookup.h: Removed.
12
13 2006-07-29  Darin Adler  <darin@apple.com>
14
15         - Removed tabs from these source files that still had them.
16           We don't use them; that way source files look fine in editors
17           that have tabs set to 8 spaces or to 4 spaces.
18         - Removed allow-tabs Subversion property from the files too.
19
20         * bindings/objc/WebScriptObject.h:
21         * bindings/objc/WebScriptObject.mm:
22         * platform/FontData.cpp:
23
24 2006-07-29  Sam Weinig  <sam.weinig@gmail.com>
25
26         Reviewed by Darin.
27
28         - patch for http://bugzilla.opendarwin.org/show_bug.cgi?id=10080
29           Adopt pedantic changes from the Unity project to improve 
30           cross-compiler compatibility
31
32           Changes include:
33           * Removing trailing semicolon from namespace braces.
34           * Removing trailing comma from last enum declaration.
35           * Updating to match style guidelines.
36           * Adding missing newline to the end of the file.
37           * Turning on gcc warning for missing newline at the end of a source file
38             (GCC_WARN_ABOUT_MISSING_NEWLINE in Xcode, -Wnewline in gcc).
39           * Alphabetical sorting of Xcode source list files.
40           * Use abs() function from <math.h> instead of ABS() macro.
41           * Use C-style comments instead of C++ comments in files that might
42             be included by either C or C++ files.
43           * Use -numeric_limits<double>::infinity() instead of -HUGE_VAL.
44
45         * WebCore+SVG/DOMList.h:
46         * WebCore.xcodeproj/project.pbxproj:
47         * WebCorePrefix.h:
48         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
49         * bindings/js/JSXSLTProcessor.h:
50         * bindings/js/kjs_domnode.h:
51         (KJS::DOMNode::):
52         * bindings/objc/DOMCSS.h:
53         (-[DOMCSSValue enum]):
54         * bindings/objc/DOMCore.h:
55         (-[DOMImplementation createDocument:::]):
56         * bindings/objc/DOMEvents.h:
57         (-[DOMOverflowEvent enum]):
58         * bindings/objc/DOMRange.h:
59         * bindings/objc/DOMTraversal.h:
60         * bindings/objc/DOMXPath.h:
61         (-[DOMXPathNSResolver lookupNamespaceURI:]):
62         * bridge/mac/WebCoreFrameBridge.h:
63         * bridge/mac/WebCoreKeyboardAccess.h:
64         * css/makeprop:
65         * css/makevalues:
66         * dom/ChildNodeList.h:
67         * dom/DocPtr.h:
68         * dom/Document.h:
69         (WebCore::Document::):
70         * dom/DocumentMarker.h:
71         (WebCore::DocumentMarker::):
72         (WebCore::DocumentMarker::operator==):
73         (WebCore::DocumentMarker::operator!=):
74         * dom/EventTargetNode.h:
75         * dom/KeyboardEvent.h:
76         (WebCore::KeyboardEvent::):
77         * dom/NameNodeList.h:
78         (WebCore::NameNodeList::rootNodeChildrenChanged):
79         * dom/QualifiedName.cpp:
80         * editing/TypingCommand.h:
81         (WebCore::TypingCommand::):
82         * editing/UnlinkCommand.h:
83         (WebCore::UnlinkCommand::editingAction):
84         * html/FormDataList.h:
85         (WebCore::FormDataListItem::FormDataListItem):
86         (WebCore::FormDataList::appendData):
87         * html/HTMLBlockquoteElement.h:
88         * html/HTMLDivElement.h:
89         * html/HTMLFormElement.h:
90         * html/HTMLHRElement.h:
91         * html/HTMLHeadingElement.h:
92         * html/HTMLMarqueeElement.h:
93         * html/HTMLParagraphElement.h:
94         * html/HTMLPlugInElement.h:
95         * html/HTMLPreElement.h:
96         * html/HTMLTokenizer.h:
97         (WebCore::HTMLTokenizer::State::):
98         * icon/IconDatabase.cpp:
99         * icon/SQLStatement.cpp:
100         * kcanvas/KCanvasFilters.h:
101         (WebCore::):
102         (WebCore::KCanvasPoint3F::KCanvasPoint3F):
103         (WebCore::KCanvasFilter::KCanvasFilter):
104         (WebCore::KCanvasFilter::~KCanvasFilter):
105         (WebCore::KCanvasFilterEffect::~KCanvasFilterEffect):
106         (WebCore::KCComponentTransferFunction::KCComponentTransferFunction):
107         (WebCore::KCanvasFEConvolveMatrix::KCanvasFEConvolveMatrix):
108         (WebCore::KCLightSource::KCLightSource):
109         (WebCore::KCDistantLightSource::KCDistantLightSource):
110         (WebCore::KCPointLightSource::KCPointLightSource):
111         (WebCore::KCSpotLightSource::KCSpotLightSource):
112         (WebCore::KCanvasFEDiffuseLighting::KCanvasFEDiffuseLighting):
113         (WebCore::KCanvasFEDisplacementMap::KCanvasFEDisplacementMap):
114         (WebCore::KCanvasFEImage::KCanvasFEImage):
115         (WebCore::KCanvasFESpecularLighting::KCanvasFESpecularLighting):
116         * kcanvas/RenderSVGImage.h:
117         * kcanvas/device/quartz/KRenderingDeviceQuartz.h:
118         * ksvg2/css/SVGRenderStyle.h:
119         (WebCore::SVGRenderStyle::InheritedFlags::):
120         (WebCore::SVGRenderStyle::NonInheritedFlags::):
121         * ksvg2/css/SVGRenderStyleDefs.h:
122         (WebCore::):
123         * ksvg2/events/SVGZoomEvent.h:
124         * ksvg2/ksvg.h:
125         (WebCore::):
126         * ksvg2/misc/KCanvasRenderingStyle.h:
127         * ksvg2/misc/SVGImageLoader.h:
128         * ksvg2/scripts/make_names.pl:
129         * ksvg2/svg/SVGAElement.h:
130         * ksvg2/svg/SVGAngle.h:
131         * ksvg2/svg/SVGAnimateColorElement.h:
132         * ksvg2/svg/SVGAnimateElement.h:
133         * ksvg2/svg/SVGAnimateTransformElement.h:
134         * ksvg2/svg/SVGAnimatedAngle.h:
135         * ksvg2/svg/SVGAnimatedBoolean.h:
136         * ksvg2/svg/SVGAnimatedColor.h:
137         * ksvg2/svg/SVGAnimatedEnumeration.h:
138         * ksvg2/svg/SVGAnimatedInteger.h:
139         * ksvg2/svg/SVGAnimatedLength.h:
140         * ksvg2/svg/SVGAnimatedLengthList.h:
141         * ksvg2/svg/SVGAnimatedNumber.h:
142         * ksvg2/svg/SVGAnimatedNumberList.h:
143         * ksvg2/svg/SVGAnimatedPathData.h:
144         * ksvg2/svg/SVGAnimatedPoints.h:
145         * ksvg2/svg/SVGAnimatedPreserveAspectRatio.h:
146         * ksvg2/svg/SVGAnimatedRect.h:
147         * ksvg2/svg/SVGAnimatedString.h:
148         * ksvg2/svg/SVGAnimatedTemplate.h:
149         * ksvg2/svg/SVGAnimatedTransformList.h:
150         * ksvg2/svg/SVGAnimationElement.cpp:
151         (SVGAnimationElement::calculateCurrentValueItem):
152         (SVGAnimationElement::calculateRelativeTimePercentage):
153         * ksvg2/svg/SVGAnimationElement.h:
154         (WebCore::):
155         * ksvg2/svg/SVGCircleElement.h:
156         * ksvg2/svg/SVGClipPathElement.h:
157         * ksvg2/svg/SVGColor.h:
158         * ksvg2/svg/SVGComponentTransferFunctionElement.h:
159         * ksvg2/svg/SVGCursorElement.h:
160         * ksvg2/svg/SVGDOMImplementation.h:
161         * ksvg2/svg/SVGDefsElement.h:
162         * ksvg2/svg/SVGDescElement.h:
163         * ksvg2/svg/SVGDocument.h:
164         * ksvg2/svg/SVGElement.h:
165         (WebCore::SVGElement::rendererIsNeeded):
166         (WebCore::svg_dynamic_cast):
167         * ksvg2/svg/SVGElementInstance.h:
168         * ksvg2/svg/SVGElementInstanceList.h:
169         * ksvg2/svg/SVGEllipseElement.h:
170         * ksvg2/svg/SVGExternalResourcesRequired.h:
171         * ksvg2/svg/SVGFEBlendElement.h:
172         * ksvg2/svg/SVGFEColorMatrixElement.h:
173         * ksvg2/svg/SVGFEComponentTransferElement.h:
174         * ksvg2/svg/SVGFECompositeElement.h:
175         * ksvg2/svg/SVGFEDiffuseLightingElement.h:
176         * ksvg2/svg/SVGFEDisplacementMapElement.h:
177         * ksvg2/svg/SVGFEDistantLightElement.h:
178         * ksvg2/svg/SVGFEFloodElement.h:
179         * ksvg2/svg/SVGFEFuncAElement.h:
180         * ksvg2/svg/SVGFEFuncBElement.h:
181         * ksvg2/svg/SVGFEFuncGElement.h:
182         * ksvg2/svg/SVGFEFuncRElement.h:
183         * ksvg2/svg/SVGFEGaussianBlurElement.h:
184         * ksvg2/svg/SVGFEImageElement.h:
185         * ksvg2/svg/SVGFELightElement.h:
186         * ksvg2/svg/SVGFEMergeElement.h:
187         * ksvg2/svg/SVGFEMergeNodeElement.h:
188         * ksvg2/svg/SVGFEOffsetElement.h:
189         * ksvg2/svg/SVGFEPointLightElement.h:
190         * ksvg2/svg/SVGFESpecularLightingElement.h:
191         * ksvg2/svg/SVGFESpotLightElement.h:
192         * ksvg2/svg/SVGFETileElement.h:
193         * ksvg2/svg/SVGFETurbulenceElement.h:
194         * ksvg2/svg/SVGFilterElement.h:
195         * ksvg2/svg/SVGFilterPrimitiveStandardAttributes.h:
196         * ksvg2/svg/SVGFitToViewBox.h:
197         * ksvg2/svg/SVGForeignObjectElement.cpp:
198         * ksvg2/svg/SVGForeignObjectElement.h:
199         * ksvg2/svg/SVGGElement.h:
200         * ksvg2/svg/SVGGradientElement.h:
201         * ksvg2/svg/SVGHelper.h:
202         (WebCore::):
203         * ksvg2/svg/SVGImageElement.h:
204         * ksvg2/svg/SVGLangSpace.h:
205         * ksvg2/svg/SVGLength.h:
206         * ksvg2/svg/SVGLengthList.h:
207         * ksvg2/svg/SVGLineElement.h:
208         * ksvg2/svg/SVGLinearGradientElement.h:
209         * ksvg2/svg/SVGList.h:
210         * ksvg2/svg/SVGLocatable.h:
211         * ksvg2/svg/SVGMarkerElement.h:
212         * ksvg2/svg/SVGMaskElement.h:
213         * ksvg2/svg/SVGMatrix.h:
214         * ksvg2/svg/SVGNumber.h:
215         * ksvg2/svg/SVGNumberList.h:
216         * ksvg2/svg/SVGPaint.h:
217         * ksvg2/svg/SVGPathElement.h:
218         * ksvg2/svg/SVGPathSeg.h:
219         * ksvg2/svg/SVGPathSegArc.h:
220         * ksvg2/svg/SVGPathSegClosePath.h:
221         * ksvg2/svg/SVGPathSegCurvetoCubic.h:
222         * ksvg2/svg/SVGPathSegCurvetoCubicSmooth.h:
223         * ksvg2/svg/SVGPathSegCurvetoQuadratic.h:
224         * ksvg2/svg/SVGPathSegCurvetoQuadraticSmooth.h:
225         * ksvg2/svg/SVGPathSegLineto.h:
226         * ksvg2/svg/SVGPathSegLinetoHorizontal.h:
227         * ksvg2/svg/SVGPathSegLinetoVertical.h:
228         * ksvg2/svg/SVGPathSegList.h:
229         * ksvg2/svg/SVGPathSegMoveto.h:
230         * ksvg2/svg/SVGPatternElement.h:
231         * ksvg2/svg/SVGPoint.h:
232         * ksvg2/svg/SVGPointList.h:
233         * ksvg2/svg/SVGPolyElement.h:
234         * ksvg2/svg/SVGPolygonElement.h:
235         * ksvg2/svg/SVGPolylineElement.h:
236         * ksvg2/svg/SVGPreserveAspectRatio.h:
237         * ksvg2/svg/SVGRadialGradientElement.h:
238         * ksvg2/svg/SVGRect.h:
239         * ksvg2/svg/SVGRectElement.h:
240         * ksvg2/svg/SVGSVGElement.h:
241         * ksvg2/svg/SVGScriptElement.h:
242         * ksvg2/svg/SVGSetElement.h:
243         * ksvg2/svg/SVGStopElement.h:
244         * ksvg2/svg/SVGStringList.h:
245         * ksvg2/svg/SVGStylable.h:
246         * ksvg2/svg/SVGStyleElement.h:
247         * ksvg2/svg/SVGStyledElement.h:
248         (WebCore::SVGStyledElement::rendererIsNeeded):
249         (WebCore::SVGStyledElement::canvasResource):
250         * ksvg2/svg/SVGStyledLocatableElement.h:
251         * ksvg2/svg/SVGStyledTransformableElement.h:
252         * ksvg2/svg/SVGSwitchElement.h:
253         * ksvg2/svg/SVGSymbolElement.h:
254         * ksvg2/svg/SVGTRefElement.h:
255         * ksvg2/svg/SVGTSpanElement.h:
256         * ksvg2/svg/SVGTests.h:
257         * ksvg2/svg/SVGTextContentElement.h:
258         * ksvg2/svg/SVGTextElement.h:
259         * ksvg2/svg/SVGTextPositioningElement.h:
260         * ksvg2/svg/SVGTitleElement.h:
261         * ksvg2/svg/SVGTransform.h:
262         * ksvg2/svg/SVGTransformList.h:
263         * ksvg2/svg/SVGTransformable.h:
264         * ksvg2/svg/SVGURIReference.h:
265         * ksvg2/svg/SVGUseElement.h:
266         * ksvg2/svg/SVGViewElement.h:
267         * ksvg2/svg/SVGZoomAndPan.h:
268         * ksvg2/svg/svgpathparser.h:
269         * page/Frame.h:
270         (WebCore::):
271         * platform/AffineTransform.h:
272         * platform/FontCache.cpp:
273         (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
274         * platform/FontData.cpp:
275         (WebCore::FontData::FontData):
276         * platform/FontData.h:
277         * platform/TextBox.h:
278         (WebCore::TextBox::):
279         * platform/Timer.cpp:
280         (WebCore::TimerBase::heapPop):
281         * platform/mac/FontCacheMac.mm:
282         * platform/mac/GlyphMapMac.cpp:
283         * platform/mac/WebFontCache.mm:
284         (betterChoice):
285         * rendering/DeprecatedRenderSelect.cpp:
286         (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
287         * rendering/EllipsisBox.h:
288         * rendering/RenderBR.h:
289         (WebCore::RenderBR::renderName):
290         (WebCore::RenderBR::width):
291         * rendering/RenderBlock.h:
292         (WebCore::):
293         * rendering/RenderFlexibleBox.h:
294         * rendering/RenderFlow.h:
295         (WebCore::RenderFlow::RenderFlow):
296         * rendering/RenderFrame.cpp:
297         * rendering/bidi.h:
298         * rendering/break_lines.cpp:
299
300 2006-07-29  Rob Buis  <buis@kde.org>
301
302         Reviewed by Geoff.
303
304         http://bugzilla.opendarwin.org/show_bug.cgi?id=10151
305         ghostmap XHTML + SVG fails due to javascript undefined exception
306
307         Make sure document.URL works when called from a non-HTML document.
308
309         * bindings/js/kjs_html.cpp:
310         (KJS::JSHTMLDocument::getValueProperty):
311         * bindings/js/kjs_html.h:
312         (KJS::JSHTMLDocument::):
313         * dom/Document.idl:
314
315 2006-07-29  Mike Emmel  <mike.emmel@gmail.com>
316
317         Reviewed and tweaked by Darin.
318
319         - fixes for Linux build
320           (still might not compile, since Darin tweaked but was unable to test).
321
322         * WebCoreSources.bkl: Added some new sources, removed some obsolete ones.
323         * Projects/gdk/webcore-gdk.bkl: Added RenderPopupMenuGdk.cpp
324
325         * html/HTMLPlugInElement.h: Removed incorrect syntax with class name
326         before ::.
327
328         * platform/gdk/FrameGdk.h:
329         * platform/gdk/FrameGdk.cpp: Updated parameters of constructor. Moved a couple stubs
330         out of this file.
331         * platform/gdk/RenderPopupMenuGdk.h: Added.
332         * platform/gdk/RenderPopupMenuGdk.cpp: Added. Just a file full of empty stubs.
333         * platform/gdk/RenderThemeGdk.h:
334         * platform/gdk/RenderThemeGdk.cpp: (WebCore::RenderThemeGdk::createPopupMenu): Added.
335
336         * platform/gdk/TemporaryLinkStubs.cpp: Add some new stubs.
337
338 2006-07-29  Mark Rowe  <opendarwin.org@bdash.net.nz>
339
340         Reviewed by Darin.
341
342         http://bugzilla.opendarwin.org/show_bug.cgi?id=10022
343         Bug 10022: REGRESSION: Crash in WebCore::XMLTokenizer::characters
344
345         * dom/XMLTokenizer.cpp:
346         (WebCore::XMLTokenizer::resumeParsing): If the write() call resulted in new callbacks being
347         added, don't call through to end() just yet.
348
349 2006-07-29  Mitz Pettel  <opendarwin.org@mitzpettel.com>
350
351         Reviewed by John Sullivan.
352
353         - manual test for http://bugzilla.opendarwin.org/show_bug.cgi?id=9984
354           ASSERTION FAILURE: _private->mouseDownEvent != nil
355           (WebKit/WebView/WebHTMLView.m:4863 -[WebHTMLView(WebInternal) _delegateDragSourceActionMask])
356
357         * manual-tests/subview-click-assertion.html: Added.
358
359 2006-07-29  Andrew Wellington  <proton@wiretapped.net>
360
361         Reviewed by Darin.
362
363         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=8587 / <rdar://problem/4631844>
364         REGRESSION: {display:list-item} items outside an ol or ul element don't number correctly
365
366         * rendering/RenderListItem.cpp:
367         (WebCore::enclosingList): If no real list element is found, use parent instead.
368         (WebCore::previousListItem): Check list elements to see if they are list items -- the
369         old code assumed that a list would never be a list item but this is entirely possible
370         with CSS and especially with the new rule that means any DOM element could act as a list.
371
372 2006-07-29  Alexey Proskuryakov  <ap@nypop.com>
373
374         Reviewed by Darin.
375
376         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10147
377         REGRESSION: custom attribute values set via javascript are not persistent
378
379         Test: fast/dom/Element/setAttribute-case-insensitivity.html
380
381         * dom/Element.cpp:
382         (WebCore::Element::setAttribute): Use the lowercased localName for retrieving the old value, too.
383
384 2006-07-28  Timothy Hatcher  <timothy@apple.com>
385
386         Suggested by Darin.
387
388         Moving the implementation of isContentEditable to the
389         the WebPrivate category.
390
391         * bindings/objc/DOM.mm:
392         (-[DOMNode isContentEditable]):
393
394 2006-07-28  Justin Garcia  <justin.garcia@apple.com>
395
396         Reviewed by levi
397         
398         First part of:
399         <rdar://problem/4515463>
400         REGRESSION: Blot and Mail both do a very poor job of pasting the main www.apple.com page
401         
402         Migrate to isBlock and enclosingBlock.
403         Changed RendereringInfo::isBlock and ReplacementFragment::isBlock
404         to wasBlock so that they don't conflict with isBlock and because
405         it's more descriptive.
406
407         * editing/ReplaceSelectionCommand.cpp:
408         (WebCore::ReplacementFragment::mergeStartNode):
409         (WebCore::ReplacementFragment::wasBlock):
410         (WebCore::ReplacementFragment::saveRenderingInfo):
411         (WebCore::ReplacementFragment::renderedBlocks):
412         (WebCore::RenderingInfo::RenderingInfo):
413         (WebCore::ReplaceSelectionCommand::shouldMergeStart):
414         (WebCore::ReplaceSelectionCommand::doApply):
415         * editing/ReplaceSelectionCommand.h:
416         (WebCore::RenderingInfo::wasBlock):
417
418 2006-07-27  Justin Garcia  <justin.garcia@apple.com>
419
420         Reviewed by levi
421         
422         More changes for:
423         <rdar://problem/4242293>
424         Poor paste fidelity of http://www.google.com/
425
426         * editing/markup.cpp:
427         (WebCore::needInterchangeNewlineAfter): Added.
428         (WebCore::createMarkup): 
429         Only add an interchangeNewline if we're annotating for interchange.  Can't test 
430         this until we expose createMarkup in non-annotate mode (I'd expose Range::toHTML).
431         Remove the FIXME about prepending the interchangeNewline before creating the rest 
432         of the markup.  Its correct to surround the interchangeNewline in ancestors of the
433         adjusted startNode.
434         Fixed the check to see if an interchangeNewline is needed (!inSameBlock).  This would
435         add an interchangeNewline for a selection that started before a table.
436         Removed the workaround for the bug where markup for a table was not included when 
437         selecting the contents of a table, since this change fixes the general problem of 
438         markup for ancestors of the startNode being left out.
439         Don't leave out ancestors of the startNode as we leave their subtrees.  Execute the
440         code to include them even if we closed ancestors in the ancestorsToClose list.
441
442 2006-07-28  Timothy Hatcher  <timothy@apple.com>
443
444         Reviewed by John.
445
446         Adding isContentEditable to DOMNode's private category. 
447
448         * bindings/objc/DOMPrivate.h:
449
450 2006-07-28  Alexey Proskuryakov  <ap@nypop.com>
451
452         Rolling out http://bugzilla.opendarwin.org/show_bug.cgi?id=6010 because of failing layout tests.
453         Add better SVGLoad event support.
454
455         * dom/EventTargetNode.cpp:
456         (WebCore::EventTargetNode::dispatchGenericEvent):
457         * html/HTMLImageLoader.cpp:
458         (WebCore::HTMLImageLoader::dispatchLoadEvent):
459         * html/HTMLImageLoader.h:
460         * ksvg2/misc/SVGImageLoader.cpp:
461         (WebCore::SVGImageLoader::SVGImageLoader):
462         * ksvg2/misc/SVGImageLoader.h:
463         * ksvg2/svg/SVGAElement.cpp:
464         (WebCore::SVGAElement::parseMappedAttribute):
465         * ksvg2/svg/SVGAnimatedBoolean.h:
466         * ksvg2/svg/SVGElement.cpp:
467         (WebCore::SVGElement::SVGElement):
468         (WebCore::SVGElement::parseMappedAttribute):
469         * ksvg2/svg/SVGElement.h:
470         (WebCore::SVGElement::adjustViewportClipping):
471         (WebCore::SVGElement::closeRenderer):
472         (WebCore::SVGElement::rendererIsNeeded):
473         (WebCore::SVGElement::isClosed):
474         (WebCore::svg_dynamic_cast):
475         * ksvg2/svg/SVGExternalResourcesRequired.h:
476         * ksvg2/svg/SVGImageElement.cpp:
477         (SVGImageElement::SVGImageElement):
478         * ksvg2/svg/SVGImageElement.h:
479         * ksvg2/svg/SVGSVGElement.cpp:
480         (WebCore::SVGSVGElement::parseMappedAttribute):
481         * ksvg2/svg/SVGScriptElement.cpp:
482         (SVGScriptElement::SVGScriptElement):
483         (SVGScriptElement::parseMappedAttribute):
484         (SVGScriptElement::executeScript):
485         * xml/xmlhttprequest.cpp:
486         (WebCore::XMLHttpRequest::callReadyStateChangeListener):
487
488 2006-07-28  Adele Peterson  <adele@apple.com>
489
490         Rolling out http://bugzilla.opendarwin.org/show_bug.cgi?id=9753 because of failing layout tests.
491         SVG with width and height 100% leaves room for scrollbar on the right.
492
493         * kcanvas/RenderPath.cpp:
494         * kcanvas/RenderPath.h:
495         * kcanvas/RenderSVGContainer.cpp:
496         (WebCore::RenderSVGContainer::layout):
497         * ksvg2/svg/SVGCircleElement.cpp:
498         * ksvg2/svg/SVGCircleElement.h:
499         * ksvg2/svg/SVGEllipseElement.cpp:
500         * ksvg2/svg/SVGEllipseElement.h:
501         * ksvg2/svg/SVGLineElement.cpp:
502         * ksvg2/svg/SVGLineElement.h:
503         * ksvg2/svg/SVGRectElement.cpp:
504         * ksvg2/svg/SVGRectElement.h:
505         * ksvg2/svg/SVGStyledElement.h:
506
507 2006-07-27  Eric Seidel  <eric@eseidel.com>
508
509         Reviewed by darin.
510         
511         Add better SVGLoad event support.
512         http://bugzilla.opendarwin.org/show_bug.cgi?id=6010
513         There will still need to be additional support added for <link> and <script> elements.
514         Not all of the error -> loaded -> error transition cases work yet.
515
516         * dom/EventTargetNode.cpp:
517         (WebCore::EventTargetNode::dispatchGenericEvent):
518         * html/HTMLImageLoader.cpp:
519         (WebCore::HTMLImageLoader::dispatchLoadEvent):
520         * html/HTMLImageLoader.h:
521         (WebCore::HTMLImageLoader::haveFiredLoadEvent):
522         (WebCore::HTMLImageLoader::setHaveFiredLoadEvent):
523         * ksvg2/misc/SVGImageLoader.cpp:
524         (WebCore::SVGImageLoader::SVGImageLoader):
525         (WebCore::SVGImageLoader::dispatchLoadEvent):
526         * ksvg2/misc/SVGImageLoader.h:
527         * ksvg2/svg/SVGAElement.cpp:
528         (WebCore::SVGAElement::parseMappedAttribute):
529         * ksvg2/svg/SVGAnimatedBoolean.h:
530         * ksvg2/svg/SVGElement.cpp:
531         (WebCore::SVGElement::SVGElement):
532         (WebCore::SVGElement::parseMappedAttribute):
533         (WebCore::SVGElement::haveLoadedRequiredResources):
534         (WebCore::SVGElement::sendSVGLoadEventIfPossible):
535         (WebCore::SVGElement::closeRenderer):
536         * ksvg2/svg/SVGElement.h:
537         (WebCore::SVGElement::rendererIsNeeded):
538         (WebCore::svg_dynamic_cast):
539         * ksvg2/svg/SVGExternalResourcesRequired.h:
540         * ksvg2/svg/SVGImageElement.cpp:
541         (SVGImageElement::SVGImageElement):
542         (SVGImageElement::haveLoadedRequiredResources):
543         * ksvg2/svg/SVGImageElement.h:
544         * ksvg2/svg/SVGSVGElement.cpp:
545         (WebCore::SVGSVGElement::parseMappedAttribute):
546         * ksvg2/svg/SVGScriptElement.cpp:
547         (WebCore::SVGScriptElement::SVGScriptElement):
548         (WebCore::SVGScriptElement::parseMappedAttribute):
549         (WebCore::SVGScriptElement::executeScript):
550         * xml/xmlhttprequest.cpp:
551         (WebCore::XMLHttpRequest::callReadyStateChangeListener): use new Event() instead of createEvent
552
553 2006-07-27  Mitz Pettel  <opendarwin.org@mitzpettel.com>
554
555         Reviewed by Anders.
556
557         - http://bugzilla.opendarwin.org/show_bug.cgi?id=10135
558           Cleanup: remove useless parameters from RenderObject::position()
559
560         No test possible (no functionality change)
561
562         * rendering/RenderBox.cpp:
563         (WebCore::RenderBox::position):
564         * rendering/RenderBox.h:
565         * rendering/RenderObject.h:
566         (WebCore::RenderObject::position):
567         * rendering/RenderTableRow.h:
568         (WebCore::RenderTableRow::position):
569         * rendering/RenderTableSection.h:
570         (WebCore::RenderTableSection::position):
571         * rendering/RenderText.cpp:
572         (WebCore::RenderText::position):
573         * rendering/RenderText.h:
574         * rendering/bidi.cpp:
575         (WebCore::RenderBlock::constructLine):
576         (WebCore::RenderBlock::computeVerticalPositionsForLine):
577
578 2006-07-27  Rob Buis  <buis@kde.org>
579
580         Reviewed by Maciej.
581
582         http://bugzilla.opendarwin.org/show_bug.cgi?id=9753
583         SVG with width and height 100% leaves room for scrollbar on the right.
584
585         Relayout children of svg containers, except svg shapes that do not depend on percentages.
586
587         * kcanvas/RenderPath.cpp: (WebCore::RenderPath::hasPercentageValues):
588         * kcanvas/RenderPath.h:
589         * kcanvas/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::layout):
590         * ksvg2/svg/SVGCircleElement.cpp: (SVGCircleElement::hasPercentageValues):
591         * ksvg2/svg/SVGCircleElement.h:
592         * ksvg2/svg/SVGEllipseElement.cpp: (WebCore::SVGEllipseElement::hasPercentageValues):
593         * ksvg2/svg/SVGEllipseElement.h:
594         * ksvg2/svg/SVGLineElement.cpp: (SVGLineElement::hasPercentageValues):
595         * ksvg2/svg/SVGLineElement.h:
596         * ksvg2/svg/SVGRectElement.cpp: (WebCore::SVGRectElement::hasPercentageValues):
597         * ksvg2/svg/SVGRectElement.h:
598         * ksvg2/svg/SVGStyledElement.h: (WebCore::SVGStyledElement::hasPercentageValues):
599
600 2006-07-27  Justin Garcia  <justin.garcia@apple.com>
601
602         Reviewed by levi
603         
604         <rdar://problem/4242293>
605         Poor paste fidelity of http://www.google.com/
606
607         * editing/ApplyStyleCommand.cpp:
608         (WebCore::ApplyStyleCommand::applyInlineStyle):  Fixed crasher with nil-check.
609         * editing/markup.cpp:
610         (WebCore::startMarkup): Style information wasn't added to an element if it had
611         attributes but no style attribute.
612
613 2006-07-27  Alexander Kellett  <lypanov@kde.org>
614
615         Reviewed by Darin.
616
617         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9867
618           REGRESSION: code that modifies form element in Firefox modifies form attribute in WebKit
619
620         * bindings/scripts/CodeGeneratorJS.pm: add new attribute - HasOverridingNameGetter
621         * html/HTMLFormElement.idl:
622
623 2006-07-27  Rob Buis  <buis@kde.org>
624
625         Reviewed by Anders.
626
627         http://bugzilla.opendarwin.org/show_bug.cgi?id=8992
628         Some HTML DOM attributes have incorrect types
629
630         Adjust idl and dom source code for HTMLImageElement and
631         HTMLBaseFontElement to choose correct type for
632         HTMLImageElement::border and HTMLBaseFontElement::size
633         attributes.
634
635         * html/HTMLBaseFontElement.cpp:
636         (WebCore::HTMLBaseFontElement::size):
637         (WebCore::HTMLBaseFontElement::setSize):
638         * html/HTMLBaseFontElement.h:
639         * html/HTMLBaseFontElement.idl:
640         * html/HTMLImageElement.cpp:
641         (WebCore::HTMLImageElement::border):
642         (WebCore::HTMLImageElement::setBorder):
643         * html/HTMLImageElement.h:
644         * html/HTMLImageElement.idl:
645
646 2006-07-27  Justin Garcia  <justin.garcia@apple.com>
647
648         Reviewed by levi
649         
650         <rdar://problem/4628409>
651         Safari crashes in CompositeEditCommand::removeBlockPlaceholder entering text in a web page form
652
653         * editing/CompositeEditCommand.cpp:
654         (WebCore::CompositeEditCommand::removeBlockPlaceholder): 
655         A script on the page shrinks the textarea down to zero rows just
656         before insertion.  That gives the shadow div a zero height, removing
657         [div, 0] as a candidate for a VisiblePosition.  Then 
658         InsertTextCommand::input() tries to create a VisiblePosition from 
659         [div, 0] and fails.  A nil check is a quick fix.  Another might
660         be to make positions where there is a caret selection candidates.
661         Another might be to make any [div, 0] where div is a shadow div inside
662         a form element a candidate.
663
664 2006-07-27  Graham Dennis  <graham.dennis@gmail.com>
665
666         Reviewed by Darin.
667
668         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=10094
669           Japanese characters improperly rendering in TOT
670           
671         Test: fast/encoding/denormalised-voiced-japanese-chars.html
672
673         * platform/Font.cpp:
674         (WebCore::WidthIterator::advance): pass currentCharacter to normalizeVoicingMarks
675         (WebCore::WidthIterator::normalizeVoicingMarks): turn the currentCharacter variable
676         into an argument as WidthIterator::advance doesn't update m_currentCharacter while
677         looping
678
679 2006-07-27  Eric Seidel  <eric@eseidel.com>
680
681         Reviewed by ap.
682
683         Complex entities seem to fail on TOT
684         http://bugzilla.opendarwin.org/show_bug.cgi?id=6390
685         Use an alternative work-around to an XML Entity parsing bug.
686
687         * dom/XMLTokenizer.cpp:
688         (WebCore::XMLTokenizer::write):
689         (WebCore::hackAroundLibXMLEntityBug): added.
690         (WebCore::startElementNsHandler):
691         (WebCore::endElementNsHandler):
692         (WebCore::charactersHandler):
693         (WebCore::processingInstructionHandler):
694         (WebCore::cdataBlockHandler):
695         (WebCore::commentHandler):
696         (WebCore::getEntityHandler):
697
698 2006-07-27  Rob Buis  <buis@kde.org>
699
700         Reviewed by Darin.
701
702         http://bugzilla.opendarwin.org/show_bug.cgi?id=9938
703         Fix viewBox issues in Hixie's test
704
705         Do a more accurate and quicker job of parsing the viewBox
706         attribute. Handle properly on negative width/height and
707         invalid syntax in general.
708
709         * ksvg2/svg/SVGFitToViewBox.cpp:
710         (SVGFitToViewBox::parseViewBox):
711
712 2006-07-27  Eric Seidel  <eric@eseidel.com>
713
714         Reviewed by ap.
715
716         Enables getSVGDocument() support for HTMLObjectElement and HTMLEmbedElement
717         http://bugzilla.opendarwin.org/show_bug.cgi?id=9237
718         This patch does not try to autogenerate anything, but enables the SVG functionality.
719         Also fix HTMLObjectElement vspace and hspace to be numbers instead of strings to match IE & Firefox.
720
721         * bindings/js/kjs_dom.cpp:
722         (KJS::toJS):
723         * bindings/js/kjs_html.cpp:
724         (KJS::JSHTMLElement::objectGetter):
725         (KJS::HTMLElementFunction::callAsFunction):
726         (KJS::JSHTMLElement::objectSetter):
727         * bindings/js/kjs_html.h:
728         (KJS::JSHTMLElement::):
729         * dom/Document.h:
730         (WebCore::Document::isSVGDocument):
731         * html/HTMLEmbedElement.cpp:
732         (WebCore::HTMLEmbedElement::contentDocument):
733         (WebCore::HTMLEmbedElement::getSVGDocument):
734         * html/HTMLEmbedElement.h:
735         * html/HTMLObjectElement.cpp:
736         (WebCore::HTMLObjectElement::HTMLObjectElement):
737         (WebCore::HTMLObjectElement::getInstance):
738         (WebCore::HTMLObjectElement::parseMappedAttribute):
739         (WebCore::HTMLObjectElement::contentDocument):
740         (WebCore::HTMLObjectElement::rendererIsNeeded):
741         (WebCore::HTMLObjectElement::createRenderer):
742         (WebCore::HTMLObjectElement::setCode):
743         (WebCore::HTMLObjectElement::setArchive):
744         (WebCore::HTMLObjectElement::setBorder):
745         (WebCore::HTMLObjectElement::setCodeBase):
746         (WebCore::HTMLObjectElement::setCodeType):
747         (WebCore::HTMLObjectElement::setData):
748         (WebCore::HTMLObjectElement::hspace):
749         (WebCore::HTMLObjectElement::setHspace):
750         (WebCore::HTMLObjectElement::setStandby):
751         (WebCore::HTMLObjectElement::setType):
752         (WebCore::HTMLObjectElement::setUseMap):
753         (WebCore::HTMLObjectElement::vspace):
754         (WebCore::HTMLObjectElement::setVspace):
755         (WebCore::HTMLObjectElement::getSVGDocument):
756         * html/HTMLObjectElement.h:
757         * ksvg2/svg/SVGDocument.h:
758         (WebCore::SVGDocument::isSVGDocument):
759         * rendering/RenderWidget.h:
760         (WebCore::RenderWidget::frameView):
761
762 2006-07-26  Alexey Proskuryakov  <ap@nypop.com>
763
764         Reviewed by Darin.
765
766         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9901
767         XSLTProcessor cannot parse text nodes for INPUT ELEMENTS in an XSLT stylesheet
768
769         Test: fast/js/xhtml-serialize.html
770
771         * editing/markup.cpp:
772         (WebCore::endMarkup): If the element has child nodes, write a closing tag even if it 
773         is not permitted in HTML, to make it valid XML.
774
775 2006-07-26  Alice Liu  <alice.liu@apple.com>
776
777         Reviewed by John Sullivan (and Kevin and Timo).
778
779         landing this patch for John et al.  
780         Fixed <rdar://problem/4651380> REGRESSION (9A232->9A234): existing web clips don't render if you restart Dashboard
781
782         * page/FrameView.cpp:
783         (WebCore::FrameView::layout):
784         moved the call to didFirstLayout to above the check for needsLayout
785         because we need to call didFirstLayout for every webview, not just
786         ones we think need layout.  
787
788 2006-07-26  Justin Garcia  <justin.garcia@apple.com>
789
790         Reviewed by darin
791         
792         <rdar://problem/4652788>
793         REGRESSION: Can't change size or style of any text in message body
794
795         * dom/Node.cpp:
796         (WebCore::Node::isContentRichlyEditable): Mimic Node::isContentEditable.
797         * html/HTMLElement.cpp:
798         (WebCore::HTMLElement::isContentRichlyEditable): First check
799         the frame for editability, then userModify, like what
800         HTMLElement::isContentEditable() does.
801         * html/HTMLElement.h:
802
803 2006-07-26  Mitz Pettel  <opendarwin.org@mitzpettel.com>
804
805         Reviewed by ap.
806
807         - fix debug-only information() string for table cells
808
809         * rendering/RenderObject.cpp:
810         (WebCore::RenderObject::information):
811
812 2006-07-25  David Harrison  <harrison@apple.com>
813
814         Reviewed by timo and Darin.
815
816         <rdar://problem/4618584> "Paste and Match Style" is not working in Mail (add SPI)
817         
818         * WebCore.xcodeproj/project.pbxproj:
819         * bridge/mac/WebCoreFrameBridge.h:
820         * bridge/mac/WebCoreFrameBridge.mm:
821         (-[WebCoreFrameBridge replaceSelectionWithNode:selectReplacement:smartReplace:matchStyle:]):
822         Add matchStyle parameter for use by WebKit.
823
824 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
825
826         Reviewed by adele
827         
828         <rdar://problem/4649560>
829         REGRESSION: Can't Select All when the body is contentEditable="true"
830
831         * editing/VisiblePosition.cpp:
832         (WebCore::VisiblePosition::canonicalPosition): Allow descent from a non-editable html
833         element into an editable body as a convenience.
834
835 2006-07-25  Justin Garcia  <justin.garcia@apple.com>
836
837         Reviewed by darin
838         
839         <rdar://problem/4468458> Incoming HTML message is editable <body contenteditable="true">
840
841         * dom/Document.cpp:
842         (WebCore::Document::inDesignMode): Removed some spaces.
843         * page/Frame.cpp:
844         (WebCore::Frame::applyEditingStyleToElement): Just add CSS properties needed for editing.
845         (WebCore::Frame::removeEditingStyleFromElement): Made this a no-op, we'll remove
846         it eventually.
847
848 2006-07-25  David Kilzer  <ddkilzer@kilzer.net>
849
850         Reviewed by Darin.
851
852         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9717
853           Replace IDL ConvertUndefinedToTrue parameter attribute with Optional attribute
854
855         No test added because there is no change in functionality.
856
857         * bindings/js/kjs_binding.cpp: Removed valueToBooleanTreatUndefinedAsTrue() method.
858         * bindings/js/kjs_binding.h: Ditto.
859         * bindings/scripts/CodeGeneratorJS.pm: Removed support for ConvertUndefinedToTrue parameter attribute.
860         * dom/Element.h: Set default value to true for scrollIntoView() and scrollIntoViewIfNeeded() arguments.
861         * dom/Element.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
862           Fixed name of scrollIntoViewIfNeeded() argument to match implementation.
863         * page/DOMWindow.idl: Replaced ConvertUndefinedToTrue attribute with Optional attribute.
864
865 2006-07-24  Dan Waylonis  <waylonis@google.com>
866
867         Reviewed and tweaked a bunch by Darin.
868
869         Test: plugins/bindings-test.html
870
871         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9902
872           jsNull and NSNull not properly converted between JS and ObjC
873
874         * bindings/objc/WebScriptObject.mm:
875         (+[WebScriptObject _convertValueToObjcValue:originExecutionContext:executionContext:]):
876         Added case that converts jsNull to NSNull.
877
878 2006-07-24  Darin Adler  <darin@apple.com>
879
880         Reviewed by Adele and Justin.
881
882         - fix <rdar://problem/4613616> REGRESSION: some spaces typed in <textarea> are posted as non-breaking spaces (9630)
883           http://bugzilla.opendarwin.org/show_bug.cgi?id=9630
884         - also fixes http://bugzilla.opendarwin.org/show_bug.cgi?id=9939
885           REGRESSION: Pasting text into native text area with newline at end does not preserve newline
886         - removed some uses of DeprecatedPtrList in the markup code
887
888         Test: fast/forms/textarea-type-spaces.html
889         Test: fast/forms/textarea-paste-newline.html
890
891         * bindings/objc/DOMHTML.mm: (-[DOMHTMLDocument createDocumentFragmentWithText:]):
892         Updated call to pass a range -- in this case it is the range of the entire document,
893         so this will not handle the whitespace properly.
894
895         * bridge/mac/WebCoreFrameBridge.h: Added range context parameter to the
896         documentFragmentWithText: method, so we can handle whitespace properly.
897         * bridge/mac/WebCoreFrameBridge.mm:
898         (-[WebCoreFrameBridge nodesFromList:]): Changed from DeprecatedPtrList to Vector.
899         (-[WebCoreFrameBridge markupStringFromNode:nodes:]): Ditto.
900         (-[WebCoreFrameBridge markupStringFromRange:nodes:]): Ditto.
901         (-[WebCoreFrameBridge documentFragmentWithText:inContext:]): Added range context
902         parameter -- pass it on to createFragmentFromText.
903         (-[WebCoreFrameBridge documentFragmentWithNodesAsParagraphs:]): Changed from
904         DeprecatedPtrList to Vector.
905         (-[WebCoreFrameBridge replaceSelectionWithText:selectReplacement:smartReplace:]):
906         Pass the range of the current selection as context when creating the fragment.
907
908         * dom/Position.cpp: (WebCore::Position::inRenderedText): Replace range check with
909         a call to the new containsCaretOffset function -- helps make the caret work right when
910         it is past the end of the last line in a textarea.
911
912         * editing/CompositeEditCommand.cpp:
913         (WebCore::CompositeEditCommand::rebalanceWhitespaceAt): Don't do anything if the
914         style does not call for collapsing whitespace.
915         (WebCore::CompositeEditCommand::rebalanceWhitespace): Call replaceWhitespaceAt
916         to share code, including the new logic mentioned above.
917
918         * editing/InsertLineBreakCommand.cpp: (WebCore::InsertLineBreakCommand::doApply):
919         Use a text node instead of a break element when inserting and the style is preserveNewline.
920
921         * editing/JSEditor.cpp: (WebCore::execRemoveFormat): Pass the selection range
922         to createFragmentFromText.
923
924         * editing/RebalanceWhitespaceCommand.cpp: (WebCore::RebalanceWhitespaceCommand::doApply):
925         Assert that we're in a style that collapses whitespace. It's the caller's responsibility
926         not to call otherwise.
927
928         * editing/ReplaceSelectionCommand.h: Removed unused destructor, type, isSingleTextNode,
929         isTreeFragment, m_type, and added a context parameter to inertFragmentForTestRendering.
930         Also changed the constructor to take a selection rather than a pointer to the root
931         editable element, replaced removeEndBRIfNeeded with shouldRemoveEndBR and removed an
932         unused parameter from shouldMergeEnd.
933         * editing/ReplaceSelectionCommand.cpp:
934         (WebCore::ReplacementFragment::ReplacementFragment): Removed code to set up m_type.
935         Compute root editable element from passed-in selection. Used the start of the selection
936         as a base node for style purposes for the test rendering. Removed the special case
937         "single text node" alternative to createFragmentFromText in the plain text case, since
938         createFragmentFromText now handles that correctly.
939         (WebCore::ReplacementFragment::insertFragmentForTestRendering): Copy the whitespace
940         property from the source location when creating a temporary element for test rendering.
941         (WebCore::ReplacementFragment::shouldMergeEnd): Removed unneeded boolean
942         parameter fragmentHadInterchangeNewlineAtEnd, which is always false.
943         (WebCore::ReplaceSelectionCommand::doApply): Update for ReplacementFragment changes,
944         change code to not remove end BR when it can be re-used instead, don't call the
945         paragraph separator insertion when the position is at the start of a paragraph already,
946         removed redundant computation of identical "next" value, removed unneeded boolean
947         parameter to shouldMergeEnd, add case for merging when all we need to do is to delete
948         a newline character, removed unneeded code to set insertionPos after all code that uses
949         it, and  use spaces instead of non-breaking spaces when doing smart paste if the
950         context is one where we do not collapse white space.
951         (WebCore::ReplaceSelectionCommand::shouldRemoveEndBR): Renamed and changed to return
952         a boolean instead of doing the removal.
953
954         * editing/markup.h: Use Vector instead of DeprecatedPtrList. Change the
955         createFragmentFromText function to take a range for context instead of a document.
956         * editing/markup.cpp:
957         (WebCore::markup): Use Vector instead of DeprecatedPtrList.
958         (WebCore::createMarkup): Ditto.
959         (WebCore::createParagraphContentsFromString): Remove unneeded document parameter
960         and changed a couple places to use isEmpty instead of comparing with "".
961         (WebCore::createFragmentFromText): Given the new context parameter, if the context
962         is one that preserves newlines, then use "\n" instead of <br> elements.
963         (WebCore::createFragmentFromNodes): Use Vector instead of DeprecatedPtrList.
964
965         * html/HTMLElement.cpp: (WebCore::HTMLElement::setInnerText): Do not use <br>
966         elements if the context of this node is one where we preserve newlines.
967
968         * rendering/InlineTextBox.h:
969         * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::containsCaretOffset):
970         Added. Implements the appropriate rule for determining if a caret position is
971         in this line or not. Returns true for both one line and the next in cases where
972         affinity must be considered to determine which line the caret is on.
973
974         * rendering/RenderText.h: Make atLineWrap no longer be a member function.
975         * rendering/RenderText.cpp:
976         (WebCore::atLineWrap): Remove special rule about preserveNewline and isLineBreak,
977         which will no longer apply due to the new containsCaretOffset function logic.
978         (WebCore::RenderText::caretRect): Use containsCaretOffset.
979         (WebCore::RenderText::inlineBox): Ditto.
980
981         * rendering/RenderTextControl.cpp:
982         (WebCore::RenderTextControl::updateFromElement): Make a placeholder <br> element
983         after calling setInnerText so that the last newline in the string has the effect
984         we expect outside the HTML world (an additional line).
985         (WebCore::RenderTextControl::setSelectionRange): Set granularity of the selection
986         too. The layout tests caught this problem, which needs a better solution long term.
987         (WebCore::RenderTextControl::text): Call textContent with the parameter false
988         so it will not include newlines for <br> elements. Now the only <br> element
989         that will ever be in the shadow DOM tree is the one to prevent collapsing, and
990         that one should not show up in the text value.
991
992         * rendering/bidi.cpp: (WebCore::RenderBlock::findNextLineBreak): Took a rule
993         that specifically called out the pre whitespace mode and made it work for all
994         the modes that preserve newlines. This makes sure we get a last line box for
995         text after the last "\n" even in cases where there is no <br> afterward.
996
997         * editing/DeleteSelectionCommand.cpp:
998         (WebCore::DeleteSelectionCommand::fixupWhitespace):
999         * editing/InsertParagraphSeparatorCommand.cpp:
1000         (WebCore::InsertParagraphSeparatorCommand::doApply):
1001         Added assertions to make sure we don't do anything when we're not collapsing
1002         whitespace.
1003
1004         * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::setDefaultValue):
1005         Changed to use Vector instead of DeprecatedPtrList.
1006
1007         * editing/HTMLInterchange.cpp: Removed obsolete comment.
1008
1009         * loader/Cache.h: Removed a stray include.
1010
1011 2006-07-24  Adele Peterson  <adele@apple.com>
1012
1013         Reviewed by Justin.
1014
1015         - Fix for <rdar://problem/4632132> Changing style of content with mixed editability fails
1016
1017         Test: * editing/style/apple-style-editable-mix.html
1018
1019         * dom/Node.cpp: (WebCore::Node::isContentRichlyEditable): Doesn't need to check the editable root.  It now just
1020           checks the user modify property of its own renderer, since that is inherited.
1021         * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyInlineStyle): If the end position is in a table,
1022         Adjust the end node to the last descendant of the table, so we don't skip over any runs.
1023
1024 2006-07-24  Darin Adler  <darin@apple.com>
1025
1026         Reviewed by Hyatt.
1027
1028         - implement String::createCFString
1029
1030         * WebCore.xcodeproj/project.pbxproj: Added StringImplMac.mm and StringMac.mm.
1031
1032         * bindings/objc/DOMInternal.mm: Moved NSString conversion functions out of here.
1033
1034         * platform/mac/StringImplMac.mm: Added. Moved NSString conversion members here
1035         and added the CFStringRef ones.
1036         * platform/mac/StringMac.mm: Added. Ditto.
1037
1038 2006-07-24  David Hyatt  <hyatt@apple.com>
1039
1040         Two bug fixes.
1041
1042         (1) Make sure to mark positioned objects that depend on line position to
1043         mark themselves as needing layout when their line box placeholder gets
1044         repositioned.
1045
1046         * rendering/RenderBox.cpp:
1047         (WebCore::RenderBox::position):
1048        
1049         (2) Improve highlighting to factor the inflation into overflow so that
1050         invalidation and repainting will work properly.
1051
1052         * rendering/RootInlineBox.cpp:
1053         (WebCore::RootInlineBox::addHighlightOverflow):
1054         * rendering/RootInlineBox.h:
1055         * rendering/bidi.cpp:
1056         (WebCore::RenderBlock::layoutInlineChildren):
1057
1058 2006-07-24  Anders Carlsson  <acarlsson@apple.com>
1059
1060         Reviewed by Adele.
1061
1062         <rdar://problem/4641824> REGRESSION: Wikipedia widget fails to complete a search after pressing return key
1063         
1064         * html/HTMLInputElement.cpp:
1065         (WebCore::HTMLInputElement::defaultEventHandler):
1066         Don't eat enter events for search fields that have no enclosing form; they need to be passed to AppKit so
1067         that onsearch can be invoked.
1068         
1069         * manual-tests/onsearch-enter.html: Added.
1070
1071 2006-07-24  Dave MacLachlan  <dmaclach@mac.com>
1072
1073         Reviewed by Darin and Alexey.
1074         
1075         Fix for: <http://bugzilla.opendarwin.org/show_bug.cgi?id=8425> 
1076         and <http://bugzilla.opendarwin.org/show_bug.cgi?id=6947>
1077
1078         Test: svg/custom/non-opaque-filters.svg
1079
1080         * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
1081         (WebCore::KCanvasFilterQuartz::prepareFilter):
1082         We create an autorelease pool so we can control the deallocation of the
1083         CIContext that we're creating. The CIContext retains the CGContext that 
1084         you pass it internally so when the CIContext is released, the 
1085         CGContext is released as well.
1086         This is all fine and dandy unless you wrap the creation of the CIFilter
1087         with a pair of CGBegin/EndTransparencyLayer calls which swap the context
1088         out from underneath you. So if you start with context A, 
1089         CGBeginTransparencyLayer swaps it out and gives you B. You create a CIFilter
1090         with it and add a reference to B. CGEndTransparencyLayer swaps out B and
1091         gives you back A. Autorelease pool comes and cleans up the Filter, and calls
1092         release on A, but A never got the refcount in the first place. B did. BOOM!
1093         So we create a pool, then do a retain, then release the pool so that we 
1094         don't have to worry about the pool releasing it at a later time.
1095         See <rdar://problem/4647735> for reduction of CGEndTransparencyLayer case
1096
1097 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1098
1099         Reviewed by Hyatt.
1100
1101         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9669
1102           Incomplete repaint when changing an inline's border
1103
1104         Test: fast/repaint/line-overflow.html
1105
1106         * rendering/RenderBlock.h:
1107         * rendering/bidi.cpp:
1108         (WebCore::RenderBlock::layoutInlineChildren): Added repaintTop and repaintBottom
1109         variables to track the vertical edges of the area that changed, accounting for
1110         lines that were deleted, inserted or moved. Removed unnecessary updating of
1111         m_overflowHeight.
1112         (WebCore::RenderBlock::determineStartPosition): Removed unnecessary updating of
1113         m_overflowHeight.
1114         (WebCore::RenderBlock::determineEndPosition):
1115         (WebCore::RenderBlock::matchedEndLine): Added repaintTop and repaintBottom
1116         arguments, which this method updates to account for deleted lines.
1117         (WebCore::RenderBlock::checkLinesForOverflow): Removed outdated FIXME.
1118
1119 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1120
1121         Reviewed by Darin.
1122
1123         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10075
1124           REGRESSION: Reversed pop-up text in visually-ordered Hebrew pages
1125
1126         Test: fast/forms/select-visual-hebrew.html
1127
1128         * css/html4.css: Set "-webkit-rtl-ordering: logical" on select elements.
1129
1130 2006-07-24  Alexey Proskuryakov  <ap@nypop.com>
1131
1132         Reviewed by Darin.
1133
1134         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10009
1135         REGRESSION: Schubert-IT PDF Plug-in not working for full page (works in frames)
1136
1137         * page/Frame.cpp:
1138         (WebCore::Frame::begin): Give PDF plugins a chance to handle frame content, before ImageDocument
1139         claims it.
1140
1141 2006-07-24  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1142
1143         Reviewed by Darin.
1144
1145         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10083
1146           REGRESSION (r15584): editing/selection/select-from-textfield-outwards failing
1147
1148         * rendering/RenderBlock.cpp:
1149         (WebCore::RenderBlock::positionForCoordinates): Added back change from the fix
1150         for bug 9312: For coordinates outside a replaced object, return the position
1151         just before (after) the element if the coordinates are above or to the left (below
1152         or to the right).
1153
1154 2006-07-23  Mark Rowe  <opendarwin.org@bdash.net.nz>
1155
1156         Reviewed by maciej.
1157
1158         Bug 9686: [Drosera] Need the ability to break into Drosera on Javascript exceptions
1159         http://bugzilla.opendarwin.org/show_bug.cgi?id=9686
1160
1161         WebCore portion of the fix.
1162
1163         * bridge/mac/WebCoreScriptDebugger.h:
1164         (-[WebScriptDebugger exceptionRaised:sourceId:line::]): Add delegate method.
1165         * bridge/mac/WebCoreScriptDebugger.mm:
1166         (WebCoreScriptDebuggerImp::exception): Call delegate method when an exception is raised.
1167
1168 2006-07-23  Alice Liu  <alice.liu@apple.com>
1169
1170         Reviewed by Adele.
1171         Actually Adele figured out how to fix the layout test failures.  Landing this patch for her.  Layout test failures exposed but not caused by  r15584 (my patch earlier today).
1172
1173         * editing/visible_units.cpp:
1174         (WebCore::previousLinePosition):
1175         When setting selection endpoints, don't traverse down into nodes where editing would ignore its contents. Use the parent node instead.  
1176         (WebCore::nextLinePosition):
1177         same as above
1178
1179 2006-07-23  David Harrison  <harrison@apple.com>
1180
1181         Reviewed by timo.
1182
1183         <rdar://problem/4646759> Mail crash editing To Do - WebCore::InsertTextCommand::prepareForTextInsertion
1184         
1185         * Test: editing/deleting/delete-mixed-editable-content-001.html
1186
1187         * editing/visible_units.cpp:
1188         (WebCore::startOfParagraph):
1189         Respect editable boundary the same way endOfParagraph does.
1190
1191 2006-07-23  Beth Dakin  <bdakin@apple.com>
1192
1193         Reviewed by Maciej. (Patch by me, Maciej, and Harrison.)
1194
1195         Fix for <rdar://problem/4529398> WebCore crashes when pasting rich 
1196         text - WebCore::InlineBox::root()
1197
1198         The initial rendering crash was due to a render object having a 
1199         stale reference to an inline box that had already been deleted and 
1200         then recreated in the exact same location in memory. (Crazy, I 
1201         know.) The situation seemed pretty specific to list markers 
1202         according to Hyatt according to Maciej, so that is what I patched 
1203         specifically. Fixing this crash unearthed a separate editing crash 
1204         where we were trying to insert a block into itself. I worked on 
1205         that with Maciej and Harrison, and Harrison came up with a fix.
1206
1207         * editing/CompositeEditCommand.cpp:
1208         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): This is the fix for the editing crash. If paragraphStart is an atomic 
1209         node, insert the new block into the parent instead.
1210         * rendering/InlineBox.cpp:
1211         (WebCore::InlineBox::isChildOfParent): This function is for 
1212         posterity. It will help keep the linebox tree in check.
1213         * rendering/InlineBox.h:
1214         * rendering/InlineFlowBox.cpp:
1215         (WebCore::InlineFlowBox::addToLine): Added assert.
1216         (WebCore::InlineFlowBox::deleteLine): Added assert.
1217         * rendering/ListMarkerBox.cpp:
1218         (WebCore::ListMarkerBox::destroy): If this has a parent, call 
1219         removeChild on this.
1220         (WebCore::ListMarkerBox::operator delete):
1221         * rendering/ListMarkerBox.h:
1222
1223 2006-07-23  Alice Liu  <alice.liu@apple.com>
1224
1225         Reviewed by Darin.
1226
1227         fixed <rdar://problem/4617841> REGRESSION (NativeTextField): You can move keyboard focus to a field without getting insertion point
1228
1229         * rendering/RenderBlock.cpp:
1230         (WebCore::RenderBlock::positionForCoordinates):
1231         removed some unnecessary vertical position checks and added a fudge factor to be more forgiving for clicks near lines.
1232         * rendering/RenderTextControl.cpp:
1233         (WebCore::RenderTextControl::nodeAtPoint):
1234         added implementation
1235         * rendering/RenderTextControl.h:
1236         added function protocol
1237
1238 2006-07-23  Adele Peterson  <adele@apple.com>
1239
1240         Reviewed by Darin.
1241
1242         Updating fix from last checkin.
1243
1244         * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::layoutVerticalBox):
1245         Only tell the view about this flexbox if there isn't another flexbox already cached.
1246
1247 2006-07-23  Adele Peterson  <adele@apple.com>
1248
1249         Reviewed by Maciej.
1250
1251         - Fix for <rdar://problem/4644614> REGRESSION: Typing, pasting or dragging in new text areas causes unnecessary scrolling
1252
1253         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::layoutBlock): Don't updateScrollInfoAfterLayout if an ancestor flexible box is just on
1254         its first layout.
1255         * rendering/RenderFlexibleBox.cpp:
1256         (WebCore::RenderFlexibleBox::layoutBlock): ditto.
1257         (WebCore::RenderFlexibleBox::layoutVerticalBox): Let the view know if this flex box is doing its first pass at layout.
1258
1259         * rendering/RenderView.cpp: (WebCore::RenderView::RenderView): Caches a flexible box that's doing its first layout.
1260         * rendering/RenderView.h:
1261         (WebCore::RenderView::setFlexBoxInFirstLayout):
1262         (WebCore::RenderView::flexBoxInFirstLayout):
1263
1264 2006-07-22  Alexey Proskuryakov  <ap@nypop.com>
1265
1266         Reviewed by Darin.
1267
1268         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=10038
1269         REGRESSION: Length of navigator.mimeTypes collection returns number of installed plugins, not number 
1270         of registered mime types
1271
1272         * bindings/js/kjs_navigator.cpp:
1273         (KJS::MimeTypes::getValueProperty): Return the length of the mime types vector, not the plugins one.
1274         (KJS::MimeTypes::getOwnPropertySlot): Fixed another typo, which prevented MimeTypes::getValueProperty()
1275         from even being called.
1276
1277 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
1278
1279         Reviewed by Adele and Tim Omernick.
1280
1281         <rdar://problem/4641004> 9A224: Safari crashes in WebCore::RenderMenuList::showPopup when changing a input select field to input text field
1282
1283         Couldn't figure out how to make layout test, here's a manual test:
1284         * manual-tests/remove-select-onchange.html: Added.
1285         
1286         * rendering/RenderMenuList.cpp:
1287         (WebCore::RenderMenuList::showPopup): Don't add the RenderPopupMenu to the render
1288         tree so it doesn't get destroyed if we do.
1289         
1290         The remaining changes are to let the RenderPopupMenu know its menu list w/o having
1291         to be in the render tree:
1292         
1293         * rendering/RenderPopupMenu.cpp:
1294         (WebCore::RenderPopupMenu::RenderPopupMenu):
1295         * rendering/RenderPopupMenu.h:
1296         (WebCore::RenderPopupMenu::menuList):
1297         * rendering/RenderPopupMenuMac.h:
1298         * rendering/RenderPopupMenuMac.mm:
1299         (WebCore::RenderPopupMenuMac::RenderPopupMenuMac):
1300         * rendering/RenderPopupMenuWin.h:
1301         (WebCore::RenderPopupMenuWin::RenderPopupMenuWin):
1302         * rendering/RenderTheme.h:
1303         * rendering/RenderThemeMac.h:
1304         * rendering/RenderThemeMac.mm:
1305         (WebCore::RenderThemeMac::createPopupMenu):
1306         * rendering/RenderThemeWin.cpp:
1307         (WebCore::RenderThemeWin::createPopupMenu):
1308         * rendering/RenderThemeWin.h:
1309
1310 2006-07-21  Adele Peterson  <adele@apple.com>
1311
1312         Reviewed by Darin.
1313
1314         Fix for: <rdar://problem/4643238> REGRESSION: Can't set insertion point at the end of a line of text
1315
1316         Test: fast/forms/textarea-scrolled-endline-caret.html
1317
1318         * rendering/RenderBlock.cpp: (WebCore::RenderBlock::positionForCoordinates):
1319         When looking for the closest line box, take the scroll offset into account.
1320
1321 2006-07-21  Tim Omernick  <timo@apple.com>
1322
1323         Reviewed by Geoff & Maciej.
1324
1325         <rdar://problem/4632505> REGRESSION: Crash at WebCore::Widget::getView() const + 6
1326
1327         Geoff is working on a layout test for this.
1328
1329         * bridge/mac/FrameMac.mm:
1330         (WebCore::FrameMac::focusWindow):
1331         (WebCore::FrameMac::unfocusWindow):
1332         Check for a NULL view.  The view can be NULL if the frame has not yet loaded any data.  This fixes the crash, but the behavior is still
1333         wrong -- we should focus the frame once it gets a view.  I've filed <rdar://problem/4645685> to track that.  It's not as urgent as this
1334         crasher.
1335         
1336 2006-07-21  Maciej Stachowiak  <mjs@apple.com>
1337
1338         Reviewed by Darin.
1339
1340         <rdar://problem/4523976> REGRESSION (NativeTextField): Crash occurs when choosing "Undo Typing" after typing and setting the value
1341
1342         * rendering/RenderTextControl.cpp:
1343         (WebCore::RenderTextControl::updateFromElement): Clear the undo
1344         chain when the text control contents have been set
1345         programmatically.
1346         * bridge/mac/FrameMac.mm:
1347         (WebCore::FrameMac::clearUndoRedoOperations): Before clearing undo
1348         stack, close all open undo groups and then open an equal number,
1349         since otherwise NSUndoManager ends up in an inconsistent state
1350         leading to uncaught ObjC exceptions.
1351
1352 2006-07-21  Beth Dakin  <bdakin@apple.com>
1353         
1354         Reviewed by Darin.
1355
1356         Just moving this assertion down a couple of lines. It was hitting 
1357         every time you try to print a page because we put it too early in 
1358         the function.
1359
1360         * bridge/mac/WebCoreFrameBridge.mm:
1361         (-[WebCoreFrameBridge drawRect:]):
1362
1363 2006-07-21  Justin Garcia  <justin.garcia@apple.com>
1364
1365         Reviewed by levi
1366         
1367         <rdar://problem/4548238>
1368         REGRESSION: Can't remove the first OL/UL list item in a Mail's compose window
1369
1370         * editing/CompositeEditCommand.cpp:
1371         (WebCore::CompositeEditCommand::breakOutOfEmptyListItem): 
1372         Moved from InsertParagraphSeparator.  Does its own typing style restoration.
1373         * editing/CompositeEditCommand.h:
1374         * editing/InsertParagraphSeparatorCommand.cpp:
1375         (WebCore::InsertParagraphSeparatorCommand::doApply): Call breakOutOfEmptyListItem.
1376         * editing/TypingCommand.cpp:
1377         (WebCore::TypingCommand::deleteKeyPressed): Call breakOutOfEmptyListItem if
1378         the endingSelection is at the start of an editable region.
1379         * editing/htmlediting.cpp:
1380         (WebCore::embeddedSublist): Moved from InsertParagraphSeparator.
1381         (WebCore::appendedSublist): Ditto.
1382         (WebCore::enclosingEmptyListItem): Ditto.
1383         * editing/htmlediting.h:
1384
1385 === Safari-521.20 ===
1386
1387 2006-07-21  Tim Omernick  <timo@apple.com>
1388
1389         Reviewed by Beth Dakin & John Sullivan.
1390
1391         <rdar://problem/4633717> 9A218: Reproducible crash in -[NSScroller mouseDown:]
1392
1393         Beth is in the middle of making a layout test for this; she will land it soon.
1394
1395         * platform/mac/ScrollBarMac.mm:
1396         (ScrollBar::~ScrollBar):
1397         Call Widget::removeFromSuperview() rather than -removeFromSuperview directly on the scroll bar view.
1398         Widget::removeFromSuperview() obeys the "mustStayInWindow" flag, which is set while tracking the mouse
1399         in view-based widgets to prevent their destruction while the tracking is in progress.
1400         I searched around WebCore and this is the only Widget subclass that directly removes its view rather
1401         than using removeFromSuperview().
1402
1403 2006-07-21  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1404
1405         Reviewed by Darin.
1406
1407         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9312
1408           REGRESSION: Selection bug in new text fields when selecting past the first letter
1409
1410         Test: editing/selection/select-from-textfield-outwards.html
1411
1412         * editing/Selection.cpp:
1413         (WebCore::Selection::adjustForEditableContent): Added code to handle the case
1414         where the selection starts (resp. ends) in the last (resp. first) visual position
1415         inside an editable root.
1416         * editing/htmlediting.cpp:
1417         (WebCore::comparePositions): Fixed the case of comparing a position inside a shadow
1418         tree with a position in the shadow ancestor.
1419         * rendering/RenderBlock.cpp:
1420         (WebCore::RenderBlock::positionForCoordinates): For coordinates outside a replaced
1421         object, return the position just before (after) the element if the coordinates are above or
1422         to the left (below or to the right).
1423         * rendering/RenderObject.cpp:
1424         (WebCore::RenderObject::caretMaxOffset): Changed to return 1 for replaced objects.
1425         * rendering/RenderText.cpp:
1426         (WebCore::RenderText::positionForCoordinates): Changed to return the last position
1427         in the lowest text box if the y coordinate is below all text boxes.
1428
1429 2006-07-21  Geoffrey Garen  <ggaren@apple.com>
1430
1431         Reviewed by Darin.
1432         
1433         - Fixed <rdar://problem/4507265> REGRESSION: overlays don't work on 
1434         HousingMaps.com (Google Maps-based site)
1435         
1436         - Made style.filter undetectable, like document.all.
1437         
1438         Unfortunately, the SVG spec-makers invented a CSS attribute named 'filter',
1439         which conflicts with IE's custom CSS attribute by the same name. Web programs 
1440         like the Google maps API test for style.filter, and assume it's the IE 
1441         style.filter if they find it, so we need to make style.filter undetectable 
1442         to avoid breaking them.
1443         
1444         An alternative solution would be to hotwire a delorean, go back in time,
1445         and beg the web standards makers to make standards that work on the web.
1446
1447         * bindings/js/kjs_css.cpp:
1448         (KJS::DOMCSSStyleDeclaration::cssPropertyGetter):
1449
1450 2006-07-20  Justin Garcia  <justin.garcia@apple.com>
1451
1452         Reviewed by john
1453         
1454         <rdar://problem/4641033>
1455         REGRESSION: Pasting from web pages into Mail (or Blot) often loses most of the content
1456         
1457         * editing/markup.cpp:
1458         (WebCore::createMarkup): We surround the currently accumulated markup with markup 
1459         for ancestors of the startNode when the pre-order traversal leaves the trees rooted 
1460         at those ancestors.  We assumed that any ancestors of the current node not in the 
1461         ancestorsToClose list were those kind of ancestors.  But we don't add renderer-less 
1462         containers to the ancestorsToClose list.  So, we were incorrectly surrounding the 
1463         currently accumulated markup with markup for render-less containers.  Most of the
1464         content at apple.com was being put inside an <optgroup> inside a <select> element.  
1465         Then on Paste createContextualFragment would drop it.
1466
1467 2006-07-21  Anders Carlsson  <acarlsson@apple.com>
1468
1469         Reviewed by Geoff.
1470
1471         * dom/Document.h:
1472         (WebCore::Document::):
1473         * dom/EventTargetNode.cpp:
1474         (WebCore::EventTargetNode::addEventListener):
1475         * page/FrameView.cpp:
1476         (WebCore::FrameView::layout):
1477         * rendering/RenderLayer.cpp:
1478         (WebCore::RenderLayer::updateScrollInfoAfterLayout):
1479         Only dispatch overflowchanged events if overflowchanged event listeners have been registered on the document.
1480
1481 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
1482
1483         Reviewed by Geoff.
1484
1485         <rdar://problem/4637807> REGRESSION: "Features & Options" page at volvocars.us fails
1486
1487         * xml/XSLTProcessor.cpp:
1488         (WebCore::xsltParamArrayFromParameterMap):
1489         Turns out parameters never worked. String parameters need to be escaped so we create a transform context,
1490         add the parameters to it quoted and then use xsltApplyStylesheetUser which lets us pass the transform context to it.
1491         This also works around a bug in libxslt where a hash table isn't allocated.
1492
1493 2006-07-20  Alice Liu  <alice.liu@apple.com>
1494
1495         Reviewed by Tim Omernick.
1496
1497         Fixed <rdar://problem/4621649> repro crash: Upload link causes crash on pages.google.com in Frame::nodeForWidget
1498         added manual test because there is no way to change the value of an <input type=file> via the DOM.  It's not supported because it's a security risk. 
1499
1500         * manual-tests/remove-input-file-onchange.html: Added.
1501         * platform/mac/FileButtonMac.mm:
1502         (-[WebFileChooserButton chooseFilename:]):
1503         swapped the calls to changeFilename and bridgeForWidget because changeFilename will destroy the widget that is accessed in bridgeForWidget 
1504
1505 2006-07-20  Alice Liu  <alice.liu@apple.com>
1506
1507         Reviewed by Adele.
1508
1509         Fixed <rdar://problem/4532113> REGRESSION (NativeTextField): Crash occurs after modifying field then reloading page -[FormDelegate frameLayoutHasChanged:]
1510         added a manual test because of the need to use AutoFill.
1511
1512         * dom/Node.h:
1513         (WebCore::Node::aboutToUnload):
1514         added virtual function prototype
1515         * html/HTMLInputElement.cpp:
1516         (WebCore::HTMLInputElement::aboutToUnload):
1517         added implementation that sends textFieldDidEndEditing notification
1518         * html/HTMLInputElement.h:
1519         added virtual function prototype
1520         * manual-tests/input-type-file-autocomplete-frame-1.html: Added.
1521         * manual-tests/input-type-file-autocomplete-frame-2.html: Added.
1522         * manual-tests/input-type-file-autocomplete-refresh.html: Added.
1523         * page/Frame.cpp:
1524         (WebCore::Frame::stopLoading):
1525         before unloading, call aboutToUnload on the current focused node
1526
1527 2006-07-20  Brady Eidson  <beidson@apple.com>
1528
1529         Reviewed by Maciej
1530
1531         fixed <rdar://problem/4611303> REGRESSION: repro crash in WebCore::EventTargetNode::dispatchWindowEvent at aeropostale.com
1532         There was an attempt to deref an EventListener that got cleaned up in GC.  Changing Document's EventListener list from 
1533         vanilla ptrs to refptrs to prevent GC, following EventTargetNode's proven example.
1534
1535         * dom/Document.cpp:
1536         (WebCore::Document::Document):
1537         (WebCore::Document::clear):
1538         (WebCore::Document::handleWindowEvent):
1539         (WebCore::Document::getHTMLWindowEventListener):
1540         (WebCore::Document::removeHTMLWindowEventListener):
1541         (WebCore::Document::removeWindowEventListener):
1542         (WebCore::Document::hasWindowEventListener):
1543         Changed all of the list iterators to work with RefPtrs instead of vanilla ptrs
1544
1545         * dom/Document.h:
1546         Changed the EventListener list to be a vanilla pointer list to a refptr list
1547
1548 2006-07-20  John Sullivan  <sullivan@apple.com>
1549
1550         Reviewed by Maciej
1551
1552         - WebCore part of fix for:
1553         <rdar://problem/4557386> REGRESSION (419.3-521.19): repro Safari world leak involving 
1554         closing tabs after clicking in a web page
1555         
1556         * bridge/mac/WebCoreFrameBridge.h:
1557         (-[WebCoreFrameBridge textViewWasFirstResponderAtMouseDownTime:])
1558         renamed to be more specific (formerly wasFirstResponderAtMouseDownTime:)
1559         * bridge/mac/FrameMac.mm:
1560         (WebCore::FrameMac::passMouseDownEventToWidget):
1561         updated for name change
1562
1563 2006-07-19  Alexey Proskuryakov  <ap@nypop.com>
1564
1565         Reviewed by Darin.
1566
1567         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8272
1568         Use of window.open & window.close can cause crash
1569
1570         * platform/PlatformMouseEvent.h:
1571         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1572         * platform/mac/PlatformMouseEventMac.mm:
1573         (WebCore::PlatformMouseEvent::PlatformMouseEvent):
1574         The default constructor now creates a "zero" event, and a new one was added to create the "current" one.
1575
1576         * bridge/mac/FrameMac.mm:
1577         (WebCore::FrameMac::handleMouseMoveEvent):
1578         * rendering/RenderFormElement.cpp:
1579         (WebCore::RenderFormElement::clicked): 
1580         Updated for the above changes.
1581
1582         * platform/gdk/MouseEventGdk.cpp:
1583         * platform/gdk/TemporaryLinkStubs.cpp:
1584         (PlatformMouseEvent::PlatformMouseEvent):
1585         * platform/win/MouseEventWin.cpp:
1586         * platform/win/TemporaryLinkStubs.cpp:
1587         (PlatformMouseEvent::PlatformMouseEvent):
1588         Trying not to break other platforms.
1589
1590         * manual-tests/invalid-mouse-event.html: Added.
1591
1592 2006-07-20  Maciej Stachowiak  <mjs@apple.com>
1593         
1594         Reviewed by Anders.
1595
1596         - delete line that I only commented in the last patch - meant to do this before landing
1597
1598         * html/HTMLFrameElement.cpp:
1599         (WebCore::HTMLFrameElement::close): 
1600
1601 2006-07-19  Maciej Stachowiak  <mjs@apple.com>
1602
1603         Reviewed by Geoff.
1604
1605         - fixed <rdar://problem/4634484> REGRESSION: Project Change Request form should have vertical scroll bar, but doesn't
1606         
1607         I couldn't figure out how to make an automated test case for this,
1608         or even a manual one. It seems to be timing-related in some way.
1609
1610         * html/HTMLFrameElement.cpp:
1611         (WebCore::HTMLFrameElement::close): detach the child frame from
1612         its element, not the frame containing this element.
1613
1614 2006-07-20  Anders Carlsson  <acarlsson@apple.com>
1615
1616         Reviewed by Darin.
1617
1618         * bridge/mac/FrameMac.mm:
1619         (WebCore::FrameMac::nextKeyViewInFrame):
1620         Hold a ref to the node in case it gets destroyed by an event handler.
1621
1622 2006-07-19  Mark Rowe  <opendarwin.org@bdash.net.nz>
1623
1624         Reviewed by Darin.
1625
1626         http://bugzilla.opendarwin.org/show_bug.cgi?id=10021
1627         Bug 10021: REGRESSION: Stack overflow due to infinite recursion in 
1628         Image::checkForSolidColor
1629
1630         * platform/Image.cpp:
1631         (WebCore::Image::cacheFrame): Don't call checkForSolidColor unless 
1632         the frame was decoded successfully.
1633
1634 2006-07-19  Adele Peterson  <adele@apple.com>
1635
1636         Reviewed by Maciej.
1637
1638         - Fix for: 
1639         <rdar://problem/4422657> REGRESSION: member name field or password field should have focus after loading webmail.mac.com (7405)
1640         http://bugzilla.opendarwin.org/show_bug.cgi?id=7405
1641
1642         <rdar://problem/4614181> REGRESSION: Crash in WebCore::RenderTextField::text() when quoting post at the Ars Technica forum (9707)
1643         http://bugzilla.opendarwin.org/show_bug.cgi?id=9707
1644
1645         Needs an http test. (http://bugzilla.opendarwin.org/show_bug.cgi?id=10020)
1646
1647         These bugs were both cases where focus() was called on an element which didn't have a renderer yet because stylesheets hadn't finished loading yet.
1648         Now, we detect this case and let setFocusNode be called.  And when the stylesheet finishes loading, and the element attaches, a timer will fire, 
1649         which will cause the correct selection & scrolling behavior to occur. 
1650
1651         This fix removes selection and scrolling behavior from the focus method.  This code is now in a new method, updateFocusAppearance.
1652         updateFocusAppearance can now be called directly from focus(), but it can also be called when a timer fires.  This timer gets set
1653         up when an element attaches, and its already been focused by the focus method.  We have to use a timer, because updateFocusAppearance can cause
1654         a layout to happen, and we don't want that to happen in the middle of attach().
1655
1656         * bindings/objc/DOM.mm: (-[DOMElement isFocused]): Added SPI for autofill.
1657         * bindings/objc/DOMPrivate.h:
1658
1659         * dom/Element.cpp:
1660         (WebCore::Element::Element): Initializes timer and needFocusAppearanceUpdate bool.
1661         (WebCore::Element::attach): Checks needsFocusAppearanceUpdate, and if the node is focused, then starts the timer.
1662         (WebCore::Element::focus): Updated to check supportsFocus before calling setFocusNode, 
1663         and only requiring the element to be focusable now before updating focus appearance.
1664         (WebCore::Element::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1665         (WebCore::Element::updateFocusAppearanceTimerFired): Stops the timer, and if the element is focusable, calls updateFocusAppearance.
1666         (WebCore::Element::stopUpdateFocusAppearanceTimer):  Cancels timer, and setsNeedsFocusAppearanceUpdate(false).
1667         (WebCore::Element::detach): Calls stopUpdateFocusAppearanceTimer.
1668         (WebCore::Element::blur): ditto.
1669         * dom/Element.h:
1670         (WebCore::Element::needsFocusAppearanceUpdate): Added so the timer only fires when focus() methods have caused an element to be focused.
1671         (WebCore::Element::setNeedsFocusAppearanceUpdate): Added so focus methods can set this flag.
1672
1673         * dom/Node.h: (WebCore::Node::supportsFocus): Added.  Base class just calls isFocusable.
1674         * html/HTMLAnchorElement.h: Added supportsFocus.
1675         * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::supportsFocus): Added. Checks for the case where stylesheets haven't loaded yet,
1676         so we can still focus the node without a renderer, and when it gets a renderer, we'll update the focus appearance.
1677         * html/HTMLGenericFormElement.h: (WebCore::HTMLGenericFormElement::supportsFocus): ditto.
1678         * html/HTMLGenericFormElement.cpp: Removed include of Document.h since this is now in the header.
1679
1680         * html/HTMLInputElement.cpp:
1681         (WebCore::HTMLInputElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1682         and only requiring the element to be focusable now before updating focus appearance.
1683         (WebCore::HTMLInputElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1684         * html/HTMLInputElement.h:
1685
1686         * html/HTMLTextAreaElement.cpp:
1687         (WebCore::HTMLTextAreaElement::focus): Updated to check supportsFocus before calling setFocusNode, 
1688         and only requiring the element to be focusable now before updating focus appearance.
1689         (WebCore::HTMLTextAreaElement::updateFocusAppearance): Added. Separates the selection, and the scrolling from focusing the node.
1690         * html/HTMLTextAreaElement.h:
1691
1692 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1693
1694         Reviewed by levi
1695         
1696         <rdar://problem/4631972>
1697         REGRESSION: Mail crashes when pasting entire contents of http://www.apple.com/support/ into a new mail message
1698
1699         * dom/Position.cpp:
1700         (WebCore::Position::upstream): Deployed isBlock and enclosingBlock.
1701         (WebCore::Position::downstream): Ditto.
1702         * editing/CompositeEditCommand.cpp:
1703         (WebCore::CompositeEditCommand::moveParagraphContentsToNewBlockIfNecessary): Ditto.
1704         * editing/htmlediting.cpp:
1705         (WebCore::canHaveChildrenForEditing): Added !iframe.
1706         (WebCore::isBlock): Added, returns !node->renderer()->isInline()
1707         (WebCore::enclosingBlock): Added.
1708         * editing/htmlediting.h:
1709
1710 2006-07-19  Anders Carlsson  <acarlsson@apple.com>
1711
1712         Reviewed by Adele.
1713
1714         <rdar://problem/4631272> REGRESSION: Crash tabbing out of hostname field at autorestore.apple.com
1715         
1716         * bridge/mac/FrameMac.mm:
1717         (WebCore::FrameMac::nextKeyViewInFrame):
1718         Take into account that focus handlers can cause a node's renderer to be destroyed.
1719         
1720 2006-07-19  David Hyatt  <hyatt@apple.com>
1721
1722         Fix for 4638376.  The 1x1 solid color image optimization was broken when
1723         I re-architected image.  This patch restores the optimization for CG.  Cairo
1724         will still need the optimization.
1725
1726         Reviewed by darin
1727
1728         WARNING: NO TEST CASES ADDED OR CHANGED (need test cases still)
1729
1730         * platform/Image.cpp:
1731         (WebCore::Image::Image):
1732         (WebCore::Image::invalidateData):
1733         (WebCore::Image::cacheFrame):
1734         * platform/Image.h:
1735         (WebCore::Image::setIsPDF):
1736         * platform/cairo/ImageCairo.cpp:
1737         (WebCore::Image::checkForSolidColor):
1738         * platform/mac/ImageMac.mm:
1739         (WebCore::Image::initNativeData):
1740         (WebCore::Image::invalidateNativeData):
1741         (WebCore::Image::checkForSolidColor):
1742         (WebCore::Image::draw):
1743         (WebCore::Image::drawTiled):
1744
1745 2006-07-19  Justin Garcia  <justin.garcia@apple.com>
1746
1747         Reviewed by levi
1748         
1749         <rdar://problem/4613519>
1750         REGRESSION: Pasting text in native text area inserts text one character before it should (9527)
1751
1752         * editing/InsertParagraphSeparatorCommand.cpp:
1753         (WebCore::InsertParagraphSeparatorCommand::doApply): Turn into an InsertLineBreakCommand instead of bailing
1754         if the enclosingBlockFlowElement doesn't have a parent.
1755
1756 2006-07-19  David Harrison  <harrison@apple.com>
1757
1758         Reviewed by Tim Hatcher.
1759
1760         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1761         <rdar://problem/4062218> pasting in contents of web.apple.com strips off the <table> element from the first table
1762         
1763         Better patch than previous checkin.
1764
1765         * test: editing/pasteboard/paste-table-003.html
1766         
1767         * editing/markup.cpp:
1768         (WebCore::createMarkup):
1769         Make sure to include the table when including a tbody.
1770
1771 === Safari-521.19 ===
1772
1773 2006-07-19  David Harrison  <harrison@apple.com>
1774
1775         Reviewed by Tim Hatcher.
1776
1777         <rdar://problem/4629307> -[DOMRange markupString] does not include the initial table element if it is at the beginning of the range
1778
1779         No test case as this can only be reproduced through ObjC APIs.
1780
1781         * editing/markup.cpp:
1782         (WebCore::createMarkup):
1783         Adjust the range for ancestor markup handling when main loop skips first node.
1784
1785 2006-07-18  David Hyatt  <hyatt@apple.com>
1786
1787         Fix for radar 4611287, make resizable text fields opt-in rather than
1788         opt-out.  Open source users will need to write the pref into their defaults
1789         to see the resizers on textareas now.
1790
1791         Reviewed by mjs and adele
1792
1793         * WebCore.xcodeproj/project.pbxproj:
1794         * bridge/mac/WebCoreSettings.mm:
1795         (-[WebCoreSettings setTextAreasAreResizable:]):
1796         * css/cssparser.cpp:
1797         (WebCore::CSSParser::parseValue):
1798         * css/cssstyleselector.cpp:
1799         (WebCore::CSSStyleSelector::applyProperty):
1800         * css/html4.css:
1801
1802 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1803
1804         Reviewed by Darin.
1805
1806         http://bugzilla.opendarwin.org/show_bug.cgi?id=9959
1807         REGRESSION: iframes stop rendering after 200th one on successive reloads
1808         
1809         * html/HTMLFrameElement.cpp:
1810         (WebCore::HTMLFrameElement::attach):
1811         (WebCore::HTMLFrameElement::close):
1812         * html/HTMLIFrameElement.cpp:
1813         (WebCore::HTMLIFrameElement::insertedIntoDocument):
1814         (WebCore::HTMLIFrameElement::willRemove):
1815         Remove calls to incrementFrameCount and decrementFrameCount.
1816         
1817         * page/Frame.cpp:
1818         (WebCore::Frame::Frame):
1819         Call incrementFrameCount here.
1820         
1821         (WebCore::Frame::~Frame):
1822         Call disconnectOwnerElement.
1823         
1824         (WebCore::Frame::disconnectOwnerElement):
1825         Call decrementFrameCount here.
1826         
1827 2006-07-18  Alexey Proskuryakov  <ap@nypop.com>
1828
1829         Reviewed by Darin.
1830
1831         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9013
1832         Let correct CSS custom cursor declarations parse
1833
1834         * css/cssparser.cpp:
1835         (WebCore::CSSParser::parseValue): Ignore any values following a custom CSS cursor URI, instead of
1836         requiring that it is the only one in the list (which is actually illegal, according to the spec). 
1837         This is only a temporary hack, with a real implementation to follow in bug 6001/6002.
1838
1839         * manual-tests/custom-cursors.html: Added a test for this issue.
1840         * manual-tests/resources/helpCursor.tiff: A cursor image used in the test.
1841
1842 2006-07-18  Timothy Hatcher  <timothy@apple.com>
1843
1844         Reviewed by Anders.
1845         
1846         <rdar://problem/4636216> NetNewsWire fails to launch on 9A224 - missing symbols
1847         
1848         WebCore needs to add -sub_library libobjc to maintain
1849         backwards compatibility with binaries linked with WebKit
1850         before JavaScriptCore moved out of WebKit.
1851
1852         * WebCore.xcodeproj/project.pbxproj:
1853
1854 2006-07-18  Mitz Pettel  <opendarwin.org@mitzpettel.com>
1855
1856         Reviewed by Justin.
1857
1858         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9978
1859           REGRESSION (r12949-r12988): Clicking the first letter on a line places the caret at the end of the previous line
1860
1861         Test: editing/selection/click-start-of-line.html
1862
1863         * rendering/RenderText.cpp:
1864         (WebCore::RenderText::positionForCoordinates): Changed to return downstream
1865         affinity if the x coordinate is to the left of the middle of the first character
1866         in the text box.
1867
1868 2006-07-18  Anders Carlsson  <acarlsson@apple.com>
1869
1870         Reviewed by Darin.
1871
1872         http://bugzilla.opendarwin.org/show_bug.cgi?id=9695
1873         <rdar://problem/4614085> 
1874         TOT REGRESSION: NativeTextArea: Text area does not respond to Cmd-UpArrow/Cmd-DownArrow (9695)
1875         
1876         * editing/SelectionController.cpp:
1877         (WebCore::SelectionController::modifyExtendingRightForward):
1878         (WebCore::SelectionController::modifyMovingRightForward):
1879         (WebCore::SelectionController::modifyExtendingLeftBackward):
1880         (WebCore::SelectionController::modifyMovingLeftBackward):
1881         If the caret is inside an editable region, the beginning/end of the document should actually be the
1882         beginning/end of the editable region.
1883
1884 2006-07-17  Tim Omernick  <timo@apple.com>
1885
1886         Reviewed by Maciej.
1887
1888         <rdar://problem/4612079> need a way to prevent pages from scrolling to reveal elements that are focused
1889         by script
1890
1891         * bridge/mac/WebCoreFrameBridge.h:
1892         * bridge/mac/WebCoreFrameBridge.mm:
1893         (-[WebCoreFrameBridge setProhibitsScrolling:]):
1894         * page/Frame.cpp:
1895         (WebCore::Frame::prohibitsScrolling):
1896         (WebCore::Frame::setProhibitsScrolling):
1897         * page/Frame.h:
1898         * page/FramePrivate.h:
1899         (WebCore::FramePrivate::FramePrivate):
1900         * page/FrameView.cpp:
1901         (WebCore::FrameView::scrollPointRecursively):
1902         (WebCore::FrameView::setContentsPos):
1903         * page/FrameView.h:
1904         * platform/ScrollView.h:
1905
1906 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1907
1908         Reviewed by Dave Harrison.
1909         
1910         - fixed <rdar://problem/4618089> Blot crashes when I paste in all the contents of http://www.apple.com/startpage/
1911
1912         * editing/htmlediting.cpp:
1913         (WebCore::editingIgnoresContent):
1914
1915 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1916
1917         Reviewed by levi
1918         
1919         <rdar://problem/4621728>
1920         REGRESSION: Selecting by dragging down creates selection in wrong direction, with certain steps
1921         <rdar://problem/4604932>
1922         REGRESSION: Dragging too far left on a line will select all lines above it.
1923  
1924         No layout test because of 9980.
1925
1926         * rendering/RenderBlock.cpp:
1927         (WebCore::RenderBlock::positionForCoordinates): Don't return positions inside editable roots
1928         for coordinates outside those roots, except for coordinates outside a document that is entirely 
1929         editable.
1930
1931 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1932
1933         Reviewed by Darin.
1934
1935         <rdar://problem/4635281> JSCanvasRenderingContext2D::drawImage needs to initialize the exception code to zero
1936
1937         * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
1938         (WebCore::JSCanvasRenderingContext2D::drawImage): initialize ec to zero
1939         * html/CanvasRenderingContext2D.cpp:
1940         (WebCore::CanvasRenderingContext2D::drawImage): initialize ec before earlier return
1941
1942 2006-07-17  Timothy Hatcher  <timothy@apple.com>
1943
1944         Reviewed by Maciej.
1945
1946         <rdar://problem/4634874> WebScriptObject and WebUndefined are no longer defined by WebKit
1947
1948         Moves WebScriptObject and WebUndefined to WebCore.
1949
1950         * WebCore.exp:
1951         * WebCore.xcodeproj/project.pbxproj:
1952         * bindings/objc/DOM.mm:
1953         * bindings/objc/DOMCore.h:
1954         * bindings/objc/DOMInternal.mm:
1955         * bindings/objc/DOMUtility.mm:
1956         * bindings/objc/WebScriptObject.mm: Added.
1957         (+[WebUndefined allocWithZone:]):
1958         (-[WebUndefined initWithCoder:]):
1959         (-[WebUndefined encodeWithCoder:]):
1960         (-[WebUndefined copyWithZone:]):
1961         * bindings/objc/WebScriptObjectPrivate.h: Added.
1962         * bridge/mac/FrameMac.mm:
1963         * bridge/mac/WebCoreScriptDebugger.mm:
1964
1965 2006-07-17  David Hyatt  <hyatt@apple.com>
1966
1967         Back out the fix for 5564, since it turns out font:x-small; is a pretty
1968         prominent IE-specific CSS hack.  Because Web sites rely on IE's incorrect
1969         font parsing as a means of also correcting IE's incorrect font size rules.
1970
1971         This fixes Yahoo.com.
1972
1973         Reviewed by darin
1974
1975         * css/cssparser.cpp:
1976         (WebCore::CSSParser::parseFont):
1977
1978 2006-07-17  Justin Garcia  <justin.garcia@apple.com>
1979
1980         Reviewed by levi
1981         
1982         <rdar://problem/4618389> REGRESSION: After applying a link to the last word of a sentence, a new selection is created at the start of the sentence
1983         
1984         * dom/Document.cpp:
1985         (WebCore::Document::updateSelection):
1986
1987 2006-07-17  Maciej Stachowiak  <mjs@apple.com>
1988
1989         Reviewed by Beth.
1990         
1991         <rdar://problem/4604946> REGRESSION: 'checkboxRef.checked = true' fires onchange event in Leopard
1992
1993         * html/HTMLInputElement.cpp:
1994         (WebCore::HTMLInputElement::setChecked):
1995         (WebCore::HTMLInputElement::preDispatchEventHandler):
1996         * html/HTMLInputElement.h:
1997
1998 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
1999
2000         Reviewed by Darin.
2001
2002         - fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9954
2003           REGRESSION: document.dir should return empty string in <head>
2004
2005         Test: fast/dom/document-dir-property.html
2006
2007         * bindings/js/kjs_html.cpp:
2008         (KJS::JSHTMLDocument::getValueProperty): Return an empty string instead of an
2009         undefined value for an unset document.dir property.
2010
2011 2006-07-16  David Kilzer  <ddkilzer@kilzer.net>
2012
2013         Reviewed by Darin.
2014
2015         * dom/NodeFilter.idl:
2016         Removed "No newline at end of file" that snuck in as part of the "apply patch" process.
2017         * manual-tests/input-empty-on-focus.html:
2018         Removed "Property changes" that snuck in as part of the "apply patch" process.
2019
2020 2006-07-16  Darin Adler  <darin@apple.com>
2021
2022         Reviewed by John Sullivan.
2023
2024         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9943
2025           <rdar://problem/4590613>
2026           REGRESSION (Tiger-TOT): menus are offset to the right at http://movies.aol.com/movie-photo-bts/superman-returns
2027
2028         The problem turns out to be the fact that body.offsetLeft is returning a non-zero value.
2029         I have no idea why the menus worked in Tiger Safari, because body.offsetLeft behavior has not changed.
2030         Presumably some other bug that we fixed had been compensating.
2031
2032         Test: fast/html/body-offset-properties.html
2033
2034         * rendering/RenderObject.cpp:
2035         (WebCore::RenderObject::offsetLeft): Always return 0 for any object without an offsetParent.
2036         (WebCore::RenderObject::offsetTop): Ditto.
2037         (WebCore::RenderObject::offsetParent): Return 0 for the body (treat as a special case).
2038
2039 2006-07-16  Beth Dakin  <bdakin@apple.com>
2040
2041         Reviewed by Maciej.
2042
2043         Fix for <rdar://problem/4616595> REGRESSION: Problems with world 
2044         clock widget clock hand motion on 9A211 + 4604574
2045
2046         The second hand on the widget was jiggling because the rotation was 
2047         messing up the use of the affine transformation matrix while 
2048         rounding to pixel boundaries in device space. We are mainly 
2049         concerned with rounding to pixel boundaries with the scale in mind, 
2050         so this patch extracts the scale to device space from the matrix, 
2051         and rounds to pixel boundaries using only the scale. This doesn't 
2052         seem like it is a perfect solution, but it definitely solves the 
2053         immediate problem. We will probably need to re-address what should 
2054         happen to avoid pixel cracks with rotations at non-integral scale 
2055         factors. 
2056
2057         * platform/cg/GraphicsContextCG.cpp:
2058         (WebCore::GraphicsContext::roundToDevicePixels):
2059
2060 2006-07-15  Darin Adler  <darin@apple.com>
2061
2062         - fix mistake from fix for 8952 that was breaking layout tests
2063
2064         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
2065         Justin was right! I changed the behavior of the function by accident. Changed it
2066         back so that it doesn't blow away the selection on the DOM side in the case where
2067         it didn't before.
2068
2069         I will write 100 times on the blackboard: "When Justin says something about editing,
2070         assume he is right."
2071
2072 2006-07-15  Darin Adler  <darin@apple.com>
2073
2074         - try to fix Windows build
2075
2076         * WebCore.vcproj/WebCore/WebCore.vcproj: Added StreamingTextDecoderICU.cpp/h.
2077
2078 2006-07-15  Darin Adler  <darin@apple.com>
2079
2080         Reviewed by John Sullivan.
2081
2082         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8952
2083           <rdar://problem/4575185>
2084           REGRESSION: crash on drag of highlighted Google custom home page modules
2085
2086         Test: fast/dynamic/move-node-with-selection.html
2087
2088         * editing/SelectionController.cpp: (WebCore::SelectionController::nodeWillBeRemoved):
2089         Call updateRendering before calling clearSelection(), since it's important to do any
2090         work beforehand, and there are calls inside clearSelection that will indirectly do an
2091         updateRendering. Also change code to make fewer assumptions about object lifetime.
2092
2093 2006-07-15  Darin Adler  <darin@apple.com>
2094
2095         Reviewed by John Sullivan.
2096
2097         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8587
2098           <rdar://problem/4631844>
2099           REGRESSION: {display:list-item} on items outside an ol or ul element no longer causes incremental numbering
2100
2101         Test: fast/lists/numeric-markers-outside-list.html
2102
2103         * rendering/RenderListItem.cpp: (WebCore::previousListItem):
2104         Look for list items, even when we're outside any list.
2105
2106 2006-07-15  Adele Peterson  <adele@apple.com>
2107
2108         Reviewed by John.
2109
2110         - Fix for <rdar://problem/4593970> REGRESSION (NativeTextField): autofill menu disappears after typing a 2nd character
2111
2112         This was caused by composite editing commands, (like typing or pasting) that include a DeleteCommand, being
2113         interpreted by the form delegate as an actual delete.  This fix doesn't notify the form delegate if the deletion is
2114         part of an editing command to replace the selected text.
2115
2116         * editing/DeleteSelectionCommand.h: Added m_replace to keep track of whether this deletion is 
2117           part of a composite command to replace the text being deleted.
2118         * editing/DeleteSelectionCommand.cpp:
2119         (WebCore::DeleteSelectionCommand::DeleteSelectionCommand): Initialize m_replace.
2120         (WebCore::DeleteSelectionCommand::doApply): Only notify the form delegate of the deletion if the text is not being replaced.
2121         * editing/CompositeEditCommand.h:
2122         * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::deleteSelection): 
2123           Added replace argument to construct DeleteSelectionCommand.
2124           
2125         * editing/InsertTextCommand.cpp: (WebCore::InsertTextCommand::input): Call deleteSelection with replace argument.
2126         * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::doApply): ditto.
2127
2128 2006-07-15  Geoffrey Garen  <ggaren@apple.com>
2129
2130         Reviewed by Maciej, tweaked to match Darin's patch.
2131         
2132         - Fixed <rdar://problem/4631837> REGRESSION: Reproducible crash on 
2133         FCKeditor demo (9911)
2134         
2135         * WebCore.xcodeproj/project.pbxproj:
2136         * bindings/js/kjs_html.cpp:
2137         (KJS::JSHTMLDocument::putValueProperty): Check for a null body element before
2138         forwarding the put request to it. I confirmed that no other parts of the 
2139         file use 'body' or 'bodyElement' without checking for null. 
2140         
2141         Also, use 'body' rather than 'bodyElement' because dir can bet set on 
2142         any element, not just HTMLBodyElement.
2143
2144 2006-07-15  Darin Adler  <darin@apple.com>
2145
2146         Reviewed by Adele.
2147
2148         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8871
2149           <rdar://problem/4575417>
2150           REGRESSION: Pressing Enter/Return in a text input removes the selected text
2151
2152         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9743
2153           <rdar://problem/4614228>
2154           REGRESSION: crash dispatching JavaScript-created keyboard event to input element
2155
2156         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::doTextFieldCommandFromEvent):
2157         Add a null check to fix the crash, and a FIXME explaining why this is not necessarily
2158         enough for the future.
2159
2160         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler):
2161         Consume Enter key keypress events even if the element is not in a form.
2162
2163         * platform/mac/KeyEventMac.mm: (WebCore::keyIdentifierForKeyEvent): Added \n to the
2164         characters that turn into "Enter". Actual keyboard events always are \r or \003 on
2165         the Macintosh, but in layout tests we can use \n, and everything other than the
2166         code path here works, so worth fixing.
2167
2168 2006-07-15  Darin Adler  <darin@apple.com>
2169
2170         Reviewed by John Sullivan.
2171
2172         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9883
2173           <rdar://problem/4631821>
2174           REGRESSION: NativePopups don't work correctly in some forum software
2175
2176         Test: fast/forms/select-selected.html
2177
2178         * rendering/RenderMenuList.h:
2179         * rendering/RenderMenuList.cpp:
2180         (WebCore::RenderMenuList::updateFromElement): Added code to map the selected option
2181         index to a list index before using it to index into the list.
2182         (WebCore::RenderMenuList::showPopup): Added code to map the selection option index
2183         to a list index before passing it to the menu renderer.
2184         (WebCore::RenderMenuList::valueChanged): Added code to map the list index back to a
2185         option index before calling setSelectedIndex (that function takes an option index).
2186
2187 2006-07-15  Darin Adler  <darin@apple.com>
2188
2189         Reviewed by John Sullivan.
2190
2191         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9928
2192           REGRESSION: Text Encoding menu inoperative (after gcc protocol build fix)
2193
2194         * bindings/objc/DOM.mm:
2195         (-[DOMNode addEventListener:::]): Moved into DOMEventTarget category.
2196         (-[DOMNode removeEventListener:::]): Ditto.
2197         (-[DOMNode dispatchEvent:]): Ditto.
2198
2199         * WebCore.xcodeproj/project.pbxproj: Allow Xcode to do its thing.
2200
2201 2006-07-15  Maciej Stachowiak  <mjs@apple.com>
2202
2203         Reviewed by Anders.
2204
2205         <rdar://problem/4632144> REGRESSION: table column tests failing as a result of very recent fix
2206
2207         * rendering/RenderTable.cpp:
2208         (WebCore::RenderTable::addChild): columns and colgroups are valid children of a table too, not
2209         just table sections!
2210
2211 2006-07-15  Anders Carlsson  <acarlsson@apple.com>
2212
2213         Reviewed by Darin.
2214
2215         http://bugzilla.opendarwin.org/show_bug.cgi?id=9866
2216         <rdar://problem/4631561>
2217         REGRESSION: Repro crash from mangleme using iframe, only from server.
2218         
2219         * html/HTMLIFrameElement.cpp:
2220         (WebCore::HTMLIFrameElement::attach):
2221         Add null check for contentFrame() since content frames won't be created for invalid URLs.        
2222
2223 2006-07-14  Alexey Proskuryakov  <ap@nypop.com>
2224
2225         Reviewed by Darin.
2226
2227         Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=4195
2228         REGRESSION: KOI8-U encoding no longer supported.
2229
2230         Tests:
2231         * http/tests/misc/BOM-override.pl
2232         * http/tests/misc/BOM-override-script.html
2233         * fast/encoding/charset-koi8-u.html
2234         * fast/encoding/charset-x-nextstep.html
2235
2236         Restored a TEC code path for encodings that are not supported by ICU (but which currently
2237         passes all layout tests even by itself with ICU disabled). A lot of refactoring is 
2238         still needed - most importantly, round-tripping encoding names via CFStringEncoding 
2239         makes little sense now.
2240
2241         * WebCore.exp:
2242         * bridge/mac/WebCoreTextDecoder.h: Removed.
2243         * bridge/mac/WebCoreTextDecoder.mm: Removed.
2244         WebCoreTextDecoder was not used anywhere since WebTextView was moved into WebCore.
2245
2246         * loader/Decoder.cpp:
2247         (Decoder::Decoder):
2248         (Decoder::setEncodingName):
2249         (Decoder::decode):
2250         Use StreamingTextDecoder::create().
2251
2252         * platform/StreamingTextDecoder.cpp:
2253         (WebCore::StreamingTextDecoder::create):
2254         (WebCore::StreamingTextDecoder::~StreamingTextDecoder):
2255         * platform/StreamingTextDecoder.h:
2256         StreamingTextDecoder is just an abstract interface to implementations now.
2257
2258         * platform/StreamingTextDecoderICU.cpp: Added.
2259         (WebCore::StreamingTextDecoderICU::StreamingTextDecoderICU):
2260         (WebCore::StreamingTextDecoderICU::~StreamingTextDecoderICU):
2261         (WebCore::StreamingTextDecoderICU::releaseICUConverter):
2262         (WebCore::StreamingTextDecoderICU::textEncodingSupported):
2263         (WebCore::StreamingTextDecoderICU::convertUTF16):
2264         (WebCore::StreamingTextDecoderICU::convertIfASCII):
2265         (WebCore::StreamingTextDecoderICU::createICUConverter):
2266         (WebCore::StreamingTextDecoderICU::appendOmittingBOM):
2267         (WebCore::StreamingTextDecoderICU::convertUsingICU):
2268         (WebCore::StreamingTextDecoderICU::convert):
2269         (WebCore::StreamingTextDecoderICU::toUnicode):
2270         (WebCore::StreamingTextDecoderICU::fromUnicode):
2271         * platform/StreamingTextDecoderICU.h: Added.
2272         Renamed from StreamingTextDecoder; added a way to tell whether the encoding is actually
2273         supported by the decoder; minor cleanup.
2274
2275         * platform/TextEncoding.cpp:
2276         (WebCore::TextEncoding::effectiveEncoding): Moved from StreamingTextDecoder.
2277         (WebCore::TextEncoding::toUnicode): Use StreamingTextDecoder::create().
2278         (WebCore::TextEncoding::fromUnicode): Moved to StreamingTextDecoderICU.
2279         
2280         * platform/TextEncoding.h: Changed __APPLE__ to PLATFORM(MAC); added effectiveEncoding().
2281
2282         * platform/mac/StreamingTextDecoderMac.cpp: Added.
2283         (WebCore::StreamingTextDecoderMac::StreamingTextDecoderMac):
2284         (WebCore::StreamingTextDecoderMac::~StreamingTextDecoderMac):
2285         (WebCore::StreamingTextDecoderMac::releaseTECConverter):
2286         (WebCore::StreamingTextDecoderMac::textEncodingSupported):
2287         (WebCore::StreamingTextDecoderMac::convertUTF16):
2288         (WebCore::StreamingTextDecoderMac::convertIfASCII):
2289         (WebCore::StreamingTextDecoderMac::createTECConverter):
2290         (WebCore::StreamingTextDecoderMac::appendOmittingBOM):
2291         (WebCore::StreamingTextDecoderMac::convertOneChunkUsingTEC):
2292         (WebCore::StreamingTextDecoderMac::convertUsingTEC):
2293         (WebCore::StreamingTextDecoderMac::convert):
2294         (WebCore::StreamingTextDecoderMac::toUnicode):
2295         (WebCore::StreamingTextDecoderMac::fromUnicode):
2296         * platform/mac/StreamingTextDecoderMac.h: Added.
2297         (WebCore::StreamingTextDecoderMac::convert):
2298         This is a TEC+CFString code path for decoding, basically restored from a year-old revision.
2299
2300         * platform/mac/TextEncodingMac.cpp: Removed. Code moved to StreamingTextDecoderMac.
2301
2302         * WebCore.xcodeproj/project.pbxproj:
2303
2304 === Safari-521.17 ===
2305
2306 2006-07-14  Timothy Hatcher  <timothy@apple.com>
2307
2308         <rdar://problem/4623957> SWB: gcc-5412 (new?) objc warning causes WebCore project failure
2309
2310         Made a DOMNode category in DOMEvents.h that lets DOMNode conform to the
2311         DOMEventTarget protocol that works with GCC 5412.
2312
2313         Removed forward declarations of WebCoreWidgetHolder and imported WebCoreWidgetHolder.h.
2314
2315         Removed all <Cocoa/Cocoa.h> and <Foundation/Foundation.h> imports in other headers,
2316         we import <Cocoa/Cocoa.h> in the prefix header for ObjC.
2317
2318         * WebCore.xcodeproj/project.pbxproj:
2319         * bindings/objc/DOMCore.h:
2320         * bindings/objc/DOMEvents.h:
2321         * bridge/mac/FormDataMac.h:
2322         * bridge/mac/WebCoreAXObject.h:
2323         * bridge/mac/WebCoreCache.h:
2324         * bridge/mac/WebCoreEncodings.h:
2325         * bridge/mac/WebCoreFrameBridge.h:
2326         * bridge/mac/WebCoreFrameNamespaces.h:
2327         * bridge/mac/WebCoreJavaScript.h:
2328         * bridge/mac/WebCorePageBridge.h:
2329         * bridge/mac/WebCorePageState.h:
2330         * bridge/mac/WebCoreResourceLoader.h:
2331         * bridge/mac/WebCoreScriptDebugger.h:
2332         * bridge/mac/WebCoreSettings.h:
2333         * bridge/mac/WebCoreStringTruncator.h:
2334         * bridge/mac/WebCoreStringTruncator.mm:
2335         * bridge/mac/WebCoreTextDecoder.h:
2336         * bridge/mac/WebDashboardRegion.h:
2337         * kcanvas/device/quartz/KRenderingDeviceQuartz.mm:
2338         * platform/mac/CookieJar.mm:
2339         * platform/mac/DeprecatedStringMac.mm:
2340         * platform/mac/FontDataMac.mm:
2341         * platform/mac/FoundationExtras.h:
2342         * platform/mac/TextBoundaries.mm:
2343         * platform/mac/WebCoreHistory.h:
2344         * platform/mac/WebCoreHistory.m:
2345         * platform/mac/WebCoreKeyGenerator.h:
2346         * platform/mac/WebCoreTextArea.h:
2347         * platform/mac/WebCoreTextField.h:
2348         * platform/mac/WebCoreTextRenderer.h:
2349         * platform/mac/WebCoreView.h:
2350         * platform/mac/WebCoreWidgetHolder.h:
2351
2352 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
2353
2354         Reviewed by Maciej.
2355
2356         - Updated ScriptInterpreter to work with Interpreter ref-counting in 
2357         JavaScriptCore.
2358
2359         (KJS::ScriptInterpreter::~ScriptInterpreter): Now protected to catch
2360         manual delete.
2361
2362 2006-07-14  Anders Carlsson  <acarlsson@apple.com>
2363
2364         Reviewed by Adele and Justin.
2365
2366         http://bugzilla.opendarwin.org/show_bug.cgi?id=9658
2367         <rdar://problem/4613948>
2368         REGRESSION: Check Spelling does not work in textarea elements
2369         
2370         * bridge/mac/FrameMac.mm:
2371         (WebCore::FrameMac::advanceToNextMisspelling):
2372         Don't use setStartBefore or setEndAfter on the search range because for shadow trees, there
2373         is no notion of before and after. Instead, use setStart and setEnd and pass in the start and end
2374         indices respectively.
2375         
2376         * dom/Range.cpp:
2377         (WebCore::Range::checkNodeBA):
2378         Allow range operations on shadow trees.
2379
2380         * manual-tests/form-element-spelling.html: Added.
2381
2382 2006-07-14  Beth Dakin  <bdakin@apple.com>
2383
2384         Reviewed by Hyatt.
2385
2386         Fix for <rdar://problem/4621660> REGRESSION: Safari crashing in 
2387         WebCore::FrameView::updateOverflowStatus
2388
2389         m_viewportRenderer is never initialized for framesets, and it 
2390         shouldn't be. So we just need to nil-check for it in 
2391         updateOverflowStatus() and return early.
2392
2393         * page/FrameView.cpp:
2394         (WebCore::FrameView::updateOverflowStatus): Nil check.
2395
2396 2006-07-14  Adele Peterson  <adele@apple.com>
2397
2398         RS by Darin.
2399
2400         Backing out fix for <rdar://problem/4604703> 
2401         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
2402
2403         Darin had a better fix in WebKit for this.
2404
2405         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
2406
2407 2006-07-14  Adele Peterson  <adele@apple.com>
2408
2409         Reviewed by Darin.
2410
2411         - Fix for <rdar://problem/4614054> REGRESSION: Safari submits forms when the Return key is hit to complete inline inputs
2412
2413         * page/Frame.h: (WebCore::Frame::inputManagerHasMarkedText): Added.
2414         * bridge/mac/FrameMac.h: ditto.
2415         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::inputManagerHasMarkedText): Added. Asks the input manager if there's marked text.
2416         * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::defaultEventHandler): For text fields, don't submit the form on Enter
2417         if the input manager says there's marked text.  I added this code for all text field paths.  For widgets, WebCoreTextField.mm
2418         has code to deal with this case.  But as we convert search, password, and isindex, they will need to do this check too.
2419
2420 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2421
2422         Reviewed by Darin.
2423
2424         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9907
2425           REGRESSION (r15418): editing/pasteboard/paste-table-001 fails in pixel  mode
2426
2427         * rendering/RenderText.cpp:
2428         (WebCore::RenderText::caretRect): Fixed the calculation of the max/min allowed caret
2429         position.
2430
2431 2006-07-14  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2432
2433         Reviewed by Darin.
2434
2435         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9905
2436           REGRESSION (r15404-r15415): Repro crash when pressing delete in an empty editable div
2437
2438         Test: editing/deleting/delete-at-start-or-end.html
2439
2440         * editing/TypingCommand.cpp:
2441         (WebCore::TypingCommand::deleteKeyPressed): Added null check.
2442         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
2443
2444 2006-07-14  David Kilzer  <ddkilzer@kilzer.net>
2445
2446         Reviewed by Geoffrey.
2447
2448         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9903
2449           Simplify logic in JSHTMLOptionsCollection::setLength() by using no-arg getNumber()
2450
2451         No test cases since there is no change in functionality.
2452
2453         * bindings/js/JSHTMLOptionsCollectionCustom.cpp:
2454         (WebCore::JSHTMLOptionsCollection::setLength):  Simplified logic by using the
2455         no-argument getNumber() method.
2456
2457 2006-07-14  Geoffrey Garen  <ggaren@apple.com>
2458
2459         Reviewed by Adele.
2460
2461         - Build fix: don't need BLOCK_OBJC_EXCEPTIONS because we already have
2462         one surrounding this function, and the nested one makes the compiler
2463         think our local variable is volatile (seems like a compiler bug to me).
2464         
2465         * bridge/mac/FrameMac.mm:
2466         (WebCore::FrameMac::sendContextMenuEvent):
2467
2468 2006-07-14  Timothy Hatcher  <timothy@apple.com>
2469
2470         Reviewed by Maciej.
2471
2472         Make JavaScriptCore a public framework. Adjusted the paths.
2473
2474         * WebCore.xcodeproj/project.pbxproj:
2475
2476 2006-07-14  Maciej Stachowiak  <mjs@apple.com>
2477
2478         Reviewed by Hyatt.
2479
2480         - fixed <rdar://problem/4567031> REGRESSION: Crash at WebCore::RenderBlock::createLineBoxes (seems to be a security hole?)
2481         
2482         I also fixed all the similar crash / assertion failure cases I could think of.
2483
2484         * dom/Node.cpp:
2485         (WebCore::Node::nextRendererWithSameParent): Helper function for some of the above.
2486         * dom/Node.h:
2487         * rendering/RenderTable.cpp:
2488         (WebCore::RenderTable::addChild): Don't allow inserting forms when not in
2489         an HTML document, since we don't need that quirk and because parsing won't
2490         do certain render tree fixups. Also watch out for case when inserting before
2491         the renderer of a misnested child.
2492         * rendering/RenderTableRow.cpp:
2493         (WebCore::RenderTableRow::addChild): ditto
2494         * rendering/RenderTableSection.cpp:
2495         (WebCore::RenderTableSection::addChild): ditto
2496
2497 2006-07-13  Adele Peterson  <adele@apple.com>
2498
2499         Reviewed by Maciej.
2500
2501         - Fix for <rdar://problem/4604703> 
2502         REGRESSION (NativeTextField): Focus is not removed from password field after I ctrl-click into a different field
2503
2504         Test:
2505         * manual-tests/password-ctrl-click-lose-focus.html: Added.
2506
2507         * bridge/mac/FrameMac.mm: (WebCore::FrameMac::sendContextMenuEvent):
2508         If we're about to set a selection in the current view, make sure its the first responder.
2509         In this case, this will cause the password field to resign first responder at the right time.
2510
2511 2006-07-13  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2512
2513         Reviewed by Hyatt.
2514
2515         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9670
2516           REGRESSION: RTL white-space:pre-wrap text is offset to the right
2517
2518         Test: fast/text/international/rtl-white-space-pre-wrap.html
2519
2520         * rendering/RenderText.cpp:
2521         (WebCore::RenderText::caretRect): Fixed LTR case and added the RTL case
2522         of clipping the caret position to the text box when the caret is after
2523         the trailing space of an autowrapped line.
2524         * rendering/bidi.cpp:
2525         (WebCore::RenderBlock::computeHorizontalPositionsForLine): Changed to truncate-
2526         to-fit the logically last text box if it contains the trailing spaces of an
2527         autowrapped line. 
2528         (WebCore::RenderBlock::bidiReorderLine): Remember the logically last text run.
2529         In the case of autowrapped text with white space that overflows beyond the line,
2530         the last text run is the one containing the overflowing white space.
2531         (WebCore::RenderBlock::findNextLineBreak): Split overflowing white space on a
2532         line that autowraps only after white space into a separate text run.
2533
2534 2006-07-13  David Harrison  <harrison@apple.com>
2535
2536         Reviewed by Dave Hyatt.
2537
2538         <rdar://problem/4624203> -webkit-highlight should be behind images
2539
2540         * rendering/RenderImage.cpp:
2541         (WebCore::RenderImage::paint):
2542         * rendering/RenderListMarker.cpp:
2543         (WebCore::RenderListMarker::paint):
2544         * rendering/RenderWidget.cpp:
2545         (WebCore::RenderWidget::paint):
2546         Call custom highlighter before painting the image, marker, or widget.
2547
2548 2006-07-13  David Harrison  <harrison@apple.com>
2549
2550         Reviewed by Justin and Levi.
2551
2552         <rdar://problem/4620743> REGRESSION: Option-Delete doesn't delete words during typing
2553
2554         * Tests:
2555         editing/deleting/delete-by-word-001.html
2556         editing/deleting/delete-by-word-002.html
2557
2558         * editing/TypingCommand.cpp:
2559         (WebCore::TypingCommand::deleteKeyPressed):
2560         (WebCore::TypingCommand::forwardDeleteKeyPressed):
2561         (WebCore::TypingCommand::doApply):
2562         * editing/TypingCommand.h:
2563         Delete and forward delete to use specified granularity.
2564         Undo of delete and forward delete to select what had been deleted (non-char granularity only).
2565         
2566         * page/Frame.cpp:
2567         (WebCore::Frame::setSelection):
2568         Close typing and end style even if selection is not changing.
2569         * page/Frame.h:
2570         Remove unused setSelection parameter keepTypingStyle.
2571
2572 2006-07-12  Levi Weintraub  <lweintraub@apple.com>
2573
2574         Reviewed by justin
2575
2576         <rdar://problem/4622763> Deleting from beginning of paragraph following a table deletes rather than selects the table
2577
2578         * editing/DeleteSelectionCommand.cpp:
2579         (WebCore::DeleteSelectionCommand::initializeStartEnd): Added selection expansion for HRs.
2580         (WebCore::DeleteSelectionCommand::initializePositionData): Now uses enclosingBlockFlowOrTableElement
2581         instead of enclosingBlockFlowElement.
2582         (WebCore::DeleteSelectionCommand::removeNode): Use to identify that we need a placeholder
2583         when the start or end block is removed.
2584         (WebCore::DeleteSelectionCommand::handleGeneralDelete): Added check for canHaveChildrenForEditing
2585         to keep things like HRs from being given children.
2586         (WebCore::DeleteSelectionCommand::doApply): Switched to use member variable for needPlaceholder.
2587         * editing/DeleteSelectionCommand.h: Made needPlaceholder a member variable.
2588         * editing/TypingCommand.cpp:
2589         (WebCore::TypingCommand::deleteKeyPressed): Fixed selection bug for tables and open typing commands.
2590         (WebCore::TypingCommand::forwardDeleteKeyPressed): Ditto.
2591         * editing/htmlediting.cpp:
2592         (WebCore::editingIgnoresContent): Added check for HRs, since it's not considered a widget.
2593         * editing/visible_units.cpp:
2594         (WebCore::startOfParagraph): Fix for HRs and tables.
2595         (WebCore::endOfParagraph): Ditto.
2596
2597 2006-07-13  Alexey Proskuryakov  <ap@nypop.com>
2598
2599         Reviewed by Darin.
2600
2601         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9880
2602           Memory leaks running DOM-Hanoi
2603
2604         No change in behavior, thus no test included.
2605
2606         * bridge/mac/FrameMac.mm:
2607         (WebCore::FrameMac::setStatusBarText): Use a local autorelease pool to release the temporaries - 
2608         the test runs non-stop, and the enclosing pool doesn't get a chance to be drained.
2609
2610 2006-07-12  Mitz Pettel  <opendarwin.org@mitzpettel.com>
2611
2612         Reviewed by Adele.
2613
2614         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9862
2615           REGRESSION: GMail: Crash in RenderView::repaintViewRectangle when spoofing as FF
2616         - see also <rdar://problem/4622407>
2617
2618         Test: fast/frames/repaint-display-none-crash.html
2619
2620         * rendering/RenderView.cpp:
2621         (WebCore::RenderView::repaintViewRectangle): Added null checking of the owner element's
2622         renderer, which can be null if the iframe is set to display:none.
2623
2624 2006-07-12  Justin Garcia  <justin.garcia@apple.com>
2625
2626         Reviewed by levi
2627         
2628         <rdar://problem/4509393>
2629         selected DOM range starts with <object>, 0 offset but selection should include the <object>
2630
2631         * editing/ReplaceSelectionCommand.cpp:
2632         (WebCore::ReplaceSelectionCommand::shouldMergeStart): 
2633         Don't pull content out of a table cell.
2634         * editing/htmlediting.cpp:
2635         (WebCore::editingIgnoresContent): Added <select> nodes.
2636         (WebCore::rangeCompliantEquivalent): Convert [node, 0] positions to positionBeforeNode(node)
2637         for more types of nodes.
2638         * rendering/RenderContainer.cpp:
2639         (WebCore::RenderContainer::positionForCoordinates): 
2640         Fix a crasher when right clicking on an anonymous table.
2641
2642 2006-07-12  John Sullivan  <sullivan@apple.com>
2643
2644         Reviewed by Brady Eidson
2645         
2646         - fixed <rdar://problem/4611164> REGRESSION: Crash occurs when undoing a series of 
2647         misspelled words (WebCore::RenderObject::repaint(bool)
2648
2649         * dom/Document.cpp:
2650         (WebCore::Document::removeMarkers):
2651         put (it - markers.begin()) in a local variable before altering markers, in every case where this was
2652         happening. One of the cases like this was fixed a while back, but other cases were
2653         either missed at that time or crept in since. 
2654
2655 2006-07-13  Anders Carlsson  <acarlsson@apple.com>
2656
2657         Reviewed by Justin.
2658
2659         http://bugzilla.opendarwin.org/show_bug.cgi?id=9663
2660         REGRESSION (r14948-r14956): Selection in text field remains highlighted when the text field loses focus
2661         
2662         * dom/Document.cpp:
2663         (WebCore::Document::updateSelection):
2664         Don't return early if the selection is empty.
2665
2666 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2667
2668         Reviewed by Adele.
2669
2670         <rdar://problem/4614656> REGRESSION: onpaste() handlers don't run for textarea elements
2671         
2672         * bridge/mac/FrameMac.mm:
2673         (WebCore::FrameMac::dispatchCPPEvent):
2674         If the element is a shadow node, dispatch the event to its real parent.
2675
2676         * manual-tests/textarea-onpaste.html: Added.
2677
2678 2006-07-12  Beth Dakin  <bdakin@apple.com>
2679
2680         Reviewed by Anders.
2681
2682         Fix for layout test regressions after my check-in last night. Just 
2683         a silly mistake where I should have asked if we were NOT printing 
2684         instead of if we were in the listbox code.
2685
2686         * WebCore.xcodeproj/project.pbxproj: Project file wars. Back to 
2687         XCode 2.3
2688         * platform/mac/ListBoxMac.mm:
2689         (itemTextRenderer): Inverted check.
2690         (groupLabelTextRenderer): Inverted check.
2691
2692 2006-07-12  Darin Adler  <darin@apple.com>
2693
2694         Reviewed by Maciej.
2695
2696         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9806
2697           <rdar://problem/4622622>
2698           REGRESSION: Large rowspan causes WebKit to call abort()
2699
2700         Test: fast/table/large-rowspan-crash.html
2701
2702         * rendering/RenderTableSection.cpp:
2703         (WebCore::RenderTableSection::ensureRows):
2704         Use sizeof(RowStruct) instead of sizeof(int).
2705         Clearly we'll need something better to solve this completely.
2706         I expect another smaller, but still huge, value will still cause a problem.
2707
2708 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2709
2710         Reviewed by Maciej.
2711
2712         <rdar://problem/4586665> REGRESSION: autorestore.apple.com: Crashes Safari in WebCore::Widget::client() const
2713
2714         * bridge/mac/FrameMac.h:
2715         Add focusCallResultedInViewBeingCreated argument. 
2716         
2717         * bridge/mac/FrameMac.mm:
2718         (WebCore::FrameMac::nextKeyViewInFrame):
2719         If the call to focus() caused the node to get a native widget, set focusCallResultedInViewBeingCreated to true.
2720         
2721         (WebCore::FrameMac::nextKeyViewInFrameHierarchy):
2722         Don't reset the focus node if focusCallResultedInViewBeingCreated is true. Also, add magic to prevent setting
2723         a text field as the first responder if its field editor already is the current first responder.
2724         
2725         * page/FrameView.cpp:
2726         (WebCore::FrameView::handleMousePressEvent):
2727         In some cases, get the event target node again after dispatching the mouse event.
2728
2729 2006-07-12  Beth Dakin  <bdakin@apple.com>
2730
2731         Reviewed by Adele.
2732
2733         Fix for <rdar://problem/4615765> Input[type='search' fields 
2734         initially render too large in Widgets
2735
2736         Fundamentally, the problem here is that we were miscalculating 
2737         things because [NSGraphicsContext currentContextDrawingToScreen] 
2738         was evaluating to false when widgets first load. We only ever used 
2739         this check, however, to determine if we were printing or not, so it 
2740         should not have evaluated to false for loading in Dashbaord. 
2741         Instead, if we query the RenderView about whether or not we are 
2742         printing, we will get the right answer.
2743
2744         No test case added since this appears only to affect Dashboard.
2745
2746         * bridge/mac/WebCoreFrameBridge.mm:
2747         (-[WebCoreFrameBridge drawRect:]): Ask the RenderView if we are 
2748         printing instead. This is not part of the actual bug fix, but it 
2749         seems wise to get rid of all calls to [NSGraphicsContext 
2750         currentContextDrawingToScreen] when we are just trying to determine 
2751         if we are printing or not.
2752         * platform/mac/ListBoxMac.mm:
2753         (itemTextRenderer):This function now takes a boolean, isPrinting.
2754         (groupLabelTextRenderer): Same as above.
2755         (ListBox::sizeForNumberOfLines): Ask the RenderView if we are 
2756         printing.
2757         (-[WebCoreTableView drawRow:clipRect:]): Same as above.
2758         * platform/mac/PopUpButtonMac.mm:
2759         (PopUpButton::sizeHint): Same as above.
2760         * platform/mac/TextFieldMac.mm:
2761         (-[NSSearchFieldCell _addStringToRecentSearches:]):
2762         * rendering/RenderLineEdit.cpp: Same as above.
2763
2764 2006-07-12  Adele Peterson  <adele@apple.com>
2765
2766         Reviewed by Maciej.
2767
2768         Fix for: http://bugzilla.opendarwin.org/show_bug.cgi?id=9813
2769         OPTION text can paint over select element's scrollbar
2770
2771         Test: fast/forms/option-text-clip.html
2772
2773         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::paintObject):
2774         When calculating the clip to apply to the button text, also consider padding.
2775         In the future, we may have separate renderers for the text part, and the arrow part
2776         of the control, and then the separation should be natural.  For now, we use padding.
2777
2778 2006-07-11  David Kilzer  <ddkilzer@kilzer.net>
2779
2780         Windows build fix.  Reviewed by NOBODY.
2781
2782         * WebCore.vcproj/WebCore/WebCore.vcproj:  Added JSHTMLOptionsCollection.cpp/h
2783         and JSHTMLOptionsCollectionCuston.cpp.  VC++ Express realphabetized the file list.
2784
2785 2006-07-11  Darin Adler  <darin@apple.com>
2786
2787         Reviewed by Adele.
2788
2789         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9809
2790           <rdar://problem/4619515>
2791           focus ring fails to appear on select element after choosing item from popup
2792
2793         - includes http://bugzilla.opendarwin.org/show_bug.cgi?id=9853
2794           improvements to select element, including some storage leak fixes
2795
2796         * html/HTMLOptionElement.cpp: (WebCore::HTMLOptionElement::index): Use a const
2797         reference for the list items, so we don't have to copy a vector.
2798         * html/HTMLSelectElement.cpp:
2799         (WebCore::HTMLSelectElement::selectedIndex): Ditto.
2800         (WebCore::HTMLSelectElement::setSelectedIndex): Ditto.
2801         (WebCore::HTMLSelectElement::length): Ditto.
2802         (WebCore::HTMLSelectElement::remove): Ditto.
2803         (WebCore::HTMLSelectElement::value): Ditto.
2804         (WebCore::HTMLSelectElement::setValue): Ditto.
2805         (WebCore::HTMLSelectElement::stateValue): Ditto.
2806         (WebCore::HTMLSelectElement::restoreState): Ditto.
2807         (WebCore::HTMLSelectElement::appendFormData): Ditto.
2808         (WebCore::HTMLSelectElement::optionToListIndex): Ditto.
2809         (WebCore::HTMLSelectElement::listToOptionIndex): Ditto.
2810         (WebCore::HTMLSelectElement::recalcListItems): Made const, with the appropriate
2811         fields mutable.
2812         (WebCore::HTMLSelectElement::reset): Use a const reference for
2813         the list items, so we don't have to copy the vector. Remove the call to
2814         setSelectionChanged for the RenderMenuList case.
2815         (WebCore::HTMLSelectElement::notifyOptionSelected): Ditto, on both counts.
2816         (WebCore::HTMLSelectElement::defaultEventHandler): Call focus() before showing
2817         the pop-up.
2818         * html/HTMLSelectElement.h: The RenderMenuList class is no longer a friend.
2819         Changed the listItems function to return a const reference to the vector so
2820         it no longer copies the vector. Removed the const_cast to the call to
2821         recalcListItems and changed it to a const member function. Made m_recalcListItems
2822         mutable.
2823         * rendering/DeprecatedRenderSelect.cpp:
2824         (WebCore::DeprecatedRenderSelect::updateFromElement): Removed an unnecessary call
2825         to recalcListItems, which is called automatically. Use a const reference for the
2826         list items so we don't have to copy a vector.
2827         (WebCore::DeprecatedRenderSelect::layout): Ditto.
2828         (WebCore::DeprecatedRenderSelect::selectionChanged): Ditto.
2829         (WebCore::DeprecatedRenderSelect::updateSelection): Ditto.
2830         * rendering/RenderMenuList.cpp:
2831         (WebCore::RenderMenuList::RenderMenuList): Updated for renamed data members.
2832         (WebCore::RenderMenuList::createInnerBlock): Ditto.
2833         (WebCore::RenderMenuList::addChild): Ditto.
2834         (WebCore::RenderMenuList::removeChild): Ditto.
2835         (WebCore::RenderMenuList::setStyle): Ditto. Also removed code to set the style
2836         on the pop-up menu, because it's created with the correct style and destroyed
2837         before it a style change could occur.
2838         (WebCore::RenderMenuList::updateFromElement): Rearranged code to compute the
2839         maximum width in a simpler fashion, and to not bother trying to maintain
2840         the "selected" flags on the elements, since the HTMLSelectElement class
2841         takes care of that. Store the width as an int. Call setText to set the text
2842         based on the selected element's option text.
2843         (WebCore::RenderMenuList::paintObject): Don't check m_inner when setting
2844         up the clip -- always set up the clip.
2845         (WebCore::RenderMenuList::calcMinMaxWidth): Use m_optionsWidth directly
2846         instead of calling ceilf on m_longestWidth.
2847         (WebCore::RenderMenuList::showPopup): Don't use m_popupMenu to store the
2848         menu -- instead keep the pointer in a local variable. Get the selected
2849         index from the HTMLSelectElement.
2850         (WebCore::RenderMenuList::valueChanged): Call HTMLSelectElement::setSelectedIndex
2851         to do most of the work.
2852         * rendering/RenderMenuList.h: Renamed m_inner to m_innerBlock. Removed
2853         m_popupMenu, m_size, m_selectionChanged, and m_selectedIndex. Renamed
2854         m_longestWidth to m_optionsWidth and changed it to be an int. Removed
2855         unneeded override of removeLeftoverAnonymousBoxes function. Removed
2856         unneeded selectionChanged, setSelectionChanged, updateSelection, and
2857         hasPopupMenu functions. Removed extra includes.
2858         * rendering/RenderPopupMenu.cpp: (WebCore::RenderPopupMenu::populate):
2859         Change to iterate the list items instead of iterating all children
2860         of the select node.
2861         * rendering/RenderPopupMenu.h: Renamed getRenderMenuList to menuList.
2862         * rendering/RenderPopupMenuMac.mm:
2863         (WebCore::RenderPopupMenuMac::populate): Moved code to clear and create
2864         the pop-up here from the caller. Removed an extra retain that would cause
2865         the NSPopUpButtonCell to leak.
2866         (WebCore::RenderPopupMenuMac::showPopup): Removed unnecessary code to
2867         create the pop-up, which is now in populate, and also the call to the
2868         clear function, for the same reason. Reorganized code to make it a bit
2869         more readable. Removed an unnecessary if to check if frame is nil.
2870         Used a RefPtr to make sure we don't make a call on a frame after it's
2871         deleted. As part of the reorganization fixed a problem where we'd retain
2872         the event and then return early without releasing it in one case.
2873         (WebCore::RenderPopupMenuMac::addSeparator): Tweaked a little.
2874         (WebCore::RenderPopupMenuMac::addGroupLabel): Grouped all the code to
2875         manage the NSMenu at the bottom of the function.
2876         (WebCore::RenderPopupMenuMac::addOption): Ditto.
2877
2878 2006-07-11  Justin Garcia  <justin.garcia@apple.com>
2879
2880         Reviewed by levi
2881         
2882         <rdar://problem/4620686>
2883         REGRESSION: Mispelling markers are still displayed when using the delete key to place caret into a misspelled word
2884
2885         * bridge/mac/FrameMac.mm:
2886         (WebCore::FrameMac::respondToChangedSelection): Remove markers from newAdjacentWords 
2887         even if oldAdjacentWords is equal to newAdjacentWords.  This happens during a deletion.
2888         
2889
2890 2006-07-11  Tim Omernick  <timo@apple.com>
2891
2892         Reviewed by NOBODY (build fix)
2893
2894         * bindings/objc/DOMPrivate.h:
2895         Don't @class NPObject; that breaks files that actually #import <JavaScriptCore/npruntime.h>, since the NPObject
2896         there is of a different type.
2897         Also clarified a highly misleading comment from my last commit.  I meant to clarify the comment
2898         before landing.
2899
2900 2006-07-12  Anders Carlsson  <acarlsson@apple.com>
2901
2902         Reviewed by Geoff.
2903
2904         http://bugzilla.opendarwin.org/show_bug.cgi?id=9635
2905         REGRESSION: Crash when adding to cart at <http://www.yemeksepeti.com/>
2906         
2907         * html/HTMLTokenizer.cpp:
2908         (WebCore::HTMLTokenizer::scriptHandler):
2909         Don't load external scripts if the parser is stopped.
2910         
2911         * manual-tests/open-close-tokenizer-crash.html: Added.
2912         * manual-tests/resources/empty-file.js: Added.
2913         * manual-tests/resources/open-close-tokenizer-crash.html: Added.
2914         Add manual test.
2915
2916 2006-07-11  John Sullivan  <sullivan@apple.com>
2917
2918         Reviewed by Kevin, Timo O, Brady, Darin, and Hyatt (whee!)
2919
2920         - added support for creating a selection image with white text
2921
2922         * rendering/RenderObject.h:
2923         (WebCore::):
2924         add PaintRestriction enum
2925         (WebCore::RenderObject::PaintInfo::PaintInfo):
2926         add forceWhiteText boolean to PaintInfo struct
2927
2928         * page/FramePrivate.h:
2929         (WebCore::FramePrivate::FramePrivate):
2930         replaced m_selectionOnly bool with m_paintRestriction, which also handles forcing the
2931         text to white
2932
2933         * page/Frame.cpp:
2934         (WebCore::Frame::paint):
2935         updated to use & pass m_paintRestriction where it used to use & pass just m_selectionOnly
2936
2937         * bridge/mac/FrameMac.h:
2938         * bridge/mac/FrameMac.mm:
2939         (WebCore::FrameMac::selectionImage):
2940         now takes forceWhiteText parameter, stored in FramePrivate as part of PaintRestriction
2941
2942         * bridge/mac/WebCoreFrameBridge.h:
2943         * bridge/mac/WebCoreFrameBridge.mm:
2944         (-[WebCoreFrameBridge selectionImageForcingWhiteText:]):
2945         renamed from selectionImage, now takes forceWhiteText parameter, which is passed
2946         down into Frame
2947
2948         * rendering/RenderLayer.h:
2949         * rendering/RenderLayer.cpp:
2950         (WebCore::RenderLayer::paint):
2951         use a PaintRestriction value where we used to use a selectionOnly bool
2952         (WebCore::RenderLayer::paintLayer):
2953         ditto; also stores forceWhiteText in PaintInfo struct
2954
2955         * kcanvas/KCanvasResources.cpp:
2956         (WebCore::KCanvasMarker::draw):
2957         updated for changed signature of PaintInfo constructor
2958
2959         * ksvg2/svg/SVGMaskElement.cpp:
2960         (WebCore::SVGMaskElement::drawMaskerContent):
2961         ditto
2962
2963         * ksvg2/svg/SVGPatternElement.cpp:
2964         (WebCore::SVGPatternElement::drawPatternContentIntoTile):
2965         ditto
2966
2967         * rendering/InlineTextBox.cpp:
2968         (WebCore::InlineTextBox::paint):
2969         paint with white text color if forceWhiteText is set in PaintInfo struct
2970
2971 2006-07-11  Tim Omernick  <timo@apple.com>
2972
2973         Reviewed by Anders.
2974
2975         <http://bugzilla.opendarwin.org/show_bug.cgi?id=9843>:
2976         Give Netscape plug-ins access to their own DOM element
2977
2978         * html/HTMLPlugInElement.h:
2979         Just import JSC headers on Mac.  The NPObject and Bindings::Instance stuff is only used on Mac anyway.
2980         Changed __APPLE__ to PLATFORM(MAC).
2981         Added m_NPObject ivar.
2982         * html/HTMLPlugInElement.cpp:
2983         (WebCore::HTMLPlugInElement::HTMLPlugInElement):
2984         Initialize the NPObject.
2985         (WebCore::HTMLPlugInElement::~HTMLPlugInElement):
2986         Release the NPObject when the element is destroyed.
2987         (WebCore::HTMLPlugInElement::createNPObject):
2988         Creates an NPObject for the element.
2989         (WebCore::HTMLPlugInElement::getNPObject):
2990         Returns the NPObject for the element, creating and caching it if necessary.
2991
2992         * html/HTMLAppletElement.h:
2993         Changed __APPLE__ to PLATFORM(MAC).
2994         * html/HTMLAppletElement.cpp:
2995         ditto
2996         * html/HTMLEmbedElement.h:
2997         ditto
2998         * html/HTMLEmbedElement.cpp:
2999         ditto
3000         * html/HTMLObjectElement.h:
3001         ditto
3002         * html/HTMLObjectElement.cpp:
3003         ditto
3004
3005         * bindings/objc/DOMPrivate.h:
3006         Added -[DOMElement _NPObject].
3007
3008         * bindings/objc/DOM.mm:
3009         (-[DOMElement _NPObject]):
3010         Returns the NPObject for the element.  Since this is only needed by the Netscape plug-in API, you can only get 
3011         the NPObject for applet, embed, and object elements.
3012         
3013 2006-07-11  Adele Peterson  <adele@apple.com>
3014
3015         Reviewed by Hyatt.
3016
3017         - Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9861
3018         REGRESSION: Can't dynamically change list box to popup
3019         
3020         and updated fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
3021         REGRESSION: Can't dynamically change popup to list box
3022
3023         The original fix for 9859 was in the renderer, and I think we can catch the change
3024         earlier in the element to detach and reattach.
3025
3026         I also did some cleanup to remove the PopupButton code path from DeprecatedRenderSelect
3027
3028         Test: fast/forms/select-change-listbox-to-popup.html
3029
3030         * html/HTMLSelectElement.cpp:
3031         (WebCore::HTMLSelectElement::parseMappedAttribute): If the new attribute value is going to require us to change from listbox to popup or vice versa,
3032         and we're already attached, then detach and reattach to create the correct renderer.  If we're not attached, then we'll create the correct renderer
3033         when we attach.
3034         (WebCore::HTMLSelectElement::recalcStyle): Updated shouldUseMenuList since it no longer takes a RenderStyle.
3035         (WebCore::HTMLSelectElement::isKeyboardFocusable): ditto.
3036         (WebCore::HTMLSelectElement::isMouseFocusable): ditto.
3037         (WebCore::HTMLSelectElement::createRenderer): ditto.
3038         (WebCore::HTMLSelectElement::setRecalcListItems): ditto.
3039         (WebCore::HTMLSelectElement::reset): ditto.
3040         (WebCore::HTMLSelectElement::notifyOptionSelected): ditto.
3041         (WebCore::HTMLSelectElement::defaultEventHandler): ditto.
3042
3043         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList):
3044         This method no longer takes a RenderStyle.  That was leftover from when we used to use the appearance
3045         to determine whether or not to use the new menu list implementation.
3046
3047         * rendering/DeprecatedRenderSelect.h: Removed PopupButton code path.
3048         * rendering/DeprecatedRenderSelect.cpp:
3049         (WebCore::DeprecatedRenderSelect::DeprecatedRenderSelect):
3050         (WebCore::DeprecatedRenderSelect::setWidgetWritingDirection):
3051         (WebCore::DeprecatedRenderSelect::updateFromElement):
3052         (WebCore::DeprecatedRenderSelect::baselinePosition):
3053         (WebCore::DeprecatedRenderSelect::layout):
3054         (WebCore::DeprecatedRenderSelect::updateSelection):
3055
3056         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
3057         Backed out previous fix since this is now done in HTMLSelectElement.
3058
3059 2006-07-11  Adele Peterson  <adele@apple.com>
3060
3061         Reviewed by Hyatt.
3062
3063         Fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=9859
3064         REGRESSION: Can't dynamically change popup to list box
3065
3066         Test: fast/forms/select-change-popup-to-listbox.html
3067
3068         * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::updateFromElement):
3069         If the select element has the multiple property set, or has a size > 1, then it
3070         really should be a list box, so we detach and attach the element so it creates the
3071         correct type of renderer.
3072
3073 2006-07-11  John Sullivan  <sullivan@apple.com>
3074
3075         Reviewed by Beth Dakin and Tim Omernick
3076
3077         - fixed <rdar://problem/4622794> HiDPI: dragging the selection in Safari can show pixel cracks 
3078         at non-integral scale factors
3079
3080         * bridge/mac/FrameMac.mm:
3081         (WebCore::FrameMac::imageFromRect):
3082         round image rect in window coordinate space
3083
3084 2006-07-10  Darin Adler  <darin@apple.com>
3085
3086         Reviewed by Geoff.
3087
3088         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9811
3089           rdar://problem/4619572
3090           OPTION text contained in OPTGROUP appears at the wrong size
3091
3092         * dom/Node.h:
3093         * dom/Node.cpp: (WebCore::Node::renderStyle): Made a const member function.
3094         The derived classes were overriding with const member functions, and I could
3095         change either this or the derived -- decided to do this.
3096
3097 2006-07-10  Darin Adler  <darin@apple.com>
3098
3099         Reviewed by Geoff.
3100
3101         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9810
3102           rdar://problem/4619534
3103           OPTGROUP label text is using the default font instead of Lucida Grande
3104
3105         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::setFontFromControlSize):
3106         Code wants the family name, but was calling fontName, which is not the same thing.
3107         Also removed the unneeded conversion to DeprecatedString.
3108
3109 === Safari-521.16 ===
3110
3111 2006-07-10  David Kilzer  <ddkilzer@kilzer.net>
3112
3113         Reviewed by Darin.
3114
3115         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9179
3116           Implement select.options.add() method
3117
3118         Tests:
3119         - fast/dom/select-selectedIndex-multiple.html
3120         - fast/dom/select-selectedIndex.html
3121         - fast/js/select-options-add.html
3122
3123         * DerivedSources.make: Added JSHTMLOptionsCollection.h.
3124         * ForwardingHeaders/kjs/operations.h: Added.
3125         * WebCore.xcodeproj/project.pbxproj: Added new source files.
3126         * bindings/js/JSHTMLOptionsCollectionCustom.cpp: Added.
3127         (WebCore::JSHTMLOptionsCollection::length):
3128         (WebCore::JSHTMLOptionsCollection::setLength):
3129         (WebCore::JSHTMLOptionsCollection::indexSetter):
3130         * bindings/js/kjs_html.cpp: Removed JSHTMLOptionsCollection implementation.
3131         Renamed classes and methods for consistency.
3132         (KJS::JSHTMLElement::selectGetter):
3133         (KJS::JSHTMLElement::put):
3134         (KJS::JSHTMLElement::selectSetter):
3135         (KJS::JSHTMLCollection::JSHTMLCollection):
3136         (KJS::JSHTMLCollectionProtoFunc::callAsFunction):
3137         (KJS::getHTMLOptionsCollection):
3138         * bindings/js/kjs_html.h: Ditto.
3139         * bindings/scripts/CodeGeneratorJS.pm: Added support for HasCustomIndexSetter class attribute.
3140         Added support for Optional parameter attribute, which makes generated code assume overloaded
3141         implementation methods are available for a JavaScript function with optional arguments.  Changed
3142         local 'impl' variables to 'imp' so that impl() methods could be called without class designation.
3143         * html/HTMLOptionElement.idl: Added GenerateNativeConverter attribute.
3144         * html/HTMLOptionsCollection.cpp: Added methods used by generated JSHTMLOptionsCollection class.
3145         (WebCore::HTMLOptionsCollection::HTMLOptionsCollection):
3146         (WebCore::HTMLOptionsCollection::add):
3147         (WebCore::HTMLOptionsCollection::selectedIndex):
3148         (WebCore::HTMLOptionsCollection::setSelectedIndex):
3149         (WebCore::HTMLOptionsCollection::setLength):
3150         * html/HTMLOptionsCollection.h: Ditto.
3151         * html/HTMLOptionsCollection.idl: Added.
3152
3153 2006-07-10  David Harrison  <harrison@apple.com>
3154
3155         Reviewed by Dave Hyatt.
3156
3157         <rdar://problem/4602408> -webkit-highlight needs to support images and elements other than text
3158
3159         * rendering/RenderBox.cpp:
3160         (WebCore::RenderBox::paintCustomHighlight):
3161         * rendering/RenderBox.h:
3162         Utility for subclasses.
3163         
3164         * rendering/RenderImage.cpp:
3165         (WebCore::RenderImage::paint):
3166         Custom highlight in front of images.
3167         
3168         * rendering/RenderListMarker.cpp:
3169         (WebCore::RenderListMarker::paint):
3170         Custom highlight in front of list markers.
3171
3172         * rendering/RenderWidget.cpp:
3173         (WebCore::RenderWidget::paint):
3174         Custom highlight in front of objects.
3175
3176 2006-07-10  David Hyatt  <hyatt@apple.com>
3177
3178         <rdar://problem/4620557> REGRESSION: In a mail message, text isn't painted
3179         correctly after choosing Redo Typing
3180
3181         Better fix for repainting issue with positioned objects when height
3182         changes.  Optimize when only a positioned child changes so that we don't
3183         incorrectly do normal flow layout.
3184
3185         Reviewed by darin
3186
3187         * WebCore.xcodeproj/project.pbxproj:
3188         * rendering/RenderBlock.cpp:
3189         (WebCore::RenderBlock::layoutBlock):
3190         * rendering/RenderFlexibleBox.cpp:
3191         (WebCore::RenderFlexibleBox::layoutBlock):
3192         * rendering/RenderTable.cpp:
3193         (WebCore::RenderTable::layout):
3194         * rendering/RenderView.cpp:
3195         (WebCore::RenderView::layout):
3196         * rendering/bidi.cpp:
3197         (WebCore::RenderBlock::layoutInlineChildren):
3198
3199 2006-07-10  Adele Peterson  <adele@apple.com>
3200
3201         Reviewed by Beth.
3202
3203         - Fix for <rdar://problem/4621442> REGRESSION (NativePopup) : Popup menus aren't drawn correctly on page at orbitz.com; cheaptickets.com
3204
3205         Test: fast/forms/select-style.html
3206
3207         * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::isControlStyled):
3208         Don't let popups be style-able for now.  We'll allow it later, when we
3209         have a good way to handle border & backgrounds and still having it look like a control.
3210
3211 2006-07-10  Justin Garcia  <justin.garcia@apple.com>
3212
3213         Reviewed by harrison
3214         
3215         <rdar://problem/4619260>
3216         9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
3217         <rdar://problem/4619841>
3218         REGRESSION: Dragging selection over input field results in a crash (WebCore::maxDeepOffset(WebCore::Node const*)
3219
3220         * WebCore.xcodeproj/project.pbxproj:
3221         * editing/Selection.cpp:
3222         (WebCore::Selection::adjustForEditableContent): Iterate using next/previousVisuallyDistinctCandidate 
3223         instead of traverseNext/Previous node because we were skipping positions.  Jump out of shadow trees.  
3224         Migrate to isEditablePosition instead of isContentEditable.
3225         
3226
3227 2006-07-10  Beth Dakin  <bdakin@apple.com>
3228
3229         Reviewed by Adele.
3230
3231         Shuffling comments around from my last check-in to make things read 
3232         more clearly.
3233
3234         * page/DOMWindow.h:
3235         * page/DOMWindow.idl:
3236
3237 2006-07-10  Beth Dakin  <bdakin@apple.com>
3238
3239         Reviewed by Darin.
3240
3241         Fix for <rdar://problem/4621095> The should be a way to 
3242         access the user interface scale factor through the DOM
3243
3244         window.devicePixelRatio returns the user interface scale factor.
3245
3246         * page/DOMWindow.cpp:
3247         (WebCore::DOMWindow::devicePixelRatio):
3248         * page/DOMWindow.h:
3249         * page/DOMWindow.idl:
3250
3251 2006-07-10  Brady Eidson  <beidson@apple.com>
3252
3253         Reviewed by Alexey
3254
3255         Resolved the console error messages people got from the new DB even if they didn't have it enabled
3256
3257         * icon/IconDatabase.cpp:
3258         (WebCore::IconDatabase::pruneUnreferencedIcons):
3259         (WebCore::IconDatabase::pruneUnretainedIcons):
3260         Added quick check to bail if the DB isn't open
3261
3262 2006-07-10  David Harrison  <harrison@apple.com>
3263
3264         Reviewed by Tim Hatcher
3265
3266         Partial fix for...
3267         <rdar://problem/4619260> 9A213 + Safari 521.15.1 Crash with To Do's alarm icon (WebCore::maxDeepOffset(WebCore::Node const*) )
3268         
3269         * editing/Selection.cpp:
3270         (WebCore::Selection::adjustForEditableContent):
3271         Allow for node being 0.  This is a bandaid fix to prevent the crash.  It will still assert in a debug build.  See bug for more info.
3272
3273 2006-07-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
3274
3275         Reviewed by Darin.
3276
3277         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9808
3278           REGRESSION: Incorrect layout (and ERROR) when forcing ATSU For All Text
3279
3280         * manual-tests/ATSU-bad-layout.html: Added.
3281         * platform/mac/FontMac.mm:
3282         (WebCore::Font::floatWidthForComplexText): Return 0 immediately for empty runs.
3283
3284 2006-07-10  Darin Adler  <darin@apple.com>
3285
3286         - try to fix the no-SVG build
3287
3288         * ksvg2/misc/SVGImageLoader.cpp: Move namespace brace inside the #if.
3289
3290 2006-07-10  Darin Adler  <darin@apple.com>
3291
3292         Reviewed by Anders.
3293
3294         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=9833
3295           REGRESSION: Reproducible crash: RenderMenuList.cpp:58: failed assertion `!m_first'
3296
3297         * manual-tests/empty-title-popup.html: Added.
3298
3299         * rendering/RenderMenuList.h: Add createInnerBlock.
3300         * rendering/RenderMenuList.cpp:
3301         (WebCore::RenderMenuList::createInnerBlock): Factored out of addChild.
3302         (WebCore::RenderMenuList::addChild): Call createInnerBlock.
3303         (WebCore::RenderMenuList::setText): Changed parameter type.
3304         (WebCore::RenderMenuList::showPopup): Call createInnerBlock before calling
3305         the parent class's addChild.
3306
3307 2006-07-10  Rob Buis  <buis@kde.org>
3308
3309         Reviewed by Maciej via IRC.
3310
3311         Make sure the attributes are calculated against viewport width value,
3312         as defined in the spec.  http://paste.lisp.org/display/22342
3313
3314         * ksvg2/svg/SVGEllipseElement.cpp:
3315         (WebCore::SVGEllipseElement::rx): Changed LM_HEIGHT to LM_WIDTH.
3316         * ksvg2/svg/SVGLineElement.cpp:
3317         (SVGLineElement::x2): Ditto.
3318
3319 2006-07-10  Beth Dakin  <bdakin@apple.com>
3320
3321         Reviewed by Maciej.
3322
3323         Fix for <rdar://problem/4610314> Support the CSS3 content property 
3324         for images
3325
3326         This patch provides initial support for the CSS3 content property. 
3327         It lacks support for any content other than images, and only allows 
3328         content for elements that seemed safe for now.
3329
3330         * css/cssstyleselector.cpp:
3331         (WebCore::CSSStyleSelector::applyProperty): Remove restrictions for 
3332         just :before and :after
3333         * html/HTMLBRElement.cpp:
3334         (WebCore::HTMLBRElement::createRenderer):
3335         * html/HTMLFrameSetElement.cpp:
3336         (WebCore::HTMLFrameSetElement::createRenderer):
3337         * html/HTMLImageElement.cpp:
3338         (WebCore::HTMLImageElement::createRenderer):
3339         * html/HTMLLegendElement.cpp:
3340         (WebCore::HTMLLegendElement::createRenderer):
3341         * rendering/RenderImage.cpp:
3342         (WebCore::RenderImage::RenderImage):
3343         (WebCore::RenderImage::setCachedImage): Don't allow the image to be 
3344         set this way if it was already set with the content property.
3345         * rendering/RenderImage.h:
3346         (WebCore::RenderImage::setIsAnonymousImage): Anonymous images are 
3347         those set through the content property.
3348         (WebCore::RenderImage::isAnonymousImage):
3349         * rendering/RenderObject.cpp:
3350         (WebCore::RenderObject::createObject): If there is content 
3351         specified, create a RenderImage with the content and initialize the 
3352         cached image to whatever was specified in the CSS.
3353
3354 2006-07-10  Brady Eidson  <beidson@apple.com>
3355
3356         Reviewed by NOBODY (Build Fix!)
3357
3358         * icon/SiteIcon.cpp:
3359         (SiteIcon::getImage):
3360         Release build made an "unused variable" warning, which is, of course, an error.  fixed that.
3361
3362 2006-07-10  Brady Eidson  <beidson@apple.com>
3363
3364         Reviewed by Maciej
3365
3366         SQLite Icon DB now fully replicates functionality of the old DB, including pruning to keep unused
3367         information out to keep down disk usage.  For now, it is still off by default, as the critical
3368         feature of importing old icons into the new DB is still unrealized.
3369         If you'd like to test, add #define ICONDEBUG to your WebKitPrefix.h
3370
3371         * icon/IconDatabase.cpp:
3372         (WebCore::IconDatabase::IconDatabase):
3373         (WebCore::IconDatabase::open):
3374           -Sets up a timer for initial pruning
3375         (WebCore::IconDatabase::iconForPageURL):
3376           -Switched away from "dirty blob hack" as the problem is provisionally solved
3377         (WebCore::IconDatabase::retainIconForURL):
3378         (WebCore::IconDatabase::releaseIconForURL):
3379           -Same as found in WebKit
3380         (WebCore::IconDatabase::totalRetainCountForIconURL):
3381           -Adds up all retainers of icon
3382         (WebCore::IconDatabase::forgetIconForIconURLFromDatabase):
3383           -Wipes an Icon table entry out
3384         (WebCore::IconDatabase::establishTemporaryIconIDForIconURL):
3385         (WebCore::IconDatabase::establishTemporaryIconIDForEscapedIconURL):
3386         (WebCore::IconDatabase::establishIconIDForIconURL):
3387         (WebCore::IconDatabase::establishIconIDForEscapedIconURL):
3388           -Added ability to get an iconID without creating a new one if a lookup is all
3389            that is genuinely wanted
3390         (WebCore::IconDatabase::pruneUnreferencedIcons):
3391         (WebCore::IconDatabase::pruneUnretainedIcons):
3392           -Called on a timer on DB startup to clean it out
3393         * icon/IconDatabase.h:
3394         * icon/SiteIcon.cpp:
3395         (SiteIcon::SiteIcon):
3396         (SiteIcon::~SiteIcon):
3397           -Deletes the image on deletion
3398         (SiteIcon::getImage):
3399           -Cut down on no-longer-necessary debug info
3400
3401 2006-07-10  Anders Carlsson  <acarlsson@apple.com>
3402
3403         Reviewed by Adele.
3404
3405         http://bugzilla.opendarwin.org/show_bug.cgi?id=9245
3406         Quirksmode: Incorrect handling of disabled BUTTON elements
3407
3408         * html/HTMLButtonElement.cpp:
3409         (WebCore::HTMLButtonElement::defaultEventHandler):
3410         Don't call prepareSubmit if the element is disabled.
3411
3412         * html/HTMLInputElement.cpp:
3413         (WebCore::HTMLInputElement::defaultEventHandler):
3414         Don't call prepareSubmit if the element is disabled.
3415
3416 2006-07-10  Darin Adler  <darin@apple.com>
3417
3418         - try to fix Windows build
3419
3420         * platform/win/TemporaryLinkStubs.cpp: Put a few functions in the WebCore namespace.
3421         * platform/gdk/TemporaryLinkStubs.cpp: Ditto.
3422
3423 2006-07-10  Darin Adler  <darin@apple.com>
3424
3425         Reviewed by Geoff.
3426
3427         - fix failures seen in layout tests
3428
3429         * bindings/js/kjs_dom.cpp: (KJS::toJS): Restore one of the few WebCore:: prefixes
3430         that really needed to be there -- because we have two classes named JSHTMLDocument
3431         at the moment! (One in KJS and one in WebCore namespace.)
3432
3433 2006-07-10  Darin Adler  <darin@apple.com>
3434
3435         - try to fix Windows build
3436
3437         * rendering/RenderLayer.h: Correct a forward declaration of ScrollBar.
3438
3439 2006-07-09  Adele Peterson  <adele@apple.com>
3440
3441         Reviewed by Maciej.
3442
3443         Fix for <rdar://problem/4463835> Switch to use new popup menu implementation for <select>
3444
3445         * css/html4.css: Added style for new selects, and for list boxes.
3446         * html/HTMLSelectElement.h: (WebCore::HTMLSelectElement::shouldUseMenuList): Removed check for appearance so new popups can be styled.
3447    
3448         * rendering/RenderMenuList.cpp:
3449         (WebCore::RenderMenuList::setStyle): Removed padding.  This is now set by the theme.
3450         (WebCore::RenderMenuList::calcMinMaxWidth): Now takes minimum text size into account.
3451         * rendering/RenderMenuList.h: Removed baselinePosition since we're letting the theme calculate that.
3452
3453         * rendering/RenderTheme.cpp: (WebCore::RenderTheme::isControlContainer): Added menuList as a ControlContainer, 
3454         so RenderThemeMac will compute its baseline.
3455         * rendering/RenderTheme.h: (WebCore::RenderTheme::minimumTextSize): Added.
3456         * rendering/RenderThemeMac.h: Added minimumTextSize, setPopupPaddingFromControlSize, popupButtonSizes, popupButtonMargins, popupButtonPadding.
3457         Removed sizeOfArrowControl. 
3458         * rendering/RenderThemeMac.mm:
3459         (WebCore::): Added enum for padding.
3460         (WebCore::RenderThemeMac::adjustRepaintRect): Now inflates rect to account for control shadow.
3461         (WebCore::RenderThemeMac::baselinePosition): Now calculates baseline for menulist.
3462         (WebCore::RenderThemeMac::popupButtonMargins): Tweaked values.
3463         (WebCore::RenderThemeMac::popupButtonSizes): Added.
3464         (WebCore::RenderThemeMac::popupButtonPadding): Added, so different padding can be set for different control sizes.
3465         (WebCore::RenderThemeMac::setPopupPaddingFromControlSize): Added.
3466         (WebCore::RenderThemeMac::paintMenuList): Now inflates rect to account for control shadow.
3467         (WebCore::RenderThemeMac::adjustMenuListStyle): Resets border, sets padding, sets control size.
3468         (WebCore::RenderThemeMac::setPopupButtonCellState): Removed unnecessary class name.
3469         (WebCore::RenderThemeMac::minimumTextSize): Added.
3470
3471 2006-07-09  Darin Adler  <darin@apple.com>
3472
3473         - add back "unused code" for plain text fields, still used by <isindex>!
3474
3475         * platform/TextField.h:
3476         * platform/mac/TextFieldMac.mm:
3477         * platform/mac/WebCoreTextField.h:
3478         * platform/mac/WebCoreTextField.mm:
3479         * rendering/RenderLineEdit.cpp:
3480
3481 2006-07-09  Darin Adler  <darin@apple.com>
3482
3483         Reviewed by Tim Hatcher.
3484
3485         - put more into the WebCore namespace
3486         - removed unused code for plain text fields
3487
3488         Put more classes, class templates, enums, functions, and constants into
3489         the WebCore namespace, including all the headers in the platform directory.
3490
3491         Removed lots of unneeded "WebCore::" qualifiers and "using" directives.
3492
3493         Added some "WebCore::" qualifiers in a few places.
3494
3495         Removed "uses WebCore::" in headers that we said we'd remove "when
3496         everything is in the WebCore namespace".
3497
3498         * bindings/js/JSDOMParser.cpp:
3499         * bindings/js/JSHTMLElementWrapperFactory.cpp:
3500         * bindings/js/JSXSLTProcessor.cpp:
3501         * bindings/js/kjs_binding.cpp:
3502         * bindings/js/kjs_css.cpp:
3503         * bindings/js/kjs_dom.cpp:
3504         * bindings/js/kjs_dom.h:
3505         * bindings/js/kjs_events.cpp:
3506         * bindings/js/kjs_proxy.h:
3