Visit Mozilla.org

Dyskusja:Firefox 3 dla programistów

z Mozilla Developer Center, polskiego centrum programistów Mozilli.

Spis treści

[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.

APIs for alternate style sheets moved to Cascading Style Sheets Object Model (currently Editor's draft)
Web Applications 1.0 (HTML5, XHTML5) jest wciąż opracowywany, nie jest to wersja końcowa dokumentacji.

[edytuj] Offline resources

Implementation is in progress - see błąd 367447 and dependencies. Spec in progress is at [1].

[edytuj] Cross-site XMLHttpRequest

[edytuj] CSS

Eric Shepherd (sheppy na #devmo) jest osobą prowadzącą dokumentację CSS dla Firefoksa 3.

  • Własność font-size-adjust działa na wszystkich platformach; wcześniej była obsługiwana tylko pod Windows.
  • Wartości inline-block i inline-table własności display zostały zaimplementowane.
  • Obsługuje wartość koloru rgba() i hsla()(błąd 147017)
  • :default obsługuje pseudo-klasę (błąd 302186)
  • Wartości -moz-intrinsic, -moz-min-intrinsic, -moz-shrink-wrap i -moz-fill zostały dodane do width, min-width i max-width (błąd 311415)
  • HTML soft hyphens (&shy;) are now supported.
  • Preformatted tabs work much better in proportional fonts, following the CSS 2.1 spec.
  • Własność ime-mode jest 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-initial for almost all remaining CSS properties (oprócz quotes i -moz-border-*-colors) błąd 80887
  • made window.getComputedStyle support all supported CSS properties (błąd 316981)
  • content's none value is now supporetd błąd 378535

[edytuj] DOM

[edytuj] JavaScript

[edytuj] XSLT/XPath

[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)
    • filter
    • feDistantLight
    • fePointLight
    • feSpotLight
    • feBlend
    • feColorMatrix
    • feConvolveMatrix
    • feComponentTransfer, feFuncR, feFuncG, feFuncB, feFuncA
    • feComposite
    • feConvolveMatrix
    • feDiffuseLighting
    • feDistantLight
    • feFlood
    • feGaussianBlur
    • feMerge, feMergeNode
    • feMorphology
    • feOffset
    • fePointLight
    • feSpecularLighting
    • feTurbulence
    • feTile
  • <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() i getCharNumAtPosition().
  • the xml:space attribute support (spec)
  • fallback fill/stroke are now supported (spec)
  • em and ex units are now supported for indicating lengths (błąd 305859).

[edytuj] Obrazki

[edytuj] Cookies

[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:

[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 seltype attribute 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 image attribute is used consistently for setting images
  • menulists fire the select event when selecting an item
  • inputField and editable properties have been added to menulist
  • the <menu>, <menuitem> and <menuseparator> elements now have a readonly selected property which retrieves whether the item is selected in a <menulist>
  • the <menu>, <menuitem> and <menuseparator> elements now have a readonly control property which returns the enclosing <menulist>
  • the <menu>, <menuitem> and <menuseparator> elements now support the accessKey, disabled, crop, image and label properties which set the corresponding attribute
  • the <menu> element now has methods to append, insert and remove menuitems. (błąd 372552)
  • supports an editor property 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 spellcheck attribute to 'true' on a textbox will enable inline spellchecking for that textbox. (błąd 346787)
  • the <textbox> now has a reset() method to reset the value of the textbox to the default value. The defaultValue property may be used to retrieve and modify the default value of the textbox. (błąd 312867)
  • supports an editor property to get the internal nsIEditor for the text field. (błąd 312867)
  • textbox now supports a newlines attribute which specifies how line breaks in pasted text are handled. (błąd 253481) Possible values are:
    • pasteintact - paste everything as is
    • pastetofirst - (default value) paste only up to the first line break
    • replacewithspaces - replace line breaks with spaces
    • replacewithcommas - replace line breaks with commas
    • strip - strip out all line breaks
    • stripsurroundingwhitespace - strip out all line breaks and surrounding whitespace

[edytuj] Poprawa innych elementów

  • the type attribute 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 buttondisabledaccept attribute can now be used on the <dialog> element to have the accept (OK) button initially disabled. (błąd 247849)
  • the <titlebar> element now supports the allowevents attribute to allow events to be passed to the children of the titlebar. (błąd 361425)
  • the <splitter> now supports an additional value for the collapse attribute of 'both' which indicates that the splitter can collapse elements on both sides of it when dragged. The substate attribute will set to either before or after when one is collapsed. (błąd 337955)
  • The <richlistbox> element now supports multiple selection. Set the seltype attribute to 'multiple' to enable this.
  • The <radio> element has a group attribute 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, openPopup and openPopupAtScreen. These methods should be used instead of showPopup which 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 let as 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 drag event is fired on the source element during the drag. The dragend event 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
[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:

[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, and nsIDownloadProgressListener for 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 nsIDownloadManagerUI interface.

[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 dlgType property now works properly. (błąd 308591)
  • the canBubble argument to event.initEvent now works properly so that events can be fired which don't bubble. (błąd 330190)
  • the DOMAttrModified event 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 means document.firstChild isn't guaranteed to be the root element, use document.documentElement instead. Also, <?xml-stylesheet ?> and <?xul-overlay ?> processing instructions now have no effect outside the document prolog. (błąd 319654)
  • getElementsByAttributeNS functions 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.