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