Dyskusja:Firefox 3 dla programistów
z Mozilla Developer Center, polskiego centrum programistów Mozilli.
[edytuj] Poprzednia zawartość artykułu
Przeniosłem zawartość tymczasowo w związku z całkowitą zmianą formy artykułu na en MDC. Informacje zostawiam na razie informacyjnie! Cała zawartość znajdująca się za linia to poprzednia treść strony Firefox 3 dla programistów.
[edytuj] Dla programistów stron i aplikacji sieciowych
Zobacz: Zmiany w Gecko 1.9 wpływające na wyświetlanie stron Pomóż w tłumaczeniu!
[edytuj] HTML basics
- Potencjalna obawa związana z bezpieczeństwem elementów <FRAME> i <IFRAME> została poprawiona; ramki nie dziedziczą już systemu kodowania znaków rodzica, o ile zarówno rodzic jak i ramka pochodzą z tego samego serwera. Zobacz błąd 35620.
[edytuj] Web Applications 1.0
Mark Finkle (mfinkle in #devmo) is leading the documentation work on Web Applications 1.0.
- Eksperymentalnie obsługa
<a ping>(błąd 319368, aktualna specyfikacja)
- You can now register web applications as protocol handlers using the
navigator.registerProtocolHandler()method. - WHATWG Obsługa zdarzeń Online/Offline are now supported, allowing applications and extensions to detect whether there's an active Internet connection available or not.
- APIs for alternate style sheets (błąd 200930)
getElementsByClassName()DOM method is now supported.<canvas>element improvements:-
transform()andsetTransform()methods support (błąd 357450, current spec) - Non-standardized API for drawing text introduced; see Drawing text using a canvas
-
contentEditablesupport (aktualna specyfikacja)- Drag and Drop events are now supported błąd 375681
- Focus management APIs are now supported błąd 337631 spec
[edytuj] Offline resources
Implementation is in progress - see błąd 367447 and dependencies. Spec in progress is at [1].
offlineResources(błąd 372970)isLocallyAvailable(błąd 373231pendingOfflineLoads(błąd 372969- błąd 371432 Need an API to store
<input type="file">data offline and access when online.fileList- nsIDOMFile
XMLHttpRequest.sendAsBinary
[edytuj] Cross-site XMLHttpRequest
- błąd 389508 Implement Cross-site XMLHttpRequest
[edytuj] CSS
Eric Shepherd (sheppy na #devmo) jest osobą prowadzącą dokumentację CSS dla Firefoksa 3.
- Własność
font-size-adjustdziała na wszystkich platformach; wcześniej była obsługiwana tylko pod Windows. - Wartości
inline-blockiinline-tablewłasnościdisplayzostały zaimplementowane. - Obsługuje wartość koloru
rgba()ihsla()(błąd 147017) :defaultobsługuje pseudo-klasę (błąd 302186)- Wartości
-moz-intrinsic,-moz-min-intrinsic,-moz-shrink-wrapi-moz-fillzostały dodane dowidth,min-widthimax-width(błąd 311415) - HTML soft hyphens (
­) are now supported. - Preformatted tabs work much better in proportional fonts, following the CSS 2.1 spec.
- Własność
ime-modejest obsługiwana. - Dodano obsługę własności CSS "text-rendering" dla języka HTML (błąd 387969)
- Własności CSS -moz-border-*-start i -moz-border-*-end zostały zaimplementowane (błąd 74880)
- implemented
-moz-initialfor almost all remaining CSS properties (opróczquotesi-moz-border-*-colors) błąd 80887 - made window.getComputedStyle support all supported CSS properties (błąd 316981)
-
content'snonevalue is now supporetd błąd 378535
[edytuj] DOM
- zaimplementowane zostały rozszerzenia IE
clientTopiclientLeft. - The
window.fullScreenproperty is now always accurate no matter where it is read, even in content. Previously it would returnfalseinaccurately (błąd 127013). - The
getClientRectsandgetBoundingClientRectDOM extensions are now supported (błąd 174397).
[edytuj] JavaScript
- obsługa dla JavaScript 1.8 is in progress (błąd 380236). John Resig will be leading documentation work on this topic.
- Everything that has been implemented is already documented on the JavaScript 1.8 page.
- Zobacz także post ma blogu, aby uzyskać dodatkowe informacje.
[edytuj] XSLT/XPath
- Obsługuje
node-set(błąd 193678, specyfikacja) - Obsługuje wyrażenia regularne (błąd 354886, specyfikacja)
[edytuj] SVG
- obsługuje element
foreignObject(błąd 326966, specyfikacja, zobacz także) - obsługuje element
pattern(specyfikacja) - obsługuje element
mask(specyfikacja) - obsługuje filtry SVG (specyfikacja)
filterfeDistantLightfePointLightfeSpotLightfeBlendfeColorMatrixfeConvolveMatrixfeComponentTransfer,feFuncR,feFuncG,feFuncB,feFuncAfeCompositefeConvolveMatrixfeDiffuseLightingfeDistantLightfeFloodfeGaussianBlurfeMerge,feMergeNodefeMorphologyfeOffsetfePointLightfeSpecularLightingfeTurbulencefeTile
<a>element handling in SVG has had several bugs fixed; see błąd 267664, błąd 268135, błąd 316248, błąd 317270 and błąd 320724.- zostały zaimplementowane metody DOM w SVG
getNumberOfChars(),getComputedTextLength(),getSubStringLength(),getStartPositionOfChar(),getEndPositionOfChar(),getRotationOfChar()igetCharNumAtPosition(). - the
xml:spaceattribute support (spec) - fallback
fill/strokeare now supported (spec) -
emandexunits are now supported for indicating lengths (błąd 305859).
[edytuj] Obrazki
- Obsługuje animowane obrazki PNG (APNG) (specyfikacja)
[edytuj] Cookies
- The
HttpOnlyextension attribute is now supported (błąd 178993); this was also added to Firefox 2.0.0.5. This attribute can be used to prevent certain types of cross-site scripting attacks.
[edytuj] Dla programistów rozszerzeń w języku XUL
[edytuj] XUL
[edytuj] Nowe elementy XUL
Mark Finkle (mfinkle na #devmo) jest prowadzącym dokumentację nowych elementów w języku XUL.
XUL w Firefoksie 3 obsługuje wiele nowych elementów:
- Został dodany element
<scale>do tworzenia suwaków skali używanych do wyboru pomiędzy wartościami. Ten widget będzie typowo używany, na przykład, do tworzenia regulacji głośności. Więcej informacji o elemencie scale Dokumentacja elementu scale(błąd 290255) - Nowa wartość
numberdla atrybututypeelementu textbox powoduje, że do tak utworzonego pola będzie można wprowadzić tylko liczby. W dodatku, przyciski ze strzałkami pojawią się z boku pola, pozwalając na łatwą zmianę wprowadzonej wartości. Dodatkowe informacje o numeric textboxes (błąd 345510) - Został dodany element
<dropmarker>, przydatny podczas tworzenia widgetów w formie menu stosując wiązania XBL. (błąd 348614) - Został dodany element
<spinbuttons>, który może zostać wykorzystany podczas tworzenia widgetów stosując wiązania XBL. (błąd 155053) - Dwa widgety,
<datepicker>i<timepicker>, mogą być użyte do umożliwienia wprowadzania daty i czasu. Różne style elementu datepicker, dostępne poprzez ustawienie atrybututype, umożliwiające wprowadzanie dat stosując pól tekstowych lub siatki kalendarza. Dodatkowe informacje o date pickers Dokumentacja elementu datepicker Dokumentacja elementu timepicker - the
<panel>element is new and designed for popups that are not menus. They can support any type of content. The <menupopup> element should be used for menus. Menus provide keyboard navigation and support opening and closing submenus.
[edytuj] Poprawa drzewa (Tree Improvements)
- Drzewa obsługują teraz przewijanie poziome. Jeśli kolumny nie będą dopasowane do dostępnej szerokości pojawi się poziomy scrollbar. This will occur if the columns have specified widths which add up to more than the space available. (błąd 212789)
- nowy styl selection allows cells to be selected individually, instead of entire rows. This may be used by setting the
seltypeattribute on a tree to'cell'. (błąd 296040) - drzewa obsługują teraz edycję pojedynczych komórek. Podwójne-kliknięcie na edytowalnej komórce wyświetli pole tekstowe w którym użytkownik może edytować zawartość. Dodatkowe informacje (błąd 201499)
- elementy <treecol> obsługują teraz atrybut
overflow, który może mieć wartość "true", aby pozwolić tekstom w komórkach w danej kolumnie zajmować przestrzeń w sąsiednich pustych komórkach jeśli tekst jest zbyt duży by zmieścić się w swojej komórce.
[edytuj] Poprawa menu (Menu Improvements)
Zrobiono kilka poprawek w elementach <menu> i <menulist> (błąd 333023):
- the
imageattribute is used consistently for setting images - menulists fire the select event when selecting an item
inputFieldandeditableproperties have been added to menulist- the
<menu>,<menuitem>and<menuseparator>elements now have a readonlyselectedproperty which retrieves whether the item is selected in a <menulist> - the
<menu>,<menuitem>and<menuseparator>elements now have a readonlycontrolproperty which returns the enclosing <menulist> - the
<menu>,<menuitem>and<menuseparator>elements now support theaccessKey,disabled,crop,imageandlabelproperties which set the corresponding attribute - the <menu> element now has methods to append, insert and remove menuitems. (błąd 372552)
- supports an
editorproperty to get the internal nsIEditor for the text field of an editable menulist.(błąd 312867) - menus may now be made translucent on platforms that support it. (błąd 70798)
[edytuj] Poprawa pól tekstowych (Textbox Improvements)
- setting the
spellcheckattribute to'true'on a textbox will enable inline spellchecking for that textbox. (błąd 346787) - the
<textbox>now has areset()method to reset the value of the textbox to the default value. ThedefaultValueproperty may be used to retrieve and modify the default value of the textbox. (błąd 312867) - supports an
editorproperty to get the internal nsIEditor for the text field. (błąd 312867) - textbox now supports a
newlinesattribute which specifies how line breaks in pasted text are handled. (błąd 253481) Possible values are:pasteintact- paste everything as ispastetofirst- (default value) paste only up to the first line breakreplacewithspaces- replace line breaks with spacesreplacewithcommas- replace line breaks with commasstrip- strip out all line breaksstripsurroundingwhitespace- strip out all line breaks and surrounding whitespace
[edytuj] Poprawa innych elementów
- the
typeattribute on a<button>may be set to'repeat'to create buttons which fire their command event repeatedly while the mouse button is held down. (błąd 331055) - the
buttondisabledacceptattribute can now be used on the<dialog>element to have the accept (OK) button initially disabled. (błąd 247849) - the
<titlebar>element now supports thealloweventsattribute to allow events to be passed to the children of the titlebar. (błąd 361425) - the
<splitter>now supports an additional value for thecollapseattribute of'both'which indicates that the splitter can collapse elements on both sides of it when dragged. Thesubstateattribute will set to either before or after when one is collapsed. (błąd 337955) - The
<richlistbox>element now supports multiple selection. Set theseltypeattribute to'multiple'to enable this. - The
<radio>element has agroupattribute which may be set to the id of a<radiogroup>element which the radio button belongs to. This allows the radio buttons to arranged in a manner that may not be as suitable when placing them all inside a radiogroup. - Menus, panels and tooltips support two additional methods,
openPopupandopenPopupAtScreen. These methods should be used instead ofshowPopupwhich was found to be confusing to use.
[edytuj] Zmiany szablonów (Template)
Templates have been significantly improved in Firefox 3. The key improvement allows the use of custom query processors to handle other types of datasources besides RDF. A new query syntax makes this possible. A full description of the new features available for templates is available. (błąd 285631)
Inne poprawki szablonu:
- relational conditions have been added to allow for more precise control over what results match a rule. This allows, for example, matching of results that start or end with certain strings, or that are before or after other values.
- a flag 'dont-recurse' has been added to prevent recursion for happening such that only one level of results are generated
- APIs have been added to the template builder to retrieve a result object representing an output item.
- the XUL sort service is more robust and sorts both content and non-content trees better. It also allows sorting of non-template built content. (błąd 335122)
[edytuj] Inne zmiany
- JavaScript 1.8 is the default for XUL scripts and for JavaScript components. This may break the scripts that use keywords like
letas identifier names.
[edytuj] XBL
You may now use data: URLs to embed XBL bindings directly instead of having to load them from separate XML files; see this documentation about [binding] for details (błąd 366770).
[edytuj] Add-on manager
[edytuj] Localizing add-ons metadata
Firefox 3 supports a new method for localizing add-on metadata. This allows the localized details to be available as soon as the add-on has been downloaded and when the add-on is disabled as well as potentially improving matters for addons.mozilla.org.
See Localizing extension descriptions for the full details.
[edytuj] Toolkit target application for add-ons
Firefox 3 (and any Gecko 1.9 based application) allows you to specify a targetApplication entry with id toolkit@mozilla.org anywhere where you would specify the application's actual id (install.rdf, update.rdf). This allows you to say that the add-on is compatible with any toolkit app. The related minVersion and maxVersion are compared to the application's toolkit version (e.g. 1.9 for Firefox 3).
[edytuj] Security restrictions for add-ons
Add-ons are now required to provide a secure method of updating in order to be installed. Add-ons hosted at addons.mozilla.org automatically provide this. Read Securing Updates for more information.
[edytuj] Other platform functionality
[edytuj] Events
- Some events that were not previously are now reflected as attributes, such as 'onscroll'. Attributes are now available for the scroll, resize, DOMMouseScroll, DOMFocusIn, DOMFocusOut events as well as for the various mutation events.
- Two new drag related events are available. The
dragevent is fired on the source element during the drag. Thedragendevent is fired on the source node when a drag is complete.
[edytuj] Full page zoom
The nsIMarkupDocumentViewer interface now includes support for full page zoom as well as text zoom. (błąd 4821)
[edytuj] Usługa usługi oczekiwania (Idle service)
Została wprowadzona nowa usługa mająca na celu sprawdzanie jak długo użytkownik był nieaktywny, czyli nie poruszał myszką ani nie używał klawiatury. Ta usługa uzupełnia interfejs nsIIdleService (błąd 343416)
[edytuj] XPCOM
[edytuj] XPCOM cycle collector
- See Interfacing with the XPCOM cycle collector (should get graydon to look at it)
- See Global nsICycleCollector service (outdated: design document)
- błąd 333078
- Using XPCOM in JavaScript without leaking should be updated
- Implementing cycle collector participant in external code ([2], błąd 386025)
[edytuj] Base64 conversion in JavaScript components
Two new global functions have been added for use by JavaScript XPCOM components: Atob() and Btoa(). These function identically to the DOM functions by the same names (see atob() and btoa() for details).
[edytuj] XPCSafeJSObjectWrapper
XPConnect now exposes the XPCSafeJSObjectWrapper JavaScript class, which is used to wrap XPCNativeWrapper.wrappedJSObject to provide improved security (błąd 355766. In addition, the sandbox now provides several new methods to support this.
Should update the XPCNativeWrapper page, link the "several new methods" from here.
[edytuj] Thread manager
[edytuj] JavaScript modules (Components.import)
Components.utils.import can now be used for sharing code among different scopes.
Some modules are shipped with Firefox and other applications:
- XPCOMUtils.jsm (simplifies boilerplate in XPCOM components)
- JSON.jsm
[edytuj] Removed interfaces
Certain interfaces have been removed from Gecko in version 1.9:
-
nsIDOMPaintListener -
nsIDOMScrollListener -
nsIDOMMutationListener -
nsIDOMPageTransitionListener
Code that makes use of any of these interfaces will need to be updated.
[edytuj] New and changed Firefox APIs
[edytuj] Miejsca
- History and Bookmarks API comparison to Fx2
- Annotations
- Querying History, Bookmarks and Annotations
- History and Bookmarks Events
- Sync
- Places Widgets
Przejdź na stronę Miejsca, aby dowiedzieć się więcej.
[edytuj] Menedżer pobierania plików
- The Download Manager API has been enhanced with new features, including support for multiple progress listeners. In addition, the Download Manager now uses mozStorage instead of RDF for its data management back-end. See
nsIDownloadManager,nsIDownload, andnsIDownloadProgressListenerfor detailed API references, and see Monitoring downloads for an example.- Back-end converted from RDF to mozStorage (resulted in an API change for nsIDownloadManager and nsIDownload). (błąd 380250)
- Download Manager can now support more than one progress listener. (błąd 289540)
- retryDownload method added to Download Manager (błąd 382825)
- getDownload method now returns downloads from the past as well as active ones. (błąd 382839)
- See this page and this page for additional information.
- You may now augment or replace the Download Manager user interface by implementing the
nsIDownloadManagerUIinterface.
[edytuj] Menedżer haseł
The Password Manager has been replaced by the new Login Manager. For details, see the following articles:
[edytuj] Site-specific preferences
Firefox 3 includes a service for getting and setting arbitrary site-specific (a.k.a. per-site) preferences that extensions as well as core code can use to keep track of their users' preferences for individual sites.
[edytuj] Notable Bugs Fixed
- if an error occurs parsing an overlay, the overlay is not applied. Parse errors are logged to the error console. (błąd 355755)
- bug fixed where
<menupopup>elements can be placed inside a binding when attached to a menu or menu-like element. (błąd 345896) - the button's
dlgTypeproperty now works properly. (błąd 308591) - the
canBubbleargument to event.initEvent now works properly so that events can be fired which don't bubble. (błąd 330190) - the
DOMAttrModifiedevent now handles namespaced attributes properly. (błąd 247095) - XML processing instructions, such as
<?xml-stylesheet ?>, are now added to a XUL document's DOM. This meansdocument.firstChildisn't guaranteed to be the root element, usedocument.documentElementinstead. Also,<?xml-stylesheet ?>and<?xul-overlay ?>processing instructions now have no effect outside the document prolog. (błąd 319654) getElementsByAttributeNSfunctions have been added to XUL elements and documents. (błąd 239976)- event listeners are maintained when moving or removing an element from a XUL document. (błąd 286619)
- mutation events are now fired for non-displayed documents. (błąd 201238)
- various issues with elements drawing in the wrong order are fixed. (błąd 317375)
[edytuj] XPCOM Cycle Collector
[edytuj] Localizing Add-ons Metadata
Firefox 3 supports a new method for localizing add-on metadata. This allows the localized details to be available as soon as the add-on has been downloaded and when the add-on is disabled as well as potentially improving matters for addons.mozilla.org.
See Lokalizacja opisu rozszerzenia for the full details.
[edytuj] Site-Specific Preferences
Firefox 3 includes a service for getting and setting arbitrary site-specific (a.k.a. per-site) preferences that extensions as well as core code can use to keep track of their users' preferences for individual sites. More information is available in the feature plan.
[edytuj] XPCSafeJSObjectWrapper
XPConnect now exposes the XPCSafeJSObjectWrapper JavaScript class, which is used to wrap XPCNativeWrapper.wrappedJSObject to provide improved security. In addition, the sandbox now provides several new methods to support this.
[edytuj] Lista propozycji tytułów artykułów dot. Fx 3
Powyżej linii jest poprzednia treść strony Firefox 3 dla programistów. Poniżej lista propozycji tytułów poszczególnych artykułów. Kolejność w spisie:
Tytuł w wersji EN (odnośnik do wersji na MDC EN) -> Tytuł w wersji PL (odnośnik do wersji na MDC PL)
Dla programistów stron i aplikacji sieciowych http://developer.mozilla.org/en/docs/Updating_web_applications_for_Firefox_3 -> Aktualizacja aplikacji sieciowych dla Firefoksa 3 http://developer.mozilla.org/en/docs/Online_and_offline_events -> Zdarzenia online i offline http://developer.mozilla.org/en/docs/Alternate_style_sheets (brak artykułu) -> http://developer.mozilla.org/en/docs/DOM:window.navigator.registerProtocolHandler -> Web-based protocol handlers ? http://developer.mozilla.org/en/docs/Drawing_text_using_a_canvas -> http://developer.mozilla.org/en/docs/Canvas_tutorial:Transformations#Transforms -> http://developer.mozilla.org/en/docs/Using_microformats -> http://developer.mozilla.org/en/docs/Drag_and_drop_events -> http://developer.mozilla.org/en/docs/Focus_management_in_HTML -> http://developer.mozilla.org/en/docs/Offline_resources_in_Firefox (brak artykułu) -> Zawartość offline w Firefox http://developer.mozilla.org/en/docs/CSS_improvements_in_Firefox_3 -> Poprawki CSS w Firefoksie 3 http://developer.mozilla.org/en/docs/DOM_improvements_in_Firefox_3 -> Poprawki DOM w Firefoksie 3 http://developer.mozilla.org/en/docs/New_in_JavaScript_1.8 -> Obsługa JavaScript 1.8 http://developer.mozilla.org/en/docs/EXSLT -> EXSLT http://developer.mozilla.org/en/docs/SVG_improvements_in_Firefox_3 -> Poprawki SVG w Firefoksie 3 http://developer.mozilla.org/en/docs/Animated_PNG_graphics -> Animowane grafiki PNG http://developer.mozilla.org/en/docs/HTML:Element:a support -> Obsługa [<a ping>] Dla programistów rozszerzeń i XUL-a http://developer.mozilla.org/en/docs/Updating_extensions_for_Firefox_3 -> Aktualizacja rozszerzeń dla Firefoksa 3 http://developer.mozilla.org/en/docs/FUEL -> FUEL http://developer.mozilla.org/en/docs/XUL_improvements_in_Firefox_3 -> http://developer.mozilla.org/en/docs/Templates_in_Firefox_3 -> http://developer.mozilla.org/en/docs/XBL:XBL_1.0_Reference:Elements#binding -> http://developer.mozilla.org/en/docs/Localizing_extension_descriptions -> Lokalizacja opisu rozszerzenia http://developer.mozilla.org/en/docs/Extension_Versioning%2C_Update_and_Compatibility#Securing_Updates -> http://developer.mozilla.org/en/docs/nsIIdleService -> nsIIdleService http://developer.mozilla.org/en/docs/Using_nsILoginManager -> Zastosowanie nsILoginManager http://developer.mozilla.org/en/docs/Full_page_zoom -> http://developer.mozilla.org/en/docs/Interfacing_with_the_XPCOM_cycle_collector -> http://developer.mozilla.org/en/docs/The_thread_manager (brak artykułu) -> http://developer.mozilla.org/en/docs/JavaScript_modules -> Moduły JavaScript http://developer.mozilla.org/en/docs/Places -> Miejsca http://developer.mozilla.org/en/docs/Making_the_transition_to_Places (brak artykułu) -> http://developer.mozilla.org/en/docs/Download_Manager_improvements_in_Firefox_3 -> http://developer.mozilla.org/en/docs/Using_nsILoginManager -> Zastosowanie nsILoginManager http://developer.mozilla.org/en/docs/Using_content_preferences -> http://developer.mozilla.org/en/docs/Notable_bugs_fixed_in_Firefox_3 ->
W dalszej części artykułu znajdują się ogólne informacje dla użytkowników końcowych aplikacji.