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