Reviewed by Tim Hatcher (earlier version).
[WebKit-https.git] / WebCore / ChangeLog
1 2006-05-11  Darin Adler  <darin@apple.com>
2
3         Reviewed by Tim Hatcher (earlier version).
4
5         - http://bugzilla.opendarwin.org/show_bug.cgi?id=8821
6           use the preprocessor for IDL files
7
8         * bindings/scripts/IDLParser.pm: Invoke the preprocessor via the "gcc"
9         driver script, passing "-E" so we only preprocess, "-P" so we don't get
10         "#line" directives, and "-x c++" so we handle both C and C++ comments.
11         Removed the code to eliminate comments since the preprocessor handles that.
12         * css/make-css-file-arrays.pl: This already invoked the preprocessor, but
13         updated it to do the same way as above.
14
15 2006-05-11  Anders Carlsson  <acarlsson@apple.com>
16
17         Reviewed by Darin.
18
19         http://bugzilla.opendarwin.org/show_bug.cgi?id=7838
20         Add support for mozilla-style node constructors as properties of the window object
21         
22         * DerivedSources.make:
23         * WebCore.xcodeproj/project.pbxproj:
24         Add new generated files.
25         
26         * bindings/js/JSCanvasRenderingContext2DBase.cpp:
27         (WebCore::JSCanvasRenderingContext2DBaseProtoFunc::callAsFunction):
28         * bindings/js/JSHTMLElementWrapperFactory.cpp:
29         (WebCore::createJSWrapper):
30         Specify the KJS namespace for JSHTMLElmement.
31                 
32         * bindings/js/kjs_dom.cpp:
33         (KJS::toJS):
34         Create a WebCore::JSHTMLDocument for document nodes. Also, create
35         JSDocumentFragments for document fragments (instead of plain node objects).
36         
37         * bindings/js/kjs_html.cpp:
38         (KJS::JSHTMLDocumentProtoFunc::callAsFunction):
39         (KJS::JSHTMLDocument::JSHTMLDocument):
40         (KJS::JSHTMLDocument::getOwnPropertySlot):
41         Add a prototype for JSHTMLDocument and move all functions there.
42         
43         (KJS::JSHTMLElement::JSHTMLElement):
44         (KJS::JSHTMLElement::getOwnPropertySlot):
45         Update since JSHTMLElement now inherits from WebCore::JSHTMLElement.
46         
47         (KJS::JSHTMLElement::getValueProperty):
48         (KJS::JSHTMLElement::putValueProperty):
49         Remove title setter and getter. Those are autogenerated now.
50         
51         * bindings/js/kjs_html.h:
52         (KJS::JSHTMLElement::):
53         Inherit from WebCore::JSHTMLElement. Clarify the inheritance chain.
54         
55         * bindings/scripts/CodeGeneratorJS.pm:
56         Always generate a prototype object, regardless of whether the object has any functions or
57         constants.
58         
59         Use the type of generator attributes to determine what constructor to use. This is useful for
60         the XMLDocument property in DOMWindow.idl, since that's just an alias for the Document constructor.
61         
62         * dom/DocumentFragment.idl: Added.        
63         * html/HTMLDocument.idl: Added.
64         * html/HTMLElement.idl: Added.
65         
66         * page/DOMWindow.idl:
67         Add constructors for DocumentFragment, HTMLElement, HTMLDocument and XMLDocument. XMLDocument is just
68         an alias for the Document constructor.
69         
70 2006-05-11  David Hyatt  <hyatt@apple.com>
71
72         Bug 8845.  Define a TextRun (similar to the old WebCoreTextRun) and
73         make it the new API for Font and GraphicsContext when drawing/measuring
74         text.
75
76         Reviewed by andersca
77
78         * platform/Font.cpp:
79         (WebCore::m_finalRoundingWidth):
80         (WebCore::WidthIterator::advance):
81         (WebCore::WidthIterator::normalizeVoicingMarks):
82         (WebCore::Font::width):
83         (WebCore::Font::canUseGlyphCache):
84         (WebCore::Font::drawSimpleText):
85         (WebCore::Font::drawText):
86         (WebCore::Font::floatWidth):
87         (WebCore::Font::floatWidthForSimpleText):
88         * platform/Font.h:
89         (WebCore::TextRun::m_to):
90         (WebCore::TextRun::operator[]):
91         (WebCore::TextRun::data):
92         (WebCore::TextRun::adjustFrom):
93         (WebCore::TextRun::adjustTo):
94         (WebCore::TextRun::characters):
95         (WebCore::TextRun::length):
96         (WebCore::TextRun::from):
97         (WebCore::TextRun::to):
98         * platform/GraphicsContext.cpp:
99         (WebCore::GraphicsContext::drawText):
100         (WebCore::GraphicsContext::drawHighlightForText):
101         * platform/GraphicsContext.h:
102         * platform/mac/FontMac.mm:
103         (WebCore::addDirectionalOverride):
104         (WebCore::overrideLayoutOperation):
105         (WebCore::ATSULayoutParameters::initialize):
106         (WebCore::Font::selectionRectForText):
107         (WebCore::Font::drawComplexText):
108         (WebCore::Font::drawHighlightForText):
109         (WebCore::Font::floatWidthForComplexText):
110         (WebCore::Font::checkSelectionPoint):
111         * platform/win/FontWin.cpp:
112         (WebCore::hackishExtentForString):
113         (WebCore::Font::floatWidth):
114         (WebCore::Font::drawText):
115         (WebCore::Font::drawHighlightForText):
116         (WebCore::Font::selectionRectForText):
117         (WebCore::Font::checkSelectionPoint):
118         * rendering/InlineTextBox.cpp:
119         (WebCore::InlineTextBox::selectionRect):
120         (WebCore::InlineTextBox::paint):
121         (WebCore::InlineTextBox::paintSelection):
122         (WebCore::InlineTextBox::paintMarkedTextBackground):
123         (WebCore::InlineTextBox::paintTextMatchMarker):
124         (WebCore::InlineTextBox::offsetForPosition):
125         (WebCore::InlineTextBox::positionForOffset):
126         * rendering/RenderBlock.cpp:
127         (WebCore::stripTrailingSpace):
128         * rendering/RenderFlexibleBox.cpp:
129         (WebCore::RenderFlexibleBox::layoutVerticalBox):
130         * rendering/RenderImage.cpp:
131         (WebCore::RenderImage::imageChanged):
132         (WebCore::RenderImage::paint):
133         * rendering/RenderText.cpp:
134         (WebCore::RenderText::cacheWidths):
135         (WebCore::RenderText::widthFromCache):
136         (WebCore::RenderText::trimmedMinMaxWidth):
137         (WebCore::RenderText::calcMinMaxWidth):
138         (WebCore::RenderText::width):
139         * rendering/RenderTextField.cpp:
140         (WebCore::RenderTextField::calcMinMaxWidth):
141         * rendering/bidi.cpp:
142         (WebCore::RenderBlock::tabWidth):
143         (WebCore::RenderBlock::checkLinesForTextOverflow):
144         * rendering/render_line.cpp:
145         (WebCore::EllipsisBox::paint):
146         * rendering/render_list.cpp:
147         (WebCore::RenderListMarker::paint):
148         (WebCore::RenderListMarker::calcMinMaxWidth):
149         (WebCore::RenderListMarker::getRelativeMarkerRect):
150
151 2006-05-10  Justin Garcia  <justin.garcia@apple.com>
152
153         Reviewed by darin
154
155         * editing/ReplaceSelectionCommand.cpp:
156         (WebCore::ReplaceSelectionCommand::doApply):
157         Removed the code to find out if we must later add smart replace whitespace.  We can 
158         wait until we've done the insertion to figure it out, and the position sampled (startPos)
159         to make the decision about trailing whitespace was wrong.
160         Changed the order that work is done during a paste: 1) Insert everything 2) Do one of
161         the following: a) handle a trailing interchange newline, b) uncollapse the last incoming
162         br if it has been collapsed because of quirks mode, c) do an end merge 3) Add smart replace
163         whitespace (2 and 3 were reversed because the end merge must happen before we can know
164         whether or not we need to add a trailing space).
165         Don't do an end merge if the last node inserted was a br because the end merge will 
166         clobber it.
167         
168         (WebCore::ReplaceSelectionCommand::removeEndBRIfNeeded):
169         brs where [br, 0] is at the end of a block and not at the start of the paragraph
170         are the ones that are collapsed because of quirks mode.
171
172 2006-05-10  David Hyatt  <hyatt@apple.com>
173
174         Rename isSpace to treatAsSpace.  Move it and the rounding hack function into
175         Font and make them static methods (inlined in the header).  Make the rounding
176         hack character table a static member as well.  Remove the redundant space/rounding
177         functions from FontData.mm.
178
179         Reviewed by darin
180
181         * platform/Font.cpp:
182         (WebCore::):
183         (WebCore::m_finalRoundingWidth):
184         (WebCore::WidthIterator::advance):
185         * platform/Font.h:
186         (WebCore::Font::treatAsSpace):
187         (WebCore::Font::isRoundingHackCharacter):
188         * platform/mac/FontData.mm:
189         (WebCore::overrideLayoutOperation):
190         (WebCore::createATSULayoutParameters):
191         (WebCore::initializeWidthIterator):
192         (WebCore::advanceWidthIterator):
193         * platform/mac/FontMac.mm:
194         (WebCore::overrideLayoutOperation):
195         (WebCore::ATSULayoutParameters::initialize):
196
197 2006-05-10  Darin Adler  <darin@apple.com>
198
199         * WebCore: Removed an extra WebCore subtree that somehow got checked in.
200
201 >>>>>>> .r14297
202 2006-05-10  David Carson <dacarson@gmail.com>
203
204         - Fix for bug 8833. Removed inline keyword from functions declared
205         in .mm and .cpp files. inline function code needs to reside in the
206         header file for the linker to find the code. 
207         http://www.parashift.com/c++-faq-lite/inline-functions.html#faq-9.7
208
209         Reviewed by Darin, landed by Timothy.
210
211         * platform/Font.cpp:
212         (WebCore::isSpace):
213         * platform/mac/FontData.mm:
214         (WebCore::widthForGlyph):
215         (WebCore::isRoundingHackCharacter):
216         (WebCore::glyphForCharacter):
217
218 2006-05-10  Mitz Pettel  <opendarwin.org@mitzpettel.com>
219
220         Reviewed and landed by Anders.
221
222         - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=8830
223           REGRESSION: Words render on top of each other when fallback font is used
224
225         Already covered by several pixel tests in fast/text
226
227         * platform/Font.cpp:
228         (WebCore::Font::drawSimpleText):
229
230 2006-05-10  David Hyatt  <hyatt@apple.com>
231
232         Fix for bug 8809, lift the Mac-specific WebTextRenderer code for
233         drawing and measuring of runs up into the Font class.  The fast code
234         path is in Font.cpp and is designed to be mostly cross-platform.  The
235         slow code path is in FontMac.cpp and is Mac-specific.
236
237         Reviewed by darin
238
239         * WebCore.xcodeproj/project.pbxproj:
240         * platform/Font.cpp:
241         (WebCore::isSpace):
242         (WebCore::):
243         (WebCore::isRoundingHackCharacter):
244         (WebCore::m_finalRoundingWidth):
245         (WebCore::WidthIterator::advance):
246         (WebCore::WidthIterator::normalizeVoicingMarks):
247         (WebCore::Font::primaryFont):
248         (WebCore::Font::setAlwaysUseComplexPath):
249         (WebCore::Font::canUseGlyphCache):
250         (WebCore::Font::drawSimpleText):
251         (WebCore::Font::drawText):
252         (WebCore::Font::floatWidth):
253         (WebCore::Font::floatWidthForSimpleText):
254         * platform/Font.h:
255         * platform/FontData.h:
256         (WebCore::FontData::platformData):
257         * platform/GlyphBuffer.h: Added.
258         (WebCore::GlyphBuffer::GlyphBuffer):
259         (WebCore::GlyphBuffer::isEmpty):
260         (WebCore::GlyphBuffer::size):
261         (WebCore::GlyphBuffer::glyphs):
262         (WebCore::GlyphBuffer::advances):
263         (WebCore::GlyphBuffer::fontDataAt):
264         (WebCore::GlyphBuffer::swap):
265         (WebCore::GlyphBuffer::glyphAt):
266         (WebCore::GlyphBuffer::advanceAt):
267         (WebCore::GlyphBuffer::add):
268         * platform/mac/FontData.mm:
269         (WebCore::isSpace):
270         (WebCore::isRoundingHackCharacter):
271         (WebCore::FontData::widthForGlyph):
272         (WebCore::m_ATSUMirrors):
273         (WebCore::FontData::xHeight):
274         (WebCore::FontData::smallCapsFontData):
275         (WebCore::findSubstituteFont):
276         (WebCore::rendererForAlternateFont):
277         (WebCore::findSubstituteRenderer):
278         (WebCore::FontData::findSubstituteFontData):
279         (WebCore::computeWidthForSpace):
280         (WebCore::FontData::updateGlyphMapEntry):
281         (WebCore::extendGlyphMap):
282         (WebCore::extendWidthMap):
283         (WebCore::createATSULayoutParameters):
284         (WebCore::FontData::glyphForCharacter):
285         (WebCore::advanceWidthIterator):
286         (WebCore::shouldUseATSU):
287         * platform/mac/FontMac.mm:
288         (WebCore::ATSULayoutParameters::m_padPerSpace):
289         (WebCore::addDirectionalOverride):
290         (WebCore::initializeATSUStyle):
291         (WebCore::overrideLayoutOperation):
292         (WebCore::ATSULayoutParameters::initialize):
293         (WebCore::disposeATSULayoutParameters):
294         (WebCore::Font::drawComplexText):
295         (WebCore::Font::floatWidthForComplexText):
296         (WebCore::Font::drawGlyphs):
297         * platform/mac/WebCoreTextRenderer.mm:
298         (WebCoreSetAlwaysUseATSU):
299
300 2006-05-10  Darin Adler  <darin@apple.com>
301
302         - another try at fixing the Windows build
303
304         * platform/win/FontWin.cpp: (WebCore::getFontData): Use characters()
305         instead of unicode().
306
307 == Rolled over to ChangeLog-2006-05-10 ==