Search completed in 1.22 seconds.
create fancy boxes - Learn web development
But beyond the technics its also all about unleashing your creativity. ...
...But beyond the technics its also all about unleashing your creativity. ...
...But beyond the technics its also all about unleashing your creativity. ...
...And 4 more matches
Tabboxes - Archive of obsolete content
A series of tabs appears across the top of a window. The user can click each tab to see a different set of options. It is useful in cases when you have more options than will fit in one screen. XUL provides a method to create such dialogs. It involves five new elements, which are described briefly here and in more detail below. tabbox The outer box that contains the tabs along the top and the tab pages themselves. ...
...s go here --> </tabpanels> </tabbox> The tab elements are placed inside a tabs element, which is much like a regular box. The tabs element itself has been placed inside a tabbox. The tabbox also contains a tabpanels element which will appear below the tabs due to the vertical orientation on the whole tabbox. There is really nothing special about the tab elements that make them different than
boxes. Like
boxes, tabs can contain any element. The difference is that the tabs render slightly differently and only one tab panel's contents are visible at once, much like a deck. The contents of the individual tab pages should go inside each tabpanel element. They do not go in the tab elements, as that is where the contents of the tabs along the top go. Each tabpanel element becomes a page on the ...
...the contents of the tabs along the top go. Each tabpanel element becomes a page on the tabbed display. The first panel corresponds to the first tab, the second panel corresponds to the second tab, and so on. There is a one-to-one relationship between the tab and tabpanel elements. When determining the size of the tabbox, the size of the largest page is used. That means that if there are ten text
boxes on one tab page and only one on another, the tab page will be sized to fit the one with the ten on it as this takes up more room. The area taken up by the tab area does not change when the user switches to a new tab page. Tabbox example Example 1 : Source View <tabbox> <tabs> <tab label="Mail"/> <tab label="News"/> </tabs> <tabpanels> <tabpanel id="mailtab"> <checkbox...
...ance of the currently selected tab to make it look selected. Only one tab will have a true value for this attribute at a time. Position of the tabs Finally, you can change the position of the tabs so that they appear on any side of the tab pages. There is no special syntax to do this. You simply set the orient and dir attributes as necessary. Remember that the tab elements are much like regular
boxes in terms of layout. Moreover, the tabbox element is much like a regular container box with a default vertical orientation, whereas the tabs element is much like a container box with a default horizontal orientation. For example, to place the tabs along the left side, change the orientation of the tabs element to vertical to make the tabs appear vertically stacked. Next, adjust the tabbox so it h...
Groupboxes - Archive of obsolete content
<< PreviousNext >> This section describes a way to include elements into groups Group
boxes The groupbox element is used to group related XUL elements together, much like the HTML fieldset element is used to group HTML elements. The groupbox is a type of box, and the elements it contains are aligned according to the XUL box rules. However, there are several differences between group
boxes and regular
boxes: The groupbox can be labeled using the caption element. The groupbox is displayed in a special way--usually with a beveled border and a caption, although you can change the appearance using CSS. ...
...g to the XUL box rules. However, there are several differences between group
boxes and regular
boxes: The groupbox can be labeled using the caption element. The groupbox is displayed in a special way--usually with a beveled border and a caption, although you can change the appearance using CSS. You can create a caption for your groupbox by inserting a caption element as the first child. Group
boxes are box elements, so you can use the box attributes, such as orient and flex. A simple groupbox example The example below shows a simple groupbox: Example 1 : Source View <groupbox> <caption label="Answer"/> <description value="Banana"/> <description value="Tangerine"/> <description value="Phone Booth"/> <description value="Kiwi"/> </groupbox> This will cause four pieces of text to...
...oupbox to the find files dialog in the next section. Radio Groups You can use the radiogroup element to group radio elements together. The radiogroup is a type of box. You can put any element you want inside it, and apart from its special handling of radio buttons, it works like any other box. Any radio buttons placed inside the radio group will be grouped together, even if they are inside nested
boxes. This could be used to add extra elements within the structure, such as in the following example: Example 3 : Source View <radiogroup> <radio id="no" value="no" label="No Number"/> <radio id="random" value="random" label="Random Number"/> <hbox> <radio id="specify" value="specify" label="Specify Number:"/> <textbox id="specificnumber"/> </hbox> </radiogroup> Note that the radiogr...
Visual formatting model - CSS: Cascading Style Sheets
g Model describes how user agents take the document tree, and process and display it for visual media. This includes continuous media such as a computer screen and paged media such as a book or document printed by browser print functions. Most of the information applies equally to continuous and paged media. In the visual formatting model, each element in the document tree generates zero or more
boxes according to the box model. The layout of these
boxes is governed by: Box dimensions and type. Positioning scheme (normal flow, float, and absolute positioning). Relationships between elements in the document tree. External information (e.g., viewport size, intrinsic dimensions of images, etc.). Much of the information about the visual formatting model is defined in CSS2, however, various...
... then the user agent needs to offer a way to scroll to the parts of the document that are not displayed. We most often see this as scrolling in the block dimension -- vertically in a horizontal, top-to-bottom language. However, you might design something that requires scrolling in the inline dimension too. Box generation Box generation is the part of the CSS visual formatting model that creates
boxes from the document's elements. Generated
boxes are of different types, which affect their visual formatting. The type of the box generated depends on the value of the CSS display property. Initially defined in CSS2, the display property is extended in the CSS Display Module Level 3. In addition, some of the terminologies around the display have been updated and clarified in the years since CSS2. ...
...this, it generates an intermediary structure, the box tree, which represents the formatting structure of the rendered document. Each box in the box tree represents its corresponding element (or pseudo-element) in space and/or time on the canvas, while each text run in the box tree likewise represents the contents of its corresponding text nodes. Then, for each element, CSS generates zero or more
boxes as specified by that element's display property value. Note:
Boxes are often referred to by their display type -- e.g. a box generated by an element with display: block is called a "block box" or just a "block". Note however that block
boxes, block-level
boxes and box containers are all subtly different; see the Block
boxes section below for more details. The principal box When an element ge...
...And 16 more matches
<input type="checkbox"> - HTML: Hypertext Markup Language
<input> elements of type checkbox are rendered by default as
boxes that are checked (ticked) when activated, like you might see in an official government paper form. The exact appearance depends upon the operating system configuration under which the browser is running. Generally this is a square but it may have rounded corners. A checkbox allows you to select single values for submission in a form (or not). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
...his is a square but it may have rounded corners. A checkbox allows you to select single values for submission in a form (or not). The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Note: Radio buttons are similar to check
boxes, but with an important distinction -- radio buttons are grouped into a set in which only one radio button can be selected at a time, whereas check
boxes allow you to turn single values on and off. Where multiple controls exist, radio buttons allow one to be selected out of them all, whereas check
boxes allow multiple values to be selected. Value A DOMString representing the value of t...
...rently toggled on checked A Boolean attribute indicating whether or not this checkbox is checked by default (when the page loads). It does not indicate whether this checkbox is currently checked: if the checkbox's state is changed, this content attribute does not reflect the change. (Only the HTMLInputElement's checked IDL attribute is updated.) Note: Unlike other input controls, a check
boxes value is only included in the submitted data if the checkbox is currently checked. If it is, then the value of the checkbox's value attribute is reported as the input's value. Unlike other browsers, Firefox by default persists the dynamic checked state of an <input> across page loads. Use the autocomplete attribute to control this feature. indeterminate If the indeterminate attribute is prese...
...And 11 more matches
The box model - Learn web development
Previous Overview: Building blocks Next Everything in CSS has a box around it, and understanding these
boxes is key to being able to create layouts with CSS, or to align items with other items. In this lesson, we will take a proper look at the CSS Box Model so that you can build more complex layout tasks with an understanding of how it works and the terminology that relates to it. ...
...he terminology that relates to it. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps.) Objective: To learn about the CSS Box Model, what makes up the box model and how to switch to the alternate model. Block and inline
boxes In CSS we broadly have two types of
boxes -- block
boxes and inline
boxes. These characteristics refer to how the box behaves in terms of page flow, and in relation to other
boxes on the page: If a box is defined as a block, it will behave in the following ways: The box will break onto a new line. The box will extend in the inline direction to fill the space available in its container. In m...
...y from the box Unless we decide to change the display type to inline, elements such as headings (e.g. <h1>) and <p> all use block as their outer display type by default. If a box has an outer display type of inline, then: The box will not break onto a new line. The width and height properties will not apply. Vertical padding, margins, and borders will apply but will not cause other inline
boxes to move away from the box. Horizontal padding, margins, and borders will apply and will cause other inline
boxes to move away from the box. The <a> element, used for links, <span>, <em> and <strong> are all examples of elements that will display inline by default. The type of box applied to an element is defined by display property values such as block and inline, and relates to the outer val...
...And 9 more matches
Block and inline layout in normal flow - CSS: Cascading Style Sheets
In this guide, we will explore the basics of how Block and Inline elements behave when they are part of the normal flow. Normal Flow is defined in the CSS 2.1 specification, which explains that any
boxes in normal flow will be part of a formatting context. They can be either block or inline, but not both at once. We describe block-level
boxes as participating in a block formatting context, and inline-level
boxes as participating in an inline formatting context. The behaviour of elements which have a block or inline formatting context is also defined in this specification. For elements with a block formatting context, the spec says: "In a block formatting context,
boxes are laid out one after the other, vertically, beginning at the top of a containing block. The vertical distance between tw...
...es as participating in an inline formatting context. The behaviour of elements which have a block or inline formatting context is also defined in this specification. For elements with a block formatting context, the spec says: "In a block formatting context,
boxes are laid out one after the other, vertically, beginning at the top of a containing block. The vertical distance between two sibling
boxes is determined by the 'margin' properties. Vertical margins between adjacent block-level
boxes in a block formatting context collapse. ...
...ibling
boxes is determined by the 'margin' properties. Vertical margins between adjacent block-level
boxes in a block formatting context collapse. In a block formatting context, each box's left outer edge touches the left edge of the containing block (for right-to-left formatting, right edges touch)." - 9.4.1 For elements with an inline formatting context: "In an inline formatting context,
boxes are laid out horizontally, one after the other, beginning at the top of a containing block. Horizontal margins, borders, and padding are respected between these
boxes. The
boxes may be aligned vertically in different ways: their bottoms or tops may be aligned, or the baselines of text within them may be aligned. ...
...And 8 more matches
Index - Archive of obsolete content
he local filesystem. 89 io/text-streams Provides streams for reading and writing text. 90 lang/functional Functional helper methods. 91 lang/type Functions for working with type detection. 92 loader/cuddlefish Add-on SDK, CFX The SDK's module loader. 93 loader/sandbox Create JavaScript sand
boxes and execute scripts in them. 94 net/url No summary! 95 net/xhr Provides access to XMLHttpRequest functionality. 96 places/bookmarks Create, modify, and retrieve bookmarks. 97 places/favicon Helper functions for working with favicons. 98 places/history Access the user's browsing history. ...
...71 Code snippets Add-ons, Code snippets, Extensions No summary! 172 Alerts and Notifications Code snippets non-modal notification and further interaction with users 173 Autocomplete Code snippets, Form Fill, Satchel No summary! 174 Bookmarks Code snippets, Developing Mozilla, Extensions, Places No summary! 175
Boxes Code snippets Make the BOX style="display: block" and the wrapping behavior will occur when the box is resized: 176 Canvas code snippets Canvas, Code snippets, Graphics No summary! 177 Cookies Add-ons, Code snippets, Cookies, Extensions No summary! 178 Customizing the download progress bar No summary! 179 Delayed...
... Next, we'll find out how to add custom properties to XBL-defined elements. 1740 Adding Style Sheets Tutorials, XUL, XUL_Tutorial We have hardly modified the look of the elements we have created so far. XUL uses CSS (Cascading Style Sheets) to customize elements. 1741 Adding more elements Tutorials, XUL, XUL_Tutorial We will conclude the discussion of
boxes by adding some
boxes to the find files dialog. 1742 Additional Install Features Tutorials, XUL, XUL_Tutorial This section describes some more specifics of installers. 1743 Advanced Rules Tutorials, XUL, XUL_Tutorial This section describes the more advanced rule syntax. 1744 Anonymous Content Tutorials, XBL, XUL, XUL_Tutorial In this s...
...And 7 more matches
Element Positioning - Archive of obsolete content
he size of an element is determined by two factors, the size that the element wants to be and the size you specify. The size that an element wants to be is determined by what is in the element. For example, a button's width is determined by the amount of text inside the button. An element will generally be as large as it needs to be to hold its contents, and no larger. Some elements, such as text
boxes have a default size, which will be used. A box will be large enough to hold the elements inside the box. A horizontal box with three buttons in it will be as wide as the three buttons, plus a small amount of padding. In the image, the first two buttons have been given a suitable size to hold their text. The third button is larger because it contains more content. The width of the box containin...
... can't grow either. Thus, the button won't get wider. The solution is to make the box flexible also. Then, when you make the window wider, extra space will be available, so the box will grow to fill the extra space. Because the box is larger, more extra space will be created inside it, and the flexible button inside it will grow to fit the available space. This process repeats for as many nested
boxes as necessary. Setting Minimum and Maximum Sizes You may want to allow an element to be flexible but constrain the size so that it cannot be larger than a certain size. Or, you may want to set a minimum size. You can set this by using four attributes: minwidth; This specifies the minimum width that the element can be. minheight This specifies the minimum height that the element can be. ma...
...reaking the flex ratio. Example 4 The fourth button is flexible and will never have a height that is smaller than 2 ex (an ex is usually the height of the letter x in the current font) or wider than 100 pixels. Example 5 The text input is flexible but will never grow to be larger than 10 ems. You will often want to use ems when specifying sizes with text in them. This unit is useful for text
boxes so that the font can change and the text
boxes would always be a suitable size, even if the font is very large. Example 6 The description element is constrained to have a maximum width of 50 pixels. The text inside will wrap to the next line, after fifty pixels. Our find files dialog Let's add some of these styles to the find files dialog. We'll make it so that the textbox will resize to fi...
...And 7 more matches
Advanced form styling - Learn web development
Prerequisites: Basic computer literacy, and a basic understanding of HTML and CSS. Objective: To understand what parts of forms are hard to style, and why; to learn what can be done to customize them. To recap what we said in the previous article, we have: The bad: Some elements are more difficult to style, requiring more complex CSS or some more specific tricks: Check
boxes and radio buttons <input type="search"> The ugly: Some elements can't be styled thoroughly using CSS. These include: Elements involved in creating dropdown widgets, including <select>, <option>, <optgroup> and <datalist>. <input type="color"> Date-related controls such as <input type="datetime-local"> <input type="range"> <input type="file"> <progress> and <meter> Let's first talk ab...
... eventuality. The following live example shows you what they look like in your system -- default on the left, and with the above CSS applied on the right (find it here also if you want to test it on other systems). In most cases, the effect is to remove the stylized border, which makes CSS styling a bit easier, but isn't really essential. In a couple of cases -- search and radio buttons/check
boxes, it becomes way more useful. We'll look at those now. Taming search
boxes <input type="search"> is basically just a text input, so why is appearance: none; useful here? The answer is that in Chromium-based browsers on macOS, search
boxes have some styling restrictions -- you can't adjust their height or font-size freely, for example. This is because non-macOS Chrome browsers no longer use the W...
...r use the WebKit rendering engine, which enabled Aqua appearance by default for certain form controls. With Aqua enabled, some form controls are not scalable. This can be fixed using our friend appearance: none;, which disables the default Aqua appearance: input[type="search"] { -webkit-appearance: none; appearance: none; } In the example below, you can see two identical styled search
boxes. The right one has appearance: none; applied, and the left one doesn't. If you look at it in macOS Chrome you'll see that the left one isn't sized properly. Interestingly, setting border/background on the search field also fixes this problem, as it disables or "breaks" the Aqua appearance too. The following styled search doesn't have appearance: none; applied, but it doesn't suffer from the sa...
...And 7 more matches
Implementing a Microsoft Active Accessibility (MSAA) Server - Accessibility
QueryInterface and QueryService. This can provide assistive technology with contextual information specific to your object model. For example, Gecko support ISimpleDOMNode to provide information about the DOM node for an accessible object. A set of system messages that confer accessibility-related events such as focus changes, changes to document content and state changes in UI objects like check
boxes. To really learn about MSAA, you need to download the entire MSAA SDK. Without downloading the SDK, you won't get the extremely useful tools, which help a great deal in the learning process. The Accessible Event Watcher shows what accessible events are being generated by a given piece of software. The Accessible Explorer and Inspect Object tools show the tree of data nodes the Accessible objec...
...epending on project] EVENT_OBJECT_REORDER [important for mutating docs] EVENT_OBJECT_FOCUS [important] EVENT_OBJECT_SELECTION [important] EVENT_OBJECT_SELECTIONADD [important for multiple selection] EVENT_OBJECT_SELECTIONREMOVE [important for multiple selection] EVENT_OBJECT_SELECTIONWITHIN [important for multiple selection] EVENT_OBJECT_STATECHANGE [important for check
boxes and radio buttons] EVENT_OBJECT_LOCATIONCHANGE EVENT_OBJECT_NAMECHANGE EVENT_OBJECT_DESCRIPTIONCHANGE EVENT_OBJECT_VALUECHANGE [important for sliders and progress meters] EVENT_OBJECT_PARENTCHANGE EVENT_OBJECT_HELPCHANGE EVENT_OBJECT_DEFACTIONCHANGE EVENT_OBJECT_ACCELERATORCHANGE MSAA States Cheat Sheet For information on what each state does, see the MSDN...
...h table. Also, don't implement EVENT_OBJECT_CREATE or EVENT_OBJECT_DESTROY. Vendors have found that watching these events causes crashes. Hacky caret tracking causes problems Problem: Assistive technologies do not use the MSAA caret. They follow screen draws, looking for a vertical blinking line. Unfortunately, some products can get confused by the vertical lines on other objects, such as list
boxes, even though those lines are not blinking. The assistive technology may not see your caret at all. Solution: Make sure there is a configuration file for each assistive technology specific to your application. Read the manual or help, and find the keystroke or commands for training the caret, and save this information in the configuration file. Make sure the caret always has the same width (1px o...
...And 6 more matches
Chapter 3: Introduction to XUL—How to build a more intuitive UI - Archive of obsolete content
g 2, we're reading in the theme's standard style sheet. By referring to a special style sheet within chrome://global/skin/, we can make label and button sizes, window background color, etc, match the currently selected theme in Firefox. We can also read in a stylesheet that we had set up ourselves. The XUL box model In principle, XUL lays out all UI components using combinations of two kinds of
boxes: horizontal and vertical. As shown in Listing 3, elements can be laid out horizontally using the hbox (horizontal box) element or vertically using the vbox (vertical box) element. When this file is opened in Firefox, it is displayed as shown in Figure 1. <label value="Horizontal layout"/> <hbox> <button label="horizontal1"/> <button label="horizontal2"/> </hbox> <label value="Vertical layout...
... Common attributes Before we look at the various interface objects, let's look at some of their...
... Common attributes Before we look at the various interface objects, let's look at some of their common attributes, especially the frequently used ones. ...
...And 5 more matches
Index - Archive of obsolete content
Next, we'll find out how to add custom properties to XBL-defined elements. 1009 Adding Style Sheets Tutorials, XUL, XUL_Tutorial We have hardly modified the look of the elements we have created so far. XUL uses CSS (Cascading Style Sheets) to customize elements. 1010 Adding more elements Tutorials, XUL, XUL_Tutorial We will conclude the discussion of
boxes by adding some
boxes to the find files dialog. 1011 Additional Install Features Tutorials, XUL, XUL_Tutorial This section describes some more specifics of installers. 1012 Advanced Rules Tutorials, XUL, XUL_Tutorial This section describes the more advanced rule syntax. 1013 Anonymous Content Tutorials, XBL, XUL, XUL_Tutorial In this s...
..., XUL, XUL Tutorial We've already seen some features of windows. We'll look at some more in this section. 1029 Focus and Selection Tutorials, XUL, XUL_Tutorial The section will describe how to handle the focus and selection of elements. 1030 Grids Tutorials, XUL, XUL_Tutorial XUL has a set of elements for creating tabular grids. 1031 Group
boxes Tutorials, XUL, XUL_Tutorial This section describes a way to include elements into groups 1032 Input Controls Tutorials, XUL, XUL_Tutorial XUL has elements that are similar to the HTML form controls. 1033 Install Scripts Tutorials, XUL, XUL_Tutorial This section describes the install script. 1034 Introduction Tutorials, XUL, XUL T...
...utorial You could use keyboard event handlers to respond to the keyboard. However, it would be tedious to do that for every button and menu item (though it could be necessary when one's key commands are only triggered when the user is focused on a particular element). 1038 List Controls Tutorials, XUL, XUL_Tutorial XUL has a number of types of elements for creating list
boxes. 1039 Localization Internationalization, Localization, Tutorials, XUL, XUL_Tutorial XUL and XML provide entities which are a convenient way of allowing localization. 1040 Manifest Files NeedsUpdate, Tutorials, XUL, XUL_Tutorial In this section, we'll see how to put chrome and XUL files into a package and create the manifest files for them. 1041 ...
...And 4 more matches
The Box Model - Archive of obsolete content
This model allows you to divide a window into a series of
boxes. Elements inside of a box will orient themselves horizontally or vertically. By combining a series of
boxes, spacers and elements with flex and pack attributes, you can control the layout of a window. Although a box is the fundamental part of XUL element layout, it follows a few very simple rules. A box can lay out its children in one of two orientations, either horizontally or vertically. ...
...tton id="yes" label="Yes"/> <button id="no" label="No"/> <button id="maybe" label="Maybe"/> </vbox> The three buttons here are oriented vertically as was indicated by the box. To change the buttons so that they are oriented horizontally, all you need to do is change the vbox element to a hbox element. Login prompt example You can add as many elements as you want inside a box, including other
boxes. In the case of a horizontal box, each additional element will be placed to the right of the previous one. The elements will not wrap at all so the more elements you add, the wider the window will be. Similarly, each element added to a vertical box will be placed underneath the previous one. The example below shows a simple login prompt: Example 2 : Source View <vbox> <hbox> <label cont...
...id="login"/> </hbox> <hbox> <label control="pass" value="Password:"/> <textbox id="pass"/> </hbox> <button id="ok" label="OK"/> <button id="cancel" label="Cancel"/> </vbox> Here four elements have been oriented vertically, two inner hbox tags and two button elements. Notice that only the elements that are direct descendants of the box are oriented vertically. The labels and text
boxes are inside the inner hbox elements, so they are oriented according to those
boxes, which are horizontal. You can see in the image that each label and textbox is oriented horizontally. Aligning text
boxes If you look closely at the image of the login dialog, you can see that the two text
boxes are not aligned with each other horizontally. It would probably be better if they were. In order to do this...
...And 4 more matches
Index - Learn web development
inner, CodingScripting, JavaScript, JavaScripting beginner, Landing, Module, Topic, l10n:priority JavaScript is a programming language that allows you to implement complex things on web pages. Every time a web page does more than just sit there and display static information for you to look at--displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video juke
boxes, or more--you can bet that JavaScript is probably involved. 49 Asynchronous JavaScript Beginner, CodingScripting, Guide, JavaScript, Landing, Promises, async, asynchronous, await, callbacks, requestAnimationFrame, setInterval, setTimeout In this module we take a look at asynchronous JavaScript, why it is important, and how it can be used to effectively handle potential blocki...
...it, its time to dive a bit deeper. This module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more. 104 A cool-looking box Assessment, Beginner, CSS, Learn, backgrounds, borders, box, box model, effects In this assessment, you'll get some more practice in creating cool-looking
boxes by trying to create an eye-catching box. 105 Advanced styling effects Article, Beginner, Blend modes,
Boxes, CSS, CodingScripting, Filters, Styling, box shadows, effects, shapes We hope this article was fun -- playing with shiny toys generally is, and it is always interesting to see what kinds of advanced styling tools are becoming available in modern browsers. 106 ...
... Beginner, CSS, Cascade, Inheritance, Learn, rules, source order, specificity The aim of this lesson is to develop your understanding of some of the most fundamental concepts of CSS -- the cascade, specificity, and inheritance -- which control how CSS is applied to HTML and how conflicts are resolved. 116 Creating fancy letterheaded paper Assessment, Background, Beginner,
Boxes, CSS, CodingScripting, border, box, letter, letterhead, letterheaded, paper If you want to make the right impression, writing a letter on nice letterheaded paper can be a really good start. In this assessment we'll challenge you to create an online template to achieve such a look. 117 Debugging CSS Beginner, CSS, DOM, Debugging, DevTools, Learn, source Sometimes when wr...
...And 4 more matches
Accessible Toolkit Checklist
) API support for custom controls. However, be aware that the wrapping layer will introduce accessibility bugs, and thus you will need to test extensively and fill in the holes. You will also need to provide a way for custom and owner drawn controls to easily accessibility API support, as wxWidgets does. There will be custom and owner drawn controls -- there always are. For example, lists of check
boxes are implemented in Windows with images of checked and unchecked check
boxes. Owner drawn toolkits , like XUL and Flash's Flex UI framework use few or no native widgets. These toolkits need to have accessibility implemented from the ground up, and get nothing for free in terms of keyboard, API or OS-theme support. In this case, adding a complete or even a partial accessibility sol...
...F6 and Shift+F6 key combinations should cycle through panes in a window Making focus visible on any widget, and focus must always be visible Shift+F10 or context menu key should work like right click on focused item, and context menu should show just under and to the right of the current focus. On Mac OS X, ctrl+space is used to bring up the context menu. Most widgets (like check
boxes) can have a label outside of themselves, which should focus the widget when clicked on, or when its mnemonic is pressed. The system should require these labels to be created/associated with each widget, not as a separate static text with no tie to the widget. The MSAA support needs to know what label goes with what widget. MSAA support: expose window with ROLE_DIALOG, unless it's already th...
...In autocomplete text fields, make sure that the delete or backspace key removes all auto completed selected text. ...
...And 4 more matches
Browser detection using the user agent - HTTP
size dependent things*/ }). What you want to do for screen size is not slash off information on smaller screens. That will only annoy people because it will force them to use the desktop version. Rather, try to have fewer columns of information in a longer page on smaller screens while having more columns with a shorter page on larger screen sizes. ...
...fect can be easily achieved using CSS flex
boxes, sometimes with floats as a partial fallback. Also try to move less relevant/important information down to the bottom and group the page's content together meaningfully. Although it is off-topic, perhaps the following detailed example might give you insights and ideas that persuade you to forgo user agent sniffing. Let us imagine a page composed of
boxes of information; each box is about a different feline breed or canine breed. Each box has an image, an overview, and a historical funfact. The pictures are kept to a maximum reasonable size even on large screens. For the purposes of grouping the content meaningfully, all the cat
boxes are separated from all the dog
boxes such that the cat and dog
boxes are not intermixed together. On a large scree...
...istorical funfact. The pictures are kept to a maximum reasonable size even on large screens. For the purposes of grouping the content meaningfully, all the cat
boxes are separated from all the dog
boxes such that the cat and dog
boxes are not intermixed together. On a large screen, it saves space to have multiple columns to reduce the space wasted to the left and to the right of the pictures. The
boxes can be separated into multiple columns via two equally fair method. ...
...And 4 more matches
Box Model Details - Archive of obsolete content
In addition, the flex attribute can be applied to any element. ...
...In addition, the flex attribute can be applied to any element. ...
...this. However, the problem with this is that you need to know how big the element will be beforehand. ...
...And 3 more matches
Focus and Selection - Archive of obsolete content
Only one element per window has the focus at a time. The user can change the focus by clicking an element with the mouse or by pressing the TAB key. When the TAB key is pressed, the next element is given the focus. ...
...ndler with the window which will call the setFocusedElement method. This method gets the focused element from the command dispatcher and sets a label to its tag name. As the focused element is changed, the label will show the tagname of the element. A few things to note. First, when the textbox is focused, the tag name is 'html:input', not 'textbox' as we might expect. This is because XUL text
boxes are implemented using the HTML input widget, so the focus event is received for that element instead. Second, clicking the textbox's label changes the focus to the textbox. This is because the label has a control attribute pointing to the id of the textbox. Finally, the other label which displays the tag name has no control attribute, so clicking it has no effect on the focused element. Only ...
...ample demonstrates this: Example 5 : Source View <textbox id="addr"/> <button label="Focus" oncommand="document.getElementById('addr').focus()"/> Or, you can use the methods advanceFocus and rewindFocus on the command dispatcher. These methods move the focus to the next element in sequence or the previous element respectively. This is what happens when the user presses TAB or Shift+Tab. For text
boxes, a special attribute, focused is added whenever the element has the focus. You can check for the presence of this attribute to determine if the element has the focus, either from a script or within a style sheet. It will have the value true if the textbox has the focus and, if the textbox does not have the focus, the attribute will not be present. Suppose you wanted to move the focus from where i...
...And 3 more matches
textbox - Archive of obsolete content
decimalplaces Type: integer The number of decimal places to display. The default is 0, which doesn't show any decimal places. The value Infinity may be used if you want no limit on the number of decimal places. Note that decimal numbers are stored as floats. disabled Type: boolean Indicates whether the element is disabled or not. If this attribu...
... retained for compatibility, but you should update your code. hidespinbuttons Type: boolean If true, the number box does not have arrow buttons next to it to allow the user to adjust the value. The value may still be adjusted with the keyboard. The default value is false. increment Type: integer The amount by which the curpos (for scroll bars) or value (for number
boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). The default value is 1. label Type: string If present and not empty, this will be exposed to screen readers through the label property. Type: integer The maximum value that the scale or number box may be set to. The default value is 100 for scales and Infinity for number
boxes. maxl...
...r which the user can use to scroll to the other rows. To get the actual number of rows in the element, use the getRowCount method. searchbutton Type: boolean If true, the search field will only fire a command event when the user presses the search button or presses the Enter key. Otherwise, the command event is fired whenever the user modifies the value. This attribute only applies to text
boxes with the type search. size Type: integer The number of characters that can be displayed in the textbox. spellcheck Type: boolean If true, spell checking is enabled by default for the text box; if false, spell checking is disabled by default. If not specified, this defaults to false The HTML The spellcheck attribute uses values of true or false (you cannot simply add the spel...
...And 3 more matches
Basic native form controls - Learn web development
the box). They can benefit from spell checking (using the spellcheck attribute), if the browser supports it. Note: The <input> element is unique amongst HTML elements because it can take many different forms depending on its type attribute value. It is used for creating most types of form widgets including single line text fields, time and date controls, controls without text input like check
boxes, radio buttons, and color pickers, and buttons. Single line text fields A single line text field is created using an <input> element whose type attribute value is set to text, or by omitting the type attribute altogether (text is the default value). The value text for this attribute is also the fallback value if the value you specify for the type attribute is unknown by the browser (for examp...
...mestamp" name="timestamp" value="1286705410"> If you create such an element, it's required to set its name and value attributes. The value can be dynamically set via JavaScript. The hidden input type should not have an associated label. Other text input types, like search, url, and tel, were added with HTML5. Those will be covered in the next tutorial, HTML5 input types. Checkable items: check
boxes and radio buttons Checkable items are controls whose state you can change by clicking on them or their associated labels. There are two kinds of checkable item: the check box and the radio button. Both use the checked attribute to indicate whether the widget is checked by default or not. It's worth noting that these widgets do not behave exactly like other form widgets. For most form widgets, o...
...sibility, you are advised to surround each list of related items in a <fieldset>, with a <legend> providing an overall description of the list. Each individual pair of <label>/<input> elements should be contained in its own list item (or similar). The associated <label> is generally placed immediately after the radio button or checkbox, with the instructions for the group of radio button or check
boxes generally being the content of the <legend>. See the examples linked above for structural examples. Check box A check box is created using the <input> element with a type attribute set to the value checkbox. <input type="checkbox" id="carrots" name="carrots" value="carrots" checked> Including the checked attribute makes the checkbox checked automatically when the page loads. Clicking the che...
...And 3 more matches
Drawing and Event Handling - Plugins
eter determines the print mode. It is set to either NP_FULL to indicate full-page plug-in printing, or NP_EMBED if this is an embedded plug-in printed as part of the window in which it is embedded. An embedded plug-in shares printing with the browser. The plug-in prints the part of the page it occupies, and the browser handles the rest of the printing process, including displaying print dialog
boxes, getting the printer device context, and, of course, printing the rest of the page. An embedded plug-in can set the pluginPrinted field in its PrintInfo parameter to false (the default). This is a field of the _NPFullPrint substructure of the NPPrint structure. The browser displays the necessary print dialog
boxes and calls NPP_Print again. This time, PrintInfo->mode should be set to NP_EMBED. ...
...urse, printing the rest of the page. An embedded plug-in can set the pluginPrinted field in its PrintInfo parameter to false (the default). This is a field of the _NPFullPrint substructure of the NPPrint structure. The browser displays the necessary print dialog
boxes and calls NPP_Print again. This time, PrintInfo->mode should be set to NP_EMBED. A full-page plug-in handles the print dialog
boxes and printing process as it sees fit. In this case, before the browser displays any print dialog
boxes, NPP_Print is called with PrintInfo->mode equal to NP_FULL. On Mac OS, full-page printing requires that the field PrintInfo contain a standard Mac OS THPrint (see Printing.h). Of course, NPP_Print is also called with PrintInfo->mode equal to NP_EMBED when the instance is embedded. In this case,...
...posed to the native windowing system) is responsible for controlling both their drawing and their event handling. See the following items for more information on controlling the drawing of the plug-in instance: Specifying That a Plug-in Is Windowless Invalidating the Drawing Area Forcing a Paint Message Making a Plug-in Opaque Making a Plug-in Transparent Creating Pop-up Menus and Dialog
Boxes Event Handling for Windowless Plug-ins Specifying That a Plug-in Is Windowless To specify that a plug-in is windowless, use the NPN_SetValue method. The instance parameter represents the current plug-in. The variable parameter contains plug-in information to set. The value parameter returns the name of the plug-in. To specify that a plug-in is windowless, use NPN_SetValue with NPPVpluginWin...
...And 3 more matches
User Notifications and Alerts - Archive of obsolete content
quickly as possible without even reading what they have to say. Or they will just get rid of your add-on. This section lists a few alternatives that give you the possibility of notifying the user and requesting action without being too annoying. The notificationbox element You have probably seen these before. The "remember password" prompt is the one that shows up the most often. They are thin
boxes that appear from beneath the tab list and above the page content, with some text and maybe a few buttons. This kind of notification is implemented with a notificationbox. This kind on notification is very easy to implement, it doesn't interrupt the user and is easy to read and dismiss, so it is our recommended way of displaying alerts and notifications. There's a catch, though: these notificatio...
...these notifications are inside the current tab, so switching tabs will make a notification disappear. The notification shows up again when you come back to the tab that displayed it. This means that these notifications make the most sense when they are related to the page currently being displayed, such as a page trying to install an add-on, or a site you just entered a password on. ...
...rmines the "strength" of the message, indicated by its background color when it is displayed. You should look for the level that better fits your message, and use the lowest applicable level, to prevent the user from getting used to dismissing high-level notifications. The buttons are represented by simple JS data objects. This is all explained in detail in the notificationbox page. Notification
boxes are designed to be easily dismissed. All notifications have an additional close button, so you should take into account that it's possible that none of your custom buttons will be clicked. Also, clicking on any of your custom buttons will cause the notification to be immediately closed, so you should only use notification
boxes for single-step processes. The Alerts Service This is a very good o...
...And 2 more matches
Things I've tried to do with XUL - Archive of obsolete content
isplay (not necessarily "UI"; my use case is for creating a calendar time display) that sizes sanely when the user resizes the window is unfortunately very difficult. (To add insult, XUL layout code *explicitly* trims off '%' from width/height, thus treating it as pixels.) For reference, I'd like the following to give a vbox that resizes along with the window, with the green, red, and blue inside
boxes always maintaining a 30%-20%-50% ratio to the height of the parent vbox. <vbox flex="1"> <box height="30%" flex="1" style="background: green;"/> <box height="20%" flex="1" style="background: red;"/> <box height="50%" flex="1" style="background: blue;"/> </vbox> Workaround: no real good ones; the closest I've gotten is to use a div instead of a box container: <html:div style="-moz-box-flex: ...
... Enn: percentages won't have any effect in these examples though, since the actual height of the container isn't known, and 30% of an unknown number is still an unknown number. Vlad: sure; the sn...
... Enn: percentages won't have any effect in these examples though, since the actual height of the container isn't known, and 30% of an unknown number is still an unknown number. ...
...And 2 more matches
Input Controls - Archive of obsolete content
> XUL has elements that are similar to the HTML form controls. Looking for a guide to using input controls and forms on the Web? See Forms in HTML. Text Entry Fields HTML has an input element which can be used for text entry controls. XUL has a similar element, textbox, used for text entry fields. Without any attributes, the textbox element creates a box in which the user can enter text. Text
boxes accept many of the same attributes as HTML input controls. The following are some of them: id A unique identifier so that you can identify the textbox. class The style class of the textbox. value If you want the textbox to have default text, supply it with the value attribute. disabled Set to true to have text entry disabled. textbox.type You can set this attribute to the special...
...t this attribute to the special value password to create a textbox that hides what it types. This is usually used for password entry fields. maxlength The maximum number of characters that the textbox allows. Note that while in HTML, several different kinds of fields can be created with the input element, in XUL there are separate elements for each type. The following example shows some text
boxes: Example 1 : Source View <label control="some-text" value="Enter some text"/> <textbox id="some-text"/> <label control="some-password" value="Enter a password"/> <textbox id="some-password" type="password" maxlength="8"/> Multiline textbox The textbox examples above will create text inputs that can only be used for entering one line of text. HTML also has a textarea element for creating a la...
...efore the buttons we created in the last section. If you open this window, you will see something much like that shown in the image. Notice that the label and the text input field have now appeared in the window. The textbox is fully functional and you can type into it and select text. Note that the control attribute has been used so that the textbox is selected when the label is clicked. ...
...And 2 more matches
List Controls - Archive of obsolete content
They work similar to the HTML select element, which performs both functions, but the XUL elements have additional features. The simplest list box uses the listbox element for the box itself, and the listitem element for each item. For example, this list box will have four rows, one for each item. ...
...They work similar to the HTML select element, which performs both functions, but the XUL elements have additional features. The simplest list box uses the listbox element for the box itself, and the listitem element for each item. For example, this list box will have four rows, one for each item. ...
...They work similar to the HTML select element, which performs both functions, but the XUL elements have additional features. The simplest list box uses the listbox element for the box itself, and the listitem element for each item. For example, this list box will have four rows, one for each item. ...
...And 2 more matches
UI pseudo-classes - Learn web development
that are valid/invalid according to form validation constraints set on them, or in-range/out-of-range. :enabled and :disabled, and :read-only and :read-write: Target enabled or disabled form controls (e.g. with the disabled HTML attribute set), and read-write or read-only form controls (e.g. with the readonly HTML attribute set). :checked, :indeterminate, and :default: Respectively target check
boxes and radio buttons that are checked, in an indeterminate state (neither checked or not checked), and the default selected option when the page loads (e.g. an <input type="checkbox"> with the checked attribute set, or an <option> element with the selected attribute set). There are many others too, but the ones listed above are the most obviously useful. Some of the others are aimed at solving ver...
...version 78; at which point it started to support the unprefixed version. The full example looks like so: Note: :enabled and :read-write are two more pseudo-classes that you'll probably rarely use, given that they describe the default states of input elements. ...
...and :read-write are two more pseudo-classes that you'll probably rarely use, given that they describe the default states of input elements. Radio and checkbox states -- checked, default, indeterminate As we've seen in earlier articles in the module, radio buttons and check
boxes can be checked or unchecked. But there are a couple of other states to consider too: :default: Matches radios/check
boxes that are checked by default, on page load (i.e. by setting the checked attribute on them) These match the :default pseudo-class, even if the user unchecks them. :indeterminate: When radios/check
boxes are neither checked nor unchecked, they are considered indeterminate and will match the :indeterminate pseudo-class. More on what this means below. :checked When checked, they will be matched by ...
...And 2 more matches
Inline formatting context - CSS: Cascading Style Sheets
This article explains the inline formatting context Core concepts The inline formatting context is part of the visual rendering of a web page. Inline
boxes are laid out one after the other, in the direction sentences run in the writing mode in use: In a horizontal writing mode,
boxes are laid out horizontally, starting on the left. In a vertical writing mode they would be laid out vertically starting at the top. In the example below, the two (<div>) elements with the black borders form a block formatting context, inside which each word participates in an inline formatting context. The
boxes in the horizontal writing mode run horizontally, and the vertical writing mode
boxes run vertically.
Boxes forming a line are contained by a rectangular area called a line box. This box wi...
... the two (<div>) elements with the black borders form a block formatting context, inside which each word participates in an inline formatting context. The
boxes in the horizontal writing mode run horizontally, and the vertical writing mode
boxes run vertically.
Boxes forming a line are contained by a rectangular area called a line box. This box will be large enough to contain all of the inline
boxes in that line; when there is no more room in the inline direction another line will be created. Therefore a paragraph is a set of inline line
boxes, stacked in the block direction. When an inline box is split, margins, borders, and padding have no visual effect where the split occurs. In the next example there is a (<span>) element wrapping a set of words wrapping onto two lines. The border on th...
...elow you can see how the margin, border, and padding on the inline <span> element are added. Note: I am using the logical, flow-relative properties -- padding-inline-start rather than padding-left -- so that they work in the inline dimension whether the text is horizontal or vertical. Read more about these properties in Logical Properties and Values. Alignment in the block direction Inline
boxes may be aligned in the block direction in different ways, using the vertical-align property, which will align on the block axis in vertical writing modes (therefore not vertically at all!). In the example below the large text is making the line box of the first sentence larger, therefore the vertical-align property can be used to align the inline
boxes either side of it. I have used the value top,...
...And 2 more matches
align-self - CSS: Cascading Style Sheets
lex item's align-items value. In Grid, it aligns the item inside the grid area. In Flexbox, it aligns the item on the cross axis. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The property doesn't apply to block-level
boxes, or to table cells. If a flexbox item's cross-axis margin is auto, then align-self is ignored. Syntax /* Keyword values */ align-self: auto; align-self: normal; /* Positional alignment */ /* align-self does not take left and right values */ align-self: center; /* Put the item around the center */ align-self: start; /* Put the item at the start */ align-self: end; /* Put the item at the end */ ...
... Overflow alignment */ align-self: safe center; align-self: unsafe center; /* Global values */ align-self: inherit; align-self: initial; align-self: unset; Values auto Computes to the parent's align-items value. normal The effect of this keyword is dependent of the layout mode we are in: In absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned
boxes, and as stretch on all other absolutely-positioned
boxes. In static position of absolutely-positioned layouts, the keyword behaves as stretch. For flex items, the keyword behaves as stretch. For grid items, this keyword leads to a behavior similar to the one of stretch, except for
boxes with an aspect ratio or an intrinsic sizes where it behaves like start. The property doesn't apply to b...
... self-start Aligns the items to be flush with the edge of the alignment container corresponding to the item's start side in the cross axis. self-end Aligns the items to be flush with the edge of the alignment container corresponding to the item's end side in the cross axis. ...
...And 2 more matches
Modules - Archive of obsolete content
n the host application to provide it with functionality such as loading subscripts, and exporting/ importing names. We will show how to do each of these things using the built-in Components object provided by Xulrunner application such as Firefox and Thunderbird. To improve encapsulation, each module should be defined in the scope of its own global object. This is made possible by the use of sand
boxes. Each sandbox lives in its own compartment. A compartment is a separate memory space. Each compartment has a set of privileges that determines what scripts running in that compartment can and cannot do. We will show how sand
boxes and compartments can be used to improve security in our module system. The module system used by the SDK is based on the CommonJS specification: it is implemented using...
...The object it passed to the loadSubScript function is an ordinary object, which has the global object of the loading script as its prototype. This breaks encapsulation, as it allows the script being loaded to access the built-in constructors of the loading script, which are defined on...
...e, by overriding one of the methods on the built-in constructors. If the loading script has chrome privileges, then so will any methods called by the loading script, even if that method was installed by a malicious script. To avoid problems like this, the object passed to loadSubScript should be a true global object, having its own instances of the built-in constructors. This is exactly what sand
boxes are for. A sandbox is a global object that lives in a separate compartment. Compartments are a fairly recent addition to SpiderMonkey, and can be seen as a separate memory space. Objects living in one compartment cannot be accessed directly from another compartment: they need to be accessed through an intermediate object, known as a wrapper. Compartments are very useful from a security point of v...
...to determine the set of privileges for the compartment in which the sandbox will be created. Passing an XUL URL will result in a compartment with chrome privileges (note, however, that if you ever actually do this in any of your code, Gabor will be forced to hunt you down and kill you). Otherwise, the compartment will have content privileges by default. Rewriting the loadScript function using sand
boxes, we end up with: function loadScript(url, imports) { let global = Components.utils.Sandbox(url); global.imports = imports; global.exports = {}; loader.loadSubScript(url, global); return global.exports; } Note that the object returned by Sandbox is a wrapper to the sandbox, not the sandbox itself. A wrapper behaves exactly like the wrapped object, with one difference: for eac...
The Box Model - Archive of obsolete content
and use in different types of operating systems, screen sizes and resolutions. The XUL box model is a significant improvement over the HTML layout model, which is mostly vertical. With XUL you can define vertically oriented as well as horizontally oriented interfaces, providing greater flexibility in interface design. Any XUL interface can be broken down into the following basic components:
Boxes Text Images Alignment and flexibility Widths and heights Margins and paddings Menus, toolbar buttons, and even the most complex elements in XUL are composed of these simple ingredients. Complex elements are created from simpler ones through XBL, which will be covered later on. Once you grasp this simple idea, you'll be able to use the DOM Inspector and CSS to mold XUL elements and layouts ...
...and layouts with great precision and flexibility. Most of the examples shown in the rest of this section were generated using the XUL Box Alignment Example. We recommend you play around with it for a while to get an idea of how the basic parts of the box model work. In order to use this page, you'll need to install the Remote XUL Manager extension and add developer.mozilla.org to the whitelist.
Boxes A XUL box is very similar to an HTML div. It's an invisible rectangular container with no styling at all (divs may have some default styling, though). Their behavior is similar. However, one of the fundamental differences between XUL and HTML has been the fact that XUL
boxes can be oriented vertically or horizontally (this behavior is being introduced into HTML standards). There are 3 basic box...
...rsion that you can orient as you please, but its default is horizontal orientation, so it's pretty much equivalent to an hbox and it is seldom used. Here's a very simple example of an hbox with 3 child buttons: <hbox> <button label="Cat" /> <button label="Parrot" /> <button label="Porcupine" /> </hbox> This is how it looks on Mac OS (the black border was added for illustrative purposes,
boxes don't have borders by default): If you use a vbox instead, it looks like this: The orientation of
boxes (and most XUL elements) can be controlled using the orient attribute or the -moz-box-orient CSS property. With these you can make an hbox have vertical orientation and viceversa, although that isn't very useful. The CSS property may be useful on some occasions, but using the orient attrib...
...en you can have an html:p (paragraph) element where you insert the result of parsing the property string. You can easily parse XML using the DOMParser object. Since XUL documents are strict XML, you can only use strict XHTML in XUL, and not the more loosely-formatted forms of HTML. Exercise Use the DOM Inspector extension to look into the Firefox chrome. Select toolbar buttons, menu items, text
boxes, etc. and look into the Box Model, CSS Style Rules and Computed Style views. Look into the computed width and height values, and how the paddings and margins affect the dimensions of XUL nodes. Modify the Hello World extension so that it changes the appearance of Firefox drastically using only CSS. Play with changing the dimensions and appearance of buttons, changing the background color of the ...
Flexbox - Learn web development
epo -- load it in a modern browser (like Firefox or Chrome), and have a look at the code in your code editor. You can see it live here also. You'll see that we have a <header> element with a top level heading inside it, and a <section> element containing three <article>s. We are going to use these to create a fairly standard three column layout. Specifying what elements to lay out as flexible
boxes To start with, we need to select which elements are to be laid out as flexible
boxes. To do this, we set a special value of display on the parent element of the elements you want to affect. In this case we want to lay out the <article> elements, so we set this on the <section>: section { display: flex; } This causes the <section> element to become a flex container, and its children to become...
...he start and end of this axis are called the main start and main end. The cross axis is the axis running perpendicular to the direction the flex items are being laid out in. The start and end of this axis are called the cross start and cross end. The parent element that has display: flex set on it (the <section> in our example) is called the flex container. The items being laid out as flexible
boxes inside the flex container are called flex items (the <article> elements in our example). Bear this terminology in mind as you go through subsequent sections. You can always refer back to it if you get confused about any of the terms being used. Columns or rows? Flexbox provides a property called flex-direction that specifies what direction the main axis runs in (what direction the flexbox chi...
...lay order would be 4th, 2nd, 3rd, then 1st. The 3rd item appears after the 2nd because it has the same order value and is after it in the source order. You can set negative order values to make items appear earlier than items with 0 set. For example, you could make the "Blush" button appear at the start of the main axis using the following rule: button:last-child { order: -1; } Nested flex
boxes It is possible to create some pretty complex layouts with flexbox. It is perfectly ok to set a flex item to also be a flex container, so that its children are also laid out like flexible
boxes. Have a look at complex-flexbox.html (see it live also). The HTML for this is fairly simple. We've got a <section> element containing three <article>s. The third <article> contains three <div>s. : sect...
...ning three <article>s. The third <article> contains three <div>s. : section - article article article - div - button div button div button button button Let's look at the code we've used for the layout. First of all, we set the children of the <section> to be laid out as flexible
boxes. section { display: flex; } Next, we set some flex values on the <article>s themselves. Take special note of the 2nd rule here -- we are setting the third <article> to have its children laid out like flex items too, but this time we are laying them out like a column. article { flex: 1 200px; } article:nth-of-type(3) { flex: 3 200px; display: flex; flex-flow: column; } Next, we sel...
Legacy layout methods - Learn web development
layout as a set number of columns (e.g. 4, 6, or 12), and then fit your content columns inside these imaginary columns. In this article we'll explore how these older methods work, in order that you understand how they were used if you work on an older project. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS and Styling
boxes.) Objective: To understand the fundamental concepts behind the grid layout systems used prior to CSS Grid Layout being available in browsers. Layout and grid systems before CSS Grid Layout It may seem surprising to anyone coming from a design background that CSS didn't have an inbuilt grid system until very recently, and instead we seemed to be using a variety of sub-optimal m...
...us to have elements that add up to less than 100%. We set that container to display: flex. On .col we set the flex property's first value (flex-grow) to 1 so our items can grow, the second value (flex-shrink) to 1 so the items can shrink, and the third value (flex-basis) to auto. As our element has a width set, auto will use that width as the flex-basis value. On the top line we get twelve neat
boxes on the grid and they grow and shrink equally as we change the viewport width. On the next line, however, we only have four items and these also grow and shrink from that 60px basis. With only four of them they can grow a lot more than the items in the row above, the result being that they all occupy the same width on the second row. To fix this we still need to include our span classes to prov...
... <div class="col">12</div> </div> <div class="row"> <div class="col">13</div> <div class="col">14</div> <div class="col">15</div> <div class="col">16</div> </div> </div> To start using Skeleton we need to give the wrapper <div> a class of container -- this is already included in our HTML. This centers the content with a maximum width of 960 pixels. You can see how the
boxes now never become wider than 960 pixels. You can take a look in the skeleton.css file to see the CSS that is used when we apply this class. The <div> is centered using auto left and right margins, and a padding of 20 pixels is applied left and right. Skeleton also sets the box-sizing property to border-box like we did earlier, so the padding and borders of this element will be included in the tot...
... width: 100%; max-width: 960px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; } Elements can only be part of the grid if they are inside a row, so as with our earlier example we need an additional <div> or other element with a class of row nested between the content <div> and our actual content container <div>s. We've done this already as well. Now let's lay out the container
boxes. Skeleton is based on a 12 column grid. The top line
boxes all need classes of one column to make them span one column. Add these now, as shown in the following snippet: <div class="container"> <div class="row"> <div class="one column">1</div> <div class="one column">2</div> <div class="one column">3</div> /* and so on */ </div> </div> Next, give the containers on the secon...
Use CSS to solve common problems - Learn web development
How to use background-clip to control how much of the box your background image covers. How to change the box model completely...
... How to use background-clip to control how much of the box your background image covers. How to change the box model completely using box-sizing How to control bac...
...cify colors in CSS How to debug CSS in the browser CSS and text How to style text How to customize a list of elements How to style links How to add shadows to text
Boxes and layouts How to size CSS
boxes How to control overflowing content How to control the part of a CSS box that the background is drawn under How do I define inline, block, and inline-block? How to create fancy
boxes (also see the Styling
boxes module, generally). How to use background-clip to control how much of the box your background image covers. How to change the box model completely using box-sizing How to control backgrounds How to control borders How to style an HTML table How to add shadows to
boxes Uncommon and advanced techniques CSS allows some advanced design techniques. These articles...
... an HTML table How to add shadows to
boxes Uncommon and advanced techniques CSS allows some advanced design techniques. These articles help demystify some of the more complicated use cases. ...
nsIMsgHeaderParser
/nsIMsgHeaderParser.idlScriptable ??? Add brief description of Interface ??? ...
... Return value A comma-separated list of just the mailbox parts of the address...
... Return value A comma-separated list of just the mailbox parts of the addresses. ...
...ing addr ); Parameters name The name of the sender. This should be in UTF-8. addr The address of the sender. This should be in UTF-8. Return value A string of the form name <address>. Exceptions thrown Missing Exception Missing Description Native code only!parseHeaderAddresses Given a string which contains a list of Header addresses, parses it into their component names and mail
boxes. The returned value is the number of addresses, or a negative error code; the names and addresses are returned into the provided pointers as consecutive null-terminated strings. It is up to the caller to free them. Note that some of the strings may be zero-length. The caller may pass nsnull for charset and it will be interpreted as "us-ascii". Either of the provided pointers may be NULL...
Capabilities, constraints, and settings - Web APIs
nd see the result, including both what the stream looks like and what the actual media settings are set to after applying the new constraints. The HTML and CSS for this example are pretty simple, and aren't shown here. You can look at the complete example by clicking here. HTML content <p>Experiment with media constraints! Edit the constraint sets for the video and audio tracks in the edit
boxes on the left, then click the "Apply Constraints" button to try them out. The actual settings the browser selected and is using are shown in the
boxes on the right. Below all of that, you'll see the video itself.</p> <p>Click the "Start" button to begin.</p> <h3>Constrainable properties available:</h3> <ul id="supportedConstraints"> </ul> <div id="startButton" class="button"> Start </di...
...aintString; Updating the settings display To the right of each of the constraint set editors is a second text box which we use to display the current configuration of the track's configurable properties. This display is updated by the function getCurrentSettings(), which gets the current settings for the audio and video tracks and inserts the corresponding code into the tracks' settings display
boxes by setting their value. function getCurrentSettings() { if (videoTrack) { videoSettingsText.value = JSON.stringify(videoTrack.getSettings(), null, 2); } if (audioTrack) { audioSettingsText.value = JSON.stringify(audioTrack.getSettings(), null, 2); } } This gets called after the stream first starts up, as well as any time we've applied updated constraints, as you'll see below. ...
...ext.value = JSON.stringify(audioTrack.getSettings(), null, 2); } } This gets called after the stream first starts up, as well as any time we've applied updated constraints, as you'll see below. Building the track constraint set objects The buildConstraints() function builds the MediaTrackConstraints objects for the audio and video tracks using the code in the two tracks' constraint set edit
boxes. function buildConstraints() { try { videoConstraints = JSON.parse(videoConstraintEditor.value); audioConstraints = JSON.parse(audioConstraintEditor.value); } catch(error) { handleError(error); } } This uses JSON.parse() to parse the code in each editor into an object. If either call to JSON.parse() throws an exception, handleError() is called to output the error message to t...
...ngth) { videoTrack = videoTracks[0]; } }).then(function() { return new Promise(function(resolve) { videoElement.onloadedmetadata = resolve; }); }).then(function() { getCurrentSettings(); }).catch(handleError); } There are several steps here: It calls buildConstraints() to create the MediaTrackConstraints objects for the two tracks from the code in the edit
boxes. It calls navigator.mediaDevices.getUserMedia(), passing in the constraints objects for the video and audio tracks. This returns a MediaStream with the audio and video from a source matching the inputs (typically a webcam, although if you provide the right constraints you can get media from other sources). When the stream is obtained, it's attached to the <video> element so that it's visible on...
ARIA: listbox role - Accessibility
he listbox role is used to identify an element that creates a list from which a user may select one or more static items, similar to the HTML <select> element. Unlike <select>, a listbox can contain images. Each child of a listbox should have a role of option. It is highly recommended to use the HTML select element, or a group of radio buttons if only one item can be selected, or a group of check
boxes if multiple items can be selected, because there is a lot of keyboard interactivity to manage focus for all the descendants, and native HTML elements provide this functionality for you for free. Elements with the role listbox have an implicit aria-orientation value of vertical. When a list is tabbed to, the first item in the list will be selected if nothing else already is. Up/down arrows navig...
...and pressing Shift + Up/Down arrows will move and extend the selection. Typing one or more letters will navigate the list items (same letter goes to each item starting with that, different letters go to the first item starting with that entire string). If the current item has an associated context menu, Shift+F10 will launch that menu. If list items are checkable, Space can be used to toggle check
boxes. For selectable list items, Space toggles their selection, Shift+Space can be used to select contiguous items, Ctrl+Arrow moves without selecting, and Ctrl+Space can be used to select non-contiguous items. It is recommended that a checkbox, link or other method be used to select all items, and Ctrl+A could be used as a shortcut key for this. When the listbox role is added to an element, or such ...
...tionally, in a single-select listbox, selection may also move with focus. Supporting this key is strongly recommended for lists with more than five options. End (Optional): Moves focus to last option. Optionally, in a single-select listbox, selection may also move with focus. Supporting this key is strongly recommended for lists with more than five options. Type-ahead is recommended for all list
boxes, especially those with more than seven options: Type a character: focus moves to the next item with a name that starts with the typed character. Type multiple characters in rapid succession: focus moves to the next item with a name that starts with the string of characters typed. Multiple Selection: Authors may implement either of two interaction models to support multiple selection: a...
... <option>Violet</option> <option>Periwinkle</option> </select> More examples Scrollable Listbox Example: Single-select listbox that scrolls to reveal more options, similar to HTML select with size attribute greater than one. Collapsible Dropdown Listbox Example: Single-select collapsible listbox that expands when activated, similar to HTML select with the attribute size="1". Example List
boxes with Rearrangeable Options: Examples of both single-select and multi-select list
boxes with accompanying toolbars where options can be added, moved, and removed. Best practices To be keyboard accessible, authors should manage focus of all descendants of this role. It is recommended that authors use different styling for the selection when the list is not focused, e.g. a non-active selection ...
CSS Box Alignment - CSS: Cascading Style Sheets
The module aims to create a consistent method of alignment across all of CSS. This document details the general concepts found in the specification. Note: The documentation for each layout method will detail how Box Alignment is applied there. Older alignment methods CSS traditionally had very limited alignment capabilities. We were able to align text using text-align, center blocks using auto margins, and in table or inline-block layouts using the vertical-align property. ...
...u were using Arabic, a right to left language, then the same value of start would result in the items moving to the right, as sentences in Arabic start on the right-hand side of the page. Both of these examples have justify-content: start, however the location of start changes according to the writing mode. Baseline alignment The Baseline alignment keywords are used to align the baselines of
boxes across a group of alignment subjects. They can be used as values for content alignment with justify-content and align-content and also for self alignment with justify-self and align-self. baseline first baseline last baseline Baseline content alignment -- specifying a baseline alignment value for justify-content or align-content -- works in layout methods that lay items out in rows. The al...
...t with justify-content and align-content and also for self alignment with justify-self and align-self. baseline first baseline last baseline Baseline content alignment -- specifying a baseline alignment value for justify-content or align-content -- works in layout methods that lay items out in rows. The alignment subjects are baseline aligned against each other by adding padding inside the
boxes. Baseline self alignment shifts the
boxes to align by baseline by adding a margin outside the
boxes. Self alignment is when using justify-self or align-self, or when setting these values as a group with justify-items and align-items. Distributed alignment The distributed alignment keywords are used with the align-content and justify-content properties. These keywords define what happens to any...
...ment subject is larger than the alignment container. The safe keyword will align to start in the case of a specified alignment causing an overflow, the aim being to avoid "data loss" where part of the item is outside of the boundaries of the alignment container and can't be scrolled to. If you specify unsafe then the alignment will be honoured even if it would cause such data loss. Gaps between
boxes The box alignment specification also includes the gap, row-gap, and column-gap properties. These properties enable the setting of a consistent gap between items in a row or column, in any layout method which has items arranged in this way. The gap property is a shorthand for row-gap and column-gap, which allows us to set these properties at once: row-gap column-gap gap In the below examp...
Logical properties for margins, borders and padding - CSS: Cascading Style Sheets
ck margins. margin-inline Sets all the inline margins. padding-block Sets the block padding. padding-inline Sets the inline padding. Margin examples The mapped margin properties of margin-inline-start, margin-inline-end, margin-block-start, and margin-inline-end can be used instead of their physical counterparts. ...
... You can also try changing the writing-mode from horizontal-tb to vertical-rl. ...
...argin-block: 5px 10px; } Note: The shorthand properties margin-inline and margin-block shipped in Firefox 66. As these are new properties check browser support before using. Padding examples The mapped padding properties of padding-inline-start, padding-inline-end, padding-block-start, and padding-inline-end can be used instead of their physical counterparts. In the example below I have two
boxes, one of which is using physical padding properties and the other logical padding properties. With a writing-mode of horizontal-tb, both
boxes should appear the same. Try changing the direction property to rtl to cause the
boxes to display in a right-to-left direction. The padding on the first box will stay in the same place, whereas the padding on the inline dimension of the second box will swit...
... many properties, as we have the longhands for the color, width, and style of the border on each side of a box, along with the shorthand to set all three at once for each side. As with margin and padding we have a mapped version of each physical property. The demo below uses some longhands and three shorthand values. As with the other demos try changing the direction property to rtl to cause the
boxes to display in a right-to-left direction, or changing the writing-mode from horizontal-tb to vertical-rl. New border shorthands There are two-value shorthands to set the width, style and, color of the block or inline dimension, and two-value shorthands to set all three values in the block or inline dimension. The below code, in a horizontal writing mode, would give you a 2px green solid border...
box-lines - CSS: Cascading Style Sheets
This is a property of the original CSS Flexible Box Layout Module draft, and has been replaced by a newer standard. See flexbox for information about the current standard. The box-lines CSS property determines whether the box may have a single or multiple lines (rows for horizontally oriented
boxes, columns for vertically oriented
boxes). /* Keyword values */ box-lines: single; box-lines: multiple; /* Global values */ box-lines: inherit; box-lines: initial; box-lines: unset; By default a horizontal box will lay out its children in a single row, and a vertical box will lay out its children in a single column. This behavior can be changed using the box-lines property. The default value is single, which means that all elements will be placed in a single row or column, and any ele...
...g reduced to their minimum widths, then children are moved one by one onto a new line, until the elements remaining on the previous line fit. This process can repeat to an arbitrary number of lines. If a line contains only a single element that doesn't fit, then the element should stay on that line and overflow out of the box. The later lines are placed below the earlier lines in normal direction
boxes and above in reverse direction
boxes. The height of a line is the height of the largest child in that line. No additional space appears between the lines apart from the margins on the largest elements in each line. For calculating the height of a line, margins with a computed value of auto should be treated as having a value of 0. A similar process occurs for children in a vertical box. Later li...
... Once the number of lines has been determined, elements with a computed value for box-flex other than 0 stretch as necessary in an attempt to fill the remaining space on the lines. ...
... No additional space appears between the lines apart from the margins on the largest elements in each line. For calculating the height of a line, margins with a computed value of auto should be treated as having a value of 0. A similar process occurs for children in a vertical box. Later lines in normal direction
boxes are placed to the right of earlier lines and to the left in reverse direction
boxes. Once the number of lines has been determined, elements with a computed value for box-flex other than 0 stretch as necessary in an attempt to fill the remaining space on the lines. Each line computes flexes independently, so only elements on that line are considered when evaluating box-flex and box-flex-groups. The packing of elements in a line, as specified by the box-pack property, is also com...
justify-self - CSS: Cascading Style Sheets
e value of the justify-items property of the parents box, unless the box has no parent, or is absolutely positioned, in these cases, auto represents normal. normal The effect of this keyword is dependent of the layout mode we are in: In block-level layouts, the keyword is a synonym of start. In absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned
boxes, and as stretch on all other absolutely-positioned
boxes. In table cell layouts, this keyword has no meaning as this property is ignored. In flexbox layouts, this keyword has no meaning as this property is ignored. In grid layouts, this keyword leads to a behavior similar to the one of stretch, except for
boxes with an aspect ratio or an intrinsic sizes where it behaves like start. sta...
... the alignment container in the appropriate axis. If the property's axis is not parallel with the inline axis, this value behaves like start. baseline first baseline last baseline Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the
boxes in its baseline-sharing group. The fallback alignment for first baseline is start, the one for last baseline is end. stretch If the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that ...
...equivalent functionality), so that the combined size exactly fills the alignment container. safe If the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe Regardless of the relative sizes of the item and alignment container, the given alignment value is honored. ...
... that the combined size exactly fills the alignment container. safe If the size of the item overflows the alignment container, the item is instead aligned as if the alignment mode were start. unsafe Regardless of the relative sizes of the item and alignment container, the given alignment value is honored. ...
mask-origin - CSS: Cascading Style Sheets
rigin: content; -webkit-mask-origin: padding; -webkit-mask-origin: border; /* Global values */ mask-origin: inherit; mask-origin: initial; mask-origin: unset; For elements rendered as a single box, this property specifies the mask positioning area. In other words, this property specifies the origin position of an image specified by the mask-image CSS property. ...
...t-mask-origin: padding; -webkit-mask-origin: border; /* Global values */ mask-origin: inherit; mask-origin: initial; mask-origin: unset; For elements rendered as a single box, this property specifies the mask positioning area. In other words, this property specifies the origin position of an image specified by the mask-image CSS property. ...
...ebkit-mask-origin: border; /* Global values */ mask-origin: inherit; mask-origin: initial; mask-origin: unset; For elements rendered as a single box, this property specifies the mask positioning area. In other words, this property specifies the origin position of an image specified by the mask-image CSS property. ...
...s */ mask-origin: inherit; mask-origin: initial; mask-origin: unset; For elements rendered as a single box, this property specifies the mask positioning area. In other words, this property specifies the origin position of an image specified by the mask-image CSS property. For elements rendered as multiple
boxes, such as inline
boxes on several lines or
boxes on several pages, it specifies which
boxes box-decoration-break operates upon to determine the mask positioning area. Syntax One or more of the keyword values listed below, separated by commas. Values content-box The position is relative to the content box. padding-box The position is relative to the padding box. For single
boxes 0 0 is the upper left corner of the padding edge, 100% 100% is the lower right corner. border-box T...
place-self - CSS: Cascading Style Sheets
baseline auto; place-self: last baseline normal; place-self: stretch auto; /* Global values */ place-self: inherit; place-self: initial; place-self: unset; Values auto Computes to the parent's align-items value. normal The effect of this keyword is dependent of the layout mode we are in: In absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned
boxes, and as stretch on all other absolutely-positioned
boxes. In static position of absolutely-positioned layouts, the keyword behaves as stretch. For flex items, the keyword behaves as stretch. For grid items, this keyword leads to a behavior similar to the one of stretch, except for
boxes with an aspect ratio or an intrinsic sizes where it behaves like start. The property doesn't apply to b...
... self-start Aligns the items to be flush with the edge of the alignment container corresponding to the item's start side in the cross axis. self-end Aligns the items to be flush with the edge of the alignment container corresponding to the item's end side in the cross axis. ...
...hin the line on the cross-axis. If the cross-size of the item is larger than the flex container, it will overflow equally in both directions. baseline first baseline last baseline Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the
boxes in its baseline-sharing group. The fallback alignment for first baseline is start, the one for last baseline is end. stretch If the combined size of the items along the cross axis is less than the size of the alignment container and the item is auto-sized, its size is increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent f...
...d, its size is increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size of all auto-sized items exactly fills the alignment container along the cross axis. Formal definition Initial valueas each of the properties of the shorthand:align-self: autojustify-self: autoApplies toblock-level
boxes, absolutely-positioned
boxes, and grid itemsInheritednoComputed valueas each of the properties of the shorthand:align-self: auto computes to itself on absolutely-positioned elements, and to the computed value of align-items on the parent (minus any legacy keywords) on all other
boxes, or start if the box has no parent. Its behavior depends on the layout model, as described for justify-self. Other...
<input>: The Input (Form Input) element - HTML: Hypertext Markup Language
of same-named radio buttons. If present on a checkbox type, it indicates that the checkbox is checked by default (when the page loads). It does not indicate whether this checkbox is currently checked: if the checkbox's state is changed, this content attribute does not reflect the change. (Only the HTMLInputElement's checked IDL attribute is updated.) Note: Unlike other input controls, a check
boxes and radio buttons value are only included in the submitted data if they are currently checked. If they are, the name and the value(s) of the checked controls are submitted. For example, if a checkbox whose name is fruit has a value of cherry, and the checkbox is checked, the form data submitted will include fruit=cherry. If the checkbox isn't active, it isn't listed in the form data at all. The...
... are only included in the submitted data if they are currently checked. If they are, the name and the value(s) of the checked controls are submitted. For example, if a checkbox whose name is fruit has a value of cherry, and the checkbox is checked, the form data submitted will include fruit=cherry. If the checkbox isn't active, it isn't listed in the form data at all. The default value for check
boxes and radio buttons is on. dirname Valid for text and search input types only, the dirname attribute enables the submission of the directionality of the element. When included, the form control will submit with two name/value pairs: the first being the name and value, the second being the value of the dirname as the name with the value of ltr or rtl being set by the browser. <form action=...
...ype. name A string specifying a name for the input control. This name is submitted along with the control's value when the form data is submitted. What's in a name Consider the name a required attribute (even though it's not). If an input has no name specified, or name is empty, the input's value is not submitted with the form! (Disabled controls, unchecked radio buttons, unchecked check
boxes, and reset buttons are also not sent.) There are two special cases: _charset_ : If used as the name of an <input> element of type hidden, the input's value is automatically set by the user agent to the character encoding being used to submit the form. isindex: For historical reasons, the name isindex is not allowed. name and radio buttons The name attribute creates a unique behavio...
...ls along side. This is needed so those who use assistive technologies can tell what the input is for. Also, clicking or touching a label gives focus to the label's associated form control. This improves the accessibility and usability for sighted users, increases the area a user can click or touch to activate the form control. this is especially useful (and even needed) for radio buttons and check
boxes, which are tiny. For more information about labels in general see Labels . The following is an example of how to associate the <label> with an <input> element in the above style. You need to give the <input> an id attribute. The <label> then needs a for attribute whose value is the same as the input's id. <label for="peas">Do you like peas?</label> <input type="checkbox" name="peas" id="peas"> ...
Content Processes - Archive of obsolete content
o the port property, workers also support the web worker API, which allows scripts to send messages to each other using the postMessage function. This function uses the same pipe internally, and causes a 'message' event to be emitted on the other side. As explained earlier, Firefox doesn't yet use separate processes for tabs or add-ons, so instead, each content script is loaded in a sandbox. Sand
boxes were explained this article. Accessing the DOM The global for the content sandbox has the window object as its prototype. This allows the content script to access any property on the window object, even though that object lives outside the sandbox. Recall that the window object inside the sandbox is actually a wrapper to the real object. A potential problem with the content script having a...
...defined on the underlying object, rather than the wrapper itself. This feature should only be used when you really need it, however. A few Notes on Security As we stated earlier, the SDK was designed with multiprocess support in mind, despite the fact that work on implementing this in Firefox has currently been suspended. Since both add-on modules and content scripts are currently loaded in sand
boxes rather than separate processes, and sand
boxes can communicate with each other directly (using imports/exports), you might be wondering why we have to go through all the trouble of passing messages between add-on and content scripts. The reason for this extra complexity is that the code for add-on modules and content scripts have different privileges. Every add-on module can get chrome privileges ...
...ht be wondering why we have to go through all the trouble of passing messages between add-on and content scripts. The reason for this extra complexity is that the code for add-on modules and content scripts have different privileges. Every add-on module can get chrome privileges simply by asking for them, whereas content scripts have the same privileges as the page it is running on. When two sand
boxes have the same privileges, a wrapper in one sandbox provides transparent access to an object in the other sandbox. When the two sand
boxes have different privileges, things become more complicated, however. Code with content privileges should not be able to acces code with chrome privileges, so we use specialized wrappers, called security wrappers, to limit access to the object in the other sandbox...
Appendix D: Loading Scripts - Archive of obsolete content
initialized with a security principal object, or otherwise a window or URL from which to derive one. This means that evalInSandbox can be used to execute code with a specified privilege level rather than full chrome privileges. Beyond this, the scope of the Sandbox can be augmented or rarified to add or remove privileges as necessary. Under ordinary circumstances, native objects passed out of Sand
boxes are wrapped in XrayWrapper objects, which means that only native properties of these objects are directly exposed to privileged code. This behavior can be reversed by setting the wantsXrays parameter to false when constructing the Sandbox. Disadvantages Performance: There are several significant performance disadvantages inherent in this method: There is currently no way to load code ...
...ped in XrayWrapper objects, which means that only native properties of these objects are directly exposed to privileged code. This behavior can be reversed by setting the wantsXrays parameter to false when constructing the Sandbox. Disadvantages Performance: There are several significant performance disadvantages inherent in this method: There is currently no way to load code into sand
boxes from a cache. This means that code must be compiled and executed anew each time it is loaded, which has a significant overhead for large code bases. In addition to compile time, reading files synchronously from disk has its own overhead, and XMLHttpRequests have significantly more overhead than native loading methods. Although wary authors can choose to cache instances of their modules so t...
...rent. Some known issues include: E4X XML objects cannot be wrapped for passage between compartments: bug 613142 There are a number of type detection issues, including: String.replace does not recognize RegExp objects from foreign compartments: bug 633830 Debugging: Support for Sandbox evaluation in development tools is uneven. Chromebug supports Firebug based Sand
boxes. Examples The following code will execute a simple script in a Sandbox with the privilege level of the current content page. The globals of the current content window will be available in the scripts global scope. In stack traces, the script will appear to have been loaded from the file "zz-9://plural/zed/alpha", line 42. // Use the current content window as the execution context. // To make ...
timeout - Archive of obsolete content
There is no default. The timer starts after the user types a character. ...
...There is no default. The timer starts after the user types a character. ...
...There is no default. The timer starts after the user types a character. ...
Adding more elements - Archive of obsolete content
Adding Elements to our find files example We will add some more elements to the find files dialog now. First, we will add the capability to search for other information such as the file size and date. ...
...A spacer has been added in between each element to separate them. These spacers have been given an explicit width of 10 pixels each. You will notice that if the window is resized, the textbox grows but the other components do not. You will also notice that the label was removed. If you resize the window vertically, the elements do not change size. This is because th...
...ialog. A spacer has been added in between each element to separate them. These spacers have been given an explicit width of 10 pixels each. You will notice that if the window is resized, the textbox grows but the other components do not. You will also notice that the label was removed. If you resize the window vertically, the elements do not change size. This is because they are inside horizontal
boxes. In might be more appropriate if the Find and Cancel buttons always stayed along the bottom of the window. This is easy to do by adding a spacer in between the two horizontal
boxes. <spacer style="height: 10px"/> <hbox> <menulist id="searchtype"> <menupopup> <menuitem label="Name"/> <menuitem label="Size"/> <menuitem label="Date Modified"/> </menupopup> </menulist> ...
Introduction to XBL - Archive of obsolete content
has a sister language, XBL (eXtensible Bindings Language). This language is used for declaring the behavior of XUL widgets. Bindings You can use XUL to define the layout of a user interface for an application. You can customize the look of elements by applying styles to them. You can also create new skins by changing the styles. The basic appearance of all elements, such as scroll bars and check
boxes may be modified by adjusting the style or by setting attributes on the element. However, XUL provides no means in which you can change how an element works (or add a new element which can be reused). For example, you might want to change how the pieces of a scroll bar function. For this, you need XBL. An XBL file contains a set of bindings. Each binding describes the behavior of a XUL widget. For...
... to. The binding can add scripts to provide default handling. In addition new events can be defined. Style: custom style properties that the XBL defined element has. Binding Example The box is generic enough that you can use it to create custom widgets (although you can use any element, even one you make up yourself). By assigning a class to a box tag, you can associate a binding to only those
boxes that belong to that class. The following example demonstrates this. XUL (example.xul): <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <?xml-stylesheet href="chrome://example/skin/example.css" type="text/css"?> <window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <box class="okcancelbuttons"/> </window> CSS (example.css): box...
...rg/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> <binding id="okcancel"> <content> <xul:button label="OK"/> <xul:button label="Cancel"/> </content> </binding> </bindings> This example creates a window with a single box. The box has been declared to have a class of okcancelbuttons. The style sheet associated with the file says that
boxes with the class okcancelbuttons have a specialized binding, defined in the XBL file. You may use other elements besides the box, even your own custom tags. We'll look more at the details of the XBL part in the next section. However, to summarize, it causes two buttons to be added automatically inside the box, one an OK button and the other a Cancel button. In the next section, we will look at crea...
XUL element attributes - Archive of obsolete content
<< XUL Reference home The following attributes are common to all XUL elements: align Type: one of the values below The align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children. For
boxes that have horizontal orientation, it specifies how its children will be aligned vertically. For
boxes that have vertical orientation, it specifies how its children will be aligned horizontally. start Child elements are aligned starting from the left or top edge of the box. If the box is larger than the total size of the children, the extra space is placed on the right or bottom side. center Extra space i...
...lly along each side of the child elements, resulting in the children being placed in the center of the box. end Child elements are placed on the right or bottom edge of the box. If the box is larger than the total size of the children, the extra space is placed on the left or top side. baseline This value applies to horizontally oriented
boxes only. It causes the child elements to be aligned so that their text labels are lined up. stretch This is the default value. The child elements are stretched to fit the size of the box. For a horizontal box, the children are stretched to be the height of the box. For a vertical box, the children are stretched to be the width of the box. If the size of the box changes,...
...are placed next to each other in a row in the order that they appear in the XUL source. vertical Child elements of the element are placed under each other in a column in the order that they appear in the XUL source. pack Type: one of the values below The pack attribute specifies where child elements of the box are placed when the box is larger that the size of the children. For
boxes with horizontal orientation, it is used to indicate the position of children horizontally. For
boxes with vertical orientation, it is used to indicate the position of children vertically. The align attribute is used to specify the position in the opposite direction. You can also specify the value of pack using the style property -moz-box-pack. start Child elements are placed starting from t...
XUL controls - Archive of obsolete content
select a color. <colorpicker color="#FF0000"/> Colorpicker Reference <colorpicker type="button"> A specialized type of color picker which shows only a button. Pressing the button displays a color picker popup window. <colorpicker type="button" color="#CC0080"/> Colorpicker Reference <datepicker> A set of text
boxes which may be used to allow the entry of a date. <datepicker value="2007/03/26"/> Datepicker Reference <datepicker type="grid"> A datepicker which displays a calendar grid for selecting a date. <datepicker type="grid" value="2007/02/20"/> Datepicker Reference <datepicker type="popup" > A datepicker which di...
...o allow the entry of a date. <datepicker value="2007/03/26"/> Datepicker Reference <datepicker type="grid"> A datepicker which displays a calendar grid for selecting a date. <datepicker type="grid" value="2007/02/20"/> Datepicker Reference <datepicker type="popup" > A datepicker which displays a set of text
boxes for date entry, but also has a button for displaying a popup calendar grid. <datepicker type="popup" value="2008/08/24"/> Datepicker Reference <description> The description element is used for descriptive text. <description> Select a time for the event to start </description> More information about the description element. Descr...
...type="search"/> Textbox Reference <textbox type="timed"> Deprecated in Gecko 1.9.1 A textbox for responding to user input. The command event is fired after the user stops typing, or if the user tabs away or hits Enter. <textbox type="timed"/> Textbox Reference <timepicker> A timepicker displays a set of text
boxes for entering a time. <timepicker value="12:05"/> Timepicker Reference <toolbarbutton> A button that is displayed on a toolbar. <toolbarbutton label="Reload"/> More information about the toolbarbutton element. Toolbarbutton Reference Related Elements: toolbar <toolbarbutton type="menu"> A button that ...
attribute.align - Archive of obsolete content
The pack attribute is related to the alignment but is used to specify the position in the opposite direction. You can also specify the value of align using the style property -moz-box-align. ...
...The pack attribute is related to the alignment but is used to specify the position in the opposite direction. You can also specify the value of align using the style property -moz-box-align. ...
...n the right or bottom side. center Extra space is split equally along each side of the child elements, resulting the children being placed in the center of the box. end Child elements are placed on the right or bottom edge of the box. If the box is larger than the total size of the children, the extra space is placed on the left or top side. baseline This value applies to horizontally oriented
boxes only. It causes the child elements to be aligned so that their text labels are lined up. stretch The child elements are stretched to fit the size of the box. For a horizontal box, the children are stretched to be the height of the box. For a vertical box, the children are stretched to be the width of the box. If the size of the box changes, the children stretch to fit. Use the flex attribute to ...
Index - Game development
llision detection 2D, Games, JavaScript, collision detection One of the simpler forms of collision detection is between two rectangles that are axis aligned -- meaning no rotation. The algorithm works by ensuring there is no gap between any of the 4 sides of the rectangles. Any gap means a collision does not exist. ...
...It is assumed that before reading this you have read our 3D collision detection introductory article first, and have basic knowledge about Three.js. ...
...ion to the different bounding volume techniques used to implement collision detection in 3D environments. Followup articles will cover implementations in specific 3D libraries. 14 Bounding volume collision detection with THREE.js 3D, Games, JavaScript, WebGL, bounding
boxes, collision detection, three.js This article shows how to implement collision detection between bounding
boxes and spheres using the Three.js library. It is assumed that before reading this you have read our 3D collision detection introductory article first, and have basic knowledge about Three.js. 15 3D games on the Web Games, Graphics, NeedsContent, NeedsExample, WebGL, WebVR, three.js For rich gaming experiences on the web, the weapon of choice is WebGL, which is rendered on HTML <...
3D collision detection - Game development
This article provides an introduction to the different bounding volume techniques used to implement collision detection in 3D environments. Followup articles will cover implementations in specific 3D libraries. Axis-aligned bounding
boxes As with 2D collision detection, axis-aligned bounding
boxes (AABB) are the quickest algorithm to determine whether the two game entities are overlapping or not. ...
...n 3D environments. Followup articles will cover implementations in specific 3D libraries. Axis-aligned bounding
boxes As with 2D collision detection, axis-aligned bounding
boxes (AABB) are the quickest algorithm to determine whether the two game entities are overlapping or not. This consists of wrapping game entities in a non-rotated (thus axis-aligned) box and checking the positions of these
boxes in the 3D coordinate space to see if they are overlapping. The axis-aligned constraint is there because of performance reasons. The overlapping area between two non-rotated
boxes can be checked with logical comparisons alone, whereas rotated
boxes require additional trigonometric operations, which are slower to calculate. If you have entities that will be rotating, you can either modify the di...
... \wedge P_z <= B_{maxZ}) Or in JavaScript: function isPointInsideAABB(point, box) { return (point.x >= box.minX && point.x <= box.maxX) && (point.y >= box.minY && point.y <= box.maxY) && (point.z >= box.minZ && point.z <= box.maxZ); } AABB vs. AABB Checking whether an AABB intersects another AABB is similar to the point test. We just need to do one test per axis, using the
boxes' boundaries. The diagram below shows the test we'd perform over the X-axis -- basically, do the ranges AminX-AmaxX and BminX-BmaxX overlap? Mathematically this would look like so: f(A,B)=(AminX<=BmaxX?AmaxX>=BminX)?(AminY<=BmaxY?AmaxY>=BminY)?(AminZ<=BmaxZ?AmaxZ>=BminZ)f(A,B) = And in JavaScript, we'd use this: function intersect(a, b) { return (a.minX <= b.maxX && a.maxX >= b.minX) && ...
Backgrounds and borders - Learn web development
round images, and rounded corners, backgrounds and borders are the answer to a lot of styling questions in CSS. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps.) Objective: To learn how to style the background and border of
boxes. Styling backgrounds in CSS The CSS background property is a shorthand for a number of background longhand properties that we will meet in this lesson. If you discover a complex background property in a stylesheet, it might seem a little hard to understand as so many values can be passed in at once. .box { background: linear-gradient(105deg, rgba(255,255,255,.2) 39%, rgba(51,56,57,1) 9...
...tends underneath the content and padding box of the element. In the example below, we have used various color values to add a background color to the box, a heading, and a <span> element. Play around with these, using any available <color> value. Background images The background-image property enables the display of an image in the background of an element. In the example below, we have two
boxes -- one has a background image which is larger than the box, the other has a small image of a star. This example demonstrates two things about background images. By default, the large image is not scaled down to fit the box, so we only see a small corner of it, whereas the small image is tiled to fill the box. In this case, the actual image is just a single star. If you specify a background co...
...n read more about the different types of gradients and things you can do with them on the MDN page for the <gradient> data type. A fun way to play with gradients is to use one of the many CSS Gradient Generators available on the web, such as this one. You can create a gradient then copy and paste out the source code that generates it. Try some different gradients in the example below. In the two
boxes respectively, we have a linear gradient that is stretched over the whole box, and a radial gradient with a set size, which therefore repeats. Multiple background images It is also possible to have multiple background images -- you specify multiple background-image values in a single property value, separating each one with a comma. When you do this you may end up with background images overl...
Handling different text directions - Learn web development
lock elements and others as inline elements. As we have seen described above, block and inline is tied to the writing mode of the document, and not the physical screen. Blocks are only displayed from the top to the bottom of the page if you are using a writing mode that displays text horizontally, such as English. If we look at an example this will become clearer. In this next example I have two
boxes that contain a heading and a paragraph. The first uses writing-mode: horizontal-tb, a writing mode that is written horizontally and from the top of the page to the bottom. The second uses writing-mode: vertical-rl; this is a writing mode that is written vertically and from right to left. When we switch the writing mode, we are changing which direction is block and which is inline. In a horizon...
...; you will find it really helpful in your understanding of CSS. Logical properties and values The reason to talk about writing modes and direction at this point in your learning however, is because of the fact we have already looked at a lot of properties which are tied to the physical dimensions of the screen, and make most sense when in a horizontal writing mode. Let's take a look at our two
boxes again -- one with a horizontal-tb writing mode and one with vertical-rl. I have given both of these
boxes a width. You can see that when the box is in the vertical writing mode, it still has a width, and this is causing the text to overflow. What we really want in this scenario, is to essentially swap height and width along with the writing mode. When we're in a vertical writing mode we want t...
... The padding-left property maps to padding-inline-start, the padding that is applied to the start of the inline direction. This will be where sentences start in that writing mode. The border-bottom property maps to border-block-end, which is the border at the end of the block dimension. You can see a comparison between physical and logical properties below. If you change the writing mode of the
boxes by switching the writing-mode property on .box to vertical-rl, you will see how the physical properties stay tied to their physical direction, whereas the logical properties switch with the writing mode. You can also see that the <h2> has a black border-bottom. Can you work out how to make that bottom border always go below the text in both writing modes? There are a huge number of properties...
Images, media, and form elements - Learn web development
Understanding what is and isn't possible can save some frustration, and this lesson will highlight some of the main things that you need to know. ...
...lt. Sizing images As you already know from following these lessons, everything in CSS generates a box. If you place an image inside a box that is smaller or larger than the intrinsic dimensions of the image file in either direction, it will either appear smaller than the box, or overflow the box. You need to make a decision about what happens with the overflow. In the example below we have two
boxes, both 200 pixels in size: One contains an image which is smaller than 200 pixels -- it is smaller than the box and doesn't stretch to fill it. The other is larger than 200 pixels and overflows the box. So what can we do about the overflowing issue? As we learned in our previous lesson, a common technique is to make the max-width of an image 100%. This will enable the image to become smal...
...or leaves a required field blank, the browser can show an error message. Different browsers are inconsistent in how much styling and customization they allow for such items. Styling text input elements Elements that allow for text input, such as <input type="text">, specific types such as <input type="email">, and the <textarea> element are quite easy to style and tend to behave just like other
boxes on your page. The default styling of these elements will differ however based on the operating system and browser that your user visits the site with. In the example below we have styled some text inputs using CSS -- you can see that things such as borders, margins and padding all apply as you would expect. We are using attribute selectors to target the different input types. Try changing how th...
Overflowing content - Learn web development
ow is and how to manage it. Prerequisites: Basic computer literacy, basic software installed, basic knowledge of working with files, HTML basics (study Introduction to HTML), and an idea of how CSS works (study CSS first steps.) Objective: To understand overflow and how to manage it. What is overflow? Everything in CSS is a box. You can constrain the size of these
boxes by assigning values of width and height (or inline-size and block-size). Overflow happens when there is too much content to fit in a box. CSS provides various tools to manage overflow. As you go further with CSS layout and writing CSS, you will encounter more overflow situations. CSS tries to avoid "data loss" Let's consider two examples that demonstrate the default behavior of CSS when there i...
...l on the y axis, you could use the overflow-y property, setting overflow-y: scroll. You can also scroll on the x axis using overflow-x, although this is not a recommended way to accommodate long words! If you have a long word in a small box, you might consider using the word-break or overflow-wrap properties. In addition, some of the methods discussed in Sizing items in CSS may help you create
boxes that scale better with varying amounts of content. As with scroll, you get a scrollbar in the scrolling dimension whether or not there is enough content to cause a scrollbar. Note: You can specify x and y scrolling using the overflow property, passing two values. If two keywords are specified, the first applies to overflow-x and the second applies to overflow-y. Otherwise, both overflow-x an...
...ined and not overlap, in order to create a consistent scrolling experience. Unwanted overflow in web design Modern layout methods (described in CSS layout) manage overflow. They largely work without assumptions or dependencies for how much content there will be on a web page. This has not always been the norm. In the past, some sites were built with fixed-height containers to align bottoms of
boxes. These
boxes may otherwise have no relationship to each other. This was fragile. In a legacy application, you may encounter a box where content is overlaying other content on the page. Now you can recognize that this happens with overflow. Ideally, you will refactor the layout to not rely on fixed-height containers. When developing a site, always keep overflow in mind. Test designs with large an...
CSS values and units - Learn web development
is value to 1.5em and you will see that the font size of all the elements increases, but only the last item will get wider, as the width is relative to that font size. After following the instructions above, try playing with the values in other ways, to see what you get. ems and rems em and rem are the two relative lengths you are likely to encounter most frequently when sizing anything from
boxes to text. It's worth understanding how these work, and the differences between them, especially when you start getting on to more complex subjects like styling text or CSS layout. The below example provides a demonstration. The HTML is a set of nested lists -- we have three lists in total and both examples have the same HTML. The only difference is that the first has a class of ems and the second...
...age is treated in the same way as a length. The thing with percentages is that they are always set relative to some other value. For example, if you set an element's font-size as a percentage it will be a percentage of the font-size of the element's parent. If you use a percentage for a width value, it will be a percentage of the width of the parent. In the below example the two percentage-sized
boxes and the two pixel-sized
boxes have the same class names. Both sets are 200px and 40% wide respectively. The difference is that the second set of two
boxes is inside a wrapper that is 400 pixels wide. The second 200px wide box is the same width as the first one, but the second 40% box is now 40% of 400px -- a lot narrower than the first one! Try changing the width of the wrapper or the percentag...
...you different levels of transparency. Note: Setting an alpha channel on a color has one key difference to using the opacity property we looked at earlier. When you use opacity you make the element and everything inside it opaque, whereas using RGBA colors only makes the color you are specifying opaque. In the example below I have added a background image to the containing block of our colored
boxes. I have then set the
boxes to have different opacity values -- notice how the background shows through more when the alpha channel value is smaller. In this example, try changing the alpha channel values to see how it affects the color output. Note: At some point modern browsers were updated so that rgba() and rgb(), and hsl() and hsla() (see below), became pure aliases of each other and st...
Floats - Learn web development
ill stick to the right, and the content will wrap around it to the left. Try changing the float value to right and replace margin-right with margin-left in the last ruleset to see what the result is. While we can add a margin to the float to push the text away, we can't add a margin to the text to move it away from the float. This is because a floated element is taken out of normal flow, and the
boxes of the following items actually run behind the float. You can demonstrate this by making some changes to your example. Add a class of special to the first paragraph of text, the one immediately following the floated box, then in your CSS add the following rules. These will give our following paragraph a background color. .special { background-color: rgb(79,185,227); padding: 10px; color: ...
... Clearing floats We have seen that the float is removed from normal flow and that other elements will display beside it, therefore if we want to stop the following element from moving up we need to clear it; thi...
...kground-color: rgb(79,185,227); padding: 10px; color: #fff; } .cleared { clear: left; } You should see that the following paragraph clears the floated element and no longer comes up alongside it. The clear property accepts the following values: left: Clear items floated to the left. right: Clear items floated to the right. both: Clear any floated items, left or right. Clearing
boxes wrapped around a float You now know how to clear something following a floated element, but let's see what happens if you have a tall float and a short paragraph, with a box wrapped around both elements. Change your document so that the first paragraph and our floated box are wrapped with a <div> with a class of wrapper. <div class="wrapper"> <div class="box">Float</div> <p>Lorem ipsum dol...
Introduction to CSS layout - Learn web development
rtant, as you can then work with the way things are laid out by default rather than fighting against it. The methods that can change how elements are laid out in CSS are as follows: The display property -- Standard values such as block, inline or inline-block can change how elements behave in normal flow, for example making a block-level element behave like an inline element (see Types of CSS
boxes for more information). We also have entire layout methods that are switched on via specific display values, for example CSS Grid and Flexbox, which alter how elements inside the element they are set on are laid out. Floats -- Applying a float value such as left can cause block level elements to wrap alongside one side of an element, like the way images sometimes have text floating around them in...
...isplay values, for example CSS Grid and Flexbox, which alter how elements inside the element they are set on are laid out. Floats -- Applying a float value such as left can cause block level elements to wrap alongside one side of an element, like the way images sometimes have text floating around them in magazine layouts. The position property -- Allows you to precisely control the placement of
boxes inside other
boxes. static positioning is the default in normal flow, but you can cause elements to be laid out differently using other values, for example always fixed to the top of the browser viewport. Table layout -- features designed for styling the parts of an HTML table can be used on non-table elements using display: table and associated properties. Multi-column layout -- The Multi-colu...
...ow -- including making it overlap other elements on the page. Absolute positioning moves an element completely out of the page's normal layout flow, like it is sitting on its own separate layer. From there, you can fix it in a position relative to the edges of the page's <html> element (or its nearest positioned ancestor element). This is useful for creating complex layout effects such as tabbed
boxes where different content panels sit on top of one another and are shown and hidden as desired, or information panels that sit off screen by default, but can be made to slide on screen using a control button. Fixed positioning is very similar to absolute positioning, except that it fixes an element relative to the browser viewport, not another element. This is useful for creating effects such as a...
Multiple-column layout - Learn web development
f is that the rule does not take up any width of its own. It lies across the gap you created with column-gap. To make more space either side of the rule you will need to increase the column-gap size. Spanning columns You can cause an element to span across all of the columns. In this case the content breaks when the spanning element is introduced and continues below creating a new set of column
boxes. To cause an element to span all of the columns use the column-span property set to all. Note that it isn't possible to cause an element to span some columns. The property can only have the value of none (which is the default) or all. Spanning the columns body { width: 90%; max-width: 900px; margin: 2em auto; font: .9em/1.2 Arial, Helvetica, sans-serif; } .container { column-count...
.... It essentially behaves the same way as content behaves in paged media -- such as when you print a webpage. When you turn your content into a multicol container it is fragmented into columns, and the content breaks to allow this to happen. Sometimes, this breaking will happen in places that lead to a poor reading experience. In the live example below, I have used multicol to lay out a series of
boxes, each of which have a heading and some text inside. The heading becomes separated from the text if the columns fragment between the two. Cards example body { width: 90%; max-width: 900px; margin: 2em auto; font: .9em/1.2 Arial, Helvetica, sans-serif; } <div class="container"> <div class="card"> <h2>I am the heading</h2> <p> Lorem ipsum dolor sit amet, con...
...tainer of the heading and text, and therefore we do not want to fragment this box. At the present time it is also worth adding the older property page-break-inside: avoid for best browser support. .card { break-inside: avoid; page-break-inside: avoid; background-color: rgb(207,232,220); border: 2px solid rgb(79,185,227); padding: 10px; margin: 0 0 1em 0; } Reload the page and your
boxes should stay in one piece. Multicol Fragmentation body { width: 90%; max-width: 900px; margin: 2em auto; font: .9em/1.2 Arial, Helvetica, sans-serif; } <div class="container"> <div class="card"> <h2>I am the heading</h2> <p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla luctus aliquam dolor, eu lacinia lorem placerat vulpu...
Supporting older browsers - Learn web development
pport the methods you have used. This will always be the case on the web -- as new features are developed, different browsers will prioritise different things. This article explains how to use modern web techniques without locking out users of older technology. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS and Styling
boxes.) Objective: To understand how to provide support for your layouts on older browsers that might not support the features you want to use. What is the browser landscape for your site? Every website is different in terms of target audience. Before deciding on the approach to take, find out the number of visitors coming to your site using older browsers. This is straightforward i...
...h the knowledge that browsers ignore CSS that they don't understand, and you have a way to create simple layouts using the legacy techniques we have already covered, which are then overwritten by your Grid layout in modern browsers that understand it. In the below example, we have floated three <div>s so they display in a row. Any browser that does not support CSS Grid Layout will see the row of
boxes as a floated layout. A floated item that becomes a grid item loses the float behaviour, which means that by turning the wrapper into a Grid Container, the floated items become Grid Items. If the browser supports Grid Layout it will display the grid view, if not it ignores the display: grid and related properties and the floated layout is used. * {box-sizing: border-box;} .wrapper { backgroun...
... create column layouts, if an item has display: inline-block set but then becomes a flex or grid item, the inline-block behaviour is ignored. display: table The method of creating CSS Tables described in the introduction to these lessons can be used as a fallback. Items that have CSS table layouts set on them will lose this behaviour if they become flex or grid items. Importantly, the anonymous
boxes created to fix up the table structure are not created. Multiple-column Layout For certain layouts you could use multi-col as a fallback, if your container has any of the column-* properties defined on it and then becomes a grid container, the multicol behaviour will not happen. Flexbox as a Fallback for Grid Flexbox has greater browser support than Grid due to being supported by IE10 and 11, ...
CSS property compatibility table for form controls - Learn web development
text-indent Yes Yes text-overflow No No text-shadow Partial Partial text-transform N.A. N.A. Border and background background No No Supported but there is too much inconsistency between browsers to be reliable. border-radius No No box-shadow No No Check
boxes and radio buttons See the checkbox and radio input types. Property N T Note CSS box model width No[1] No[1] Some browsers add extra margins and others stretch the widget. height No[1] No[1] Some browsers add extra margins and others stretch the widget. border No No ...
...align N.A. N.A. text-decoration N.A. N.A. text-indent N.A. N.A. text-overflow N.A. N.A. text-shadow N.A. N.A. text-transform N.A. N.A. Border and background background No No border-radius No No box-shadow No No Select
boxes (single line) See the <select>, <optgroup> and <option> elements. Property N T Note CSS box model width Partial[1] Partial[1] This property is okay on the <select> element, but it cannot be the case on the <option> or <optgroup> elements. height No Yes border Partial Yes margin ...
...<select> element. Border and background background Partial[1] Partial[1] Most of the browsers only support this property on the <select> element. border-radius Partial[1] Partial[1] box-shadow No Partial[1] Note Firefox does not provide any way to change the down arrow on the <select> element. Select
boxes (multiline) See the <select>, <optgroup> and <option> elements and the size attribute. Property N T Note CSS box model width Yes Yes height Yes Yes border Yes Yes margin Yes Yes padding Partial[1] Partial[1] Opera does not support padding-top and padding-botto...
Experimental features in Firefox
ad Firefox Nightly or Firefox Developer Edition. Which you need is described alongside each feature's description below. Editor's note: When adding features to these tables, please try to include a link to the relevant bug or bugs using the bug macro: {{bug(bug-number)}}. HTML Element: <dialog> The HTML <dialog> element and its associated DOM APIs provide support for HTML-based modal dialog
boxes. The current implementation is a little inelegant but is basically functional. See bug 840640 for more details. Release channel Version added Enabled by default? Nightly 53 Yes Developer Edition 53 No Beta 53 No Release 53 No Preference name dom.dialog_element.enabled Global attribute: inputmode Ou...
...ith rel="preload" for more details. For more details on the status of this feature, see bug 1639607. Release channel Version added Enabled by default? Nightly 78 Yes Developer Edition 78 Yes Beta 78 Yes Release 78 No Preference name network.preload CSS Display stray control characters in CSS as hex
boxes This feature renders control characters (Unicode category Cc) other than tab (U+0009), line feed (U+000A), form feed (U+000C), and carriage return (U+000D) as a hexbox when they are not expected. See bug 1099557 for more details. Release channel Version added Enabled by default? Nightly 43 Yes Developer Edition 43 No Beta 43 No ...
... another node. See bug 918189 for more details. Release channel Version added Enabled by default? Nightly 31 Yes Developer Edition 31 No Beta 31 No Release 31 No Preference name layout.css.getBoxQuads.enabled GeometryUtils method: getBoxQuads() The GeometryUtils method getBoxQuads() returns the CSS
boxes for a Node relative to any other node or viewport. See bug 917755 for more details. Release channel Version added Enabled by default? Nightly 31 Yes Developer Edition 31 No Beta 31 No Release 31 No Preference name layout.css.convertFromNode.enable Payment Request API Primary payment handling The P...
Limitations of chrome scripts
s in the content process, relaying the result back to the chrome process. The Event object itself is relayed to the chrome process as a CPOW. To make the shim unnecessary: register event listeners on the global object inside a frame script. For example: addEventListener("load", handler, true) // for example If you need to contact the chrome process when that happens, send it a message. ...
...relaying the result back to the chrome process. The Event object itself is relayed to the chrome process as a CPOW. To make the shim unnecessary: register event listeners on the global object inside a frame script. For example: addEventListener("load", handler, true) // for example If you need to contact the chrome process when that happens, send it a message. ...
...The Event object itself is relayed to the chrome process as a CPOW. To make the shim unnecessary: register event listeners on the global object inside a frame script. For example: addEventListener("load", handler, true) // for example If you need to contact the chrome process when that happens, send it a message. Sand
boxes You can create sand
boxes in the chrome or the content process. Sand
boxes are often used as a safe way to manipulate web content, and if that's your goal, create the sandbox in the content process. There is a shim for sand
boxes: if you make a sandbox in the chrome process and give it content principals (by passing a CPOW as the first argument to Components.utils.Sandbox) then we'll actually make it in the content process. nsIAboutModule By default, custom abo...
Components.utils.Sandbox
nsIPrincipal); From Firefox 37 onwards, you can also specify the null principal by simply passing null as the principal argument. options The constructor accepts an optional parameter. This parameter is an object with the following optional properties: freshZone If true creates a new GC region separate from both the calling context's and the sandbox prototype's region. Addons creating sand
boxes whose expected lifetime is tied to that of a content window object will want to use sameZoneAs instead. sameZoneAs A JavaScript object in whose garbage collection region the sandbox should be created in. This helps to improve memory usage by allowing sand
boxes to be discarded when that zone goes away. Content scripts should pass the window they're running in as this parameter, in order to en...
...e. wantExportHelpers A Boolean: if true, then createObjectIn(), evalInWindow(), and exportFunction() are available in the sandbox. Default: false. wantGlobalProperties An array of strings. Each string is the name of an object that you want to make available as a global to code running in the sandbox. The exception is "-Promise": the Promise constructor is available by default for sand
boxes, and you use this option to remove it from the sandbox. Note that "-Promise" is removed in Firefox 37. The following objects are supported: -Promise (removed in Firefox 37) CSS indexedDB (Web Worker only) XMLHttpRequest TextEncoder TextDecoder URL URLSearchParams atob btoa ...
...rties, and the target receives appropriate privacy from having its expandos inspected by untrusted callers. In situations where only unidirectional protection is needed, callers have the option to waive the X-ray behavior using wrappedJSObject or XPCNativeWrapper.unwrap(). In general, when accessing same-origin content, script gets a Transparent wrapper rather than an Xray wrapper. However, sand
boxes are often used when chrome wants to run script as another origin, possibly to interact with the page. In this case, same-origin Xrays are desirable, and wantXrays should be set to true. See Safely accessing content DOM from chrome for more details. Methods available on the Sandbox object dump() - Similar to window.dump(). debug() For more information on the built-in Sandbox functions, pl...
Intersection Observer API - Web APIs
this code runs on the main thread, even one of these can cause performance problems. When a site is loaded with these tests, things can get downright ugly. Consider a web page that uses infinite scrolling. It uses a vendor-provided library to manage the advertisements placed periodically throughout the page, has animated graphics here and there, and uses a custom library that draws notification
boxes and the like. Each of these has its own intersection detection routines, all running on the main thread. The author of the web site may not even realize this is happening, since they may know very little about the inner workings of the two libraries they are using. As the user scrolls the page, these intersection detection routines are firing constantly during the scroll handling code, resulting ...
...; } .topRight { right: 2px; top: 2px; } .bottomLeft { bottom: 2px; left: 2px; } .bottomRight { bottom: 2px; right: 2px; } let observers = []; startup = () => { let wrapper = document.querySelector(".wrapper"); // Options for the observers let observerOptions = { root: null, rootMargin: "0px", threshold: [] }; // An array of threshold sets for each of the
boxes. The // first box's thresholds are set programmatically // since there will be so many of them (for each percentage // point). let thresholdSets = [ [], [0.5], [0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0], [0, 0.25, 0.5, 0.75, 1.0] ]; for (let i=0; i<=1.0; i+= 0.01) { thresholdSets[0].push(i); } // Add each box, creating a new observer for each ...
...erHTML = visiblePct; }); } startup(); Clipping and the intersection rectangle The browser computes the final intersection rectangle as follows; this is all done for you, but it can be helpful to understand these steps in order to better grasp exactly when intersections will occur. The target element's bounding rectangle (that is, the smallest rectangle that fully encloses the bounding
boxes of every component that makes up the element) is obtained by calling getBoundingClientRect() on the target. This is the largest the intersection rectangle may be. The remaining steps will remove any portions that don't intersect. Starting at the target's immediate parent block and moving outward, each containing block's clipping (if any) is applied to the intersection rectangle. A block's clippi...
ARIA Test Cases - Accessibility
: Screen reader should announce accessible name, role and state. When toggling, new state should be announced (not checked, partially checked, checked). Markup used: role="checkbox" aria-checked="true" | "false" | "mixed" Notes: Results: AT Firefox IE Opera Safari JAWS 9 - - n/a n/a JAWS 10 Partial pass. The state of tristate check
boxes is not announced when initially focusing. It is announced when toggling. Fail - changes not spoken Fail Fail VoiceOver (Leopard) n/a n/a - fail Window-Eyes Pass Fail (unchecked presented as checked, IE exposing incorrect state for no aria-checked attribute) Fail Fail NVDA Fail -- for change from mixed to fully checked, nothing spoken ...
...- NVDA - n/a - - Zoom (Leopard) pass n/a pass pass ZoomText - - - - Orca - - - - Group (no examples yet) Expected AT Behavior: (MZ) When focus first lands on a control inside the group, the name should be spoken. Role may or may not be spoken, screen reader should use same handling as for regular group
boxes. If describedby is present, the description should be spoken. Following all that, the focused control should be spoken. JAWS - JAWS speaks the group name when focus is placed on a control within the group for the first time. If described by is used on a fieldset (group box), JAWS speaks the description when focus is placed on a control within the group box for the first time. Mar...
... - - NVDA - n/a - - Zoom (Leopard) pass n/a pass pass ZoomText - - - - Orca - - - - Textbox dojo nightly build Expected AT Behavior: (MZ) When focus first lands on the textbox, its label and role should be indicated. If it also contains content, an indication should be given as for regular text
boxes. If the text is automatically selected on focus, this should be indicated. Arrow keys should read by character or line as usual. (AL) I think we need more here. For example, what about reading the line number if the user requests that info? Markup used: Notes: Results: AT Firefox IE Opera Safari JAWS 9 - - n/a n/a JAWS 10 - - - ...
Basic Concepts of Multicol - CSS: Cascading Style Sheets
This guide explains how the specification works with some common use case examples. Key Concepts and Terminology Multicol is unlike any of the other layout methods we have in CSS in that it fragments the content, including all descendent elements, into columns. This happens in the same way that content is fragmented into pages when we work with CSS Paged Media, for example by creating a print stylesheet. ...
... example by creating a print stylesheet. The properties defined by the specification are: column-width column-count columns column-rule-color column-rule-style column-rule-width column-rule column-span column-fill column-gap By adding column-count or column-width to an element, that element becomes a multi-column container, or multicol container for short. The columns are anonymous
boxes and described as column
boxes in the specification. Defining columns To create a multicol container you must use at least one of the column-* properties, these being column-count and column-width. The column-count property The column-count property specifies the number of columns that you would like the content to be displayed as. The browser will then assign the correct amount of space to ea...
...ith any margin on the container. The column-width property The column-width property is used to set the optimal width for every column box. If you declare a column-width, the browser will work out how many columns of that width will fit into the multicol container and distribute any extra space equally between the columns. Therefore, the column width should be seen as a minimum width, as column
boxes are likely to be wider due to the additional space. The column box will only shrink to be smaller than the declared column width in the case of a single column with less available width than the value of column-width. In the below example we use the column-width property with a value of 200px. We get as many 200 pixel columns as will fit the container, with the extra space shared equally. Us...
Handling content breaks in multicol - CSS: Cascading Style Sheets
In both contexts we control where and how things break by using properties of the CSS Fragmentation specification. In this guide we see how Fragmentation works in multicol. Fragmentation basics The CSS Fragmentation specification details how content breaks between the fragmentation containers, or fragmentainers. In multicol, the fragmentainer is the column box. A column box can contain other markup and there are many places where a break would not be ideal. ...
...re are many places where a break would not be ideal. For example, we would generally prefer that the figcaption of an image not be separated into a new column away from the image it refers to and ending a column with a heading looks strange. The fragmentation properties give us ways to exercise some control over this. There are various places we might want to control our breaks: Breaks inside
boxes, for example inside a figure element. Breaks before and after
boxes, which would include our heading example above. Breaks between lines. Breaks inside
boxes To control breaks inside
boxes use the break-inside property. This property takes values of: auto avoid avoid-page avoid-column avoid-region In the example below, we have applied break-inside to the figure element to prevent th...
...They take the following values when in a multicol context: auto avoid avoid-column column In this next example, we are forcing a column break before an h2 element. ...
Styling Columns - CSS: Cascading Style Sheets
Perhaps in future versions of the specification it might be. For now, however, we are able to change the spacing and add lines between columns. The column-gap property The gap between our columns is controlled by the column-gap property. This property was originally defined in the Multi-column Layout specification. ...
...hers. Perhaps in future versions of the specification it might be. For now, however, we are able to change the spacing and add lines between columns. The column-gap property The gap between our columns is controlled by the column-gap property. This property was originally defined in the Multi-column Layout specification. However, it is now defined in Box Alignment in order to unify gaps between
boxes in other specifications such as CSS Grid Layout. The initial value of column-gap in multicol is 1em. This means your columns will not run into each other. In other layout methods the initial value for column-gap is 0. If you use the keyword value "normal" the gap will be set to 1em. You can change the gap by using any length unit as the value of column-gap. In the example below, the column-gap ...
...wide rule will not push the columns apart to make space for the rule. Instead, the rule overlays the gap. In this next example we have a very wide rule of 40px and a 10px gap. The rule displays under the content of the columns. In order to make space on both sides of the rule, the gap would need to be increased to be larger than 40px. Summary This details all the current ways in which column
boxes can be styled. In the next guide we will take a look at making elements inside a container span across all columns. ...
Controlling Ratios of Flex Items Along the Main Axis - CSS: Cascading Style Sheets
that case 200px would be the flex-basis for this item. If your item is instead auto-sized, then auto resolves to the size of its content. At this point your knowledge of min- and max-content sizing becomes useful, as flexbox will take the max-content size of the item as the flex-basis. The following live example can help to demonstrate this. In this example I have created a series of inflexible
boxes, with both flex-grow and flex-shrink set to 0. Here we can see how the first item -- which has an explicit width of 150 pixels set as the main size -- takes a flex-basis of 150px, whereas the other two items have no width and so are sized according to their content width. In addition to the auto keyword, you can use the content keyword as the flex-basis. This will result in the flex-basis bein...
...tributed. This property deals with situations where the browser calculates the flex-basis values of the flex items, and finds that they are too large to fit into the flex container. As long as flex-shrink has a positive value the items will shrink in order that they do not overflow the container. So where flex-grow deals with adding available space, flex-shrink manages taking away space to make
boxes fit into their container without overflowing. In the next live example I have three items in a flex container; I've given each a width of 200 pixels, and the container is 500 pixels wide. With flex-shrink set to 0 the items are not allowed to shrink and so they overflow the box. Change the flex-shrink value to 1 and you will see each item shrink by the same amount, in order that all of the it...
... it to 700px for example -- and then reduce the flex item width, you can see that the first two items will wrap, however they will never become smaller than that min-content size. As the box gets smaller space is then just removed from the third item. In practice the shrinking behaviour does tend to give you reasonable results. You don't usually want your content to disappear completely or for
boxes to get smaller than their minimum content, so the above rules make sense in terms of sensible behaviour for content that needs to be shrunk in order to fit into a container. Giving items different flex-shrink factors In the same way as flex-grow, you can give flex-items different flex-shrink factors. This can help change the default behaviour if, for example, you want an item to shrink more or ...
CSS Grid Layout and Progressive Enhancement - CSS: Cascading Style Sheets
eries too. You can use them to deal with the issue we have with our enhanced: floated layout. I use an @supports rule to check for support of display: grid. I then do my grid code on the <ul>, set my width and min-height on the <li> to auto. I also remove the margins and negative margins, and replace the spacing with the grid-gap property. This means I don't get a final margin on the last row of
boxes. The layout now works, even if there is more content in one of the cards, than the others: * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color: #fff4e6; max-width: 600px; margin: 0 auto; } .wrapper li { border: 2px solid #ffa94d; border-radius: 5px; background-color: #ffd8a8; padding: 1em; color: #d9480...
... the interaction between different layout methods. Other values of display When an element has a parent set to display: grid it is blockified, as defined in the CSS display specification. In the case of our item set to inline-block, this is why display: inline-block no longer applied. If you are using display: table for your legacy layout, an item set to display: table-cell generates anonymous
boxes. Therefore, if you use display: table-cell without any parent element set to display-table, an anonymous table wrapper is created around any adjacent cells, just as if you had wrapped them in a div or other element set to display: table. If you have an item set to display: table-cell, and then in a feature query change the parent to display: grid, this anonymous box creation will not happen. This...
..., an anonymous table wrapper is created around any adjacent cells, just as if you had wrapped them in a div or other element set to display: table. If you have an item set to display: table-cell, and then in a feature query change the parent to display: grid, this anonymous box creation will not happen. This means you can overwrite display: table based layouts, without having additional anonymous
boxes. Floated elements As we have already seen, float and also clear have no effect on a grid item. Therefore you do not need to explicitly set items to float: none. Vertical alignment The alignment property vertical-align has no effect on a grid item. In layouts using display: inline-block or display: table, you might use the vertical-align property to perform basic alignment. In your grid layout...
Basic Shapes - CSS: Cascading Style Sheets
on creating shapes from Box Values, which directly uses the reference box to create the shape. The Firefox Shapes Inspector helpfully shows the reference box in use when you inspect a shape. In the screenshot below I have created a circle, using shape-outside: circle(50%). The floated element has 20 pixels of padding, border and margin applied, and the Shapes Inspector highlights these reference
boxes. When using a Basic Shape the reference box used by default is the margin-box. You can see in the screenshot that the shape is being defined with reference to that part of the Box Model. You can add the various Box Values after your Basic Shape definition. Therefore the default behaviour is as if you have defined. .shape { shape-outside: circle(50%) margin-box; } You can therefore change ...
...box model, for example to use the border. .shape { shape-outside: circle(50%) border-box; } What is worth noting is that the margin-box will clip the shape, therefore shapes created in reference to other shapes which extend past the margin box will have the shape clipped to the margin box. We will see this in the following examples of basic shapes. For an excellent description of references
boxes as they apply to CSS Shapes see Understanding Reference
Boxes for CSS Shapes. inset() The inset() type defines a rectangle, which may not seem very useful as simply floating an item will give you a rectangular shape around it. However the inset() types enables the definition of offsets, thus pulling the content in over the shape. Therefore inset() takes four values for the top, right, bottom a...
...round with the position value, or setting a reference box as we did for inset(). As an additional example, if you use the keywords top left for position, you can make a quarter circle shape in the top left corner of the page. The example below uses generated content to create a quarter circle shape for text to flow around. The shape will be clipped by the margin box When describing Reference
Boxes I explained that the margin-box will clip the shape. You can see this by moving the centre of our circle towards the content by setting the position to 60%. The centre of the circle is now nearer the content and the circle extends past the margin-box. This means that the extension becomes clipped and squared off. img { float: left; shape-outside: circle(50% at 60%); } ellipse() An ellip...
align-items - CSS: Cascading Style Sheets
The property doesn't apply to b...
...t only) */ align-items: safe center; align-items: unsafe center; /* Global values */ align-items: inherit; align-items: initial; align-items: unset; Values normal The effect of this keyword is dependent of the layout mode we are in: In absolutely-positioned layouts, the keyword behaves like start on replaced absolutely-positioned
boxes, and as stretch on all other absolutely-positioned
boxes. In static position of absolutely-positioned layouts, the keyword behaves as stretch. For flex items, the keyword behaves as stretch. For grid items, this keyword leads to a behavior similar to the one of stretch, except for
boxes with an aspect ratio or an intrinsic sizes where it behaves like start. The property doesn't apply to block-level
boxes, and to table cells. flex-start Th...
...If the cross-size of an item is larger than the flex container, it will overflow equally in both directions. start The items are packed flush to each other toward the start edge of the alignment container in the appropriate axis. ...
Applying color to HTML elements using CSS - HTML: Hypertext Markup Language
hen drawing emphasis symbols adjacent to each character in the text. This is used primarily when drawing text for East Asian languages. caret-color The color to use when drawing the caret (sometimes referred to as the text input cursor) within the element. This is only useful in elements that are editable, such as <input> and <textarea> or elements whose HTML contenteditable attribute is set.
Boxes Every element is a box with some sort of content, and has a background and a border in addition to whatever contents the box may have. Borders See the section Borders for a list of the CSS properties you can use to set the colors of a box's borders. background-color The background color to use in areas of the element that have no foreground content. column-rule-color The color to use whe...
... to assign styles to the <div> that encloses all of our other content. This establishes the size of the container using width and height as well as its margin and padding. Of more interest to our discussion here is the use of the border property to establish a border around the outside edge of the element. This border is a solid line, 6 pixels wide, in the color mediumturquoise. ...
...; display: flex; justify-content: center; align-items: center; } In brief, .box establishes the size of each box, as well as the configuration of the font used within. We also take advantage of CSS Flexbox to easily center the contents of each box. We enable flex mode using display: flex, and set both justify-content and align-items to center. Then we can create a class for each of the two
boxes that defines the properties that differ between the two. .boxLeft { float: left; background-color: rgb(245, 130, 130); outline: 2px solid darkred; } The .boxLeft class--which, cleverly, is used to style the box on the left--floats the box to the left, then sets up the colors: The box's background color is set by changing the value of the CSS background-color property to rgb(245, 130, 1...
core/namespace - Archive of obsolete content
} = dom(this); element.parentNode.removeChild(element); // ... }; // ... exports.View = View; // ... Also, multiple namespaces can be used with one object: // ./widget.js let { Cu } = require('chrome'); let { ns } = require('sdk/core/namespace'); let { View } = require('./view'); // Note this is completely independent from View's internal Namespace object. let sand
boxes = ns(); function Widget(options) { let { element, contentScript } = options; let widget = Object.create(Widget.prototype); View.call(widget, options.element); sand
boxes(widget).sandbox = Cu.Sandbox(element.ownerDocument.defaultView); // ... } Widget.prototype = Object.create(View.prototype); Widget.prototype.postMessage = function postMessage(message) { let { sand...
...function Widget(options) { let { element, contentScript } = options; let widget = Object.create(Widget.prototype); View.call(widget, options.element); sand
boxes(widget).sandbox = Cu.Sandbox(element.ownerDocument.defaultView); // ... } Widget.prototype = Object.create(View.prototype); Widget.prototype.postMessage = function postMessage(message) { let { sandbox } = sand
boxes(this); sandbox.postMessage(JSON.stringify(JSON.parse(message))); ... }; Widget.prototype.destroy = function destroy() { View.prototype.destroy.call(this); // ... delete sand
boxes(this).sandbox; }; exports.Widget = Widget; In addition access to the namespace can be shared with other code by just handing them a namespace accessor function. let { dom } = require('./vi...
Examples and demos from articles - Archive of obsolete content
menus (that is only CSS, without using JavaScript). .[article] Pure-CSS web gallery based on the :hover pseudoclass [zip] You can use the :hover pseudo-class in order to build an image gallery with full-size images shown only when mouse goes over previews. .[article] Pure-CSS web gallery based on the :checked pseudoclass [zip] You can also use the :checked pseudo-class applied to hidden radio
boxes in order to build, for example, an image gallery with full-size images shown only when mouse clicks on previews. [article] Pure-CSS tooltips [html] This shows the use of the ::after pseudo-element in conjunction with the attr() CSS expression and a data-descr custom data attribute to create a pure-CSS, glossary-like tooltip. [article] Pure-CSS lightbox [html] The :target pseudo-class is usefu...
...on and a data-descr custom data attribute to create a pure-CSS, glossary-like tooltip. [article] Pure-CSS lightbox [html] The :target pseudo-class is useful to switch on/off some invisible elements. In this way you can create a pure-CSS lightbox. [article] Pure-CSS editable (pseudo)<select> [html] This example shows how it's possible to simulate an editable <select> through a fieldset of radio
boxes and text
boxes. [article] Expandable elements [html] This example shows how it is possible to show/hide classes of elements in pure CSS. In this demo there is also an example of a "toggle button" rendered through a <label> element. [article] Code snippets and tutorials JavaScript Complete cookies reader/writer with full unicode support This little framework consists of a complete cookies ...
Code snippets - Archive of obsolete content
ion of examples and demos from articles. Window code Opening and manipulating windows Toolbar Toolbar related code Sidebar Sidebar related code Forms Forms related code XML Code used to parse, write, manipulate, etc. ...
...XUL Widgets HTML in XUL for Rich Tooltips Dynamically embed HTML into a XUL element to attain markup in a tooltip Label and description Special uses and line breaking examples Tree Setup and manipulation of trees using XUL and JS Scrollbar Changing style of scrollbars. Applies to scrollbars in browser and iframe as well. Autocomplete Code used to enable form autocomplete in a browser
Boxes Tips and tricks when using
boxes as containers Tabbox Removing and manipulating tabs in a tabbox Windows-specific Finding Window Handles (HWND) (Firefox) How to use Windows API calls to find various kinds of Mozilla window handles. Window handles can be used for IPC and Accessibility purposes. Using the Windows Registry with XPCOM How to read, write, modify, delete, enumerate, and watc...
Adding windows and dialogs - Archive of obsolete content
to continue?")) { // do something. } else { // do something else } The method returns a boolean value indicating the user's response. Others Unprivileged Javascript can also use the window.prompt function to receive text input from the user. The Prompt Service has a very rich set of functions that allow different kinds of inputs, such as text, passwords, usernames and passwords, and check
boxes that can be used for "Never ask this again"-type dialogs. The confirmEx and prompt methods are the most customizable, allowing a great deal of options that cover most common dialog cases. Using the Prompt Service will save you a lot of XUL coding, and you'll be at ease knowing that you're using Mozilla's tried and tested code. The Dialog Element When the Prompt Service is not enough, you'll ha...
...nput form. Let's look into the most commonly used form elements and how to use them in your XUL windows. There isn't much we need to add from what the XUL Tutorial explains, so go ahead and read the following sections: Input controls Numeric controls List controls There are some other aspects to take into account when handling input controls, which we cover in the following sections. Group
boxes The groupbox element should be easy to understand: it groups a series of XUL controls together. It's a box container with styling that is usually a visible border around its contents, so that it's clear what is being grouped together. It is frequently used with the caption element to associate the grouped elements with a title. The groupbox shouldn't be seen as an aesthetic device, but a logica...
align - Archive of obsolete content
<< XUL Reference home align Type: one of the values below The align attribute specifies how child elements of the box are aligned, when the size of the box is larger than the total size of the children. For
boxes that have horizontal orientation, it specifies how its children will be aligned vertically. For
boxes that have vertical orientation, it specifies how its children will be aligned horizontally. start Child elements are aligned starting from the left or top edge of the box. If the box is larger than the total size of the children, the extra space is placed on the right or bottom side. center Extra space is split equally along each side of the child elements, resu...
...lly along each side of the child elements, resulting in the children being placed in the center of the box. end Child elements are placed on the right or bottom edge of the box. If the box is larger than the total size of the children, the extra space is placed on the left or top side. baseline This value applies to horizontally oriented
boxes only. It causes the child elements to be aligned so that their text labels are lined up. stretch This is the default value. The child elements are stretched to fit the size of the box. For a horizontal box, the children are stretched to be the height of the box. For a vertical box, the children are stretched to be the width of the box. If the size of the box changes,...
pack - Archive of obsolete content
The align attribute is used to specify the position in the opposite direction. You can also specify the value of pack using the style property -moz-box-pack. ...
...The align attribute is used to specify the position in the opposite direction. You can also specify the value of pack using the style property -moz-box-pack. ...
textbox (Toolkit autocomplete) - Archive of obsolete content
the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence. tabscrolling New in Thunderbird 3Requires SeaMonkey 2.0 Type: boolean If true, the user may cycle through the results list by pressing the Tab key. If false, the default, the Tab key moves the focus to the next element. timeout Type: integer For autocomplete text
boxes, the number of milliseconds before the textbox starts searching for completions. The default is 50 milliseconds. For search text
boxes, the number of milliseconds before the timer fires a command event. The default is 500 milliseconds. For timed text
boxes, the number of milliseconds before the timer fires a command event. There is no default. The timer starts after the user types a character. If t...
...r starts after the user types a character. If the user types another character, the timer resets. type Type: one of the values below You can set the type attribute to one of the values below for a more specialized type of textbox. Don't set the type if you wish to use a regular textbox. autocomplete A textbox that supports autocomplete. For more information about autocomplete text
boxes, see the autocomplete documentation (XPFE [Thunderbird/SeaMonkey]) (Firefox) number A textbox that only allows the user to enter numbers. In addition, arrow buttons appear next to the textbox to let the user step through values. There are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparound, hidespinbuttons, and textbox.v...
Textbox (XPFE autocomplete) - Archive of obsolete content
e Tab key moves the focus to the next element.As of Gecko 1.9.1, this attribute is now always specified in lower case. tabscrolling New in Thunderbird 3Requires SeaMonkey 2.0 Type: boolean If true, the user may cycle through the results list by pressing the Tab key. If false, the default, the Tab key moves the focus to the next element. timeout Type: integer For autocomplete text
boxes, the number of milliseconds before the textbox starts searching for completions. The default is 50 milliseconds. For search text
boxes, the number of milliseconds before the timer fires a command event. The default is 500 milliseconds. For timed text
boxes, the number of milliseconds before the timer fires a command event. There is no default. The timer starts after the user types a character. If t...
...r starts after the user types a character. If the user types another character, the timer resets. type Type: one of the values below You can set the type attribute to one of the values below for a more specialized type of textbox. Don't set the type if you wish to use a regular textbox. autocomplete A textbox that supports autocomplete. For more information about autocomplete text
boxes, see the autocomplete documentation (XPFE [Thunderbird/SeaMonkey]) (Firefox) number A textbox that only allows the user to enter numbers. In addition, arrow buttons appear next to the textbox to let the user step through values. There are several attributes that allow the number textbox to be configured, including decimalplaces, min, max, increment, wraparound, hidespinbuttons, and textbox.v...
Box Objects - Archive of obsolete content
es of information are used such as the tag name, the attributes on an element, various CSS properties, the elements and layout objects around the element, and the XBL associated with an element (XBL is described in a later section). Unless you change the style for an element, most XUL elements will usually use the box layout object or one of its subtypes. Recall that all XUL elements are types of
boxes, that is the box is the base of all displayed XUL elements. However, there are a number of subtypes, about 25 or so, for specific XUL elements. Some of these subtypes, such as the stack or listbox are needed for more complex layouts than the basic box, while others such as the button are used only to add extra mouse and key event handling. The layout object associated with an element can be remov...
...ut on a window, the elements are ordered according to a number of properties, for instance the orientation, their ordinal group and their direction. orient attribute The orientation is commonly modified using the orient attribute. There is also a corresponding CSS property -moz-box-orient which may be used instead, depending on the situation. This attribute was explained earlier in the section on
boxes. ordinal attribute The ordinal attribute on an element may be used to specify the ordinal group of the element, or you can use the CSS property -moz-box-ordinal-group. Elements with a lower ordinal value are placed in the box before elements with a higher ordinal value. For example, if one element has an ordinal of 2, it would be placed before an element with ordinal 3 or higher but after one wit...
Grids - Archive of obsolete content
<hbox flex="1"> <textbox id="docpath" flex="1"/> <button label="Browse..."/> </hbox> </row> </rows> </grid> Notice in the image how the first column of elements containing the labels has only a single element in each row. The second column contains a box in its second row, which in turn contains two elements, a textbox and a button. You could add additional nested
boxes or even another grid inside a single cell. If you resize the window of the last example, you will see that the text
boxes resize, but no other elements do. This is because of the flex attributes added to the text
boxes and the second column. The first column does not need to be flexible as the labels do not need to change size. The initial width of a column is determined by the largest element in...
...n the columns is displayed on top. Similarly, events such as mouse buttons and keypresses are sent only to the set on top. This is why the columns were declared after the rows in the above example. If the columns has been placed first, the rows would have grabbed the events and you would not be able to type into the fields. Flexibility of grids One advantage that grids have over a set of nested
boxes is that you can create cells that are flexible both horizontally and vertically. You can do this by putting a flex attribute on both a row and a column. The following example demonstrates this: Example 4 : Source View <grid flex="1"> <columns> <column flex="5"/> <column/> <column/> </columns> <rows> <row flex="10"> <button label="Cherry"/> <button label="Lemon"/> <button ...
Keyboard Shortcuts - Archive of obsolete content
rs="accel" key="C" oncommand="DoCopy();"/> </keyset> The function DoCopy will be called when the user presses the keys specified by the key element, which in this example, are the keys for copying to the clipboard (such as Control + C). This will work as long as the window is open. The DoCopy function should check to see if text is selected and then copy the text to the clipboard. Note that text
boxes have the clipboard shortcuts built-in so you don't have to implement them yourself. Assigning a keyboard shortcut on a menu The second way is: If you are assigning a keyboard shortcut that performs a command that also exists on a menu, you can associate the key element directly with the menu command. To do this, also add a key attribute on the menuitem. Set its value to the id of the key that y...
...ht use this to check for allowed characters in a field. keydown Called when a key is pressed down while an element has the focus. Note that the event will be called as soon as the key is pressed, even if it hasn't been released yet. keyup Called when a key is released while an element has the focus. Key events are only sent to the element that has the focus. Typically, this will include text
boxes, buttons, check
boxes and so forth. If no element is focused, the key event will instead be targeted at the XUL document itself. In this case, you can add an event listener to the window tag. Normally though, if you want to respond to keys globally, you will use a keyboard shortcut as described earlier. The key event object has two properties which hold the key that was pressed. The keyCode prope...
Manipulating Lists - Archive of obsolete content
These functions are bit simpler and will do the right thing. The appendItem() function is used to append a new item to the end a list. ...
...This interface provides a number of functions specifically for handling multiple selection. For example the selectedItems property holds a list of the items that are selected, while the selectedCount property holds the number of items selected. Typically, you will use these properties to iterate...
Modifying a XUL Interface - Archive of obsolete content
the vbox element. a copy of this element is made using the cloneNode() function and the copy is appended using appendChild(). Note that some elements, such as listbox and menulist provide some additional specialized modification functions which you should use instead when you can. These are described in the next section. Manipulating Basic Elements The main XUL elements such as buttons, check
boxes and radio buttons may be manipulated using a number of script properties. The properties available are listed in the element reference as those available are different for each element. Common properties that you will manipulate include the label, value, checked and disabled properties. They set or clear the corresponding attribute as necessary. Label and value properties examples Here is a simpl...
... the next element, the textbox. The += operator is used to add to the current value so a 1 will be added onto the end of the existing text. Note that you can still enter text into the textbox. You can also retrieve the current label or value using these properties, as in the following example: Example 5 : Source View <button label="Hello" oncommand="alert(this.label);"/> Toggling a checkbox Check
boxes have a checked property which may be used to check or uncheck the checkbox. It should be easy to determine how this is used. In this next example, we reverse the state of the checked property whenever the button is pressed. Note that while the label and value properties are strings, the checked property is a boolean property which will be set either true or false. Note: If you're creating the ...
Numeric Controls - Archive of obsolete content
ly available in Firefox 3 and later. Number Fields A textbox may be used for entering numbers by setting the value of the type attribute to the value number. This type of textbox may only be used to enter numbers. Other characters are not allowed and are just ignored if typed. In addition, arrow buttons appear beside the textbox to allow the user to cycle through the values. As with other text
boxes, the default value can be specified with the value attribute. Naturally, this value should be a number. However, the minimum and maximum values can also be specified using the min and max attributes. If these are set, you can control the range of values that the textbox may be set to. If the user enters a value less or greater than this value, it will be reset to the minimum or maximum value as n...
...ues to the right. However, you can change this orientation with the orient and dir attributes. <scale orient="vertical" dir="reverse"/> This scale will be shown vertical with lower values at the bottom and higher values at the top. Date and Time Entry Fields The datepicker and timepicker elements may be used to allow the user to enter dates and times. When used, they display a set of numeric text
boxes to enter each of the components of the date or time. <datepicker value="2004-03-24"/> <timepicker value="15:30:00"/> The value attribute is used to set the default value; if this attribute is omitted, the field will be initially set to the current date or time. The format of the attribute is exactly as above, that is dates are of the form YYYY/MM/DD and times are of the form HH:MM:SS (althou...
Stack Positioning - Archive of obsolete content
e View <stack> <button label="Goblins" left="5" top="5"/> <button label="Trolls" left="60" top="20"/> <button label="Vampires" left="10" top="60"/> </stack> The stack here contains three elements, each positioned at the coordinates given by the left and top attributes. Here, all three children are buttons, but the elements do not have to be same type. They may be any element, including
boxes and other stacks. The size of a stack is determined by the positions of the child elements. It is always sized so that all of the child elements are visible (excluding any children with -moz-stack-sizing: ignore). So if you set a left attribute to 400, the stack will have a width around 400 pixels plus the width of the element. You can override this size with the various style properties such as...
... <hbox flex="1"> <!-- content --> </hbox> <hbox left="0" right="200" > <!-- Some content here. --> </hbox> </stack> In some case, setting the width or height this way may even be necessary because using the width/height attributes (eg, "width", "minwidth" and "maxwidth") inside a stack can sometimes produce unpredictable and undesireable results. The next section describes tab
boxes which are like decks but provide their own navigation. << PreviousNext >> ...
Stacks and Decks - Archive of obsolete content
<< PreviousNext >> There may be need to display elements as a set of overlapping cards. The stack and deck elements can be used for this purpose. Containers Each XUL box is a container that can contain any other element. There are a number of elements that are specialized types of
boxes, such as toolbars and tabbed panels. The box tag creates the simplest box with no special properties. However, the specialized types of
boxes work just like regular
boxes in the way they orient the elements inside them, but they have additional features. In fact, many components can contain other elements. We've already seen that buttons may contain other things besides the default. A scroll bar is just a special type of box that creates its own elements if you don't provide them. It also hand...
...mponents can contain other elements. We've already seen that buttons may contain other things besides the default. A scroll bar is just a special type of box that creates its own elements if you don't provide them. It also handles the moving of the scroll bar thumb. In the next few sections, we'll introduce some elements that are designed for holding other elements. They are all special types of
boxes and allow all of the attributes of
boxes on them. Stacks The stack element is a simple box. It works like any other box but has the special property that its children are laid out all on top of each other. The first child of the stack is drawn underneath, the second child is drawn next, followed by the third and so on. Any number of elements may be stacked up in a stack. The orient property ha...
Trees - Archive of obsolete content
resize and hide individual columns. Some examples of trees include the list of messages in a mail application, or the Bookmarks window in Mozilla. In some ways, a tree has some similarities with the listbox. Both can be used to create tables of data with multiple rows and columns, and both may contain column headers. The tree also supports nested rows, whereas the listbox does not. However, list
boxes may contain any type of content, whereas trees may only contain text and images. (Using advanced features, progress meters or check
boxes also can be added to the tree) A tree consists of two parts, the set of columns, and the tree body. The set of columns is defined by a number of treecol elements, one for each column. Each column will appear as a header at the top of the tree. The second pa...
...col id="addressColumn" label="Address" flex="2"/> </treecols> <treechildren/> </tree> First, the entire table is surrounded with a tree element. This declares an element that is used as a table or tree. As with HTML tables, the data in a tree is always organized into rows. The columns are specified using the treecols tag. You may place as many columns as you wish in a tree. As with list
boxes, a header row will appear with column labels. A drop-down menu will appear in the upper-right corner of the tree, which the user may use to show and hide individual columns. Each column is created with a treecol element. You can set the header label using the label attribute. You may also want to make the columns flexible if your tree is flexible, so that the columns stretch as the tree does. In ...
Using Spacers - Archive of obsolete content
xample.) XUL provides the capability for elements to position and resize automatically. As we've seen, the find files window has appeared in a size that will fit the elements inside it. Each time we add something, the window gets bigger. XUL uses a layout system called the 'Box Model'. We'll talk more about this in the next section but it essentially allows you to divide a window into a series of
boxes that hold elements. The
boxes will be positioned and resized based on specifications that you can define. For now, just know that the window element is a type of box. Before we get into detail about
boxes, we'll introduce another XUL element that is useful for layout, the spacer. A spacer is very simple and only requires one attribute, which will be explained in a moment. The simplest spacer look...
.... If one element has a flex of 1 and the next one has a flex of 2, the second one will grow at twice the rate of the first one. In effect, a flex of 2 says that this element has a flex that is two times the elements that have a flex of one. The flex attribute isn't used to specify an actual size. Instead, it specifies how empty space it divided among the children of a container box. We'll look at
boxes in the next section. Once the default sizes of the children of a box are determined, the flexibility values are used to divide up the remaining empty space in the box. For example, if a box is 200 pixels wide and contains two flexible buttons, the first 50 pixels and the other 90 pixels, there will be 60 pixels of space left over. If both buttons have a flex value of 1, the space will be divided ...
XUL Structure - Archive of obsolete content
t appear. These are the -chrome command line argument and the chrome modifier to the window.open() function. Neither of these features grant extra privileges; instead they are used to open a new top-level window without the browser UI such as the menu and toolbar. You will commonly use this feature in more complex XUL applications since you wouldn't want the browser UI to exist around your dialog
boxes. The files for a package are usually combined into a single JAR file. A JAR file may be created and examined using a ZIP utility. For instance, you can open the JAR files in Mozilla's chrome directory to see the basic structure of a package. Although it's normal to combine the files into a JAR file, packages may also be accessed in expanded form into a directory. Although you don't normally dist...
... or language without having to change the original package. Other Packages There is a special package called toolkit (or global). We saw the global directory earlier for skins. The file toolkit.jar contains the corresponding content part for it. It contains some global dialogs and definitions. It also defines the default appearance and functionality of the various common XUL widgets such as text
boxes and buttons. The files located in the global part of a skin package contain the default look for all of the XUL interface elements. The toolkit package is used by all XUL applications. Adding a Package Mozilla places the packages that are included with the installation in the chrome directory. However, they do not need to be placed there. When installing another package, you can place it anywhe...
XUL Tutorial - Archive of obsolete content
used to describe its user interface. ...
... URL Manifest Files Simple Elements Creating a Window Adding Buttons Adding Labels and Images Input Controls Numeric Controls List Controls Progress Meters Adding HTML Elements Using Spacers More Button Features The Box Model The Box Model Element Positioning Box Model Details Group
boxes Adding More Elements More Layout Elements Stacks and Decks Stack Positioning Tab
boxes Grids Content Panels Splitters Toolbars and Menus Toolbars Simple Menu Bars More Menu Features Popup Menus Scrolling Menus Events and Scripts Adding Event Handlers More Event Handlers Keyboard Shortcuts Focus and Selection Commands Updating Commands Broadcasters and Observers Document Object Model Document Object Model Modifying a XUL Interface Manipulating Lists Bo...
XUL accessibility guidelines - Archive of obsolete content
s to visually structure forms, always provide a text label for every form element. Form elements should not be used to label other form elements. When form elements are encapsulated in a groupbox with a caption, assistive technologies such as screen readers will read the caption along with the label to the form element. For example, under the privacy section of preferences there are three group
boxes captioned: History, Cookies, and Private Data. If the user were to tab to the "Exceptions..." button they would hear "cookies {pause} exceptions {pause} button." The next tab would read "cookies {pause} keep until {pause} they expire {pause} one of three {pause} combobox." If the screen reader only read the label, then the user would have to guess what the "exceptions" button or the "keep until" ...
... Private Data. If the user were to tab to the "Exceptions..." button they would hear "cookies {pause} exceptions {pause} button." The next tab would read "cookies {pause} keep until {pause} they expire {pause} one of three {pause} combobox." If the screen reader only read the label, then the user would have to guess what the "exceptions" button or the "keep until" combobox was referring to. Group
boxes are essential for radiogroups or groups of check
boxes with a similar theme (e.g. check all that apply). If you find nested group
boxes visually unappealing, use CSS to hide the border of the inner groupbox so that it can remain in the code to benefit users of assistive technologies. Complex forms sometimes require a more advanced labeling system than is possible with the standard XUL attributes. ...
arrowscrollbox - Archive of obsolete content
out entirely. Visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. smoothscroll Type: boolean true initially enables smooth scrolling for the corresponding arrowscrollbox, false disables it. Currently, smooth scrolling supports horizontal arrowscroll
boxes only. tabindex Type: integer The tab order of the element. The tab order is the order in which the focus is moved when the user presses the "tab" key. Elements with a higher tabindex are later in the tab sequence. Properties Inherited Properties align, , allowEvents, , boxObject, builder, , , , className, , , , , collapsed, contextMenu, controllers, database, datasources, dir, ,...
...ixels by which scrolling will occur when the arrowscrollbox is clicked. smoothScroll Type: boolean Can be set to enable or disable smooth scrolling for the corresponding arrowscrollbox. If not set explicitly, it will fall back to the smoothscroll attribute and then to the toolkit.scrollbox.smoothScroll preference. Currently, smooth scrolling supports horizontal arrowscroll
boxes only. tabIndex Type: integer Gets and sets the value of the tabindex attribute. Methods ensureElementIsVisible( element ) Return type: no return value If the specified element is not currently visible to the user, the displayed items are scrolled so that it is. If the item is already visible, no scrolling occurs. scrollByIndex( lines ) Return type: n...
richlistbox - Archive of obsolete content
<< XUL Reference home [ Examples | Attributes | Properties | Methods | Related ] This element is used to create a list of listitems (richlistitems), similar to a listbox, but is designed to be used when the items do not contain simple text content. Note: In versions of Firefox prior to Firefox 3, rich list
boxes support only single selection. Firefox 3 introduced multiple selection to rich list
boxes. Attributes disabled, disableKeyNavigation, preference, seltype, suppressonselect, tabindex, value Properties accessibleType, currentIndex, currentItem, disabled, disableKeyNavigation, itemCount, scrollBoxObject, selectedCount, selectedIndex, selectedItem, selectedItems, selType, suppressOnSelect, tabIndex, value Methods addItemToSelection, appendItem, clearSelect...
... Deselects all of the currently selected items and selects the given item. A select event is sent after the selection is made. selectItemRange( startItem, endItem ) Return type: no return value Selects the items between the two items given as arguments, including the start and end items. All other items are deselected. This method does nothing for single-selection list
boxes. A select event is sent after the selection is made. timedSelect( item, timeout ) Return type: no return value Selects the item specified by the argument item after the number of milliseconds given by the timeout argument. All other items are deselected. toggleItemSelection( item ) Return type: no return value If the specified item is selected, it is ...
titlebar - Archive of obsolete content
This element can't be used to change the platform-native titlebar of normal windows; instead, it's used to create custom titlebars for chromeless windows. If the titlebar is in a panel element, dragging it will move the panel. Elements inside the titlebar usually don't receive any mouse events, so e.g. buttons inside it can't be clicked and text
boxes can't be focused with the mouse. ...
...t is clicked and dragged, the window moves with it. This element can't be used to change the platform-native titlebar of normal windows; instead, it's used to create custom titlebars for chromeless windows. If the titlebar is in a panel element, dragging it will move the panel. Elements inside the titlebar usually don't receive any mouse events, so e.g. buttons inside it can't be clicked and text
boxes can't be focused with the mouse. If you don't want this behavior, you can override it by setting allowevents="true" on the titlebar element. The titlebar will send a command event after the move is complete. Examples This XUL file will create a HUD-style window that can be moved with the mouse. It will close if the mouse button is released. <?xml version="1.0"?> <window title="Movable HUD Win...
2006-10-20 - Archive of obsolete content
that performed SeaMonkey Trunk gtk1 builds, this Friday. J. Paul Reed's long-term goal is to remove old incompatible hardware. On the same day Robert Kaiser responded to J. Paul Reed's post: Robert Kaiser shared the following information about comet and btek machines: comet and btek are used as machines that upload nightly gtk1 builds. comet and btek are currently the fastest-cycling tinder
boxes available therefore they are quite fast to detect general fires on the mozilla tree. Robert Kaiser also suggested replacing luna, a machine used to create gtk1 builds, with a machine thats sole responsibility is to only the tests on builds from the official nightly machines. On October 20th J. Paul Reed responded to Robert Kaiser's post: J. Paul Reed replies to Robert Kaiser post and asks...
...ng built since it is know to be unsupported on trunk. On October 20th Boris Zbarsky responded to J. Paul Reed previous post: Boris Zbarsky answered J. Paul Reed's question that was posted in his previous reply. J. Paul Reed had asked "why gtk1 was still being built". Boris Zbarsky's said: The reason why gtk1 builds are still being performed is because: When requests are made to change build
boxes to newer versions the people responsible for making the change reply with "That would require an OS upgrade". On October 20th J. Paul Reed responded to Boris Zbarsky's post: J. Paul Reed restates his overall goal that are "Getting us to not rely on hardware that you have to have in a certain position for it to boot" To use standard known configuration for every nightly build that is produce...
display-outside - Archive of obsolete content
flex formatting contexts, may also work with block-level elements. inline-level The element generates an inline-level box, and participates in an inline formatting context. run-in The element generates a run-in box. Run-in elements act like inlines or blocks, depending on the surrounding elements. contents The element lays out its contents using flex layout. none The element generates no
boxes, and does not participate in any formatting context. table-row-group, table-header-group, table-footer-group, table-row, table-cell, table-column-group, table-column, table-caption The element is an internal table element, and participates in a table layout context. table-cell and table-caption are layout-specific leaf types; the rest are layout-specific internal types. ruby-base, ruby-text...
...s in a ruby layout context. ruby-base and ruby-text are layout-specific leaf types; ruby-base-container and ruby-text-container are layout-specific internal types. layout-specific internal types These display types require their parent and children to be of particular display types. For example, a table-row box requires its parent to be a table row group box and its children to be table-cell
boxes. layout-specific leaf types These display types require their parent to be of a particular display type, but can accept any display-inside value. For example, a table-caption box must have a table parent, but can establish any kind of formatting context for its children. Formal syntax Syntax not found in DB! Specifications Specification Status Comment CSS Displa...
Styling the Amazing Netscape Fish Cam Page - Archive of obsolete content
kind of like a barnacle. Giving the Fish Some Style With the markup all set, it was time to style. The idea was to have the fish listed in a side-by-side arrangement, sort of like a two-column table, only without the table. This was most easily accomplished by floating the div elements themselves. Since I wanted them to be side by side, it was important to be sure the total width of the element
boxes (including margins) was less than 50%, so the first step was this: div.card {float: left; width: 45%; margin: 1em 2% 0 2%;} By making the content of each card 45% the width of the containing element, and adding 2% margin to both the left and right sides, each card's element box is 49% as wide as the parent. Two of them side by side will take up 98% the width of the parent element. This leaves...
...and right sides, each card's element box is 49% as wide as the parent. Two of them side by side will take up 98% the width of the parent element. This leaves out 2% as "wasted space," so to speak. I did it that way because it's a lot less likely to trigger a situation where rounding errors force the two floats to total more than 100% the width of the parent, as could happen if the floats' element
boxes were made to total 50%. Unfortunately, a few browsers don't get this right, and end up flowing the cards as a single vertical column instead of putting the fish side by side. After a bit of fiddling to try to fix this, I decided that trying to overcome this error in document flow wasn't worth the effort. The layout wasn't bad if the fish weren't laid out next to each other, so I moved on. Float...
Bounding volume collision detection with THREE.js - Game development
This article shows how to implement collision detection between bounding
boxes and spheres using the Three.js library. It is assumed that before reading this you have read our 3D collision detection introductory article first, and have basic knowledge about Three.js. Using Box3 and Sphere Three.js has objects that represent mathematical volumes and shapes -- for 3D AABB and bounding spheres we can use the Box3 and Sphere objects. Once instantiated, they have methods available to do intersection tests against other volumes. Instantiating
boxes To create a Box3 instance, we need to provide the lower and upper boundaries of the box. Usually we will want this AABB to be "linked" to an object in our 3D world (like a character.) In Three.js, Geometry instances have a boundingBox property with mi...
...quared(THREE.Sphere.__closest); return distance < (this.radius * this.radius); }; Demos We have prepared some live demos to demonstrate these techniques, with source code to examine. Point vs. Box and Sphere Box vs. Box and Sphere Sphere vs. Box and Sphere Using BoxHelper As an alternative to using raw Box3 and Sphere objects, Three.js has a useful object to make handling bounding
boxes easier: BoxHelper (previously BoundingBoxHelper, which has been deprecated). This helper takes a Mesh and calculates a bounding box volume for it (including its child meshes). This results in a new box Mesh representing the bounding box, which shows the bounding box's shape, and can passed to the previously seen setFromObject method in order to have a bounding box matching the Mesh. BoxHelper i...
Debugging CSS - Learn web development
eed to add a rule to overwrite it in the context of this element. Also useful is the ability to expand out shorthand properties. In our example the margin shorthand is used. Click on the little arrow to expand the view, showing the different longhand properties and their values. You can toggle values in the Rules view on and off, when that panel is active -- if you hold your mouse over it check
boxes will appear. Uncheck a rule's checkbox, for example border-radius, and the CSS will stop applying. You can use this to do an A/B comparison, deciding if something looks better with a rule applied or not, and also to help debug it -- for example if a layout is going wrong and you are trying to work out which property is causing the problem. The following video provides some useful tips on debugg...
...model on the selected element, along with a description of the properties and values that change how the element is laid out. This includes a description of properties that you may not have explicitly used on the element, but which do have initial values set. In this panel, one of the detailed properties is the box-sizing property, which controls what box model the element uses. Compare the two
boxes with classes box1 and box2. They both have the same width applied (400px), however box1 is visually wider. You can see in the layout panel that it is using content-box. This is the value that takes the size you give the element and then adds on the padding and border width. The element with a class of box2 is using border-box, so here the padding and border is subtracted from the size that you h...
Sizing items in CSS - Learn web development
to give an element a minimum or a maximum size. If you have a box that might contain a variable amount of content, and you always want it to be at least a certain height, you could set the min-height property on it. The box will always be at least this height, but will then grow taller if there is more content than the box has space for at its minimum height. In the example below you can see two
boxes, both with a defined height of 150 pixels. The box on the left is 150 pixels tall; the box on the right has content that needs more room, and so it has grown taller than 150 pixels. This is very useful for dealing with variable amounts of content while avoiding overflow. A common use of max-width is to cause images to scale down if there is not enough space to display them at their intrinsic ...
...your page in the browser you are using to view a site -- also has a size. In CSS we have units which relate to the size of the viewport -- the vw unit for viewport width, and vh for viewport height. Using these units you can size something relative to the viewport of the user. 1vh is equal to 1% of the viewport height, and 1vw is equal to 1% of the viewport width. You can use these units to size
boxes, but also text. In the example below we have a box which is sized as 20vh and 20vw. The box contains a letter A, which has been given a font-size of 10vh. If you change the vh and vw values this will change the size of the box or font; changing the viewport size will also change their sizes because they are sized relative to the viewport. To see the example change when you change the viewport ...
Test your skills: sizing - Learn web development
ooked at in the lesson on Sizing items in CSS. Note: You can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. Task One In this task, you have two
boxes. The first should be sized so that the height will be at least 100 pixels tall, even if there is less content than would cause it to grow to that height, however, the content should not overflow if there is more content than fits in 100 pixels. Test this box by removing the content from the HTML to make sure you still get a 100 pixel tall box even with no content. The second box should be fixed ...
...should also give the inner box padding of 10% using the width (or inline size) as the size from which that percentage is calculated. Try updating the live code below to recreate the example as displayed in the image: For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. Task Three This task has two images in
boxes. One image is smaller than the box, the other is larger and breaking out of the box. If you imagine that the box is responsive and therefore could grow and shrink, which property would you apply to the image so that the large image shrinks down into the box but the small image does not stretch. Try updating the live code below to recreate the example as displayed in the image: For assessme...
CSS building blocks - Learn web development
for fine-grained precision when selecting elements to style. In this article and its sub-articles, we'll run through the different types in great detail, seeing how they work. The sub-articles are as follows: Type, class, and ID selectors Attribute selectors Pseudo-classes and pseudo-elements Combinators The box model Everything in CSS has a box around it, and understanding these
boxes is key to being able to create layouts with CSS, or to align items with other items. In this lesson, we will take a proper look at the CSS Box Model, in order that you can move onto more complex layout tasks with an understanding of how it works and the terminology that relates to it. Backgrounds and borders In this lesson we will take a look at some of the creative things you can do with CSS b...
...in this lesson, we will summarize the various ways elements get a size via CSS and define a few terms around sizing that will help you in the future. Images, media, and form elements In this lesson we will take a look at how certain special elements are treated in CSS. Images, other media, and form elements behave a little differently in terms of your ability to style them with CSS than regular
boxes. Understanding what is and isn't possible can save some frustration, and this lesson will highlight some of the main things that you need to know. Styling tables Styling an HTML table isn't the most glamorous job in the world, but sometimes we all have to do it. This article provides a guide to making HTML tables look good, with some specific table styling techniques highlighted. Debugging CSS...
Grids - Learn web development
id Layout is a two-dimensional layout system for the web. It lets you lay content out in rows and columns, and has many features that make building complex layouts straightforward. This article will give you all you need to know to get started with page layout. Prerequisites: HTML basics (study Introduction to HTML), and an idea of how CSS works (study Introduction to CSS and Styling
boxes.) Objective: To understand the fundamental concepts behind grid layout systems, and how to implement a grid layout using CSS Grid. What is grid layout? A grid is a collection of horizontal and vertical lines creating a pattern against which we can line up our design elements. They help us to create designs where elements don't jump around or change width as we move from page ...
...xplore how to create a simple grid system for your project. The following video provides a nice visual explanation of using CSS Grid: Defining a grid As a starting point, download and open the starting point file in your text editor and browser (you can also see it live here). You will see an example with a container, which has some child items. By default these display in normal flow so the
boxes display one below the other. We will be working with this file for the first part of this lesson, making changes to see how grid behaves. To define a grid we use the grid value of the display property. As with Flexbox, this switches on Grid Layout, and all of the direct children of the container become grid items. Add this to the CSS inside your file: .container { display: grid; } Unlike f...
Positioning - Learn web development
follow along with the exercises on your local computer, if possible -- grab a copy of 0_basic-flow.html from our GitHub repo (source code here) and use that as a starting point. Introducing positioning The whole idea of positioning is to allow us to override the basic document flow behavior described above, to produce interesting effects. What if you want to slightly alter the position of some
boxes inside a layout from their default layout flow position, to give a slightly quirky, distressed feel? Positioning is your tool. Or if you want to create a UI element that floats over the top of other parts of the page, and/or always sits in the same place inside the browser window no matter how much the page is scrolled? Positioning makes such layout work possible. There are a number of different...
...s have closed together like it no longer exists! Well, in a way, this is true. An absolutely positioned element no longer exists in the normal document layout flow. Instead, it sits on its own layer separate from everything else. This is very useful: it means that we can create isolated UI features that don't interfere with the layout of other elements on the page. For example, popup information
boxes and control menus; rollover panels; UI features that can be dragged and dropped anywhere on the page; and so on... Second, notice that the position of the element has changed -- this is because top, bottom, left, and right behave in a different way with absolute positioning. Rather than positioning the element based on its relative position within the normal document layout flow, they specify th...
CSS layout - Learn web development
We have covered the necessary prerequisites so we can now dive deep into CSS layout, looking at different display settings, modern layout tools like flexbox, CSS grid, and positioning, and some of the legacy techniques you might still want to know about. Looking to become a front-end web developer? We have put together a course that includes all the essential information you need to work towards your goal. ...
...ont-end web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites Before starting this module, you should already: Have basic familiarity with HTML, as discussed in the Introduction to HTML module. Be comfortable with CSS fundamentals, as discussed in Introduction to CSS. Understand how to style
boxes. Note: If you are working on a computer/tablet/other device where you don't have the ability to create your own files, you could try out (most of) the code examples in an online coding program such as JSBin or Glitch. Guides These articles will provide instruction on the fundamental layout tools and techniques available in CSS. At the end of the lessons is an assessment to help you check yo...
How to structure a web form - Learn web development
der will read out something like "Edit text blank", which isn't very helpful at all. Labels are clickable, too! Another advantage of properly set up labels is that you can click or tap the label to activate the corresponding widget. This is useful for controls like text inputs, where you can click the label as well as the input to focus it, but it is especially useful for radio buttons and check
boxes -- the hit area of such a control can be very small, so it is useful to make it as easy to activate as possible. For example, clicking on the "I like cherry" label text in the example below will toggle the selected state of the taste_cherry checkbox: <form> <p> <input type="checkbox" id="taste_1" name="taste_cherry" value="cherry"> <label for="taste_1">I like cherry</label> </p> <...
...d the structures specific to web forms, it's good to remember that form markup is just HTML. This means that you can use all the power of HTML to structure a web form. As you can see in the examples, it's common practice to wrap a label and its widget with a <li> element within a <ul> or <ol> list. <p> and <div> elements are also commonly used. Lists are recommended for structuring multiple check
boxes or radio buttons. In addition to the <fieldset> element, it's also common practice to use HTML titles (e.g. <h1>, <h2>) and sectioning (e.g. <section>) to structure complex forms. Above all, it is up to you to find a comfortable coding style that results in accessible, usable forms. Each separate section of functionality should be contained in a separate <section> element, with <fieldset> eleme...
Componentizing our React app - Learn web development
he <input /> so that its value is equal to the completed prop. Once you're done, the Todo component's <input /> element will read like this: <input id="todo-0" type="checkbox" defaultChecked={props.completed} /> And your browser should update to show only Eat being checked: If you change each <Todo /> component's completed prop, your browser will check or uncheck the equivalent rendered check
boxes accordingly. Gimme some id, please Right now, our <Todo /> component gives every task an id attribute of todo-0. This is bad HTML because id attributes must be unique (they are used as unique identifiers for document fragments, by CSS, JavaScript, etc.). This means we should give our component an id prop that takes a unique value for each Todo. To follow the same pattern we had initially, let'...
... all the children of the <ul> with taskList: <ul role="list" className="todo-list stack-large stack-exception" aria-labelledby="list-heading" > {taskList} </ul> This gets us some of the way towards showing all the components again, but we've got more work to do: the browser currently renders each task's name as unstructured text. ...
Componentizing our Svelte app - Learn web development
t practice of organizing your code into manageable pieces. It will help you understand how they relate to each other, it will promote reuse, and it will make your code easier to reason about, maintain, and extend. But how do you know what should be split into its own component? There are no hard rules for this. Some people prefer an intuitive approach and start looking at the markup and drawing
boxes around every component and subcomponent that seems to have its own logic. Other people apply the same techniques used for deciding if you should create a new function or object. One such technique is the single responsibility principle -- that is, a component should ideally only do one thing. If it ends up growing, it should be split into smaller subcomponents. Both approaches should complement...
...ct into the component as a prop. Update the {#each} block inside Todos.svelte like so: <ul role="list" class="todo-list stack-large" aria-labelledby="list-heading"> {#each filterTodos(filter, todos) as todo (todo.id)} <li class="todo"> <Todo {todo} /> </li> {:else} <li>Nothing to do here!</li> {/each} </ul> The list of todos is displayed on the page, and the check
boxes should work (try checking/unchecking a couple, and then observing that the filters still work as expected), but our "x out of y items completed" status heading will no longer update accordingly. That's because our Todo component is receiving the todo via the prop, but it's not sending any information back to its parent. We'll fix this later on. Sharing data between components: props-down, events...
Creating our first Vue component - Learn web development
e again. So that's props in a nutshell. Next we'll move on to how Vue persists data state. Vue's data object If you change the value of the label prop passed into the <to-do-item></to-do-item> call in your App component, you should see it update. This is great. We have a checkbox, with an updatable label. However, we're currently not doing anything with the "done" prop -- we can check the check
boxes in the UI, but nowhere in the app are we recording whether a todo item is actually done. To achieve this, we want to bind the component's done prop to the checked attribute on the <input> element, so that it can serve as a record of whether the checkbox is checked or not. However, it's important that props serve as one-way data binding -- a component should never alter the value of its own props...
...and back again, reloading your app in between to see how the state changes. Giving Todos a unique id Great! We now have a working checkbox where we can set the state programmatically. However, we can currently only add one ToDoList component to the page because the id is hardcoded. This would result in errors with assistive technology since the id is needed to correctly map labels to their check
boxes. To fix this, we can programmatically set the id in the component data. We can use the lodash package's uniqueid() method to help keep the index unique. This package exports a function that takes in a string and appends a unique integer to the end of the prefix. This will be sufficient for keeping component ids unique. Let's add the package to our project with npm; stop your server and enter th...
Strategies for carrying out testing - Learn web development
is unable to provide these; most, like Windows OSes, are commercial products that can't be freely distributed. Download the appropriate installer for your operating system and install it. Open the app; you'll be presented with a view like the following: To create a new virtual machine, press the New button in the top left hand corner. ...
... Choose the file location and size for the virtual hard disk (choose a sensible name and location to keep it, and for the size specify around 50GB, or as much as you are comfortable with specifying). ...
Gecko info for Windows accessibility vendors
It's also used in the root pane object to show when the STATE_BUSY flag changes from loading new content. EVENT_SCROLLINGEND is used to indicate when a document has scrolled, even if only 1 line. Gecko fires this event when the scrolling is finished, rather than fire excessive events. EVENT_SCROLLINGSTART is fired when the user has ...
... get_accFocus get_accDefaultAction accLocation accSelect accHitTest accDoDefaultAction accNavigate get_accKeyboardShortcut MSAA Support: IAccessible Events and Unique ID's What MSAA events do we support? EVENT_FOCUS is fired for focus changes on any kind of focusable object EVENT_STATECHANGE is used in check
boxes, radio buttons, text fields, combo
boxes and list
boxes. It's also used in the root pane object to show when the STATE_BUSY flag changes from loading new content. EVENT_SCROLLINGEND is used to indicate when a document has scrolled, even if only 1 line. Gecko fires this event when the scrolling is finished, rather than fire excessive events. EVENT_SCROLLINGSTART is fired when the user has jumped to a named anchor within the page.
Mozilla’s UAAG evaluation report
Most browsers do not allow the user to select text with the keyboard alone. We intend to do this with a caret browsing feature. 1.2 Activate event handlers. (P1) P onMouseOver, onMouseDown, onMouseUp, onMouseMove, onClick, onDBClick: no keyboard support onFocus and onBlur: Cannot be activated with pointer 1.3 Provide text messages. (P1) C Status line and alert
boxes used to convey messages and alerts Guideline 2. Ensure user access to all content. Checkpoint Title Status Notes/plans Checkpoint Title Status Notes/plans 2.1 Render content according to specification. (P1) VG Renders HTML, CSS, and a number of graphic image formats. Does not contradict current specifications for HTML and CSS renderin...
...tion colors as specified in the control panel. Mozilla exposes the focus via WM_FOCUS system messages Mozilla does not use the system focus drawing routines, because they aren't flexible enough (don't support CSS) 7.2 Respect input configuration conventions. (P1) VG Mozilla implements standard keyboard bindings There are a few missing pieces, such as support in XUL combo
boxes (menulist) for selecting items by typing alphanumeric keystrokes 7.3 Operating environment conventions. (P2) G Mozilla uses non-native controls. It does, however, support the look and feel of widgets on various operating systems, when the classic theme is selected (on by default). 7.4 Input configuration indications. (P2) G Menus indicate accesskey and accelerator co...
Embedding Tips
Embedders may wish to override some of the default service implementations with their own. ...
...plementation of nsIDirectoryServiceProvider passed to XRE_InitEmbedding. Use XRE_NotifyProfile to make gecko actually use a profile location. How do I change the user agent string? The default useragent is set using the value from your application.ini/nsXREAppData. You can override this default using the "general.useragent.override" preference. How do I display my own message, alert and prompt
boxes? You need to implement and register your own prompt service. How do I get the DOM document from the web browser object? nsCOMPtr<nsIDOMDocument> doc; nsCOMPtr<nsIDOMWindow> window; webBrowser->GetContentDOMWindow(getter_AddRefs(window)); if (window) { window->GetDocument(getter_AddRefs(doc)); } What is the docshell? A description of the docshell may be found here. How do I implement cont...
Script security
. Compartments Compartments are the foundation for Gecko's script security architecture. A compartment is a specific, separate area of memory. In Gecko, there's a separate compartment for every global object. This means that each global object and the objects associated with it live in their own region of memory. Normal content windows are globals, of course, but so are chrome windows, sand
boxes, workers, the ContentFrameMessageManager in a frame script, and so on. Gecko guarantees that JavaScript code running in a given compartment is only allowed to access objects in the same compartment. When code from compartment A tries to access an object in compartment B, Gecko gives it a cross-compartment wrapper. This is a proxy in compartment A for the real object, which lives in compartment B...
...per. This denies access to all the object's properties, except for a few properties of Window and Location objects, as defined by the same-origin policy. Privileged to unprivileged code The most obvious example of this kind of security relation is between system-privileged chrome code and untrusted web content, but there are other examples in Gecko. The Add-on SDK runs content scripts in sand
boxes, which are initialized with an expanded principal, giving them elevated privileges with respect to the web content they operate on, but reduced privileges with respect to chrome. If the caller has a higher privilege than the target object, the caller gets an Xray wrapper for the object. Xrays are designed to prevent untrusted code from confusing trusted code by redefining objects in unexpecte...
Gecko's "Almost Standards" Mode
As of Mozilla 1.0.1 and 1.1 beta, there is a new rendering mode referred to as "almost standards" mode. This is added to the long-standing "quirks" and "standards" modes. "Almost standards" rendering mode is exactly the same as "standards" mode in all details save one, where it works like "quirks" mode: the height calculations for line
boxes and some of the inline elements in them. A common case that this affects is the layout of images inside table cells. This means that sliced-images-in-tables layouts are less likely to fall apart in Gecko-based browsers based on the rendering engine found in Mozilla 1.0.1 or later when in either "quirks" or "almost standards" mode. (See the DevEdge article "Images, Tables, and Mysterious Gaps" for a detailed explanation of how such layouts are trea...
...are less likely to fall apart in Gecko-based browsers based on the rendering engine found in Mozilla 1.0.1 or later when in either "quirks" or "almost standards" mode. ...
Index
e screen reader's. The rest of the boundary types must be supported. This enum is used in textBeforeOffset(), textAtOffset(), and textAfterOffset(). 174 IAccessibleValue Interfaces, XPCOM, XPCOM Interface Reference The IAccessibleValue interface represents a single numerical value and should be implemented by any class that supports numerical value like progress bars and spin
boxes. This interface lets you access the value and its upper and lower bounds. 175 IDispatch Interfaces, Interfaces:Scriptable, XPCOM, XPCOM Interface Reference No summary! 176 IJSDebugger Debugger, Interfaces, Interfaces:Scriptable, XPCOM Interface Reference Implemented by: @mozilla.org/jsdebugger;1 as a service: 177 amIInstallCallback Interfac...
...aration 1226 nsSupportsWeakReference XPCOM, XPCOM API Reference Inherit from this C++ class to add canonical support for nsISupportsWeakReference. 1227 nsXPIDLCString Class Declaration 1228 nsXPIDLString Class Declaration 1229 XPCOM primitive XPCOM, XPCOM API Reference An XPCOM primitive is an XPCOM object that "
boxes" a value of a primitive type. All XPCOM primitives are scriptable, and they all implement an XPCOM interface from the table below. 1230 XPCOM string functions Landing, Mozilla, XPCOM, strings XPCOM provides these low-level string functions to let you work with strings; however, it's often better to use one of the string classes rather than directly using these functions. ...
XUL Overlays
a base file tells the layout engine to load the named overlay file: <?xul-overlay href="chrome://component/content/componentOverlay.xul"?> where component is the name of the package being overlayed (e.g., chrome://navigator/content/navigatorOverlay.xul). The layout engine loads any overlay files and then flows the resulting XUL document, so problems associated with incremental insertion in menus,
boxes, tables, and forms are avoided. Any number of overlays can be loaded into a master document, and an overlay can also load other overlays. Because an overlay is superimposed on the master document, there are no ambiguities relating to scoping of style sheets or scripts. Style sheets and scripts loaded by the overlay simply apply to the entire master document. Loading overlays dynamically The chrom...
...See also Chapter 12 "Overlays and Chrome" of "Rapid Application Development with Mozilla" "Overlays", "Cross Package Overlays of XUL Tutorial ...
Main Windows
notification bars, and the status bar, but also includes most of the commands, keysets, and context menus of Thunderbird, along with a whole lot of Javascript. mailOverlay.xul A really small overlay that only adds a few "New message" and "New Card" commands to the menus, along with their associated javascript. msgHdrViewOverlay.xul Shown in blue above (where?), this overlay consists of three
boxes. Two are stacked showing either a brief or expanded view of the headers. The third is the attachment box which can be toggled into a slim or an expanded view baseMenuOverlay.xul Contains the contents of most of the menus (i.e. File, Edit, View, etc). OSX Only: macMenuOverlay.xul A special overlay for OSX that adds a few items to the window menu. messageWindow.xul messageWindow.xul is shown...
...ll taken from exactly the same overlays listed above though. mailWindowOverlay.xul This is the red sections shown in the interface above, including the toolbars, notification bars and the status bar.It also includes most of the commands, keysets, and context menus of Thunderbird, along with a whole lot of Javascript. msgHdrViewOverlay.xul Shown in blue above, this overlay consists of three
boxes. Two are stacked showing either a brief or expanded view of the headers. The third is the attachment box which can be toggled into a slim or an expanded view baseMenuOverlay.xul Contains the contents of most of the menus (i.e. File, Edit, View, etc). OSX Only: macMenuOverlay.xul A special overlay for OSX that adds a few items to the window menu. customizeToolbar.xul and customizeToolbarShee...
Tutorial: Set a breakpoint - Firefox Developer Tools
was tested against Firefox 58 Beta and Nightly. It does not work in Firefox 57. Since the Debugger API is only available to privileged JavaScript code, you'll need to use the Browser Content Toolbox to try it out. To do this, open the Firefox developer tools, click on the options gear at the upper right of the toolbox, and make sure that both "Enable browser chrome and add-on debugging tool
boxes" and "Enable remote debugging" are checked. These are located at the bottom right of the options panel; you may need to scroll to see them. Once they're checked, you can close the developer tools. Save the following text to an HTML file: <div onclick="report('the best div');">Click me!</div> <div onclick="report('another great div');">Or me!</div> <script> function report(what) { conso...
...!</div> <div onclick="report('another great div');">Or me!</div> <script> function report(what) { console.log('clicked: ' + what); } </script> Visit the HTML file in your browser, and open the Browser Content Toolbox by opening the Firefox menu, choosing "Web Developer", and then "Browser Content Toolbox". If that item doesn't appear in the "Web Developer" menu, make sure you checked both
boxes to enable the Browser Content Toolbox as explained in Step 1. Our example code is long enough that the best way to run it is to use the Scratchpad panel, which is not enabled by default. To enable it, click on the options gear at the upper right of the Browser Content Toolbox, and make sure the "Scratchpad" box in the "Default Developer Tools" section the left is checked. The Scratchpad pan...
DevTools API - Firefox Developer Tools
An instance of a tool is called a ToolPanel. The ToolPanel is built only when the tool is selected (not when the toolbox is opened). There is no way to "close/destroy" a ToolPanel. The only way to close a toolPanel is to close its containing toolbox. All these objects implement the EventEmitter interface. API gDevTools The gDevTools API can be used to register new tools, themes and handle tool
boxes for different tabs and windows. To use the gDevTools API from an add-on, it can be imported with following snippet const { gDevTools } = require("resource:///modules/devtools/gDevTools.jsm"); Methods registerTool(toolDefinition) Registers a new tool and adds a tab to each existing toolbox. Parameters: toolDefinition {ToolDefinition} - An object that contains information about the tool...
... const { gDevTools } = require("resource:///modules/devtools/gDevTools.jsm"); Methods registerTool(toolDefinition) Registers a new tool and adds a tab to each existing toolbox. Parameters: toolDefinition {ToolDefinition} - An object that contains information about the tool. See ToolDefinition for details. unregisterTool(tool) Unregisters the given tool and removes it from all tool
boxes. Parameters: tool {ToolDefinition|String} - The tool definition object or the id of the tool to unregister. registerTheme(themeDefinition) Registers a new theme. Parameters: themeDefinition {ThemeDefinition} - An object that contains information about the theme. unregisterTheme(theme) Unregisters the given theme. Parameters: theme {ThemeDefinition|String} - The theme definitio...
Settings - Firefox Developer Tools
e or two lines of the console output. The rest of the settings are on the Developer Tools Settings Pane. To see the settings, open any of the Developer Tools, and then: click the "Settings" command in the menu: or press F1 to toggle between the active tool and the Settings pane The Settings pane looks something like this: Categories Default Firefox Developer Tools This group of check
boxes determines which tools are enabled in the toolbox. New tools are often included in Firefox but not enabled by default. Available Toolbox Buttons This group of check
boxes determines which tools get an icon in the Toolbox's toolbar. As of Firefox 62, if the option to "Select an iframe as the currently targeted document" is checked, the icon will appear in the toolbar while the Settings tab is di...
...his option was called "Disable Cache" in Firefox versions previous to 49, but it was renamed to make it clearer that this affects the HTTP cache, and not Service Workers/the Cache API. Disable JavaScript Reload the current tab with JavaScript disabled. Enable Service Workers over HTTP Enable Service Worker registrations from insecure websites. Enable browser chrome and add-on debugging tool
boxes Enable you to use developer tools in the context of the browser itself, and not only web content. Enable remote debugging Enable the developer tools to debug remote Firefox instances. Enable worker debugging Enable a panel within the debugger to debug workers. Note: This option got removed from the UI in Firefox 56, because this version ships with a new Debugger UI, but it can still be enab...
Element.getBoundingClientRect() - Web APIs
The element's size is equal to its width/height + padding + border-width in the case that the standard box model is being used, or width/height only if box-sizing: border-box has been set on it. ...
...les returned by getClientRects() for the element, i.e., the CSS border-
boxes associated with the element. The result is the smallest rectangle which contains the entire element, with read-only left, top, right, bottom, x, y, width, and height properties describing the overall border-box in pixels. Properties other than width and height are relative to the top-left of the viewport. Empty border-
boxes are completely ignored. If all the element's border-
boxes are empty, then a rectangle is returned with a width and height of zero and where the top and left are the top-left of the border-box for the first CSS box (in content order) for the element. The amount of scrolling that has been done of the viewport area (or any other scrollable element) is taken into account when computing the bounding ...
Element.getClientRects() - Web APIs
llable element) is taken into account when computing the rectangles. The returned rectangles do not include the bounds of any child elements that might happen to overflow. For HTML <area> elements, SVG elements that do not render anything themselves, display:none elements, and generally any elements that are not directly rendered, an empty list is returned. Rectangles are returned even for CSS
boxes that have empty border-
boxes. The left, top, right, and bottom coordinates can still be meaningful. Fractional pixel offsets are possible. Examples These examples draw client rects in various colors. Note that the JavaScript function that paints the client rects is connected to the markup via the class withClientRectsOverlay. HTML Example 1: This HTML creates three paragraphs with a <span> i...
...s HTML creates three paragraphs with a <span> inside, each embedded in a <div> block. Client rects are painted for the paragraph in the second block, and for the <span> element in the third block. <h3>A paragraph with a span inside</h3> <p>Both the span and the paragraph have a border set. The client rects are in red. ...
ResizeObserverEntry.borderBoxSize - Web APIs
var myBorderBoxSize = ResizeObserverEntry.borderBoxSize; Value An array containing objects with the new border box size of the observed element. The array is necessary to support elements that have multiple fragments, which occur in multi-column scenarios. Each object in the array contains two properties: blockSize The length of the observed element's border box in the block dimension. ...
... scenarios. Each object in the array contains two properties: blockSize The length of the observed element's border box in the block dimension. For
boxes with a horizontal writing-mode, this is the vertical dimension, or height; if the writing-mode is vertical, this is the horizontal dimension, or width. inlineSize The length of the observed element's border box in the inline dimension. For
boxes with a horizontal writing-mode, this is the horizontal dimension, or width; if the writing-mode is vertical, this is the vertical dimension, or height. Note: For more explanation of writing modes and block and inline dimensions, read Handling different text directions. Examples const resizeObserver = new ResizeObserver(entries => { for (let entry of entries) { if(entry.borderBoxSize &...
ResizeObserverEntry.contentBoxSize - Web APIs
erverEntry interface returns an array containing the new content box size of the observed element when the callback is run. Syntax var myContentBoxSize = ResizeObserverEntry.contentBoxSize; Value An object containing the new content box size of the observed element. This object contains two properties: blockSize The length of the observed element's content box in the block dimension. ...
... the observed element. This object contains two properties: blockSize The length of the observed element's content box in the block dimension. For
boxes with a horizontal writing-mode, this is the vertical dimension, or height; if the writing-mode is vertical, this is the horizontal dimension, or width. inlineSize The length of the observed element's content box in the inline dimension. For
boxes with a horizontal writing-mode, this is the horizontal dimension, or width; if the writing-mode is vertical, this is the vertical dimension, or height. Note: For more explanation of writing modes and block and inline dimensions, read Handling different text directions. Examples The following snippet is taken from the resize-observer-border-radius.html (see source) example. This example incl...
Introduction to the CSS basic box model - CSS: Cascading Style Sheets
Every box is composed of four parts (or areas), defined by their respective edges: the content edge, padding edge, border edge, and margin edge. The content area, bounded by the content edge, contains the "real" content of the element, such as text, an image, or a video player. ...
...ds the border area to include an empty area used to separate the element from its neighbors. Its dimensions are the margin-box width and the margin-box height. The size of the margin area is determined by the margin-top, margin-right, margin-bottom, margin-left, and shorthand margin properties. When margin collapsing occurs, the margin area is not clearly defined since margins are shared between
boxes. Finally, note that for non-replaced inline elements, the amount of space taken up (the contribution to the height of the line) is determined by the line-height property, even though the borders and padding are still displayed around the content. ...
Spanning and Balancing Columns - CSS: Cascading Style Sheets
e a section nested inside the multicol container. In the example below, the h2 element is set to column-span: all and spans all of the columns. In this second example, the heading is inside an <article> element, yet still spans the content as expected. When a spanner is introduced, it breaks the flow of columns and columns restart after the spanner, effectively creating a new set of column
boxes. The content does not jump over a spanning element. Limitations of column-span In the current level 1 specification there are only two allowable values for column-span. The value none is the initial value and means the item does not span, remaining within a column. The value all means the item spans all of the columns. You cannot cause an item to span two out of three columns for example. Thin...
...nto play when the amount of content does not match the amount of space provided, such as when a height is declared on the container. The initial value of multicol for column-fill is balance. The value of balance means all columns are as balanced as is possible. In fragmented contexts such as Paged Media, only the last fragment is balanced. This means that on the last page the final set of column
boxes will be balanced. There is a second value for balancing, balance-all, which attempts to balance all columns in fragmented contexts and not just the columns on the final fragment. In this example, we have columns containing an image and some text which are balanced. The image cannot break and so goes into the first column and the other columns fill with equal amounts of text. The other value ...
Backwards Compatibility of Flexbox - CSS: Cascading Style Sheets
te space like other inline items. display: table- The CSS table display properties are potentially very useful as a fallback, due to the fact that they allow design patterns such as full height columns and vertical centering and work back as far as Internet Explorer 8. If you use display: table-cell on an item in your HTML it takes on the styling of an HTML table cell. ...
...tical centering and work back as far as Internet Explorer 8. If you use display: table-cell on an item in your HTML it takes on the styling of an HTML table cell. CSS creates anonymous
boxes to represent these items so that you do not need to wrap each item in a wrapper to represent the HTML table row, and a second one to represent the table element itself, You can't see or style these anonymous
boxes; they are there purely to fix up the tree. If you then declare display: flex on the parent item, these anonymous
boxes do not get created and so your item remains a direct child and can become a flex item -- losing any of the table display features. "Note: Some values of display normally trigger the creation of anonymous
boxes around the original box. If such a box is a flex item, it is blocki...
Flow Layout and Writing Modes - CSS: Cascading Style Sheets
ms of its inline base direction and block flow direction." The specification defines the inline base direction as the direction in which content is ordered on a line. This defines the start and end of the inline direction. The start is where sentences start and the end is where a line of text ends before it would begin to wrap onto a new line. The block flow direction is the direction in which
boxes, for example paragraphs, stack in that writing mode. The CSS writing-mode property controls the block flow direction. If you want to change your page, or part of your page, to vertical-lr then you can set writing-mode: vertical-lr on the element and this will change the direction of the blocks and therefore the inline direction as well. While certain languages will use a particular writing mode ...
...ic, are all horizontal-tb. The following example shows blocks using horizontal-tb. The value vertical-rl gives you a right-to-left block flow direction with a vertical inline direction, as shown in the next example. The final example demonstrates the third possible value for writing-mode -- vertical-lr. This gives you a left-to-right block flow direction and a vertical inline direction.
Boxes with a different writing mode to their parent When a nested box is assigned a different writing mode to its parent, then an inline level box will display as if it has display: inline-block. A block-level box will establish a new block formatting context, meaning that if its inner display type would be flow, it will get a computed display type of flow-root. This is shown in the next example wh...
Relationship of grid layout to other layout methods - CSS: Cascading Style Sheets
s, and columns at the same time. The two specifications share some common features, however, and if you have already learned how to use flexbox, the similarities should help you get to grips with Grid. One-dimensional vs. two-dimensional layout A simple example can demonstrate the difference between one- and two-dimensional layouts. In this first example, I am using flexbox to lay out a set of
boxes. I have five child items in my container, and I have given the flex properties values so that they can grow and shrink from a flex-basis of 150 pixels. I have also set the flex-wrap property to wrap, so that if the space in the container becomes too narrow to maintain the flex basis, items will wrap onto a new row. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-...
...der: 1px solid rgba(0,0,0,0.5); color: #000; padding: 10px; } Grid and display: contents A final interaction with another layout specification that is worth noting is the interaction between CSS Grid Layout and display: contents. The contents value of the display property is a new value that is described in the Display specification as follows: "The element itself does not generate any
boxes, but its children and pseudo-elements still generate
boxes as normal. For the purposes of box generation and layout, the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree." If you set an item to display: contents the box it would normally create disappears, and the
boxes of the child elements appear as if they have risen up a level. Th...
Overview of CSS Shapes - CSS: Cascading Style Sheets
rectangular box as before. If they do have Shapes support then the visual display is enhanced. Basic Shapes The value circle(50%) is an example of a Basic Shape. The specification defines four <basic-shape> values, which are: inset() circle() ellipse() polygon() Using the value inset() wraps text around a rectangular shape however you are able to add offset values, thus pulling the line
boxes of any wrapping content closer to the object than would otherwise happen. We have already seen how circle() creates a circular shape. An ellipse() is essentially a squashed circle. If none of these simple shapes do the trick you can create a polygon() and make the shape as complex as you want. In our Guide to Basic Shapes we explore each of the possible Basic Shapes and how to create them. Sha...
... gradient as the image on which to define our shape. In the example below, if you change the threshold the path that the shape takes changes based on the level of opacity you have selected. We take a deeper look at creating shapes from images in the Shapes from Images guide. The shape-margin property The shape-margin property adds a margin to shape-outside. This will further shorten the line
boxes of any content wrapping the shape, pushing it away from the shape itself. In the example below we have added a shape-margin to a basic shape. Change the margin to push the text further away from the path the shape would take by default. Using Generated Content as the floated item In the examples above we have used images or a visible element to define the shape, meaning that you can see the ...
Layout mode - CSS: Cascading Style Sheets
Table layout, designed for laying out tables. Float layout, designed to cause an item to position itself left or right with the rest of the content in normal flow wrapping around it. ...
... Table layout, designed for laying out tables. Float layout, designed to cause an item to position itself left or right with the rest of the content in normal flow wrapping around it. ...
CSS Tutorials - CSS: Cascading Style Sheets
ize images used as an element's background. This tutorial describes how to achieve this in a simple way. Media queries The size of the screens, or the kind of devices like touchscreens or printed sheets vary greatly nowadays. Media queries are the fundamental building blocks in achieving Web sites that render everywhere in their best quality. Understanding z-index Controlling superposition of
boxes is a basic feature that is very quickly needed by Web developers. Though not that difficult, it requires a basic knowledge of CSS. Intermediate-level CSS tutorials After the release of CSS 2 (Level 1), new features have been added to CSS. Some of them are fancy and are pretty self contained. They are easy to use for anybody with a fair knowledge of basic concepts. CSS Counters Counting ite...
... complex layouts. Though the simplest way to achieve such layout, they are more complex to use for people without too much experience. CSS multi-column layouts CSS3 introduces a new layout allowing you to easily define multiple columns in an element. Though multi-column text is not that common on devices like screens, this is particularly useful on printed pages, or for indexes. CSS flexible
boxes layouts This new layout allow you to give
boxes flexibility, allowing them to be resized smoothly. It is a powerful way to describe complex interfaces. ...
<color> - CSS: Cascading Style Sheets
lor. -moz-CellHighlight Background color for selected item in a tree widget. Should be used with the -moz-CellHighlightText foreground color. See also -moz-html-CellHighlight. -moz-CellHighlightText Text color for a selected item in a tree. Should be used with the -moz-CellHighlight background color. See also -moz-html-CellHighlightText. -moz-Combobox Background color for combo-
boxes. Should be used with the -moz-ComboboxText foreground color. In versions prior to 1.9.2, use -moz-Field instead. -moz-ComboboxText Text color for combo-
boxes. Should be used with the -moz-Combobox background color. In versions prior to 1.9.2, use -moz-FieldText instead. -moz-Dialog Background color for dialog
boxes. Should be used with the -moz-DialogText foreground color. -moz-Di...
...Should be used with the -moz-Dialog background color. -moz-dragtargetzone -moz-EvenTreeRow Background color for even-numbered rows in a tree. Should be used with the -moz-FieldText foreground color. In Gecko versions prior to 1.9, use -moz-Field. ...
Adapting to the new two-value syntax of display - CSS: Cascading Style Sheets
that box behave. As an example, when we use display: flex we create a block-level container, with flex children. The children are described as participating in a flex formatting context. You can see this if you take a <span> -- normally an inline-level element -- and apply display: flex to it. The <span> becomes a block-level element. It behaves as block-level things do in relationship to other
boxes in the layout. It's as if you had applied display: block to the span, however we also get the changed behavior of the children. The live example below has a <span> with display: flex applied. It has become a block-level box taking up all available space in the inline direction. You can now use justify-content: space-between; to put this space between the two flex items. We can create inline f...
...creates a grid formatting context for the direct children. Using display: inline-grid will create an inline-level box, which creates a grid formatting context for the children. The two-value syntax As you can see from the above explanation, the display property has gained considerable new powers. In addition to indicating whether something is block-level or inline-level in relationship to other
boxes on the page, it now also indicates the formatting context inside the box it is applied to. In order to better describe this behavior, the display property has been refactored to allow for two values -- an outer and inner value -- to be set on it, as well as the single values we are used to. This means that instead of setting display: flex to create a block-level box with flex children, we will u...
display - CSS: Cascading Style Sheets
<display-box> | <display-legacy> ; } Outside <display-outside> These keywords specify the element's outer display type, which is essentially its role in flow layout. Valid <display-outside> values: block The element generates a block element box, generating line breaks both before and after the element when in the normal flow. inline The element generates one or more inline element
boxes that do not generate line breaks before or after themselves. In normal flow, the next element will be on the same line if there is space run-in The element generates a run-in box. If the adjacent sibling of the element defined as display: run-in box is a block box, the run-in box becomes the first inline box of the block box that follows it. Run-in elements act like inlines or blocks, dep...
...These elements behave like <colgroup> HTML elements. table-column These elements behave like <col> HTML elements. table-caption These elements behave like <caption> HTML elements. ruby-base These elements behave like <rb> HTML elements. ruby-text These elements behave like <rt> HTML elements. ruby-base-container These elements behave like <rbc> HTML elements generated as anonymous
boxes. ruby-text-container These elements behave like <rtc> HTML elements. Box <display-box> These values define whether an element generates display
boxes at all. Valid <display-box> values: contents These elements don't produce a specific box by themselves. They are replaced by their pseudo-box and their child
boxes. Please note that the CSS Display Level 3 spec defines how the cont...
justify-content - CSS: Cascading Style Sheets
items are packed in their default position as if no justify-content value was set. This value behaves as stretch in grid and flex containers. baseline first baseline last baseline Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the
boxes in its baseline-sharing group. The fallback alignment for first baseline is start, the one for last baseline is end. space-between The items are evenly distributed within the alignment container along the main axis. The spacing between each pair of adjacent items is the same. The first item is flush with the main-start edge, and the last item is flush with the main-end edge. space-around The...
... size of the items along the main axis is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that the combined size exactly fills the alignment container along the main axis. Note: stretch is not supported by flexible
boxes (flexbox). safe Used alongside an alignment keyword. If the chosen keyword means that the item overflows the alignment container causing data loss, the item is instead aligned as if the alignment mode were start. unsafe Used alongside an alignment keyword. Regardless of the relative sizes of the item and alignment container, and regardless of whether overflow which causes data loss might ...
justify-items - CSS: Cascading Style Sheets
e value of the justify-items property of the parents box, unless the box has no parent, or is absolutely positioned, in these cases, auto represents normal. normal The effect of this keyword is dependent of the layout mode we are in: In block-level layouts, the keyword is a synonym of start. In absolutely-positioned layouts, the keyword behaved like start on replaced absolutely-positioned
boxes, and as stretch on all other absolutely-positioned
boxes. In table cell layouts, this keyword has no meaning as this property is ignored. In flexbox layouts, this keyword has no meaning as this property is ignored. In grid layouts, this keyword leads to a behavior similar to the one of stretch, except for
boxes with an aspect ratio or an intrinsic sizes where it behaves like start. sta...
... the alignment container in the appropriate axis. If the property's axis is not parallel with the inline axis, this value behaves like start. baseline first baseline last baseline Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the
boxes in its baseline-sharing group. The fallback alignment for first baseline is start, the one for last baseline is end. stretch If the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that ...
margin-trim - CSS: Cascading Style Sheets
Formal definition Initial valuenoneApplies toBlock containers and multi-column containers. ...
... Formal definition Initial valuenoneApplies toBlock containers and multi-column containers. ...
max-block-size - CSS: Cascading Style Sheets
ntaining blockComputed valuesame as max-width and max-heightAnimation typea length, percentage or calc(); Formal syntax <'max-width'> Examples Setting max-block-size with horizontal and vertical text In this example, the same text (the opening sentences from Herman Melville's novel Moby-Dick) is presented in both the horizontal-tb and vertical-rl writing modes. Everything else about the two
boxes is identical, including the values used for max-block-size. HTML The HTML simply establishes the two <div> blocks that will be presented with their writing-mode set using the classes horizontal or vertical. Both
boxes share the standard-box class, which simply establishes coloring, padding, and their respective values of max-block-size. <p>Writing mode <code>horizontal-tb</code> (the default):...
... me Ishmael. Some years ago--never mind how long precisely--having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world. It is a way I have of driving off the spleen and regulating the circulation. </div> CSS The CSS defines three classes. The first, standard-box, is applied to both
boxes, as seen above. It provides standard styling including the minimum and maximum block sizes, font size, and so forth. After that come the classes horizontal and vertical, which add the writing-mode property to the box, with the value set to horizontal-tb or vertical-rl depending on which class is used. .standard-box { padding: 4px; background-color: #abcdef; color: #000; font: 16px "Open...
place-items - CSS: Cascading Style Sheets
e value of the justify-items property of the parents box, unless the box has no parent, or is absolutely positioned, in these cases, auto represents normal. normal The effect of this keyword is dependent of the layout mode we are in: In block-level layouts, the keyword is a synonym of start. In absolutely-positioned layouts, the keyword behaved like start on replaced absolutely-positioned
boxes, and as stretch on all other absolutely-positioned
boxes. In table cell layouts, this keyword has no meaning as this property is ignored. In flexbox layouts, this keyword has no meaning as this property is ignored. In grid layouts, this keyword leads to a behavior similar to the one of stretch, except for
boxes with an aspect ratio or an intrinsic sizes where it behaves like start. sta...
... the alignment container in the appropriate axis. If the property's axis is not parallel with the inline axis, this value behaves like start. baseline first baseline last baseline Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the
boxes in its baseline-sharing group. The fallback alignment for first baseline is start, the one for last baseline is end. stretch If the combined size of the items is less than the size of the alignment container, any auto-sized items have their size increased equally (not proportionally), while still respecting the constraints imposed by max-height/max-width (or equivalent functionality), so that ...
scrollbar-width - CSS: Cascading Style Sheets
It must be one of the following values: auto The default scrollbar width for the platform. ...
...eight (although the problem is compounded on high-resolution screens; thorough testing is advised). MDN Understanding WCAG, Guideline 2.1 explanations MDN Understanding WCAG, Guideline 2.5 explanations Understanding Success Criterion 2.1.1 | W3C Understanding WCAG 2.1 Understanding Success Criterion 2.5.5 | W3C Understanding WCAG 2.1 Formal definition Initial valueautoApplies toscrolling
boxesInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax auto | thin | none Examples Sizing overflow scrollbars CSS .scroller { width: 300px; height: 100px; overflow-y: scroll; scrollbar-width: thin; } HTML <div class="scroller">Veggies es bonus vobis, proinde vos postulo essum magis kohlrabi welsh onion daikon amaranth tatsoi tomatillo melon azuki bean garlic. Gum...
white-space - CSS: Cascading Style Sheets
: pre-line; white-space: break-spaces; /* Global values */ white-space: inherit; white-space: initial; white-space: unset; The white-space property is specified as a single keyword chosen from the list of values below. Values normal Sequences of white space are collapsed. Newline characters in the source are handled the same as other white space. Lines are broken as necessary to fill line
boxes. nowrap Collapses white space as for normal, but suppresses line breaks (text wrapping) within the source. pre Sequences of white space are preserved. Lines are only broken at newline characters in the source and at <br> elements. pre-wrap Sequences of white space are preserved. Lines are broken at newline characters, at <br>, and as necessary to fill line
boxes. pre-line Sequences of whi...
...ource. pre Sequences of white space are preserved. Lines are only broken at newline characters in the source and at <br> elements. pre-wrap Sequences of white space are preserved. Lines are broken at newline characters, at <br>, and as necessary to fill line
boxes. pre-line Sequences of white space are collapsed. Lines are broken at newline characters, at <br>, and as necessary to fill line
boxes. break-spaces The behavior is identical to that of pre-wrap, except that: Any sequence of preserved white space always takes up space, including at the end of the line. A line breaking opportunity exists after every preserved white space character, including between white space characters. Such preserved spaces take up space and do not hang, and thus affect the box's intrinsic sizes (mi...
HTML attribute: readonly - HTML: Hypertext Markup Language
ckbox and radio or cannot, by definition, start with a value, such as the file input type. range and color, as both have default values. It is also not supported on hidden as it can not be expected that a user to fill out a form that is hidden. Nor is it supported on any of the button types, including image. Note: Only text controls can be made read-only, since for other controls (such as check
boxes and buttons) there is no useful distinction between being read-only and being disabled, so the readonly attribute does not apply. When an input has the readonly attribute, the :read-only pseudo-class also applies to it. Conversely, inputs that support the readonly attribute but don't have the attribute set match the :read-write pseudo-class. Attribute interactions The difference between disab...
...bel> </div> <div class="group"> <input type="email" value="Some value" readonly="readonly"/> <label>Email</label> </div> <div class="group"> <input type="password" value="Some value" readonly="readonly"/> <label>Password</label> </div> <div class="group"> <textarea readonly="readonly">Some value</textarea> <label>Message</label> </div> Result Examples <fieldset> <legend>Check
boxes buttons</legend> <p><label> <input type="checkbox" name="chbox" value="regular"> Regular </label></p> <p><label> <input type="checkbox" name="chbox" value="readonly" readonly> readonly </label></p> <p><label> <input type="checkbox" name="chbox" value="disabled" disabled> disabled </label></p> </fieldset> <fieldset> <legend>Radio buttons</legend> <p><label> <input t...
<input type="radio"> - HTML: Hypertext Markup Language
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. They are called radio buttons because they look and operate in a similar manner to the push buttons on old-fashioned radios, such as the one shown below. Note: Check
boxes are similar to radio buttons, but with an important distinction: radio buttons are designed for selecting one value out of a set, whereas check
boxes let you turn individual values on and off. Where multiple controls exist, radio buttons allow one to be selected out of them all, whereas check
boxes allow multiple values to be selected. Value A DOMString representing the value of the r...
...color: white; background-color: black; padding: 5px 10px; border-radius: 0; border: 0; font-size: 14px; } button:hover, button:focus { color: #999; } button:active { background-color: white; color: black; outline: 1px solid black; } Most notable here is the use of the -moz-appearance property (with prefixes needed to support some browsers). By default, radio buttons (and check
boxes) are styled with the operating system's native styles for those controls. By specifying appearance: none, you can remove the native styling altogether, and create your own styles for them. Here we've used a border along with border-radius and a transition to create a nice animating radio selection. Notice also how the :checked pseudo-class is used to specify the styles for the radio button's appe...
Guides - Archive of obsolete content
This page lists more theoretical in-depth articles about the SDK. Contributor's guide Getting Started Learn how to contribute to the SDK: getting the code, opening/taking a bug, filing a patch, getting reviews, and getting help. Modules Learn about the module system used by the SDK (which is based on the CommonJS specification), how sand
boxes and compartments can be used to improve security, and about the built-in SDK module loader, known as Cuddlefish. Classes and Inheritance Learn how classes and inheritance can be implemented in JavaScript, using constructors and prototypes, and about the helper functions provided by the SDK to simplify this. Private Properties Learn how private properties can be implemented in JavaScript using prefixes, closures, and WeakMaps, and how th...
/loader - Archive of obsolete content
n't actually load any module code, it just creates a placeholder for it. The section below describes how to load the module. load() The load() function takes loader and loads the given module into it: let loader = Loader(options); let module = Module('foo/bar', 'resource:///modules/foo/bar.js'); load(loader, module); Sandbox() The Sandbox() function is a utility function for creating JS sand
boxes. It is used by the loader to create scopes into which modules are loaded. It takes the following set of configuration options: name: A string value which identifies the sandbox in about:memory. Will throw exception if omitted. principal: String URI or nsIPrincipal for the sandbox. If omitted defaults to system principal. prototype: Object that the returned sandbox will inherit from. Defaults...
core/promise - Archive of obsolete content
Implementation of promises to make asynchronous programming easier. Rationale Most of the JS APIs are asynchronous complementing its non-blocking nature. While this has a good reason and many advantages, it comes with a price. ...
loader/sandbox - Archive of obsolete content
Usage Create a sandbox To create a sandbox: const { sandbox, evaluate, load } = require("sdk/loader/sandbox"); let scope = sandbox('http://example.com'); The argument passed to the sandbox defines its privileges. The argument may be: a URL string, in which case the sandbox will get the same privileges as a script loaded from that URL a DOM window object, to inherit privileges from the window being passed. omitted or null: then the sandbox will have chrome privileges giving it access to all the XPCOM components. Optionally the sandbox function can be passed a second argument (See sandbox documentation on MDN for details). ...
Low-Level APIs - Archive of obsolete content
with the NodeJS path module API. io/byte-streams Provides streams for reading and writing bytes. io/file Provides access to the local filesystem. io/text-streams Provides streams for reading and writing text. lang/functional Functional helper methods. lang/type Functions for working with type detection. loader/cuddlefish The SDK's module loader. loader/sandbox Create JavaScript sand
boxes and execute scripts in them. net/url Enables you to read content from a URI. net/xhr Provides access to XMLHttpRequest functionality. places/bookmarks Create, modify, and retrieve bookmarks. places/favicon Helper functions for working with favicons. places/history Access the user's browsing history. platform/xpcom Implement XPCOM objects, factories, and services. preferences/...
Dialogs and Prompts - Archive of obsolete content
See Working with windows in chrome code for introductory information and more discussion and examples. Describing dialog windows Dialogs in Mozilla Whenever you want to create a dialog in your application, use <dialog> (instead of usual <window>) as root element in the XUL file. This will: Handle a few keyboard events (ENTER/ESC and more), which is good for keyboard accessibility. Add OK and Cancel buttons in an order that is consistent with OS default (but the button set and layout is highly customizable, see below). ...
Forms related code snippets - Archive of obsolete content
cell"> </td> <td class="zdp-empty-cell"> </td> <td class="zdp-empty-cell"> </td> <td class="zdp-empty-cell"> </td> <td class="zdp-empty-cell"> </td> </tr> </tbody> </table> Editable <select> fields The content of the <select> element is actually static and not editable. If you want to emulate an editable select through a <fieldset> of radio
boxes and text
boxes (written in pure CSS, without JavaScript), please see this example. Autogrowing <textarea> This example shows how to make a textarea really autogrowing during a typing. Insert some custom text in a <textarea> This example shows how to insert some HTML tags or smiles or any custom text in a textarea. Image preview before upload The FileReader.prototype.readAsDataURL() method ca...
Extension Etiquette - Archive of obsolete content
flicts can occur, there are many others. In general, care must be taken whenever defining a name anywhere that other code might do likewise. Strategies to avoid such conflicts include: Avoid shared namespaces where possible Many naming conflicts are best avoided by simply not sharing namespaces. Scripts can be loaded into their own globals, such as CommonJS modules, JavaScript modules, or Sand
boxes, to avoid most global variable and prototype conflicts. Expando properties are best avoided using tools such as WeakMaps. Prefix names in shared namespaces When shared namespaces can't be avoided, the simplest solution to prevent conflicts is to use a distinct prefix for all of your names. Class names for HTML elements created by the Cool Beans extension, for instance, might all be prefixed w...
Adding Events and Commands - Archive of obsolete content
the situation. Elements only implement the events that are relevant to them, but there are several events that are implemented for most elements. These are some notable events you should keep in mind: oncommand. This is one of the most important and commonly used events in XUL. It's very useful because it represents the most common action for input controls such as menu items, buttons and check
boxes. For a button, it represents the action of the user clicking on it, or focusing it with the keyboard and then pressing the ENTER key. It's an abstraction of the main way to interact with a control element. onselect. Fired when the selection in a tree or listbox changes. onclick. Triggered when the user clicks on the element, including right clicks. You shouldn't normally use this event to trigg...
Adding sidebars - Archive of obsolete content
of other content and switch between different sections easily. The tabbox Element The << XUL Reference << element creates a tabbed view of one or more tabpanel elements. You can see an example of a tabbox element if you open the Firefox Preferences window and select the Advanced section. The tabs are styled to match the operating system you're using, so you should avoid changing the CSS in tab
boxes. On the other hand, if you need UI that behaves like a tabbox but doesn't look like one, you should still favor using a tabbox and use CSS to change its look. Using custom-made elements are likely to cause accessibility and functional problems. Creating a tabbed view is simple: <tabbox id="xulschoolhello-tabbox"> <tabs> <tab label="&xulschoolhello.mainTab.label;" /> <tab label="&xul...
Custom XUL Elements with XBL - Archive of obsolete content
could be applied to any XML language. XBL was submitted to the W3C for standardization, but for now it's used in XUL almost exclusively. With XBL you can define new elements and define their properties, attributes, methods and event handlers. Many complex elements such as tabs, buttons and input controls are implemented using XBL and simpler XUL elements. As explained earlier, XUL is really just
boxes, text and images. We'll look into XBL using a modified version of the Hello World extension. Download the Hello World XBL project, build it and test it for a while. You should see a new item in the Hello World menu, that opens a Binding Test window where you can add "Persons" to a list. XBL Basics In order to create an XBL binding you'll need 2 files: the XBL file and a CSS file that binds an ...
Handling Preferences - Archive of obsolete content
rence="xulschoolhello-message-count-pref" type="number" min="0" max="100" /> In this case we use a numeric field to set the message count preference. Changing the value in the control will change the preference (depending on the instant apply rule), and vice versa. You may be able to create a Preferences window without a single line of JS code thanks to the preference element. Finally, group
boxes are a good idea to organize the contents of the window and preference panes. They are heavily stylized in the Firefox Preferences window, so you should include the same CSS file that is included in it (chrome://browser/skin/preferences/preferences.css). This way you don't have to rewrite all the CSS rules defined for Firefox. You should also look at the class values set to elements in the XUL fil...
Security best practices in extensions - Archive of obsolete content
m a server, or come from local HTML files bundled with the extension. For pages coming from the server, you need to take steps to ensure that the content can not call back into the Web browser and run malicious code. The main way to do this is by creating an iframe or browser element in the sidebar, and loading your content there. Give the element a type="content" attribute, which essentially sand
boxes the code there and blocks callback rights into chrome. Using eval() in an extension Using the built-in JavaScript eval function is frowned upon in the context of extensions. While there are some legitimate use-cases, most of the time there are safer alternatives. This blog post offers some excellent reasons not to use eval(). Sandboxed HTTP connections The main purpose of sandboxed HTTP conne...
Using the Stylesheet Service - Archive of obsolete content
CSS file you want to load. You can replace USER_SHEET with AGENT_SHEET or AUTHOR_SHEET, depending where in the CSS Cascade you want the sheet to be placed. See the CSS Specification for more details. Note that UA stylesheets are allowed to do certain unsafe things that user stylesheets are not allowed to do. In particular, they can apply styles to native anonymous elements and to CSS anonymous
boxes. Getting such styles wrong can easily lead to very incorrect behavior, including crashes. Be very careful with your CSS when using AGENT_SHEET stylesheets. Adding a stylesheet To use the stylesheet service, you get a reference to the service, create a URI and pass the URI to the stylesheet service's loadAndRegisterSheet method. var sss = Components.classes["@mozilla.org/content/style-sheet-s...
Index of archived content - Archive of obsolete content
Open a Web Page Troubleshooting Unit Testing Using XPCOM without chrome Using third-party modules (jpm) Bootstrapped extensions Code snippets Alerts and Notifications Autocomplete Bookmarks
Boxes Canvas code snippets Cookies Customizing the download progress bar Delayed Execution Dialogs and Prompts Downloading Files Drag & Drop Embedding SVG Examples and demos from articles File I/O Finding window handles Forms related code snippets H...
Notes on HTML Reflow - Archive of obsolete content
delegate that responsibility to its parent. If it decides to delegate, then it sets the NS_FRAME_IS_DIRTY state bit on itself and recursively calls ReflowDirtyChild. Eventually, the ReflowDirty Incremental reflow is dispatched, and arrives at the container frame that scheduled it. The target frame recovers its bookkeeping information (e.g., the block frame iterates through the dirty line
boxes), and reflows the dirty child frames. Isn't information lost if a ReflowDirty Incremental reflow coalesces different kinds of incremental reflows (e.g., a ContentChanged with a StyleChanged)? No, because these kinds of reflows aren't coalesced; instead, they're directly enqueued to the presentation shell's reflow queue. HTML and XUL Interaction As mentioned above, HTML and XUL have funda...
Source code directories overview - Archive of obsolete content
draw according the scroll bar thumbs. webshell contains C interfaces, C code, Linux shell scripts and other files for embedding Mozilla in other programs on various different platforms in various different ways (e.g. as plug-in, as ActiveX component, as XPCOM classes). widget contains C interfaces and code for platform independent controls (widgets), such as scroll bars, radio buttons and list
boxes. xpcom contains the low-level C interfaces, C code, C code, a bit of assembly code and command line tools for implementing the basic machinery of XPCOM components (which stands for "Cross Platform Component Object Model"). XPCOM is the mechanism that allows Mozilla to export interfaces and have them automatically available to JavaScript scripts, to Microsoft COM and to regular Mozilla C code. So...
Getting Started - Archive of obsolete content
must first understand the directory structure. Directories In \mozilla\chrome\classic\skin\classic there are a number of different directories which contain the skin information for the default packages that come with Mozilla. The most important directory is \global. The default Widgets are defined here, and anything that is modified will change throughout Mozilla. If you want to modify how check
boxes, radio buttons, and scrollbars appear, this is the place. The next directory is the \communicator directory. This is a catchall directory which holds all of the images and styles for portions of Mozilla that don't merit their own individual directory. You'll be able to change the bookmark manager and the profile migration window here. The three remaining directories are pretty self-explanatory. T...
In-Depth - Archive of obsolete content
y, putting the navigation controls (back button) on the right hand side of the toolbar. Values: Normal, Reverse -moz-image-region This is useful for dividing up an image into multiple smaller images. It uses a rect() object to determine the clipping region. Check out the section on Organizing Images for more information. Example: -moz-image-region: rect(168px 69px 189px 46px); -moz-opacity Makes
boxes semi-transparent. It takes a decimal value, 0.00 is invisible and 1.00 is totally visible. How do I know what to Modify? Now that you've got everything extracted and you know how to modify items, you might be wondering, how do I know where everything is? Well there is an easy way to find out - Using the DOM Inspector. If you didn't install it when you first installed Mozilla you may have to run t...
Drag and Drop Example - Archive of obsolete content
agover="nsDragAndDrop.dragOver(event, boardObserver)" ondragdrop="nsDragAndDrop.drop(event, boardObserver)"> </stack> The board only needs to respond to the dragdrop and dragover events. We'll add a boardObserver to the file dragboard.js in a moment. Next, a palette will be added to the right side of the window. It will contain three buttons, one to create new buttons, one to create check
boxes and the other to create text
boxes. This buttons will respond to the draggesture event and start a drag. <vbox> <button label="Button" elem="button" ondraggesture="nsDragAndDrop.startDrag(event, listObserver)"/> <button label="Check Box" elem="checkbox" ondraggesture="nsDragAndDrop.startDrag(event, listObserver)"/> <button label="Text Box" el...
Repackaging Firefox - Archive of obsolete content
urce directory is a directory that contains the Windows installer, Mac disk image (.dmg), and/or Linux tarball of the standard Firefox that you wish to customize. Second, set the destination directory to the directory into which you wish to save the customized installers. The "Platforms" section lets you select the platforms for which you wish to generate customized installers. Check the
boxes next to each one you want to generate. Make sure you have the standard Firefox install package in the source directory for each of these. The names of the source installer packages for each platform that are included in your source directory will appear next to each checkbox. The repackager tool will do its work, placing the customized installers into the destination directory you specified. Pl...
Menu - Archive of obsolete content
an array of menuitems. show(anchorNode) Shows the menu immediately. Parameters anchorNode The menu will pop up on this node, which may be either a raw DOM node or a DOM node wrapped by jQuery. Menuitems Menus in Jetpack contain Menuitem objects, including both built-in Firefox menus and menus that features create. No Menuitem constructor is exposed, because Jetpack automatically
boxes simple JavaScript objects into Menuitem objects. Creating menuitems To pass a new menuitem into the API, pass one of the following types: null A simple menu separator. (Note that any falsey value will suffice, including undefined, null, and the empty string. null is recommended because it stands out.) function A menuitem that will update itself when its menu is shown. The function is invoked just...
Mozilla Application Framework in Detail - Archive of obsolete content
edded and used to interpret, display and run web content, applications and services on any computing platform or device. Open source and freely available, Gecko is small in size and modular and achieves rendering speed superior to all other browser engines - which makes it perfect for embedding into both desktop applications such as browsers and new devices such as browsing appliances and set top
boxes. Supporting Gecko Technologies provide a complete set of resources for efficient development, including full support of web standards, a cross-platform/cross-device user interface language, an extensible architecture and embedding technologies. With its unprecedented power, speed and standards support, the Gecko browser engine represents a major advance for developers. With Gecko, developers seek...
New Skin Notes - Archive of obsolete content
Devmo has a new skin that is ready for testing. If you go to your user preferences, you can change the skin to "Devmo". This is currently just a preview, but we would appreciate help with testing. Please add any feedback to this page. Thanks! Feedback Fix weird width bug on Preferences page. --dria CSS classes for Feature and Subfeature
boxes, including required graphics. -- dria When will these fixes be on the live site? --Nickolay 10:38, 31 Aug 2005 (PDT) Existing fixes should be on test/docs/ now. --dria Stuff That's Been Fixed Note that while I've made these fixes, they haven't necessarily been checked in yet. Edit page textarea needs to 'scale' better with page width (so large whitespace area's are non-existant), suggest min-width:some-em-size; width: 88%; and max-w...
Using XPInstall to Install Plugins - Archive of obsolete content
SmartUpdate differs from XPInstall in that: XPInstall uses ZIP files named XPI files (*.xpi) and SmartUpdate uses JAR files (*.jar) Unlike a SmartUpdate JAR file, XPI Packages do not have to be digitally signed with a code-signing certificate. XPI Packages make use of different APIs from within install.js, although the concept is the same.
ContextMenus - Archive of obsolete content
a context menu, a single event may be used to listen for any of these situations; the 'contextmenu' event is fired in any case. <hbox id="container" align="center" oncontextmenu="..."> <label value="Name:"/> <textbox id="name"/> </hbox> In this example, an attempt to open a context menu anywhere inside the hbox will call the event listener attached using the oncontextmenu attribute. As text
boxes have a context menu built in, the event will fire before an attempt to open the context menu. However, the event will also fire when the label is right-clicked for instance, so the event handler should check to make sure that the target of the contextmenu event is what is desired. To cancel a context menu event, you can use the preventDefault method of the event object. function checkContextMen...
boxObject - Archive of obsolete content
<< XUL Reference boxObject Type: nsIBoxObject This property is available for elements that are derived from
boxes, which is most displayable XUL elements. Prior to Gecko 1.9.1, you can retrieve the boxObject for non-XUL elements using the document.getBoxObjectFor method; the method was removed in Gecko 1.9.1 because it was non-standard. It is covered further in the tutorial. ...
The Joy of XUL - Archive of obsolete content
r data storage. The Calendar was initially developed exclusively for Linux but was successfully ported to both Macintosh and Windows within a week. XUL provides a rich set of UI components.The user interface for the Calendar is written entirely in XUL, JavaScript, and CSS, which is a testament to the power and flexibility of this application building framework. It uses simple XUL components like
boxes, grids, and stacks to compose views for the weeks, days, and months. The initial implementation of Calendar did not exploit XBL because the developers involved were not experienced with this complementary technology. But future plans for the Calendar include converting many of these UI components to XBL widgets to further simplify their implementation. XPCOM/XPConnect enables integration of nati...
Broadcasters and Observers - Archive of obsolete content
vent handler onbroadcast is called. This results in an alert message appearing. Note that the broadcast only occurs if the attributes on the broadcaster element are changed. Changing the style of the buttons directly will not cause the broadcast to occur so the alert box will not appear. If you tried duplicating the code for the first button several times, you would end up with a series of alert
boxes appearing, one for each button. This is because each button is an observer and will be notified when the style changes. Next, we'll look at using the Document Object Model with XUL elements. << PreviousNext >> ...
Commands - Archive of obsolete content
roller by looking at the currently focused element to see if it has a controller which can handle the command. XUL elements have a controllers property which is used to check. You can use the controllers property to add your own controllers. You might use this to have a listbox respond to cut, copy and paste operations, for instance. An example of this will be provided later. By default, only text
boxes have a controller that does anything. The textbox controller handles clipboard operations, selection, undo and redo as well as some editing operations. Note that an element may have multiple controllers, which will all be checked. If the currently focused element does not have a suitable controller, the window is checked next. The window also has a controllers property which you can modify if de...
Creating a Skin - Archive of obsolete content
by changing the menus, the grippies on the toolbar and the input and checkbox elements. Creating a Global Skin The skin created above is simple and only applies to the find files dialog. Some of the changes made to the skin could be placed in the global style sheets (those in the global directory of the skin) to be applied to all applications. For example, having different images for the check
boxes in the find files dialog as other windows looks a little odd. This change should really be moved into the global style sheet. Try moving the CSS styles from findfile.css into global.css and then look at some of the dialogs in Mozilla. (The cookie viewer is a good example.) You will notice that it has adopted the rules that we have added. Some of the rules conflict with those already in the globa...
Document Object Model - Archive of obsolete content
that something would happen. function doFind(){ var meter=document.getElementById('progmeter'); meter.hidden = false; var searchtext=document.getElementById('find-text').value; alert("Searching for \"" + searchtext + "\""); } Now, with that alert box in there, we know what should happen when we click the Find button. We could add additional code to get the selections from the drop-down
boxes too. XUL Element DOM Every XUL element has a set of attributes, a set of properties and a set of children. The attributes are declared in the source, for example, flex="1", is a flex attribute set to the value 1. Properties are available in JavaScript using the dot syntax. For example, element.hidden refers to the hidden property of an element. The children are the child tags of the eleme...
Introduction - Archive of obsolete content
anguages such as MathML or SVG can be inserted within it. Also, text displayed with XUL is easily localizable, which means that it can be translated into other languages with little effort. What kinds of user interfaces can be made with XUL? XUL provides the ability to create most elements found in modern graphical interfaces. Some elements that can be created are: Input controls such as text
boxes and check
boxes Toolbars with buttons or other content Menus on a menu bar or pop up menus Tabbed dialogs Trees for hierarchical or tabular information Keyboard shortcuts The displayed content can be created from the contents of a XUL file or with data from a datasource. In Mozilla, such datasources include a user's mailbox, their bookmarks and search results. The contents of menus, trees a...
Introduction to RDF - Archive of obsolete content
rks, the history or mail messages. Mozilla provides datasources for this common data so that you can easily use them. You can use any of the provided RDF datasources to populate trees with data or you can point to an RDF file stored in XML which contains the data. This makes it very convenient to display trees with lots of rows in them. RDF can also populate other XUL elements as well such as list
boxes and menus. We'll see this in the next section. A very brief overview of RDF will be provided here. For more information about RDF, see the RDF specification. RDF/XML RDF consists of a model, which is a graph representation of data. RDF/XML is an XML language which can be used to represent RDF data. It contains a fairly simple set of elements. The sample below shows a simple RDF template. <?xml v...
Scroll Bars - Archive of obsolete content
<< PreviousNext >> Now, let's find out to add scroll bars to a window. Adding Scroll Bars A scroll bar is typically used so that a user can move around in a large document. You can also use it when you need to ask for a value that falls within a certain range. Scroll bars can be created in a number of ways. In XUL, one can be created using the scrollbar tag. Some elements, such as text
boxes, will also add scroll bars as necessary when the content inside is too large. In this section, we'll discuss creating a stand-alone scroll bar. The user will set the value by adjusting the scroll bar. You probably won't use this too often. A scroll bar is made up of several parts: the slider, which is the main part of the scroll bar with the adjustable box, and the two arrow buttons on the end. A...
The Chrome URL - Archive of obsolete content
me://browser/content/bookmarks/bookmarksManager.xul You can enter chrome URLs anywhere normal URLs can be used. You can even enter them directly into the URL bar in a Firefox browser window. If you enter the URL mentioned above into the browser's address bar, you should see that window appear like a web page might do and for the most part will function as if it was a separate window. Some dialog
boxes may not work right, however, as they may be expecting arguments to be supplied from the window that opened them. You will also see chrome URLs without specified filenames, such as: chrome://browser/content/ In this case, only the package name and part is specified. This type of reference will automatically select an appropriate file from that right directory. For content, a file with the same na...
Toolbars - Archive of obsolete content
bars are a type of box. Usually, a row of buttons would appear in the toolbar, but any element can be placed in a toolbar. For example, the Mozilla browser window contains a textbox that displays the page URL. Toolbars may be placed on any side of the window, either horizontally or vertically. Of course you wouldn't normally put a textbox in a vertical toolbar. Actually, because toolbars are just
boxes they can actually go anywhere you want, even in the middle of a window. Typically however, a set of toolbars would appear along the top of a window. When more than one toolbar is placed next to each other, they are typically grouped together in something called a 'toolbox'. A simple toolbar inside a toolbox Source View <toolbox> <toolbar id="nav-toolbar"> <toolbarbutton label="Back"/> ...
Tree Box Objects - Archive of obsolete content
ee.boxObject.QueryInterface(Components.interfaces.nsITreeBoxObject) as shown in the code examples on this page because: let boxobject = tree.treeBoxObject; Note: is equivalent to: let boxobject = tree.boxObject; boxobject.queryInterface("Components.interfaces.nsITreeBoxObject"); Scrolling the Tree You can also scroll the tree using four different methods, similar to those available for list
boxes. The scrollToRow() function may be used to scroll to a particular row. Here is a simple example. Example 1 : Source View <script> function doScroll(){ var value = document.getElementById("tbox").value; var tree = document.getElementById("thetree"); var boxobject = tree.boxObject; boxobject.QueryInterface(Components.interfaces.nsITreeBoxObject); boxobject.scrollToRow(value); } </scrip...
XBL Inheritance - Archive of obsolete content
de="VK_F4"> this.value="http://www"+value; </handler> </handlers> </binding> The XBL here extends from the XUL textbox element. The URL given in the extends attribute above is the URL of the textbox binding. This means that we inherit all of the content and behavior provided by the textbox binding. In addition, we add a handler which responds to the keypress event. Autocompleting Text
Boxes The example above is similar to how the URL autocomplete feature works in Mozilla. A textbox that supports autocomplete is just one with a XBL binding that extends the basic textbox. The autocomplete textbox adds extra event handling so that when a URL is typed, a menu will pop up with possible completions. You can use it in your own applications too. Just create a textbox with two extra attribut...
dialog - Archive of obsolete content
The buttons attribute may be used to set which buttons should appear in the dialog box. These buttons will be placed in the correct locations for the user's platform. More information is available in the XUL tutorial and Dialogs and prompts (code snippets). ...
label - Archive of obsolete content
cription Attributes label Interfaces nsIAccessibleProvider, nsIDOMXULLabelElement Notes Labels are not focusable Note: Starting in Gecko 2.0, labels are properly not focusable. They used to incorrectly inherit from nsIDOMXULControlElement. The caption is in the "value" attribute Remember that the label element has a "value" attribute, unlike value in HTML whereas buttons, check
boxes use label="foo" as the attribute <label label="A Caption"/> <!-- wrong --> <label value="A Caption"/> <label value="Click the button"/> <button label="A Button"/> <checkbox label="A Decision" value="1"/> Wrapping By default, label text does not wrap. To enable wrapping, use a text node instead of the value attribute. <label control="email">Email address</label> <textbox id="email"/> If the tex...
listbox - Archive of obsolete content
Deselects all of the currently selected items and selects the given item. A select event is sent after the selection is made. selectItemRange( startItem, endItem ) Return type: no return value Selects the items between the two items given as arguments, including the start and end items. All other items are deselected. This method does nothing for single-selection list
boxes. A select event is sent after the selection is made. timedSelect( item, timeout ) Return type: no return value Selects the item specified by the argument item after the number of milliseconds given by the timeout argument. All other items are deselected. toggleItemSelection( item ) Return type: no return value If the specified item is selected, it is de...
scale - Archive of obsolete content
will, however, still respond to mouse events. To enable the element, leave this attribute out entirely. Visible controls have a disabled property which, except for menus and menuitems, is normally preferred to use of the attribute, as it may need to update additional state. increment Type: integer The amount by which the curpos (for scroll bars) or value (for number
boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). The default value is 1. min Type: integer The minimum value the control's value may take. The default value is 0. Type: integer The maximum value that the scale or number box may be set to. The default value is 100 for scales and Infinity for number
boxes. moveto...
scrollbar - Archive of obsolete content
L tutorial. Attributes curpos, increment, maxpos, pageincrement Examples <scrollbar curpos="5" maxpos="50"/> Attributes curpos Type: integer The current position of the scrollbar, which ranges from 0 to the value of the maxpos attribute. The default value is 0. increment Type: integer The amount by which the curpos (for scroll bars) or value (for number
boxes and scale) attribute changes when the arrows are clicked(or scales are dragged). The default value is 1. maxpos Type: integer The maximum position of the scrollbar. The default value is 100. pageincrement Type: integer The amount by which the value of the curpos or value attribute changes when the tray of the scroll bar (the area in which the scroll bar thumb moves) is clicked, ...
scrollbox - Archive of obsolete content
sing element also was overflow:auto. If the user made the window smaller, the outer box would get smaller in response and sprout its scroll bars. We wanted our vbox to get smaller and sprout its scroll bars instead. Note that this example doesn't use a scrollbox tag; you only need that tag if you want to programmatically scroll in addition to the automatic scroll bars. Note: avoid nested scroll
boxes; it's maddening for the experienced user and confusing for the less experienced user. Instead, figure out some other way to lay things out. Scrolling a child element into view See element.scrollIntoView. Prior to Gecko 19, scrollIntoView() didn't exist in XUL. Do this instead: var xpcomInterface =scrollbox_element.boxObject.QueryInterface( Components.interfaces.nsIScrollBoxObject)...
toolbar - Archive of obsolete content
string The name of the toolbar. toolboxid Type: string The ID of the toolbox this toolbar is a member of. This will either be the toolbox's parent (if it's in a toolbox), or, if the toolbar is an external toolbar (that is, one not contained in a toolbox), the ID of the toolbox it should be considered to be part of. This makes it possible to have toolbars that are not contained within tool
boxes, such as the add-on bar. Methods insertItem( id, beforeNode, wrapper, beforePermanent ) Not in SeaMonkey 1.x Return type: element Add an item with the given id to the toolbar. The new item is added just before the item given by the second argument. If the second argument is null, but the beforePermanent argument is true, the item is added to the beginning of the toolbar before the fi...
treecol - Archive of obsolete content
l-image must be used on the treecol element for the image to appear. You should still specify a label for use in the column picker if ignoreincolumnpicker is not true and hidecolumnpicker is not true on the tree. type Type: one of the values below The type of tree column. The default is a text column that displays the content as text. checkbox The content of the columns are check
boxes. progressmeter The content of the columns are a progress meters. This is used in Mozilla's download manager window. text The content of the columns is text. width Type: string (representing an integer) The preferred width of the tree column. The value should not include a unit as all values are in pixels. Specifying widths for your columns causes Gecko to allow the tree to b...
XULRunner Hall of Fame - Archive of obsolete content
Cross-platform viewer for OpenDocument files. TaskPool TaskPool is a little application to help keep track of time. You can add tasks to a pool, turn them on and off, and it will tick off seconds. SVGclock An SVG-based clock. Crowbar A web scraping environment based on the use of a server-side headless mozilla-based browser. 30b A XULRunner-based wrapper for 30
boxes.com XUL Explorer "a lightweight XUL IDE... an easy way to experiment with XUL" XULExplorer A patched version of XUL Explorer to re-enable application and extension skeleton generation. Foxkeh Clock (for Japanese page) A clock application based charactor Foxkeh. Pyjamas-Desktop A Python Web Widget toolkit (similar to pyqt4 and pygtk2) that uses XULrunner DOM to impl...
2006-11-03 - Archive of obsolete content
created the following bug entry https://bugzilla.mozilla.org/show_bug.cgi?id=331404. Announcements A change in Tp2's numbers On October 31st Adam Guthrie announced that: Rob Helmer will be adding his patch to fix Tp2's reporting of average pre-load times. More Tbox changes on the way, most hitting on Friday On October 30th J. Paul Reed announced that: that he is taking down old Tinder
boxes and making a few changes to existing Tinder
boxes. On October 30th Boris Zbarsky Boris expresses his opinion about Paul taking down one of the two build
boxes that produces nightly builds for linux. On October 30th J. Paul Reed responds to Boris with the following explanation on why he is taking down one of two the linux build servers. Paul explains that his goal is to do only singular set...
2006-11-17 - Archive of obsolete content
re responsible for running autoconf (configure.in -> configure), located in his office failed to boot up after power was restored. configure regeneration back up, but another outage tonight... On November 13th J. Paul Reed announced that: The machine in his office are now back up. He also warns that there will be another outage which will cause the servers in his office as well as all tinder
boxes to go down. Meetings There were no meetings this week. Summarized By: Vanessa Miranda & Mohammad Tirtashi ...
Extentsions FAQ - Archive of obsolete content
ged until after it's upgrade? Is there a way of changing the Thunderbird displays headers when replying and forwarding? Why there are some rss feeds that do not appear as livemarks when bookmarked even though the necessary tags for the feed to appear as a livemark are seemingly present and properly formatted in the feeds source? Asking for help in knowing the data that is typed into text
boxes. Asking about the feasibility of making an extension that has the same functionality as "trace route". Friday, September 29 - October 6, 2006 (? top) How can we programmatically extract the subject, sender, date and the body of an e- mail when you are reading one (in Thunderbird presumably)? Could someone make an addressbook enhancer extension that has the ability to put pictures on a co...
2006-10-20 - Archive of obsolete content
d Downtime - 10/17/2006, 7pm - 10pm PDT (0200 - 0500 UTC) Scheduled downtime for upgrades and migration. Firefox 2 Release Candidate 3 is now available for download FF2 RC3 available for download. Completed RC3 Testing Key testing activities for FF2 RC3 are done. Discussions Sparky AND comet going away on Friday Preed wants to get rid of Sparky and comet (both older desktop class linux
boxes). Robert Kaiser gave some background on the
boxes. Decommissioning sparky on Friday Preed wants to get rid of Sparky (a linux build box) and wants to know if there are reasons wy not to do it. Feature Brainstorming + Firefox 3 Dria posted a link to the Firefox Feature Brainstorming List (open to everyone). Discussion of what is the best format for the list and how to use it best. Meetings...
2006-11-03 - Archive of obsolete content
- 11pm PDT (0300 - 0700 UTC) Opening l10n repository on MOZILLA_1_8_BRANCH for approved check-ins Opening l10n repository on MOZILLA_1_8_BRANCH for approved check-ins Discussion From 50 to 100 locales a discussion on how to make l10n easier and increase the number of locals with which mozilla products ship. More Tbox changes on the way, most hitting on Friday Preed discusses killing more t
boxes. Cross-Product extension install improvements Simon Paquet points out how much easier it is to install an extension in firefox than it in any other product. A discussion of how to get firefox to be able to install extensions for other products (e.g. Thunderbird, sunbird). button in the upper right hand corner the removal of the firefox home page button was purposeful, you can add that functio...
2006-11-10 - Archive of obsolete content
ome new functionality of calendar. Discussions Hunting down the "Sunbird fails to start" bug -- please help Discussion about a crash when starting Sunbird 0.2. Calendar:Improving the Calendar Views Discussion about improving the layout of Calendar. next steps for 24 hours view Discussion about the improving of some features of Calendar ex. configurable start/end hours, optimal size of grid
boxes in 24 hours view. Meetings No Meetings were scheduled this week. Authors Mark Paruzel Yi (Eric) Shen [Back to Weekly Summaries ] ...
NPAPI plugin developer guide - Archive of obsolete content
-ins Printing the Plug-in Setting the Window Getting Information Windowed Plug-ins Mac OS Windows Unix Event Handling for Windowed Plug-ins Windowless Plug-ins Specifying That a Plug-in Is Windowless Invalidating the Drawing Area Forcing a Paint Message Making a Plug-in Opaque Making a Plug-in Transparent Creating Pop-up Menus and Dialog
Boxes Event Handling for Windowless Plug-ins Streams Receiving a Stream Telling the Plug-in When a Stream Is Created Telling the Plug-in When a Stream Is Deleted Finding Out How Much Data the Plug-in Can Accept Writing the Stream to the Plug-in Sending the Stream in Random-Access Mode Sending the Stream in File Mode Sending a Stream Creating a Stream Pushing Data into the Stream ...
Monitoring plugins - Archive of obsolete content
Also note that in the example above an if statement first checks to see that the arriving notification's topic is the correct one. This is useful in cases where your class is registered to receive notifications for more than one topic with the observer service. Clean Up To unregister your class with the observer service - when you no longer want to be listening to runtime notifi...
NPP_Print - Archive of obsolete content
plug-in (either embedded or full-page). It uses the print mode set in the NPPrint structure in its printInfo parameter to determine whether the plug-in should print as an embedded plug-in or as a full-page plug-in. An embedded plug-in shares printing with the browser; the plug-in prints the part of the page it occupies, and the browser handles everything else, including displaying print dialog
boxes, getting the printer device context, and any other tasks involved in printing, as well as printing the rest of the page. For an embedded plug-in, set the printInfo field to NPEmbedPrint. A full-page plug-in handles all aspects of printing itself. For a full-page plug-in, set the printInfo field to NPFullPrint or null. For information about printing on your platform, see your platform documenta...
Theme changes in Firefox 3.5 - Archive of obsolete content
humb button by bug 448704. For the Windows and Linux native default themes, the gripper is now drawn as a part of the background of the scrollbar thumb widget. Third-party themes can still draw a gripper for the scrollbar thumb button by applying a centered background image to the scrollbar's thumb button. global/checkbox.css, global/radio.css Since bug 394892, radio buttons and check
boxes no longer have a minimum size on Mac OS X. If your theme uses native check
boxes or radiobuttons (-moz-appearance: radio / checkbox), this can result in distorted controls. You might have to set the width and height of .checkbox-check and .radio-check to 16px to avoid that problem. Look at the patch to see what was changed for Pinstripe. Bug 450944 changed the way window shadow is ha...
-moz-border-bottom-colors - Archive of obsolete content
color> values */ -moz-border-bottom-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* Global values */ -moz-border-bottom-colors: inherit; -moz-border-bottom-colors: initial; -moz-border-bottom-colors: unset; When an element has a border that is larger than a single CSS pixel, each line of pixels uses the next color specified in this property, from the outside in. This eliminates the need for nested
boxes. If the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. Initial valuenoneApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete It does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. Syntax Values Accepts a white-space separated list of color value...
-moz-border-left-colors - Archive of obsolete content
ltiple <color> values */ -moz-border-left-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* Global values */ -moz-border-left-colors: inherit; -moz-border-left-colors: initial; -moz-border-left-colors: unset; When an element has a border that is larger than a single CSS pixel, each line of pixels uses the next color specified in this property, from the outside in. This eliminates the need for nested
boxes. If the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. Initial valuenoneApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete It does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. Syntax Values Accepts a white-space separated list of color value...
-moz-border-right-colors - Archive of obsolete content
le <color> values */ -moz-border-right-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* Global values */ -moz-border-right-colors: inherit; -moz-border-right-colors: initial; -moz-border-right-colors: unset; When an element has a border that is larger than a single CSS pixel, each line of pixels uses the next color specified in this property, from the outside in. This eliminates the need for nested
boxes. If the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. Initial valuenoneApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete It does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. Syntax Values Accepts a white-space separated list of color value...
-moz-border-top-colors - Archive of obsolete content
* Multiple <color> values */ -moz-border-top-colors: #f0f0f0 #a0a0a0 #505050 #000000; /* Global values */ -moz-border-top-colors: inherit; -moz-border-top-colors: initial; -moz-border-top-colors: unset; When an element has a border that is larger than a single CSS pixel, each line of pixels uses the next color specified in this property, from the outside in. This eliminates the need for nested
boxes. If the border is wider than the number of specified colors, the remaining part of the border is the innermost color specified. Initial valuenoneApplies toall elementsInheritednoComputed valueas specifiedAnimation typediscrete It does not apply if border-style is dashed or dotted. to tables with border-collapse: collapse. Syntax Values Accepts a white-space separated list of color value...
-ms-wrap-through - Archive of obsolete content
ormal syntax wrap | none Specifications Not part of any specification. Remarks You can use the -ms-wrap-through property to control the effect of exclusions; for instance, to cause one content block to wrap around an exclusion element and another to intersect the same exclusion element. The wrapping context of a box is a collection of exclusion areas contributed by its associated exclusion
boxes. The inline flow content of a box is placed in the area that corresponds to the subtraction of its wrapping context from its own content area. For more information about exclusion elements' impact on content flow, see the Terminology section of the CSS Exclusions Module Level 1 specification. ...
::-ms-check - Archive of obsolete content
This pseudo-element is supported only in Internet Explorer and Microsoft Edge. Allowable Properties Only the following CSS properties can be used in a rule with ::-ms-check in its selector. Other properties are ignored. ...
CSS - Archive of obsolete content
This pseudo-element is non-standard, supported only in Internet Explorer 10, Internet Explorer 11, and Microsoft Edge.::-ms-expandThe ::-ms-expand CSS pseudo-elemen...
XForms Select Element - Archive of obsolete content
). Characteristics analogous widgets are <html:select size="5" multiple="true"/> and <xul:listbox seltype="multiple"/> visual grouping by choices element isn't implemented if incremental attribute value is false, the bound node is updated when the select control is blurred (i.e. loses focus), otherwise it is updated upon item selection check group The select is represented as group of check
boxes (xhtml/xul). Characteristics appearance attribute contains the value full there are no analogue widgets in XHTML or in XUL visual grouping by choices element is supported if incremental attribute value is false then bound node is updated when item is blurred Examples <xf:model> <xf:instance> <data xmlns=""> <values>g</values> </data> </xf:instance> </xf:model> <xf:selec...
Game monetization - Game development
on and see what your options are. The technology is mature enough; now it's just about chosing the right approach. Paid games The first, most obvious choice that may come to your mind might be selling the games the way it is done for huge AAA titles -- with a fixed, up front price. Even though the digital market is key and you don't need to print covers and put your game in a physical store in
boxes, to earn decent money on selling your games for a fixed price you have to invest your time and money in marketing. Only the best games will break even or earn more than they cost to make, and you still need a lot of luck for that. How much you charge for your game depends on the market, quality of your game and a lot of other small factors. An arcade iOS title can be sold for 0.99 USD, but a lon...
Building up a basic demo with A-Frame - Game development
build up a simple demo. High level overview The current version of A-Frame is 0.3.2, which means it's highly experimental, but it already works and you can test it right away in the browser. It runs on desktop, mobile (iOS and Android), and Oculus Rift, Gear VR and HTC Vive. A-Frame is built on top of WebGL, and provides pre built components to use in applications -- models, video players, sky
boxes, geometries, controls, animations, cursors, etc. It is based on the entity component system, which is known in the game development world, but it targets web developers with a familiar markup structure, manipulable with JavaScript. The end result is 3D web experiences, which are VR-enabled by default. Environment setup Let's start by setting up an environment to create something with A-Frame. W...
Accessibility tree (AOM) - MDN Web Docs Glossary: Definitions of Web-related terms
w names are computed in the Accessible Name and Description Computation spec). description How do we describe this element, if we want to add anything to the name? The description of a table could explain what kind of info that table offers. role What kind of thing is it? For example, is it a button, a nav bar, or a list of items? state Does it have a state? Think checked/unchecked for check
boxes, or collapsed/expanded for the <summary> element. Additionally, the accessibility tree often contains information on what can be done with an element: a link can be followed, a text input can be typed into, etc. ...
Alignment subject - MDN Web Docs Glossary: Definitions of Web-related terms
the alignment subject is the margin box of the box the property is set on, using the writing mode of that box. For justify-content and align-content, the writing mode of the box is also used. The definition of the alignment subject depends on the layout mode being used. Block containers (including table cells) The entire content of the block as a single unit. Multicol containers The column
boxes, with any spacing inserted between column
boxes added to the relevant column gaps. Flex containers For justify-content, the flex items in each flex line. For align-content, the flex lines. Note, this only has an effect on multi-line flex containers. Grid containers The grid tracks in the appropriate axis, with any spacing inserted between tracks added to the relevant gutters. Collapsed gutte...
Alpha (alpha channel) - MDN Web Docs Glossary: Definitions of Web-related terms
en to some extent, a fourth channel is added to the color: the alpha channel. The alpha channel specifies how opaque the color is. For example, the color #8921F2 (also described as rgb(137, 33, 242) or hsl(270, 89%, 54)) is a nice shade of purple. Below you see a small box of that color in the top-left corner and a box of the same color but with an alpha channel set at 0.5 (50% opacity). The two
boxes are drawn on top of a paragraph of text. As you can see, the color without an alpha channel completely blocks the background text, while the box with the alpha channel leaves it visible through the purple background color. Learn more General knowledge Alpha compositing on Wikipedia RGBA color model on Wikipedia Channel (digital image) on Wikipedia Technical reference CSS color ...
caret - MDN Web Docs Glossary: Definitions of Web-related terms
y allowing the contents of the element to be edited by the user. Learn more General knowledge Caret navigation on Wikipedia CSS related to the caret You can set the color of the caret for a given element's editable content by setting the element's CSS caret-color property to the appropriate <color> value. HTML elements that may present a caret These elements provide text entry fields or
boxes and therefore make use of the caret. <input type="text"> <input type="password"> <input type="search"> <input type="date">, <input type="time">, <input type="datetime">, and <input type="datetime-local"> <input type="number">, <input type="range"> <input type="email">, <input type="tel">, and <input type="url"> <textarea> Any element with its contenteditable attribute set ...
A cool-looking box - Learn web development
Prerequisites: Before attempting this assessment, you should have already worked through all the articles in this module. Objective: To test comprehension of the CSS box model and other box-related features such as borders and backgrounds. Starting point To get this assessment started, you should: Make local copies of the starting HTML and CSS -- save them as index.html and style.css in a new directory. Alternatively, you could use a site like JSBin or Glitch to do your assessment. You could paste the HTML and fill in the CSS into one of these online editors. ...
Test your skills: The Box Model - Learn web development
you check your understanding of the CSS Box Model. Note: You can try out solutions in the interactive editors below, however, it may be helpful to download the code and use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. The Box Model One With the two
boxes below, one is using the standard box model, the other the alternate box model. Change the width of the second box by adding rules to the .alternate class, so that it matches the visual width of the first box. Your final result will look like the image below. Try updating the live code below to recreate the finished example: For assessment or further work purposes, download the starting poi...
Pseudo-classes and pseudo-elements - Learn web development
ent has focus and the focus should be visible to the user. :focus-within Matches an element with focus plus an element with a descendent that has focus. :future Matches the elements after the current element. :hover Matches when the user hovers over an element. :indeterminate Matches UI elements whose value is in an indeterminate state, usually check
boxes. :in-range Matches an element with a range when its value is in-range. :invalid Matches an element, such as an <input>, in an invalid state. :lang Matches an element based on language (value of the HTML lang attribute). :last-child Matches an element which is last among its siblings. :last-of-type Matches an element of a certain type tha...
Test your skills: floats - Learn web development
be helpful to download the code and use an online tool such as CodePen, jsFiddle, or Glitch to work on the tasks. If you get stuck, then ask us for help -- see the Assessment or further help section at the bottom of this page. Floats One In this task you need to float the two elements with a class of float1 and float2 left and right respectively. The text should then appear between the two
boxes as in the image below. Try updating the live code below to recreate the finished example: For assessment or further work purposes, download the starting point for this task to work in your own editor or in an online editor. Float Two In this example the element with a class of float should be floated left. Then we want the first line of text to display next to that element, but the foll...
Normal Flow - Learn web development
make a readable document, by starting in this way you are working with the document rather than fighting against it as you make changes to the layout. Before digging deeper into different layout methods, it is worth revisiting some of the things you will have studied in previous modules with regard to normal document flow. How are elements laid out by default? First of all, individual element
boxes are laid out by taking the elements' content, then adding any padding, border and margin around them -- it's that box model thing again, which we've looked at earlier. By default, a block level element's content is 100% of the width of its parent element, and as tall as its content. Inline elements are as tall as their content, and as wide as their content. You can't set width or height on inlin...
Practical positioning examples - Learn web development
e: To get an idea of the practicalities of positioning A tabbed info-box The first example we'll look at is a classic tabbed info box -- a very common feature used when you want to pack a lot of information into a small area. This includes information-heavy apps like strategy/war games, mobile versions of websites where the screen is narrow and space is limited, and compact information
boxes where you might want to make lots of information available without having it fill the whole UI. Our simple example will look like this once we are finished: Note: You can see the finished example running live at info-box.html (source code). Check it out to get an idea of what you will be building in this section of the article. You might be thinking "why not just create the separate tabs as...
Responsive design - Learn web development
the layout section of our Legacy layout methods article. It is likely that you will come across websites using this approach in your work, so it is worth understanding it, even though you would not build a modern site using a float-based flexible grid. The following example demonstrates a simple responsive design using Media Queries and a flexible grid. On narrow screens the layout displays the
boxes stacked on top of one another: On wider screens they move to two columns: Note: You can find the live example and source code for this example on GitHub. Modern layout technologies Modern layout methods such as Multiple-column layout, Flexbox, and Grid are responsive by default. They all assume that you are trying to create a flexible grid and give you easier ways to do so. Multico...
Getting started with CSS - Learn web development
ame. To target all paragraphs in the document you would use the selector p. To turn all paragraphs green you would use: p { color: green; } You can target multiple selectors at once, by separating the selectors with a comma. If I want all paragraphs and all list items to be green my rule looks like this: p, li { color: green; } Try this out in the interactive editor below (edit the code
boxes), or in your local CSS document. Changing the default behavior of elements When we look at a well-marked up HTML document, even something as simple as our example, we can see how the browser is making the HTML readable by adding some default styling. Headings are large and bold and our list has bullets. This happens because browsers have internal stylesheets containing default styles, which ...
Styling links - Learn web development
kground: orange; } a:active { background: red; color: white; } This gives us the following result: Let's explain what's going on here, focusing on the most interesting parts: Our second rule removes the default padding from the <ul> element, and sets its width to span 100% of the outer container (the <body>, in this case). <li> elements are normally block by default (see types of CSS
boxes for a refresher), meaning that they will sit on their own lines. In this case, we are creating a horizontal list of links, so in the third rule we set the display property to inline, which causes the list items to sit on the same line as one another -- they now behave like inline elements. The fourth rule -- which styles the <a> element -- is the most complicated here; let's go through it step b...
Learn to style HTML using CSS - Learn web development
ngs you'll do with CSS. Here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows and other text features. We round off the module by looking at applying custom fonts to your page, and styling lists and links. CSS layout At this point we've already looked at CSS fundamentals, how to style text, and how to style and manipulate the
boxes that your content sits inside. Now it's time to look at how to place your
boxes in the right place in relation to the viewport, and one another. We have covered the necessary prerequisites so we can now dive deep into CSS layout, looking at different display settings, modern layout tools like flexbox, CSS grid, and positioning, and some of the legacy techniques you might still want to know about.
What are browser developer tools? - Learn web development
right-click it and choose Edit as HTML from the context menu. You can make any changes you'd like, but you cannot save your changes. Exploring the CSS editor By default, the CSS editor displays the CSS rules applied to the currently selected element: These features are especially handy: The rules applied to the current element are shown in order of most-to-least-specific. Click the check
boxes next to each declaration to see what would happen if you removed the declaration. Click the little arrow next to each shorthand property to show the property's longhand equivalents. Click a property name or value to bring up a text box, where you can key in a new value to get a live preview of a style change. Next to each rule is the file name and line number the rule is defined in. Clicking t...
The HTML5 input types - Learn web development
avior, you can use the pattern attribute, and you can also custom the error messages; we'll talk how to use these features in the Client-side form validation article later on. Note: If the data entered is not an email address, the :invalid pseudo-class will match, and the validityState.typeMismatch property will return true. Search field Search fields are intended to be used to create search
boxes on pages and apps. This type of field is set by using the value search for the type attribute: <input type="search" id="search" name="search"> The main difference between a text field and a search field is how the browser styles its appearance. Often, search fields are rendered with rounded corners; they also sometimes display an "(X)", which clears the field of any value when clicked). Additio...
Other form controls - Learn web development
s on desktop). <select id="multi" name="multi" multiple size="2"> <optgroup label="fruits"> <option>Banana</option> <option selected>Cherry</option> <option>Lemon</option> </optgroup> <optgroup label="vegetables"> <option>Carrot</option> <option>Eggplant</option> <option>Potato</option> </optgroup> </select> Note: In the case of multiple choice select
boxes, you'll notice that the select box no longer displays the values as drop-down content -- instead, all values are displayed at once in a list, with the optional size attribute determining the height of the widget. Note: All browsers that support the <select> element also support the multiple attribute. Autocomplete box You can provide suggested, automatically-completed values for form widgets ...
Styling web forms - Learn web development
f any problems across platforms. These include the following elements: <form> <fieldset> and <legend> Single-line text <input>s (e.g. type text, url, email...), except for <input type="search">. Multi-line <textarea>s Buttons (both <input> and <button>s) <label> <output> The bad Some elements are more difficult to style, requiring more complex CSS or some more specific tricks: Check
boxes and radio buttons <input type="search"> We describe how to handle these more specific features in the article Advanced form styling. The ugly Some elements can't be styled thoroughly using CSS. These include: <input type="color"> Date-related controls such as <input type="datetime-local"> <input type="range"> <input type="file"> Elements involved in creating dropdown widgets, includin...
Test your skills: Basic controls - Learn web development
You should also associate them with their text labels semantically. Create a submit button inside the remaining list item, with button text of "Log in". Try updating the live code below to recreate the finished example: Download the starting point for this task to work in your own editor or in an online editor. Basic controls 2 The next task requires you to create working sets of check
boxes and radio buttons, from the provided text labels. Turn the first <fieldset>'s contents into a set of radio buttons -- you should only be able to select one pony character at once. Make it so that the first radio button is selected upon page load. Turn the second <fieldset>'s content into a set of check
boxes. Add a couple more hotdog choices of your own. Try updating the live code below to...
Your first form - Learn web development
on the client-side to immediately update the interface in some way (for example, add another item to a list, or show or hide a UI feature). A web form's HTML is made up of one or more form controls (sometimes called widgets), plus some additional elements to help structure the overall form -- they are often referred to as HTML forms. The controls can be single or multi-line text fields, dropdown
boxes, buttons, check
boxes, or radio buttons, and are mostly created using the <input> element, although there are some other elements to learn about too. Form controls can also be programmed to enforce specific formats or values to be entered (form validation), and paired with text labels that describe their purpose to both sighted and blind users. Designing your form Before starting to code, it's ...
CSS basics - Learn web development
<p>). We'll also center the heading. Finally, let's expand the second ruleset (below) with settings for line height and letter spacing to make body content more readable. h1 { font-size: 60px; text-align: center; } p, li { font-size: 16px; line-height: 2; letter-spacing: 1px; } Adjust the px values as you like. Your work-in-progress should look similar to this: CSS: all about
boxes Something you'll notice about writing CSS: a lot of it is about
boxes. This includes setting size, color, and position. Most HTML elements on your page can be thought of as
boxes sitting on top of other
boxes. CSS layout is mostly based on the box model. Each box taking up space on your page has properties like: padding, the space around the content. In the example below, it is the space a...
Getting started with HTML - Learn web development
Note: HTML5 redefined the element categories: see Element content categories. While these definitions are more accurate and less ambiguous than their predecessors, the new definitions are a lot more complicated to understand than block and inline. This article will stay with these two terms. Note: The terms block and inline, as used in this article, should not be confused with the types of CSS
boxes that have the same names. While the names correlate by default, changing the CSS display type doesn't change the category of the element, and doesn't affect which elements it can contain and which elements it can be contained in. One reason HTML5 dropped these terms was to prevent this rather common confusion. Note: Find useful reference pages that include lists of block and inline elements. S...
Storing the information you need — Variables - Learn web development
contain just about anything -- not just strings and numbers. Variables can also contain complex data and even entire functions to do amazing things. You'll learn more about this as you go along. Note: We say variables contain values. This is an important distinction to make. Variables aren't the values themselves; they are containers for values. You can think of them being like little cardboard
boxes that you can store things in. Declaring a variable To use a variable, you've first got to create it -- more accurately, we call this declaring the variable. To do this, we type the keyword var or let followed by the name you want to call your variable: let myName; let myAge; Here we're creating two variables called myName and myAge. Try typing these lines into your web browser's console. A...
What is JavaScript? - Learn web development
is, what it can do, and how it fits into a web site. A high-level definition JavaScript is a scripting or programming language that allows you to implement complex features on web pages -- every time a web page does more than just sit there and display static information for you to look at -- displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video juke
boxes, etc. -- you can bet that JavaScript is probably involved. It is the third layer of the layer cake of standard web technologies, two of which (HTML and CSS) we have covered in much more detail in other parts of the Learning Area. HTML is the markup language that we use to structure and give meaning to our web content, for example defining paragraphs, headings, and data tables, or embedding i...
JavaScript — Dynamic client-side scripting - Learn web development
JavaScript is a programming language that allows you to implement complex things on web pages. Every time a web page does more than just sit there and display static information for you to look at--displaying timely content updates, interactive maps, animated 2D/3D graphics, scrolling video juke
boxes, or more--you can bet that JavaScript is probably involved. Looking to become a front-end web developer? We have put together a course that includes all the essential information you need to work towards your goal. Get started Prerequisites JavaScript is arguably more difficult to learn than related technologies such as HTML and CSS. Before attempting to learn JavaScript, you are strongly advised to get familiar with at least these two technologies first, and perhaps others as well. Start b...
Dynamic behavior in Svelte: working with variables and props - Learn web development
{removeTodo}, but not on:event={removeTodo()}. This is not some special Svelte syntax -- here we are just using regular JavaScript arrow functions. Again, this is good progress -- at this point, we can now delete tasks. When a todo item's Delete button is pressed, the relevant todo is removed from the todos array, and the UI updates to no longer show it. In addition, we can now check the check
boxes, and the completed status of the relevant todos will now update in the todos array. However, the "x out of y items completed" heading is not being updated. Read on to find out why this is happening and how we can solve it. Reactive todos As we've already seen, every time the value of a component top-level variable is modified Svelte knows how to update the UI. In our app, the todos array value...
Vue conditional rendering: editing existing todos - Learn web development
@item-deleted="deleteToDo(item.id)" @item-edited="editToDo(item.id, $event)"> </to-do-item> And there you have it -- you should now be able to edit and delete items from the list! Fixing a small bug with isDone status This is great so far, but we've actually introduced a bug by adding in the edit functionality. Try doing this: Check (or uncheck) one of the todo check
boxes. Press the "Edit" button for that todo item. Cancel the edit by pressing the "Cancel" button. Note the state of the checkbox after you cancel -- not only has the app forgotten the state of the checkbox, but the done status of that todo item is now out of whack. If you try checking (or unchecking) it again, the completed count will change in the opposite way to what you'd expect. This is becau...
Adding a new todo form: Vue events, methods, and models - Learn web development
console.log("form submitted"); } }, data() { return { label: "" }; } }; We now need some way to attach the value of the new-todo-input <input> field to the label field. Vue has a special directive for this: v-model. v-model binds to the data property you set on it and keeps it in sync with the <input>. v-model works across all the various input types, including check
boxes, radios, and select inputs. To use v-model, you add an attribute with the structure v-model="variable" to the <input>. So in our case, we would add it to our new-todo-input field as seen below. Do this now: <input type="text" id="new-todo-input" name="new-todo" autocomplete="off" v-model="label" /> Note: You can also sync data with <input> values through a combination of ev...
Rendering a list of Vue components - Learn web development
el" :done="item.done"></to-do-item> </li> </ul> Now when you look at your running app, it'll show the todo items with their proper names, and if you inspect the source code you'll see that the inputs all have unique ids, taken from the object in the App component. Chance for a slight refactor There's one little bit of refactoring we can do here. Instead of generating the id for the check
boxes inside your ToDoItem component, we can turn the id into a prop. While this isn't strictly necessary, it makes it easier for us to manage since we already need to create a unique id for each todo item anyway. Add a new prop to your ToDoItem component -- id. Make it required, and make its type a String. To prevent name collisions, remove the id field from your data attribute. You are no longe...
Styling Vue components with CSS - Learn web development
label, input, .custom-checkbox { font-size: 19px; font-size: 1.9rem; line-height: 1.31579; } } Now we need to add some CSS classes to our template to connect the styles. To the root <div>, add a custom-checkbox class. To the <input>, add a checkbox class. Last of all, to the <label> add a checkbox-label class. The updated template is below: The app should now have custom check
boxes. Your app should look something like the screenshot below. Summary Our work is done on the styling of our sample app. In the next article we'll return to adding some more functionlity to our app, namely using a computed property to add a count of completed todo items to our app. Previous Overview: Client-side JavaScript frameworks Next In this module Introduction to client-side f...
Handling common accessibility problems - Learn web development
when link/button or other activatable item is selected) Activate item. NVDA + Space (when form is selected) Enter form so individual items can be selected, or leave form if you are already in it. Shift Tab and Tab (when inside form) Move between form inputs. Up cursor and down cursor (when inside form) Change form input values (in the case of things like select
boxes). Spacebar (when inside form) Select chosen value. Ctrl + Alt + cursor keys (when a table is selected) Move between table cells. Screenreader testing Now you've gotten used to using a screenreader, we'd like you to use it to do some quick accessibility tests, to get an idea of how screenreaders deal with good and bad webpage features: Look at good-semantics.html...
Accessibility API cross-reference
nted if they are made. n/a n/a aria-autocomplete The control cannot accept input at this time. Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user. BUSY BUSY BUSY aria-busy Indicates the current "checked" state of check
boxes, radio buttons, and other widgets. CHECKED CHECKED CHECKED aria-checked checked (boolean attribute) Defines the total number of columns in a table, grid, or treegrid. n/a n/a aria-colcount Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid. n/a n...
Mozilla accessibility architecture
t have accessibility interfaces. We call these objects "accessible nodes". Each of these accessible nodes supports at minimum the generic cross-platform accessibility interface nsIAccessible (which provides a text name, enumerated role identifier and a set of state flags) and sometimes additional interfaces. For example, tables support nsIAccessibleTable, text supports nsIAccessibleText and edit
boxes support nsIEditableText., although this code has been moved into the ATK specific directories because it is not currently used in Windows. We will not rule out the possibility of supporting some of the rich ATK interfaces on Windows. The toolkit-specific classes then use these XPCOM interfaces to gather information about the objects they want to expose, make any necessary changes, and then expose...
Accessibility information for UI designers and developers
er spacing (tracking) to at least 0.12 times the font size set word spacing to at least 0.16 times the font size This does not mean that your page needs to offer controls to make such changes, merely that if someone does these things in a custom stylesheet, they should not break the interface. Forms In forms, provide labels for all controls. This includes form elements like inputs and select
boxes, but also buttons. For form elements, it should be clear what kind of input is expected. Placeholders are best avoided for this, as they are often too low in contrast. It is more helpful to describe what an input element is for in text just above or underneath the input. Error recovery When you detect users provide unexpected input, explain what is wrong and, if possible, how to correct it. Th...
Embedding API for Accessibility
to cursor around the HTML content as if in a read-only editor */ Moz 0.9 Special Content Notifications The W3C UAAG specifies types of content that must be optional. The intention is for a user to be notified of its existence, and at some point they can choose to load the content. This is a much better alternative than having the user go through a long series of confirm
boxes for each new page, for each type of content. For each preference named "browser.accept.*", there is also an "alert.audio.*" preference, to allow configuration of sound files to go with each type of content. The audio file could be a clip of a human voice saying "You've got video" or even a simple beep. How we expose this through the user interface is another matter. Accepting Special Content ...
ZoomText
address is aaronleventhal@moonset.net. Issues for AI Squared, from high to low priority DocReader and AppReader don't respect the structure of the document -- no support for columns. ZoomText text to speech doesn't always echo what it should -- need more details from testers. Mozilla issues Cannot tab into frames and iframes. Cannot customize the sidebar with the keyboard only. Combo
boxes report incorrect bounds, causing ZoomText tracking to move to the wrong area of the screen. ...
A bird's-eye view of the Mozilla framework
ee basic layers depicted in Figure 1. Figure 1. User Interface (UI) Widgets and Services The X Window System Toolkit defines the termwidget as a pre-defined object that encapsulates both the command actions and data associated with a graphical user interface (GUI) control. The various X Toolkit implementations provide a set of widgets for UI controls such as menus, command buttons, dialog
boxes and scroll bars. The Mozilla XPToolkit module provides a similar set of facilities for building cross-platform UI controls implemented as XML User Interface Language (XUL) packages. A XUL package consists of a XUL description of the UI widget Cascading Style Sheets customizing appearance JavaScript services implementing the UI behavior A package (also known as chrome) is really just a bund...
Debugging
gging purposes. Debugging tools Tools Assorted tools that will help you debug your code or web site. nserror lookup Useful for when your code gets a complicated numeric error code and you can't figure out what it means. Download a debug build Recent automatically compiled debug builds are available. Note that these are replaced frequently by our tinder
boxes. The debug builds have "-debug" at the end of their file names. Related topics Performance and profiling Troubleshooting performance problems. ...
The Firefox codebase: CSS Guidelines
refox uses colors as authored, which is why using pre-defined variables, currentcolor or inheritance is useful to integrate with the system theme with little hassle. If not, as a last resort, using system colors also works for non-default Windows themes or Linux. In general, the following colors are used: -moz-Field: textbox or field background colors, also used as the background color of list
boxes or trees. -moz-FieldText: textbox or field text colors, also used as the text color of list
boxes or trees. -moz-Dialog: window or dialog background color. -moz-DialogText: window or dialog text color. GrayText: used on disabled items as text color. Do not use it on text that is not disabled to desemphsize text, because it does not guarantee a sufficient contrast ratio for non-disabled text. ...
Performance
remove interactive UI elements that would be inert with the addon ...
Introduction to Layout in Mozilla
ired size returned "up" via nsHTMLReflowMetrics Basic pattern Parent frame initializes child reflow state (available w, h); places child frame (x, y); invokes child's Reflow method Child frame computes desired (w, h), returns via reflow metrics Parent frame sizes child frame and view based on child's metrics N.B. ...
CustomizableUI.jsm
tomize Mode only, do not use otherwise. Parameters aWindow the window entering customize mode notifyEndCustomizing() Notify listeners that a window is exiting customize mode. For use from Customize Mode only, do not use otherwise. Parameters aWindow the window exiting customize mode dispatchToolboxEvent() Notify toolbox(es) of a particular event. If you don't pass aWindow, all tool
boxes will be notified. For use from Customize Mode only, do not use otherwise. Parameters aEvent the name of the event to send. aDetails optional, the details of the event. aWindow optional, the window in which to send the event. isAreaOverflowable() Check whether an area is overflowable. Parameters aAreaId the ID of an area to check for overflowable-ness Return value true if the a...
MathML Demo: <mtable> - tables and matrices
r the baseline (in which case Mozilla will behave as if it was align="center#rownumber"). These may sound like gimmicks until you want to get a damping effect such as this ---... ab ab ab ab ab ab , or perhaps the reverse ---... ab ab ab ab ab ab , modulo pixel roundoff errors. Here 'a' and 'b' can be other combinations of possibly irregular
boxes. And making floating elements do a multiplication such as the following one which is anchored at a baseline is made simple by using align="baseline1" on both tables [ a b c d ] [ a b c d ] To multiply a matrix A by a vector x, each row of the matrix has to be multiplied to the vector. So at the i-th step, it proceeds thus: i-th row [ a11 a12 ...
Mozilla Web Developer FAQ
ing the above-mentioned exact doctypes) is the best way to get consistent CSS layout results across different browsers. On the other hand, the quirks implemented in the quirks modes of different browsers vary from browser to browser. Why are there gaps between image rows in tables when the layout engine is in the Standards mode? In the CSS2 box layout model the default vertical sizing of layout
boxes and the default vertical alignment of images is different from the behavior of old browsers. These aspects of the layout can be changed by explicitly setting the display CSS property of the images (and possible surrounding <a> elements) to block. If the table cells that contain only an image are marked with <td class="imgcell">, the required CSS rule is: .imgcell img, .imgcell a { display: block...
about:memory
d into totals for the whole browser, as the following example shows. ...
NSS API Guidelines
ary (mostly) operates. Layering Each separate component of the API should live in its own layer. The functions in these APIs should never call API layers above them. In addition, some low-level APIs may be completely opaque to higher level layers. That is, access to these functions should only be provided by the API directly above them. The NSS APIs are layered, as shown in this diagram: The
boxes in the gray section, towards the center, are exported only through PKCS #11. PKCS #11 is only exported through the Wrappers. The areas which need the most work (both here and throughout the code) is: The relationship of the Certificate library with just about every other component (most noticeably PKCS #12, PKCS #7, and PKCS #11) Splitting Low Key and High Key components more clearly The Cr...
JSAPI User Guide
ilure mode is pretty severe. If you do accidentally leak an object from one sandbox into another, the genie is out of the bottle. Once a malicious script gets a reference to a single object in a sandbox, it can use that object to get a reference to the sandbox's global object, and from there, almost any other object or function in that sandbox. There is no way to fix it except to destroy both sand
boxes and start over. A second drawback is that the system doesn't automatically respond to changes in user privileges. Suppose user A is not an administrator, so you set up sandbox A with no administrator functionality. If you promote user A to be an admin, SpiderMonkey won't magically update sandbox A to have the administrator classes and functions you didn't define before. Your application will have...
Gecko object attributes
vent explicit user input? See the Live Region Support for more information. member-of Points to the root of the atomic container that this object is in. This will always be an ancestor of the current object. See the Live Region Support for more information. Common widget attributes checkable true when the widget is known to behave like a checkbox. Note some widgets which appear to be check
boxes might in fact be cyclers (see "cycles" below). Action 0 is named either "check" or "uncheck". Applied to: STATE_CHECKABLE state datatype WARNING: obsolete, do not use! A qname that refers to an XSD (schema) defined type. For example, a datatype may be xsd:integer. When this is not specified, the default is string, unless the Value interface is exposed, which indicates the type is numeric. F...
XForms Accessibility
ons (see the spec, the docs). This element is represented by button. submit Invokes the submission of the selected instance data to its target destination (see the spec, the docs). This element is represented by button. select Allows the user to choose one or multiple values from a list of pre-defined values (see the spec, the docs). It can have the following representations: listbox check
boxes group select1 Allows the user to choose a single value from a list of pre-defined values (see the spec, the docs). It can have the following representations: combobox listbox radio group Additional Elements These elements may be used as child elements to the form controls described above. Some of these elements are not accessible itself but they makes accessibility properties for XForm...
Building the WebLock UI
calls the JavaScript methods when the user interacts with it. The XUL Document The first thing to do is create the actual XUL document in which the user interface for the dialog and the events that initiate interaction with the web locking are defined. At the top of all XUL documents, an XML declaration is followed by the root element for the document, which is usually <window/> but for dialog
boxes can also be the element <dialog/>. The "shell" for the XUL file, then, looks like this: <?xml version="1.0"?> <?xml-stylesheet href="chrome://global/skin/" type="text/css"?> <dialog id="weblock_ui" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" title="Web Lock Manager" persist="screenX screenY" screenX="24" screenY="24"> </dialog> Note t...
Preface
hings easier to scan. The goal is to use as few formats as possible, but to distinguish the various different types of information clearly. Format Description bold component names appear in bold in the text monospace code listings, interface names and members of interfaces (e.g., createInstance()) appear in monospaced font. Lines of code are placed in separate
boxes. Additionally, filenames and directories appear in monospaced font. italic variables appear in italic. Important terms and new concepts are also italicized the first time they appear in the text. Those terms are either explained immediately after they are cited, or else the reader is referred to a section in the book where they are described in detail. link References to o...
Components.utils.createObjectIn
Note that this function is now mostly obsolete when you are using Sandbox, because you can create an object in a different compartment using new. For example, to create a new object in the compartment identified by contentWindow: var newObject = new contentWindow.Object(); But it is really needeed from Firefox 30 onwards when trying to manipulate the DOM window. ...
Components.utils.evalInWindow
ged code, such as add-on code, to access variables and APIs defined in web content. Even so, while the code is being evaluated it is in the content's context, so the caller has to be prepared for the possibility that the content could have redefined behavior (for example, a setter in the script may have been redefined to do something unexpected). This function is made available as a global in sand
boxes which have the wantExportHelpers option set in the Sandbox() constructor. Syntax var result = Components.utils.evalInWindow(script, window); Parameters script : string The script to evaluate in the other window. window : object The window in which to evaluate the script. Returns The result of evaluating the script. If this is just native (for example, a DOM node), then the func...
Components.utils.exportFunction
less-privileged code can be called from the less privileged code's context. The function has access to its surrounding closure just as if it were being called in the privileged context. The exported function does not have to be added to the less privileged code's global window object: it can be exported to any object in the target scope. exportFunction() is made available as a global in sand
boxes which have the wantExportHelpers option set in the Sandbox() constructor. This includes Add-on SDK content scripts. To understand what happens if the functions you export accept arguments, see Exporting functions that take arguments below. Syntax Components.utils.exportFunction(func, targetScope[, options]); Parameters func : function The function to export. targetScope : object The obj...
Folders
ich implements a lot of the core functionality. ...
IAccessibleText
Returns the number of active non-contiguous selections. [propget] HRESULT nSelections( [out] long nSelections ); Parameters nSelections Missing Description Return value S_OK. offsetAtPoint() Returns the text() position for the specified screen position. Given a point return the zero-based index of the character under that point. The same functionality could be achieved by using the bounding
boxes for each character as returned by characterExtents(). The method offsetAtPoint, however, can be implemented more efficiently. [propget] HRESULT offsetAtPoint( [in] long x, [in] long y, [in] enum IA2CoordinateType coordType, [out] long offset ); Parameters x The position's x value for which to look up the index of the character that is rendered on to the display at that point. y The posi...
IAccessibleValue
other-licenses/ia2/AccessibleValue.idlNot scriptable This interface gives access to a single numerical value. 1.0 66 Introduced Gecko 1.9 Inherits from: IUnknown Last changed in Gecko 1.9 (Firefox 3) The IAccessibleValue interface represents a single numerical value and should be implemented by any class that supports numerical value like progress bars and spin
boxes. This interface lets you access the value and its upper and lower bounds. Method overview [propget] HRESULT currentValue([out] VARIANT currentValue ); [propget] HRESULT maximumValue([out] VARIANT maximumValue ); [propget] HRESULT minimumValue([out] VARIANT minimumValue ); HRESULT setCurrentValue([in] VARIANT value ); Methods currentValue() Returns the value of this object as a number. T...
mozIRegistry
vices (versus the Service Manager insisting on creating the services itself) would suffice. Worst case, clients would obtain the mozIRegistry singleton via some other means (i.e., a "NSGetRegistry" function). Architecture This diagram illustrates the various components that you will be using to interoperate with other Mozilla components. Some are for illustrative purposes (the lighter-colored
boxes near the top of the picture). These are placeholders for the types of components you're designing and implementing. I'll talk about them to provide examples of how you should use the other
boxes. These components (indicated by the darker-colored
boxes) are the services you'll be using. I'll be explaining the rationale for the design and implementation of these components in this document. Lastly,...
nsIAccessibleProvider
y slider. XFormsSelect 0x00002009 Used for select and select1 that are implemented using host document's native widget. For example, a select1 in a xhtml document may be represented by the native html control html:select. XFormsChoices 0x00002010 Used for xforms choices element. XFormsSelectFull 0x00002011 Used for xforms full select/select1 elements that may be represented by group of check
boxes and radiogroup. XFormsItemCheckgroup 0x00002012 Used for xforms item element that is used inside xforms select elements represented by group of check
boxes. XFormsItemRadiogroup 0x00002013 Used for xforms item element that is used inside xforms select1 elements represented by radio group. XFormsSelectCombobox 0x00002014 Used for xforms select1 element that is represented by combobox. XForm...
nsIDOMWindowUtils
ivileged context (not content-accessible) Read only. elementsRestyled Read only unsigned long long The number of elements which have been restyled for the current document. Keep in mind that during a restyle operation, an element may be restyled multiple times (for example, when an inline element contains blocks). This number also counts restyling of pseudo-elements and anonymous
boxes. Throws NS_ERROR_NOT_AVAILABLE if the count can't be provided. focusedInputType string The type of the currently-focused HTML <input> element, if one is focused. imageAnimationMode unsigned short Returns the image animation mode of the window. The attribute's value must be one of the animationMode values from imgIContainer. IMEIsOpen boolean Returns t...
nsIXPConnect
to use while creating the global object. aCOMObj The native object that represents the global object. aIID The IID used to wrap the global object. aPrincipal The principal of the code that will run in this compartment. Can be null if not on the main thread. aExtraPtr Must be passed if aPrincipal is null. Used to separate code from the same principal into different compartments, as for sand
boxes. aFlags One of the flags below specifying what options this global object wants. Return value Missing Description Exceptions thrown Missing Exception Missing Description JSToVariant() nsIVariant JSToVariant( in JSContextPtr ctx, in jsval value ); Parameters ctx Missing Description value Missing Description Return value Missing Description Exceptions thrown Missing ...
XPCOM primitive
All XPCOM primitives are scriptable, and they all implement an XPCOM interface from the table below. Primitives are rarely useful. The main use case is to store primitive values in a data structure that can only store XPCOM objects, such as nsIArray. Also, certain APIs, such as nsITransferable.setTransferData(), require primitives. ...
XPCOM reference
items by alphabetical sorting, this page attempts to group them by function. Grouping and category names were made by somewhat arbitrary decision by the author. (I'm fully aware that this will be a great point of discussion and probably will end in tears, but since I'm the first person to apparently take a swing at this, I get first dibs.)XPCOM primitiveAn XPCOM primitive is an XPCOM object that "
boxes" a value of a primitive type. All XPCOM primitives are scriptable, and they all implement an XPCOM interface from the table below.XPCOM string functionsXPCOM provides these low-level string functions to let you work with strings; however, it's often better to use one of the string classes rather than directly using these functions. Many XPCOM pages return an nsresult. Prior to Gecko 19 (Fir...
Xray vision
ng system privileges. If chrome-privileged code is compromised, the attacker can take over the user's computer. JavaScript loaded from normal web pages is called content code. Because this code is being loaded from arbitrary web pages, it is regarded as untrusted and potentially hostile, both to other websites and to the user. As well as these two levels of privilege, chrome code can create sand
boxes. The security principal defined for the sandbox determines its privilege level. If an Expanded Principal is used, the sandbox is granted certain privileges over content code and is protected from direct access by content code. The security machinery in Gecko ensures that there's asymmetric access between code at different privilege levels: so for example, content code can't access objects creat...
Thunderbird Binaries
ers and extension developers. Note: While Beta builds have had some testing, they should be considered preview only and should not be used in a production environment. Please read the release notes before downloading. Preview Releases are available from http://www.mozilla.org/thunderbird/channel/ Nightly Builds Nightly builds are cutting-edge builds. They are built every 24 hours by the tinder
boxes from the very latest source code. There are various sorts of nightly builds available for download. If you wish to download nightly builds to help us test for the next release, please read the testing page for where we need help. Warning: Whilst developers try to ensure that nightly builds are stable, it is possible that errors can get into nightly builds that can destroy your data or harm ...
WebIDL bindings
Used to flag a method that, when called, will not have the same-origin constraint tested: it can be called from a context with a different origin. [SecureContext] We implement the standard extended attribute with a few details specific to Gecko: System principals are considered secure. An extension poking at non-secured DOM objects will see APIs marked with [SecureContext]. XPConnect sand
boxes doesn't see [SecureContext] APIs, but this may change in bug 1273687. [NeedsSubjectPrincipal], [GetterNeedsSubjectPrincipal], [SetterNeedsSubjectPrincipal] Used to flag a method or an attribute that needs to know the subject principal. This principal will be passed as argument. If the interface is not exposed on any worker global, the argument will be a nsIPrincipal& because a subject princip...
Zombie compartments
- style-sets | | | | +--0.29 MB (00.06%) -- pres-shell | | | | +--0.05 MB (00.01%) -- rule-nodes | | | | +--0.04 MB (00.01%) -- style-contexts | | | | +--0.03 MB (00.01%) -- frames | | | | | +--0.02 MB (00.00%) -- sundries | | | | | +--0.01 MB (00.00%) -- nsBlockFrame | | | | +--0.01 MB (00.00%) -- pres-contexts | | | | +--0.01 MB (00.00%) -- line-
boxes | | | | +--0.00 MB (00.00%) -- text-runs | | | +--3.78 MB (00.76%) ++ js-compartment(https://www.google.de/?gws_rd=ssl) | | | +--0.51 MB (00.10%) -- style-sheets | | | +--0.33 MB (00.07%) -- dom | | | | +--0.17 MB (00.04%) -- text-nodes | | | | +--0.13 MB (00.03%) -- element-nodes | | | | +--0.02 MB (00.00%) -- other | | | | +--0.01 MB (00.00%) -- orph...
Mozilla
L, JavaScript, and render it on the user's screen or print it. In XUL-based applications Gecko also renders the application's user interface. Gecko's "Almost Standards" Mode "Almost standards" rendering mode is exactly the same as "standards" mode in all details save one, where it works like "quirks" mode: the height calculations for line
boxes and some of the inline elements in them. Geckoview-Junit Tests The geckoview-junit tests are on-device Android junit tests written for geckoview. Getting from Content to Layout Gecko maintains two separate representations of a document in memory: the content tree and the frame tree. Changes to a document originate in the content...
Gecko Plugin API Reference - Plugins
-ins Printing the Plug-in Setting the Window Getting Information Windowed Plug-ins Mac OS Windows Unix Event Handling for Windowed Plug-ins Windowless Plug-ins Specifying That a Plug-in Is Windowless Invalidating the Drawing Area Forcing a Paint Message Making a Plug-in Opaque Making a Plug-in Transparent Creating Pop-up Menus and Dialog
Boxes Event Handling for Windowless Plug-ins Streams Receiving a Stream Telling the Plug-in When a Stream Is Created Telling the Plug-in When a Stream Is Deleted Finding Out How Much Data the Plug-in Can Accept Writing the Stream to the Plug-in Sending the Stream in Random-Access Mode Sending the Stream in File Mode Sending a Stream Creating a Stream Pushing Data into the Stream ...
Browser Console - Firefox Developer Tools
e window. This means you can interact with all the browser's tabs using the gBrowser global, and even with the XUL used to specify the browser's user interface. NB: The Browser Console command line (to execute JavaScript expressions) is disabled by default. To enable it set the devtools.chrome.enabled preference to true in about:config, or set the "Enable browser chrome and add-on debugging tool
boxes" (Firefox 40 and later) option in the developer tool settings. Opening the Browser Console You can open the Browser Console in one of two ways: from the menu: select "Browser Console" from the Web Developer submenu in the Firefox Menu (or Tools menu if you display the menu bar or are on macOS). from the keyboard: press Ctrl+Shift+J (or Cmd+Shift+J on a Mac). You can also start the Brows...
Browser Toolbox - Firefox Developer Tools
he Browser Toolbox for add-ons that are neither. Enabling the Browser Toolbox The Browser Toolbox is not enabled by default. To enable it you need to check the settings "Enable chrome and addon debugging" and "Enable remote debugging". To do this, open the Developer Tools Settings, go to the section "Advanced Settings", and check the settings "Enable browser chrome and add-on debugging tool
boxes" and "Enable remote debugging". Opening the Browser Toolbox Open the Browser Toolbox through the menu button and the menu items "Developer" then "Browser Toolbox". You can also open it with the Ctrl + Alt +Shift + I key combination ( Cmd + Opt +Shift + I on a Mac). You will be presented with a dialog like this (it can be removed by setting the devtools.debugger.prompt-connection propert...
Set event listener breakpoints - Firefox Developer Tools
lers is simplified because the debugger now includes the ability to automatically break when the code hits an event handler. This article explains how to use it. Using a standard event breakpoint To use an event breakpoint, you open up the JavaScript debugger, and find and expand the Event Listener Breakpoints section in the right hand column. To break when event listeners are hit, check the
boxes next the events you are interested in. All of the standard events supported in your version of Firefox are listed, arranged by which API or API area they're part of. Now when a keydown, keyup, keypress, or input event occurs, execution will pause as soon as it enters the listener code. When execution pauses, the source pane displays the highlighted line of the JavaScript code that is next to ...
Edit Shape Paths in CSS - Firefox Developer Tools
s being created. A solid line shows the outline of the shape that is wrapping the text. This is your shape. If the shape is clipped by the margin box then the margin box will make up part of this line. A dashed line demonstrates the outline of the shape which extends past the margin box reference; this is the area that will be clipped by the margin box. To understand the margin box, and other
boxes used by CSS Shapes see our guide to Shapes from box values. Editing Basic Shapes The options given to you by the tool will differ depending on the type of basic shape that you are editing. Options can be accessed by activating the Shape Path Editor with a regular click on the icon, and you can use the context menu (Ctrl/Cmd + click) to access additional functionality. circle() If the value...
Examine and edit CSS - Firefox Developer Tools
If you enable one of these pseudo-classes for a node, an orange dot appears in the markup view next to all nodes to which the pseudo-class has been applied. In addition, the information that appears...
Examine and edit the box model - Firefox Developer Tools
Viewing the box model With the Select Element button pressed, if you hover over an element in the page, the box model for the element is shown overlaid on the page: It's also shown overlaid if you hover over an element's markup in the HTML pane: If the element is inline and is split over multiple line
boxes, the highlighter shows each individual line box that together make up the element: The Box Model view When an element's selected, you can get a detailed look at the box model in the Box Model view: If you hover over a value, you'll see a tooltip telling you which rule the value comes from: If you hover over part of the box model in the Box Model view, the corresponding part of the page is highlighted: Editing the box model You can also edit the values in the Box ...
Debugging Firefox Desktop - Firefox Developer Tools
the Firefox Developer Tools to debug a different instance of desktop Firefox running on the same machine. In this guide, the instance of Firefox being debugged is called the debuggee, and the instance of Firefox doing the debugging is called the debugger. Enable remote debugging First, you'll need to ensure that both debugger and debuggee have the "Enable browser chrome and add-on debugging tool
boxes" and "Enable remote debugging" settings checked in the Developer Tools Settings. You only need to do this once: the setting values persist across restarts. Start the debugger server Next, you need to start the debugger server in the debuggee. Run the debuggee from the command line, passing it the --start-debugger-server option: /path/to/firefox --start-debugger-server Passed with no argum...
about:debugging (before Firefox 68) - Firefox Developer Tools
e add-on debugging" button works by turning on the devtools.chrome.enabled and devtools.debugger.remote-enabled preferences. Both preferences must be true to enable add-on debugging. Checking the box sets both preferences to true, and unchecking it sets them both to false. You can also modify the preferences directly in about:config, or by checking "Enable browser chrome and add-on debugging tool
boxes" and "Enable remote debugging" in the Developer Tools Settings. Loading a temporary add-on With the "Load Temporary Add-on" button you can load any sort of restartless add-on temporarily, from a directory on disk. Just click the button, navigate to the directory containing the add-on's file, and select any file in that directory. The temporary add-on will be displayed under the "Temporary Exte...
Element.clientHeight - Web APIs
It includes padding but excludes borders, margins, and horizontal scrollbars (if present). clientHeight can be calculated as: CSS height + CSS padding - height of horizontal scrollbar (if present). When clientHeight is used on the root element (the <html> element), (or on <body> if the document is in quirks mode), the viewport's height (excluding any scrollbar) is returned. This is a special case of clientHeight. Note: This property will round the value to an integer. If you need a fractional value, use element.getBoundingClientRect(). ...
FormData() - Web APIs
r account number:</label> <input type="text" id="useracc" name="useracc"> </div> <div> <label for="userfile">Upload file:</label> <input type="file" id="userfile" name="userfile"> </div> <input type="submit" value="Submit!"> </form> Note: Only successful form controls are included in a FormData object, i.e. those with a name, not disabled and checked (radio buttons and check
boxes) or selected (one or more options within a select). let myForm = document.getElementById('myForm'); let formData = new FormData(myForm); Specifications Specification Status Comment XMLHttpRequestThe definition of 'FormData()' in that specification. Living Standard Initial definition ...
HTMLElement.hidden - Web APIs
.getElementById("okButton") .addEventListener("click", function() { document.getElementById("welcome").hidden = true; document.getElementById("awesome").hidden = false; }, false); This code sets up a handler for the welcome panel's "OK" button that hides the welcome panel and makes the follow-up panel--with the curious name "awesome"--visible in its place. HTML The HTML for the two
boxes are shown here. The welcome panel <div id="welcome" class="panel"> <h1>Welcome to Foobar.com!</h1> <p>By clicking "OK" you agree to be awesome every day!</p> <button class="button" id="okButton">OK</button> </div> This HTML creates a panel (in a <div> block) that welcomes the user to a site and tells them what they're agreeing to by clicking the OK button. The follow-up panel Once the ...
HTMLInputElement - Web APIs
checkbox or radio checked Boolean: Returns / Sets the current state of the element when type is checkbox or radio. defaultChecked Boolean: Returns / Sets the default state of a radio button or checkbox as originally specified in HTML that created this object. indeterminate Boolean: Returns whether the checkbox or radio button is in indeterminate state. For check
boxes, the effect is that the appearance of the checkbox is obscured/greyed in some way as to indicate its state is indeterminate (not checked but not unchecked). Does not affect the value of the checked attribute, and clicking the checkbox will set the value to false. Properties that apply only to elements of type image alt string: Returns / Sets the element's alt attribute, contai...
Recommended Drag Types - Web APIs
tices for common draggable data types. Caution: All methods and properties in this document with a moz prefix, such as mozSetDataAt(), will only work with Gecko-based browsers. Dragging Text For dragging text, use the text/plain type. The second data parameter should be the dragged string. For example: event.dataTransfer.setData("text/plain", "This is text to drag"); Dragging text in text
boxes and selections on web pages is done automatically by the browser, so you do not need to handle it yourself. It is recommended to always add data of the text/plain type as a fallback for applications or drop targets that do not support other types, unless there is no logical text alternative. Always add this text/plain type last, as it is the least specific and shouldn't be preferred. Note: In o...
Index - Web APIs
t. 1102 Element.className API, DOM, Gecko, Property, Reference The className property of the Element interface gets and sets the value of the class attribute of the specified element. 1103 Element.clientHeight API, CSSOM View, NeedsMarkupWork, Property, Reference The Element.clientHeight read-only property is zero for elements with no CSS or inline layout
boxes; otherwise, it's the inner height of an element in pixels. It includes padding but excludes borders, margins, and horizontal scrollbars (if present). 1104 Element.clientLeft API, CSSOM View, NeedsAgnostify, NeedsMarkupWork, Property, Reference The width of the left border of an element in pixels. It includes the width of the vertical scrollbar if the text direction of the ele...
Timing element visibility with the Intersection Observer API - Web APIs
argin: 0; margin-left: 16px; font-size: 16px; } The primary feature here is that the grid position is set to place the body content in column 2, row 2. Articles Each article is contained in an <article> element, styled like this: article { background-color: white; padding: 6px; } article:not(:last-child) { margin-bottom: 8px; } article h2 { margin-top: 0; } This creates article
boxes with a white background which float atop the blue background, with a small margin around the article. Every article which isn't the last item in the container has an 8px bottom margin to space things apart. Ads Finally, the ads have the following initial styling. Individual ads may customize the style somewhat, as we'll see later. .ad { height: 96px; padding: 6px; border-color: #555; b...
MouseEvent.relatedTarget - Web APIs
get the pointing device exited from The EventTarget the pointing device entered to For events with no secondary target, relatedTarget returns null. FocusEvent.relatedTarget is a similar property for focus events. Syntax var target = instanceOfMouseEvent.relatedTarget Return value An EventTarget object or null. Example Try moving your mouse cursor into and out of the red and blue
boxes. HTML <body id="body"> <div id="outer"> <div id="red"></div> <div id="blue"></div> </div> <p id="log"></p> </body> CSS #outer { width: 250px; height: 125px; display: flex; } #red { flex-grow: 1; background: red; } #blue { flex-grow: 1; background: blue; } #log { max-height: 120px; overflow-y: scroll; } JavaScript const mouseoutLog = document.getElementById...
Node - Web APIs
e.cloneNode() Clone a Node, and optionally, all of its contents. By default, it clones the content of the node. Node.compareDocumentPosition() Compares the position of the current node against another node in any other document. Node.contains() Returns a Boolean value indicating whether or not a node is a descendant of the calling node. Node.getBoxQuads() Returns a list of the node's CSS
boxes relative to another node. Node.getRootNode() Returns the context object's root which optionally includes the shadow root if it is available. Node.hasChildNodes() Returns a Boolean indicating whether or not the element has any child nodes. Node.insertBefore() Inserts a Node before the reference node as a child of a specified parent node. Node.isDefaultNamespace() Accepts a namespace URI a...
Storage API - Web APIs
the data retention policy for that box. There are two modes: "best-effort" The user agent will try to retain the data contained in the box for as long as it can, but will not warn users if storage space runs low and it becomes necessary to clear the box in order to relieve the storage pressure. "persistent" The user agent will retain the data as long as possible, clearing all "best-effort"
boxes before considering clearing a box marked "persistent". If it becomes necessary to consider clearing persistent
boxes, the user agent will notify the user and provide a way to clear one or more persistent
boxes as needed. To change an origin's box mode requires permission to use the "persistent-storage" feature. Data persistence and clearing If the site or app has the "persistent-storage" feat...
WebGL model view projection - Web APIs
ause it's entirely outside of clip space. The depth is outside of the -1.0 to 1.0 range. box.draw({ top : 1, // x bottom : -1, // x left : -1, // y right : 1, // y depth : -1.5, // z color : [0.4, 0.4, 1, 1] // blue }); The results View on JSFiddle Exercise A helpful exercise at this point is to move the
boxes around the clip space by varying the code to get a feel for how points get clipped and moved around in clip space. Try drawing a picture like a boxy smiley face with a background. Homogeneous coordinates The main line of the previous clip space vertex shader contained this code: gl_Position = vec4(position, 1.0); The position variable was defined in the draw() method and passed in as an attr...
Window.alert() - Web APIs
y, an object that is converted into a string and displayed. Example window.alert("Hello world!"); alert("Hello world!"); Both produce: Notes The alert dialog should be used for messages which do not require any response on the part of the user, other than the acknowledgement of the message. The following text is shared between this article, DOM:window.prompt and DOM:window.confirm Dialog
boxes are modal windows - they prevent the user from accessing the rest of the program's interface until the dialog box is closed. For this reason, you should not overuse any function that creates a dialog box (or modal window). Specification Specification Status Comment HTML Living StandardThe definition of 'alert()' in that specification. Living Standard ...
Window.confirm() - Web APIs
alue A boolean indicating whether OK (true) or Cancel (false) was selected. If a browser is ignoring in-page dialogs, then the returned value is always false. Example if (window.confirm("Do you really want to leave?")) { window.open("exit.html", "Thanks for Visiting!"); } Produces: Notes The following text is shared between this article, DOM:window.prompt and DOM:window.alert Dialog
boxes are modal windows -- they prevent the user from accessing the rest of the program's interface until the dialog box is closed. For this reason, you should not overuse any function that creates a dialog box (or modal window). Regardless, there are good reasons to avoid using dialog
boxes for confirmation. Specification Specification Status Comment HTML Living StandardThe d...
Window.devicePixelRatio - Web APIs
nt pixelRatioBox to a string which displays the ratio both as a percentage and as a raw decimal value with up to two decimal places. Then the updatePixelRatio() function is called once to display the starting value, after which the media query is created using matchMedia() and addEventListener() is called to set up updatePixelRatio() as a handler for the change event. HTML The HTML creates the
boxes containing the instructions and the pixel-ratio box that will display the current pixel ratio information. <div class="container"> <div class="inner-container"> <p>This example demonstrates the effect of zooming the page in and out (or moving it to a screen with a different scaling factor) on the value of the property <code>Window.devicePixelRatio</code>. Try it and wa...
window.dump() - Web APIs
nt to the Browser Console. Output can be sent to the Browser Console using console.log(). Privileged code can also use Components.utils.reportError and nsIConsoleService to log messages to the Error Console/Browser Console. dump() is also available to XPCOM components implemented in JavaScript, even though window is not the global object in components. It is also explicitly made available in sand
boxes. However, this use of dump is not affected by the preference mentioned below -- it will always be shown. It is therefore advisable to either check this preference yourself or use a debugging preference of your own to make sure you don't send lots of debugging content to a user's console when they might not be interested in it at all. Note that dump output from XPCOM components goes to stderr, whi...
Window.prompt() - Web APIs
returned. If the user clicks the Cancel button, this function returns null. The above prompt appears as follows (in Chrome on OS X): Notes A prompt dialog contains a single-line textbox, a Cancel button, and an OK button, and returns the (possibly empty) text the user entered into that textbox. The following text is shared between this article, DOM:window.confirm and DOM:window.alert Dialog
boxes are modal windows; they prevent the user from accessing the rest of the program's interface until the dialog box is closed. For this reason, you should not overuse any function that creates a dialog box (or modal window). Please note that result is a string. That means you should sometimes cast the value given by the user. For example, if their answer should be a Number, you should cast the valu...
Using the alert role - Accessibility
er. For example, a form control may have instruction about the expected value. If a different value is entered, role="alert can be added to the instruction text so that the screen reader announces it as an alert. The pseudo code snippet below illustrates this approach: <p id="formInstruction">You must select at least 3 options</p> // When the user tries to submit the form with less than 3 check
boxes selected: document.getElementById("formInstruction").setAttribute("role", "alert"); Example 4: Making an element with an alert role visible If an element already has role="alert" and is initially hidden using CSS, making it visible will cause the alert to fire as if it was just added to the page. This means that an existing alert can be "reused" multiple times. Note: In most cases this approa...
Using the alertdialog role - Accessibility
description (using aria-describedby). Unlike regular alerts, an alert dialog must have at least one focusable control and focus must be moved to that control when the alert dialog appears. Generally alert dialogs have at least a Confirmation, Close or Cancel button that can be used to move focus to. Additionally, alert dialogs can have other interactive controls such as text fields, tabs or check
boxes. Which particular control focus should be moved to depends on the purpose of the dialog. The tab order inside the alert dialog must wrap. The difference with regular dialogs is that the alertdialog role should only used when an alert, error, or warning occurs. In other words, when a dialog's information and controls require the user's immediate attention alertdialog should be used instead of d...
ARIA: Complementary role - Accessibility
If possible, use the HTML <aside> element instead. <div role="complementary"> <h2>Our partners</h2> <!-- complementary section content --> </div> This is a sidebar containing links to event sponsors. Description The complementary role is a landmark role. Landmarks can be used by assistive technology to quickly identify and navigate to large sections of the document. ...
ARIA: grid role - Accessibility
the first row. ctrl + End Moves focus to the last cell in the last row. If cells, rows, or columns can be selected, the following key combination are commonly used: Key combination Action ctrl + Space Select the column that contains the focus. shift + Space Selects the row that contains the focus. If the grid includes a column with check
boxes to select rows, this key combination can be used to check that box even if the focus is not on the checkbox. ctrl + A Selects all cells. shift + -> Extends selection one cell to the right. shift + <- Extends selection one cell to the left. shift + ? Extends selection one cell down. shift + ? Extends selection one cell up. Examples...
ARIA: button role - Accessibility
name will be the same as the text inside the button. In some cases, for example buttons represented by icons, the accessible name may be provided from the aria-label or aria-labelledby attributes. Toggle buttons A toggle button typically has two states: pressed and not pressed. A third mixed state is available for toggle buttons that control other elements, such as other toggle buttons or check
boxes, which do not all share the same value. Whether an element is a toggle button or not can be indicated with the aria-pressed attribute in addition to the button role (if the element is not already a native button element): If aria-pressed is not used, or is set to the "undefined" state, the button is not a toggle button. If aria-pressed="false" is used the button is a toggle button that is cu...
WAI-ARIA Roles - Accessibility
state to assistive technology.ARIA: Comment roleThe comment landmark role semantically denotes a comment/reaction to some content on the page, or to a previous comment.ARIA: Complementary roleThe complementary landmark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated. These sections are frequently presented as sidebars or call-out
boxes. If possible, use the HTML <aside> element instead.ARIA: contentinfo roleThe contentinfo landmark role is used to identify information repeated at the end of every page of a website, including copyright information, navigation links, and privacy statements. This section is commonly called a footer.ARIA: dialog roleThe dialog role is used to mark up an HTML based application dialog or window that ...
Architecture - Accessibility
kIndex) IAccessible* accessible = QI/QS(object) (B) To get the offset in the parent text for a given embedded object: QI/QA to IAHyperLink If not successful, then it is not embedded in text, so it's position in parent should be determined just by IA2::indexInParent, which will return its child offset within the parent. Examples of objects not embedded in text are the child options in list
boxes and combo
boxes. otherwise, use IAHyperLink::getStartIndex() to find the index in parent. In Firefox, the results of getEndIndex will always be the startIndex + 1, because links are always just represented by a single embedded object character (C) To get the next char fom a given offset in an accessible text: If current char is 0 (end of string), then we are on a hard line break: get next n...
Accessibility documentation index - Accessibility
semantically denotes a comment/reaction to some content on the page, or to a previous comment. 43 ARIA: Complementary role ARIA, ARIA Role, Reference, role-complementary The complementary landmark role is used to designate a supporting section that relates to the main content, yet can stand alone when separated. These sections are frequently presented as sidebars or call-out
boxes. If possible, use the HTML <aside> element instead. 44 ARIA: List role ARIA, ARIA Role, ARIA list, Accessibility, Reference, Role, list The ARIA list role can be used to identify a list of items. It is normally used in conjunction with the listitem role, which is used to identify a list item contained inside the list. 45 ARIA: Listitem role ARIA, ARIA Role, ARI...
Mobile accessibility checklist - Accessibility
aria-describedby. Images of text MUST be avoided. All user interface components with visible text (or image of text) as labels must have the same text available in the programmatic name of the component. WCAG 2.1: Label in name. All form controls MUST have labels (<label> elements) for the benefit of screen reader users. Handling State Standard controls such as radio buttons and check
boxes are handled by the operating system. However, for other custom controls state changes must be provided via ARIA States such as aria-checked, aria-disabled, aria-selected, aria-expanded, and aria-pressed. Orientation Content should not be restricted to a single orientation, such as portrait or landscape, unless essential. WCAG 2.1: Orientation Examples of when an orientation is esssent...
-moz-image-rect - CSS: Cascading Style Sheets
four values are relative to the upper left corner of the image. Examples This example loads an image and uses it in four segments to draw the Firefox logo in four <div> blocks. Clicking on their container causes the four segments to rotate around by swapping the background-image property values among the four <div> blocks. CSS The CSS defines one container style, then the styles for the four
boxes that comprise the complete image. The container looks like this: #container { width:267px; height:272px; top:100px; left:100px; position:absolute; font-size:16px; text-shadow:white 0px 0px 6px; text-align:center; } Then the four
boxes defining the segments of the image are defined. Let's look at them one at a time. #box1 { background-image: -moz-image-rect(url(https://mdn.mo...
-moz-user-input - CSS: Cascading Style Sheets
user-input property, which has not yet reached Candidate Recommendation (call for implementations). A similar property, user-focus, was proposed in early drafts of a predecessor of the CSS3 UI specification, but was rejected by the working group. Syntax Values none The element does not respond to user input, and it does not become :active. enabled The element accepts user input. For text
boxes, this is the default behavior. Please note that this value is no longer supported in Firefox 60 onwards (bug 1405087). disabled The element does not accept user input. However, this is not the same as setting disabled to true, in that the element is drawn normally. Please note that this value is no longer supported in Firefox 60 onwards (bug 1405087). Formal definition Initial valueautoAppli...
-webkit-overflow-scrolling - CSS: Cascading Style Sheets
finger from the touchscreen. touch Use momentum-based scrolling, where the content continues to scroll for a while after finishing the scroll gesture and removing your finger from the touchscreen. The speed and duration of the continued scrolling is proportional to how vigorous the scroll gesture was. Also creates a new stacking context. Formal definition Initial valueautoApplies toscrolling
boxesInheritedyesComputed valueas specifiedAnimation typediscrete Formal syntax auto | touch Examples HTML <div class="scroll-touch"> <p> This paragraph has momentum scrolling </p> </div> <div class="scroll-auto"> <p> This paragraph does not. </p> </div> CSS div { width: 100%; overflow: auto; } p { width: 200%; background: #f5f9fa; border: 2px solid #eaf2f4; padding:...
::cue-region - CSS: Cascading Style Sheets
CSS pseudo-element matches WebVTT cues within a selected element. This can be used to style captions and other cues in media with VTT tracks. ::cue-region { color: yellow; font-weight: bold; } The properties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its shorthand properties apply to each cue individually, to avoid creating
boxes and obscuring unexpectedly large areas of the media. Syntax ::cue-region | ::cue-region( <selector> ) Permitted properties Rules whose selectors include this element may only use the following CSS properties: background background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size color font font-...
::cue - CSS: Cascading Style Sheets
e ::cue CSS pseudo-element matches WebVTT cues within a selected element. This can be used to style captions and other cues in media with VTT tracks. ::cue { color: yellow; font-weight: bold; } The properties are applied to the entire set of cues as if they were a single unit. The only exception is that background and its longhand properties apply to each cue individually, to avoid creating
boxes and obscuring unexpectedly large areas of the media. Syntax ::cue | ::cue( <selector> ) Permitted properties Rules whose selectors include this element may only use the following CSS properties: background background-attachment background-clip background-color background-image background-origin background-position background-repeat background-size color font font-family font-s...
:checked - CSS: Cascading Style Sheets
he button when the checkbox is checked */ #expand-toggle:checked ~ #expand-btn { background-color: #ccc; } Result Image gallery You can use the :checked pseudo-class to build an image gallery with full-size images that show only when the user clicks on a thumbnail. See this demo for a possible cue. Note: For an analogous effect, but based on the :hover pseudo-class and without hidden radio
boxes, see this demo, taken from the :hover reference page. Specifications Specification Status Comment HTML Living StandardThe definition of ':checked' in that specification. Living Standard No change. HTML5The definition of ':checked' in that specification. Recommendation Defines the semantic regarding HTML. Selectors Level 4The definition o...
:hover - CSS: Cascading Style Sheets
background-color: powderblue; transition: background-color .5s; } a:hover { background-color: gold; } Result Image gallery You can use the :hover pseudo-class to build an image gallery with full-size images that show only when the mouse moves over a thumbnail. See this demo for a possible cue. Note: For an analogous effect, but based on the :checked pseudo-class (applied to hidden radio
boxes), see this demo, taken from the :checked reference page. Specifications Specification Comment Feedback HTML Living StandardThe definition of ':hover' in that specification. WHATWG HTML GitHub issues Selectors Level 4The definition of ':hover' in that specification. Allows :hover to be applied to any pseudo-element. CSS Working Group drafts GitHu...
:indeterminate - CSS: Cascading Style Sheets
The :indeterminate CSS pseudo-class represents any form element whose state is indeterminate, such as check
boxes which have their HTML indeterminate attribute set to true, radio buttons which are members of a group in which all radio buttons are unchecked, and indeterminate <progress> elements. /* Selects any <input> whose state is indeterminate */ input:indeterminate { background: lime; } Elements targeted by this selector are: <input type="checkbox"> elements whose indeterminate property is set to true by JavaScript <input type="radio"> elements, when all radio buttons with the same name value in the form are unchecked <progress> elements in an indeterminate state Syntax :indeterminate Examples Checkbox & radio button This example applies special styles to the labels associate...
Coordinate systems - CSS: Cascading Style Sheets
if the containing window is moved, for example, or if the user's screen geometry changes (by changing display resolution or by adding or removing monitors to their system). The MouseEvent.screenX and MouseEvent.screenY properties give the coordinates of a mouse event's position relative to the screen's origin. Example Let's take a look at an example. This simple example creates a set of nested
boxes. Whenever the mouse enters, moves around inside, or exits the inner box, the corresponding event is handled by updating a set of informational messages within the box, listing out the current mouse coordinates in each of the four available coordinate systems. JavaScript Let's look at the script in two sections. First, the code that logs the coordinates to the screen. This code will be called by...
CSS Backgrounds and Borders - CSS: Cascading Style Sheets
Styles in the CSS Backgrounds and Borders module allow filling backgrounds with color or an image (clipped or resized), or modifying them in other ways. These styles can also decorate borders with lines or images, and make them square or rounded. ...
Box alignment for block, absolutely positioned and table layout - CSS: Cascading Style Sheets
roperty does not apply to floated elements or table cells. Absolutely positioned elements The alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. The normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. align-self The align-self property does not apply to block-level
boxes (including floats), because there is more than one item in the block axis. It also does not apply to table cells. Absolutely positioned elements The alignment container is the positioned block, accounting for the offset values of top, left, bottom, and right. The normal keyword resolves to stretch, unless the positioned item is a replaced element, in which case it resolves to start. Aligning i...
Box alignment in Multi-column Layout - CSS: Cascading Style Sheets
-content and justify-content The align-content property applies to the block axis and justify-content to the inline axis. Any spacing added to the columns due to use of space distribution will be added to the gap between the columns, therefore making the gap larger than might be specified by the column-gap property. Using a value of justify-content other than normal or stretch will cause column
boxes to display at the column-width specified on the multicol container, and the remaining space distributed according to the value of justify-content. column-gap The column-gap property was specified in earlier versions of the multiple-column layout specification, and has now been unified with the gap properties for other layout methods in box alignment. While other layout methods treat the initial...
CSS Basic Box Model - CSS: Cascading Style Sheets
CSS Basic Box Model is a module of CSS that defines the rectangular
boxes--including their padding and margin--that are generated for elements and laid out according to the visual formatting model. Reference Properties Properties controlling the flow of content in a box overflow overflow-x overflow-y Properties controlling the size of a box height width max-height max-width min-height min-width Properties controlling the margins of a box margin margin-bottom margin-left margin-right margin-top margin-trim Properties controlling the paddings of a box padding padding-bottom padding-left padding-right padding-top Other properties visibility Guides Introduction to the CSS box model Explains one of the fundamental concept of CSS: the box m...
Handling Overflow in Multicol - CSS: Cascading Style Sheets
For example, the situation could happen when an image in a column is wider than the column-width value or the width of the column based on the number of columns declared with column-count. In this situation, the content should visibly overflow into the next column, rather than be clipped by the column box. ...
Using feature queries - CSS: Cascading Style Sheets
using feature queries for progressive enhancement, this doesn't matter. You do however need to structure your CSS in a certain way, writing CSS for non-supporting browsers and overwriting it with the CSS inside the feature query. Let's walk through a very simple example where feature queries come in handy, which uses them in the way described above. Let's say we want to create a layout of three
boxes in a row, and ideally we would like to use CSS Grid Layout. However, we would like to have a layout for older browsers using floats. We can start by creating that floated layout with the following code, which gives us three columns. When browsers don't understand a CSS property or value, they ignore it. So we could start enhancing our layout by using CSS Grid. Browsers that do not support grid...
Cross-browser Flexbox mixins - CSS: Cascading Style Sheets
rrent browsers. This set uses: Fallbacks using 2009 'box' syntax (FF and Older WebKit) and prefixed syntaxes (IE10, WebKit browsers without flex wrapping) Final standards syntax (FF, Safari, Chrome, IE11+, Edge, Opera) This was inspired by: http://dev.opera.com/articles/view/advanced-cross-browser-flexbox/ With help from: http://w3.org/tr/css3-flexbox/ http://the-echoplex.net/flexy
boxes/ http://msdn.microsoft.com/en-us/library/ie/hh772069(v=vs.85).aspx http://css-tricks.com/using-flexbox/ A Complete Guide to Flexbox | CSS-Tricks Visual Guide to CSS3 Flexbox: Flexbox Playground | Note: Mixins are not currently supported natively in browsers. Instead, you will need to use a CSS pre-processor to make the most of the following. However, CSS pre-processors simply generate valid...
Relationship of flexbox to other layout methods - CSS: Cascading Style Sheets
d Layout differs from flex layout, and demonstrates some of the extra functionality you get when using Grid Layout such as layering of items on the grid. This may also help in your decision as to which layout method to use. Flexbox and display: contents The contents value of the display property is a new value that is described in the spec as follows: "The element itself does not generate any
boxes, but its children and pseudo-elements still generate
boxes as normal. For the purposes of box generation and layout, the element must be treated as if it had been replaced with its children and pseudo-elements in the document tree." This value of display controls box generation, and whether the element should generate a box that we can style and see on the page, or whether instead the box it wo...
Flow Layout and Overflow - CSS: Cascading Style Sheets
or writing mode in use. Block-Axis Overflow There is also a proposal for a block-overflow property, although at the time of writing the name is still up for discussion. This proposal would enable the adding of an ellipsis when text overflows in the block dimension. This is useful in the situation where you have a listing of articles, for example, and you display the listings in fixed height
boxes which only take a limited amount of text. It may not be obvious to the reader that there is more content to click through to when clicking the box or the title. An ellipsis indicates clearly the fact there is more content. The specification would allow a string of content or a regular ellipsis to be inserted. Summary Whether you are in continuous media on the web or in a Paged Media format such...
In Flow and Out of Flow - CSS: Cascading Style Sheets
le I have a div, and then two paragraphs. I've added a background colour to the paragraphs, and then floated the div left. The div is now out of flow. As a float it is first laid out according to where it would be in normal flow, then taken out of flow and moved to the left as far as possible. You can see the background colour of the following paragraph running underneath, it is only the line
boxes of that paragraph that have been shortened to cause the effect of wrapping content around the float. The box of our paragraph is still displaying according to the rules of normal flow. This is why, to make space around a floated item, you must add a margin to the item, in order to push the line
boxes away from it. You cannot apply anything to the following in-flow content to achieve that. Absolu...
Introduction to formatting contexts - CSS: Cascading Style Sheets
y to items participating in an inline formatting context. In a horizontal writing mode line, horizontal padding, borders and margin will be applied to the element and push the text away left and right. However, margins above and below the element will not be applied. Vertical padding and borders will be applied but may overlap content above and below as, in the inline formatting context, the line
boxes will not be pushed apart by padding and borders. Other formatting contexts This guide covers flow layout and is therefore not referring to other possible formatting contexts. As such, it is useful to understand that creating any kind of formatting context will change the way elements inside that formatting context behave. This behavior is always described in the specification and also here on...
CSS Flow Layout - CSS: Cascading Style Sheets
ds are displayed in a sentence according to the Writing Mode of the document. Block elements display one after the other, as paragraphs do in the Writing Mode of that document. In English therefore, inline elements display one after the other, starting on the left, and block elements start at the top and move down the page. Basic Example The following example demonstrates Block and Inline Level
boxes. The two paragraph elements with a green border are Block Level, displaying one under the other. The first sentence also includes a span element with a blue background. This is inline level and therefore displays in place in the sentence. Guides Block and Inline Layout in Normal Flow In Flow and Out of Flow Formatting Contexts Explained Flow Layout and Writing Modes Flow Layout and Ove...
CSS Grid Layout and Accessibility - CSS: Cascading Style Sheets
this mean for designing with grid layout in practice? Visual not logical re-ordering Any time you reorder things with grid layout - or with flexbox - you only perform visual reordering. The underlying source is what controls things like text to speech, and the tab order of the document. You can see how this works with a very simple example. In this example I have used grid to lay out a set of
boxes that contain links. I have used the line-based placement properties to position box 1 on the second row of the grid. Visually it now appears as the fourth item in the list. However, if I tab from link to link the tab order still begins with box 1, as it comes first in the source. * {box-sizing: border-box;} .wrapper { border: 2px solid #f76707; border-radius: 5px; background-color...
Realizing common layouts using CSS Grid Layout - CSS: Cascading Style Sheets
list-style: none; margin: 2em; display: grid; grid-gap: 20px; grid-template-columns: repeat(auto-fill,minmax(200px, 1fr)); } As soon as I add this CSS, the items start to lay out as a grid. If I make the window smaller or wider the number of column tracks changes - without me needing to add breakpoints using media queries and redefine the grid. I can then tidy up the internals of the
boxes using a little touch of flexbox. I set the list item to display: flex and the flex-direction to column. I can then use an auto margin on the .cta to push this bar down to the bottom of the box. .listing li { border: 1px solid #ffe066; border-radius: 5px; display: flex; flex-direction: column; } .listing .cta { margin-top: auto; border-top: 1px solid #ffe066; padding: 10px; text-a...
Consistent list indentation - CSS: Cascading Style Sheets
Figure 1. That dotted red border represents outer edges of the content-area of the list item. Remember that, at this point, the list item has no padding or borders. If we add two more list items, we get a result like that shown in Figure 2. Now we wrap these in a parent element; in this case, we'll wrap them in an unordered list (i.e., <ul>). According to the CSS box model, the list items'
boxes must be displayed within the parent element's content area. Since that parent has no padding or margins yet, we get the situation shown in Figure 3. Here, the dotted blue border shows us the edges of the <ul> element's content area. Since we have no padding for the <ul> element, its content wraps snugly around the three list items. Now we add the list item markers. Since this is an unordered ...
Basic concepts of Logical Properties and Values - CSS: Cascading Style Sheets
The Logical Properties and Values Specification introduces flow-relative mappings for many of the properties and values in CSS. This article introduces the specification, and explains flow relative properties and values. Why do we need logical properties? CSS traditionally has sized things according to the physical dimensions of the screen. Therefore we describe
boxes as having a width and height, position items from the top and left, float things left, assign borders, margin, and padding to the top, right, bottom, left, etc. The Logical Properties and Values specification defines mappings for these physical values to their logical, or flow relative, counterparts -- e.g. start and end as opposed to left and right/top and bottom. An example of why these mappings might be needed is as follows...
Logical properties for floating and positioning - CSS: Cascading Style Sheets
e block dimension simultaneously. inset Sets all four inset values simultaneously with physical mapping of multi-value. Float and clear example The physical values used with the float and clear properties are left, right and both. The Logical Properties specification defines the values inline-start and inline-end as mappings for left and right. In the example below I have two
boxes -- the first has the box floated with float: left, the second with float: inline-start. If you change the writing-mode to vertical-rl or the direction to rtl you will see that the left-floated box always sticks to the left, whereas the inline-start-floated item follows the direction and writing-mode. Example: Inset properties for positioned layout Positioning generally allows us to position a...
Understanding CSS z-index - CSS: Cascading Style Sheets
e text, images, and other elements are arranged on the page without overlapping. In this case, there is a single rendering flow, and all elements are aware of the space taken by others. The z-index attribute lets you adjust the order of the layering of objects when rendering content. In CSS 2.1, each box has a position in three dimensions. In addition to their horizontal and vertical positions,
boxes lie along a "z-axis" and are formatted one on top of the other. Z-axis positions are particularly relevant when
boxes overlap visually. (from CSS 2.1 Section 9.9.1 - Layered presentation) This means that CSS style rules allow you to position
boxes on layers in addition to the normal rendering layer (layer 0). The Z position of each layer is expressed as an integer representing the stacking ord...
CSS Shapes - CSS: Cascading Style Sheets
ent, causing wrapping lines to wrap round the shape rather than following the rectangle of the element's box. Basic example The example below shows an image that has been floated left, and the shape-outside property applied with a value of circle(50%). This creates a circle shape, and the content wrapping the float now wraps around that shape. This changes the length of the wrapping text's line
boxes. Reference Properties shape-image-threshold shape-margin shape-outside Data types <basic-shape> Guides Overview of CSS Shapes Shapes from Box Values Basic Shapes Shapes from Images Edit Shape Paths in CSS -- Firefox Developer Tools External Resources A list of CSS Shapes resources CSS Shapes 101 Creating non-rectangular layouts with CSS Shapes How To Use CSS Sha...
Column layouts - CSS: Cascading Style Sheets
t an individual column or the content of an individual column. You can control the gaps between columns with the column-gap property, and add a rule between columns using column-rule. Download this example Use multicol when: You want your text to display in newspaper-like columns. You have a set of small items you want to break into columns. You do not need to target individual column
boxes for styling. A single row of items with equal heights -- flexbox Flexbox can be used to break content into columns by setting flex-direction to row, however flexbox targets the elements inside the flex container and will place each direct child into a new column. This is a different behavior to what you saw with multicol. There is currently no way to add a rule between flex items, and browser...
align-content - CSS: Cascading Style Sheets
the alignment container along the cross axis. normal The items are packed in their default position as if no align-content value was set. baseline first baseline last baseline Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the
boxes in its baseline-sharing group. The fallback alignment for first baseline is start, the one for last baseline is end. space-between The items are evenly distributed within the alignment container along the cross axis. The spacing between each pair of adjacent items is the same. The first item is flush with the start edge of the alignment container in the cross axis, and the last item is flush w...
aspect-ratio - CSS: Cascading Style Sheets
has no preferred aspect ratio. Size calculations involving intrinsic aspect ratio always work with the content box dimensions. <ratio> The box's preferred aspect ratio is the specified ratio of width / height. Size calculations involving preferred aspect ratio work with the dimensions of the box specified by box-sizing. Formal definition Initial valueautoApplies toall elements except inline
boxes and internal ruby or table
boxesInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax auto | <ratio> Examples Mapping width and height to aspect-ratio Firefox has added an internal aspect-ratio property (in version 69 onwards) that applies to replaced elements and other related elements that accept width and height attributes. This appears in the browser's internal UA sty...
box-ordinal-group - CSS: Cascading Style Sheets
oup: inherit; box-ordinal-group: initial; box-ordinal-group: unset; Ordinal groups may be used in conjunction with the box-direction property to control the order in which the direct children of a box appear. When the computed box-direction is normal, a box will display its elements starting from the lowest numbered ordinal group and ensure that those elements appear to the left (for horizontal
boxes) or at the top (for vertical
boxes) of the container. Elements with the same ordinal group are flowed in the order they appear in the source document tree. In the reverse direction, the ordinal groups are examined in the same order, except the elements appear reversed. Syntax The box-ordinal-group property is specified as any positive <integer>. Formal definition Initial value1Applies tochild...
box-sizing - CSS: Cascading Style Sheets
and height you assign to an element is applied only to the element's content box. If the element has any border or padding, this is then added to the width and height to arrive at the size of the box that's rendered on the screen. This means that when you set width and height, you have to adjust the value you give to allow for any border or padding that may be added. For example, if you have four
boxes with width: 25%;, if any has left or right padding or a left or right border, they will not by default fit on one line within the constraints of the parent container. The box-sizing property can be used to adjust this behavior: content-box gives you the default CSS box-sizing behavior. If you set an element's width to 100 pixels, then the element's content box will be 100 pixels wide, and the...
column-count - CSS: Cascading Style Sheets
ns is determined by other CSS properties, such as column-width. <integer> Is a strictly positive <integer> describing the ideal number of columns into which the content of the element will be flowed. If the column-width is also set to a non-auto value, it merely indicates the maximum allowed number of columns. Formal definition Initial valueautoApplies toBlock containers except table wrapper
boxesInheritednoComputed valueas specifiedAnimation typean integer Formal syntax <integer> | auto Examples Splitting a paragraph across three columns HTML <p class="content-box"> This is a bunch of text split into three columns using the CSS `column-count` property. The text is equally distributed over the columns. </p> CSS .content-box { column-count: 3; } Result Specifications ...
column-width - CSS: Cascading Style Sheets
fied value: it may be wider when necessary to fill available space, and narrower when the available space is too small. The value must be strictly positive or the declaration is invalid. Percentage values are also invalid. auto The width of the column is determined by other CSS properties, such as column-count. Formal definition Initial valueautoApplies toBlock containers except table wrapper
boxesInheritednoComputed valuethe absolute length, zero or largerAnimation typea length Formal syntax <length> | auto Examples Setting column width in pixels HTML <p class="content-box"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorpe...
columns - CSS: Cascading Style Sheets
columns into which the element's content should be flowed, defined as an <integer> or the keyword auto. If neither this value nor the column's width are auto, it merely indicates the maximum allowable number of columns. See column-count. ...
<display-box> - CSS: Cascading Style Sheets
Please note that the CSS Display Level 3 spec defines how the contents value should affect "unusual elements" -- elements that aren't rendered purely by CSS box concepts such as replaced elements. See Appendix B: Effects of display: contents on Unusual Elements for more details. Due to a bug in browsers this will currently remove the element from the accessibility tree -- screen readers will not look at what's inside. See the Accessibility concerns section below for more details. ...
<display-internal> - CSS: Cascading Style Sheets
These elements behave like <colgroup> HTML elements. table-column These elements behave like <col> HTML elements. table-caption These elements behave like <caption> HTML elements. ruby-base These elements behave like <rb> HTML elements. ruby-text These elements behave like <rt> HTML elements. ruby-base-container These elements behave like <rbc> HTML elements generated as anonymous
boxes. ruby-text-container These elements behave like <rtc> HTML elements. Examples CSS tables example The following example demonstrates laying out a simple form using CSS table layout. HTML <main> <div> <label for="name">Name</label> <input type="text" id="name" name="name"> </div> <div> <label for="age">Age</label> <input type="text" id="age" name="age"> </div> </ma...
<display-outside> - CSS: Cascading Style Sheets
y property, and can be used for legacy purposes as a single keyword, or as defined in the Level 3 specification alongside a value from the <display-inside> keywords. Syntax Valid <display-outside> values: block The element generates a block element box, generating line breaks both before and after the element when in the normal flow. inline The element generates one or more inline element
boxes that do not generate line breaks before or after themselves. In normal flow, the next element will be on the same line if there is space run-in The element generates a run-in box. If the adjacent sibling of the element defined as display: run-in box is a block box, the run-in box becomes the first inline box of the block box that follows it. Run-in elements act like inlines or blocks, dep...
flex-wrap - CSS: Cascading Style Sheets
s whether flex items are forced onto one line or can wrap onto multiple lines. If wrapping is allowed, it sets the direction that lines are stacked. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. See Using CSS flexible
boxes for more properties and information. Syntax flex-wrap: nowrap; /* Default value */ flex-wrap: wrap; flex-wrap: wrap-reverse; /* Global values */ flex-wrap: inherit; flex-wrap: initial; flex-wrap: unset; The flex-wrap property is specified as a single keyword chosen from the list of values below. Values The following values are accepted: nowrap The flex items are laid out in a single li...
font - CSS: Cascading Style Sheets
size CSS property. <'line-height'> See the line-height CSS property. <'font-family'> See the font-family CSS property. System font values caption The system font used for captioned controls (e.g., buttons, drop-downs, etc.). icon The system font used to label icons. menu The system font used in menus (e.g., dropdown menus and menu lists). message-box The system font used in dialog
boxes. small-caption The system font used for labeling small controls. status-bar The system font used in window status bars. Prefixed system font keywords Browsers often implement several more, prefixed, keywords: Gecko implements -moz-window, -moz-document, -moz-desktop, -moz-info, -moz-dialog, -moz-button, -moz-pull-down-menu, -moz-list, and -moz-field. Formal definition Initial valueas eac...
grid-area - CSS: Cascading Style Sheets
corresponding to the search direction are assumed to have that name for the purpose of counting this span. If the <integer> is omitted, it defaults to 1. Negative integers or 0 are invalid. ...
grid-column-end - CSS: Cascading Style Sheets
at name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. If the <integer> is omitted, it defaults to 1. Negative integers or 0 are invalid. The <custom-ident> cannot take the span value. ...
grid-column-start - CSS: Cascading Style Sheets
t name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. If the <integer> is omitted, it defaults to 1. Negative integers and 0 are invalid. The <custom-ident> cannot take the span value. ...
grid-column - CSS: Cascading Style Sheets
tomatic placement of grid items. All items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. One can use a little JavaScript to enable automatic annotation: source repository. ...
grid-row-end - CSS: Cascading Style Sheets
hat name are counted. If not enough lines with that name exist, all implicit grid lines on the side of the explicit grid corresponding to the search direction are assumed to have that name for the purpose of counting this span. If the <integer> is omitted, it defaults to 1. Negative integers or 0 are invalid. ...
grid-row-start - CSS: Cascading Style Sheets
name exist, all implicit grid lines on the side of the explicit grid, corresponding to the search direction, are assumed to have that name for the purpose of counting this span. If the <integer> is omitted, it defaults to 1. Negative integers or 0 are invalid. The <custom-ident> cannot take the span value. ...
grid-row - CSS: Cascading Style Sheets
ort automatic placement of grid items. All items end up in the first row/col of the grid unless explicitly annotated with -ms-grid-column and -ms-grid-row. One can use a little JavaScript to enable automatic annotation: source repository. ...
line-height - CSS: Cascading Style Sheets
On non-replaced inline elements, it specifies the height that is used to calculate line box height. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. ...
margin-left - CSS: Cascading Style Sheets
n area on the left side of an element. A positive value places it farther from its neighbors, while a negative value places it closer. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The vertical margins of two adjacent
boxes may fuse. This is called margin collapsing. In the rare cases where width is overconstrained (i.e., when all of width, margin-left, border, padding, the content area, and margin-right are defined), margin-left is ignored, and will have the same calculated value as if the auto value was specified. Syntax /* <length> values */ margin-left: 10px; /* An absolute length */ margin-left: 1em; /* r...
margin-right - CSS: Cascading Style Sheets
area on the right side of an element. A positive value places it farther from its neighbors, while a negative value places it closer. The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. The vertical margins of two adjacent
boxes may fuse. This is called margin collapsing. Syntax /* <length> values */ margin-right: 20px; /* An absolute length */ margin-right: 1em; /* relative to the text size */ margin-right: 5%; /* relative to the nearest block container's width */ /* Keyword values */ margin-right: auto; /* Global values */ margin-right: inherit; margin-right: initial; margin-right: unset; The margin-right p...
offset-path - CSS: Cascading Style Sheets
yntax /* Default */ offset-path: none; /* Function values */ offset-path: ray(45deg closest-side contain); /* URL */ offset-path: url(#path); /* Shapes */ offset-path: circle(50% at 25% 25%); offset-path: inset(50% 50% 50% 50%); offset-path: polygon(30% 0%, 70% 0%, 100% 50%, 30% 100%, 0% 70%, 0% 30%); offset-path: path('M 0,200 Q 200,200 260,80 Q 290,20 400,0 Q 300,100 400,200'); /* Geometry
Boxes */ offset-path: margin-box; offset-path: stroke-box; /* Global values */ offset-path: inherit; offset-path: initial; offset-path: unset; Values ray() Taking up to three values, defines a path that is a line segment starting from the position of the box and proceeds in the direction defined by the specified angle similar to the CSS gradient angle where 0deg is up, with positive angles incre...
overscroll-behavior-block - CSS: Cascading Style Sheets
l chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. Formal definition Initial valueautoApplies tonon-replaced block-level elements and non-replaced inline-block elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax contain | none | auto Examples Preventing block overscrolling In this demo we have two block-level
boxes, one inside the other. The outer box has a large height set on it so the page will scroll vertically. The inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large height so it will also scroll vertically. By default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is ...
overscroll-behavior-inline - CSS: Cascading Style Sheets
chaining occurs to neighbouring scrolling areas, and default scroll overflow behavior is prevented. Formal definition Initial valueautoApplies tonon-replaced block-level elements and non-replaced inline-block elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax contain | none | auto Examples Preventing inline overscrolling In this demo we have two block-level
boxes, one inside the other. The outer box has a large width set on it so the page will scroll horizontally. The inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large width so it will also scroll horizontally. By default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which i...
overscroll-behavior-x - CSS: Cascading Style Sheets
or is prevented. Formal definition Initial valueautoApplies tonon-replaced block-level elements and non-replaced inline-block elementsInheritednoComputed valueas specifiedAnimation typediscrete Formal syntax contain | none | auto Examples Preventing an underlying element from scrolling horizontally In our simple overscroll-behavior-x example (see source code also), we have two block-level
boxes, one inside the other. The outer box has a large width set on it so the page will scroll horizontally. The inner box has a small width (and height) set on it so it sits comforably inside the viewport, but its content is given a large width so it will scroll horizontally. By default, when the inner box is scrolled and a scroll boundary is reached, the whole page will begin to scroll, which is pro...
place-content - CSS: Cascading Style Sheets
each pair of adjacent items is the same. The first item is flush with the main-start edge, and the last item is flush with the main-end edge. baseline first baseline last baseline Specifies participation in first- or last-baseline alignment: aligns the alignment baseline of the box's first or last baseline set with the corresponding baseline in the shared first or last baseline set of all the
boxes in its baseline-sharing group. The fallback alignment for first baseline is start, the one for last baseline is end. space-around The items are evenly distributed within the alignment container. The spacing between each pair of adjacent items is the same. The empty space before the first and after the last item equals half of the space between each pair of adjacent items. space-evenly The it...
position - CSS: Cascading Style Sheets
low, and no space is created for the element in the page layout. It is positioned relative to its closest positioned ancestor, if any; otherwise, it is placed relative to the initial containing block. Its final position is determined by the values of top, right, bottom, and left. This value creates a new stacking context when the value of z-index is not auto. The margins of absolutely positioned
boxes do not collapse with other margins. fixed The element is removed from the normal document flow, and no space is created for the element in the page layout. It is positioned relative to the initial containing block established by the viewport, except when one of its ancestors has a transform, perspective, or filter property set to something other than none (see the CSS Transforms Spec), in which...
scroll-behavior - CSS: Cascading Style Sheets
set; The scroll-behavior property is specified as one of the keyword values listed below. Values auto The scrolling box scrolls instantly. smooth The scrolling box scrolls in a smooth fashion using a user-agent-defined timing function over a user-agent-defined period of time. User agents should follow platform conventions, if any. ...
scrollbar-color - CSS: Cascading Style Sheets
element to the viewport. Accessibility concerns When using scrollbar-color property with specific color values, authors should ensure the specified colors have enough contrast between them. For keyword values, UAs should ensure the colors they use have enough contrast. See Techniques for WCAG 2.0: G183: Using a contrast ratio of 3:1. ...
text-decoration-skip - CSS: Cascading Style Sheets
le keywords */ text-decoration-skip: objects spaces; text-decoration-skip: leading-spaces trailing-spaces; text-decoration-skip: objects edges box-decoration; /* Global values */ text-decoration-skip: inherit; text-decoration-skip: initial; text-decoration-skip: unset; Syntax Values none Nothing is skipped. Thus, text decoration is drawn for all text content and across atomic inline-level
boxes. objects The entire margin box of the element is skipped if it is an atomic inline such as an image or inline-block. spaces All spacing is skipped: all Unicode white space characters and all word separators, plus any adjacent letter-spacing or word-spacing. leading-spaces The same as spaces, except that only leading spaces are skipped. trailing-spaces The same as spaces, except that only ...
translateZ() - CSS: Cascading Style Sheets
Cartesian coordinates on R2 Homogeneous coordinates on RP2 Cartesian coordinates on R3 Homogeneous coordinates on RP3 This transformation applies to the 3D space and can't be represented on the plane. A translation is not a linear transformation in R3 and can't be represented using a Cartesian-coordinate matrix. 10000100001t0001 Examples In this example, two
boxes are created. One is positioned normally on the page, without being translated at all. The second is altered by applying perspective to create a 3D space, then moved towards the user. HTML <div>Static</div> <div class="moved">Moved</div> CSS div { position: relative; width: 60px; height: 60px; left: 100px; background-color: skyblue; } .moved { transform: perspective(500px) transla...
transform - CSS: Cascading Style Sheets
les and send us a pull request. If the property has a value different than none, a stacking context will be created. In that case, the element will act as a containing block for any position: fixed; or position: absolute; elements that it contains. Only transformable elements can be transformed. That is, all elements whose layout is governed by the CSS box model except for: non-replaced inline
boxes, table-column
boxes, and table-column-group
boxes. Syntax /* Keyword values */ transform: none; /* Function values */ transform: matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: perspective(17px); transform: rotate(0.5turn); transform: rotate3d(1, 2.0, 3.0, 10deg); transform: rotateX(10deg); transform: rotateY(10deg); transf...
user-select - CSS: Cascading Style Sheets
The user-select CSS property controls whether the user can select text. This doesn't have any effect on content loaded as chrome, except in text
boxes. /* Keyword values */ user-select: none; user-select: auto; user-select: text; user-select: contain; user-select: all; /* Global values */ user-select: inherit; user-select: initial; user-select: unset; /* Mozilla-specific values */ -moz-user-select: none; -moz-user-select: text; -moz-user-select: all; /* WebKit-specific values */ -webkit-user-select: none; -webkit-user-select: text; -webkit-user-select: all; /* Doesn't work in Safari; use only "none" or "text", or else it will allow typing in the <html> container */ /* Microsoft-specific values */ -ms-user-select: none; -ms-user-sele...
CSS: Cascading Style Sheets
gs you'll do with CSS. Here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows, and other text features. We round off the module by looking at applying custom fonts to your page, and styling lists and links. CSS layout At this point we've already looked at CSS fundamentals, how to style text, and how to style and manipulate the
boxes that your content sits inside. Now it's time to look at how to place your
boxes in the right place concerning the viewport, and one another. We have covered the necessary prerequisites so we can now dive deep into CSS layout, looking at different display settings, modern layout tools like flexbox, CSS grid, and positioning, and some of the legacy techniques you might still want to know about. Us...
Block formatting context - Developer guides
A block formatting context is created by at least one of the following: The root element of the document (<html>). Floats (elements where float isn't none). Absolutely positioned elements (elements where position is absolute or fixed). Inline-blocks (elements with display: inline-block). Table cells (elements with display: table-cell, which is the default for HTML table cells). Table captions (elements with display: table-caption, which is the default for HTML table captions). ...
Challenge solutions - Developer guides
nge Change your stylesheet to identify the headings with capital letters in parentheses. Solution Add a rule to the body element (parent of the headings) to reset a new counter, and one to display and increment the counter on the headings: /* numbered headings */ body {counter-reset: headnum;} h3:before { content: "(" counter(headnum, upper-latin) ") "; counter-increment: headnum; }
Boxes Ocean border Challenge Add one rule to your stylesheet, making a wide border all around the oceans in a color that reminds you of the sea. Solution The following rule achieves this effect: ul { border: 10px solid lightblue; width: 100px; } Layout Default image position Fixed image position Challenge Change your sample document, doc2.html, adding this tag to it near the en...
disabled - HTML: Hypertext Markup Language
t. Here are examples of a disabled checkbox, radio button, <option> and <optgroup>, as well as some form controls that are disabled via the disabled attribute set on the ancestor <fieldset> element. The <option>s are disabled, but the <select> itself is not. We could have disable the entire <select> by adding the attribute to that element rather than it's descendants. ...
HTML attribute: required - HTML: Hypertext Markup Language
radio button in the group has the required attribute, a radio button in that group must be check, though it doesn't have to be the one with the attribute is applied. For this reason, to improve code maintenance, it is recommened to either include the required attribute in every same-named radio button in the group or none. In the case of a same named group of checkbox input types, only the check
boxes with the required attribute are required. Note: Setting aria-required="true" tells a screen reader that an element (any element) is required, but has no bearing on the optionality of the element. Attribute interactions Because a read-only field cannot have a value, required does not have any effect on inputs with the readonly attribute also specified. Usability When including the require...
Block-level elements - HTML: Hypertext Markup Language
historically were categorized as either "block-level" elements or "inline-level" elements. By default, a block-level element occupies the entire space of its parent element (container), thereby creating a "block." This article helps to explain what this means. Browsers typically display the block-level element with a newline both before and after the element. You can visualize them as a stack of
boxes. A block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can). The following example demonstrates the block-level element's influence: Block-level elements HTML <p>This paragraph is a block-level element; its background has been colored to display the paragraph's parent element.</p> CSS p { background-color...
<aside>: The Aside element - HTML: Hypertext Markup Language
The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone https://github.com/mdn/interactive-examples and send us a pull request. Content categories Flow content, sectioning content, palpable content. Permitted content Flow content. ...
<input type="password"> - HTML: Hypertext Markup Language
be narrower or wider than the specified number of characters, depending on the characters and the font (font settings in use). This does not set a limit on how many characters the user can enter into the field. It only specifies approximately how many can be seen at a time. To set an upper limit on the length of the input data, use the maxlength attribute. Using password inputs Password input
boxes generally work just like other textual input
boxes; the main difference is the obscuring of the content to prevent people near the user from reading the password. A simple password input Here we see the most basic password input, with a label established using the <label> element. <label for="userPassword">Password: </label> <input id="userPassword" type="password"> Allowing autocomplete T...
<input type="search"> - HTML: Hypertext Markup Language
<form> <div> <input type="search" id="mySearch" name="q" placeholder="Search the site..." size="30"> <button>Search</button> </div> </form> The result is this wider input box: Validation <input> elements of type search have the same validation features available to them as regular text inputs. It is less likely that you'd want to use validation features in general for search
boxes. In many cases, users should just be allowed to search for anything, but there are a few cases to consider, such as searches against data of a known format. Note: HTML form validation is not a substitute for scripts that ensure that the entered data is in the proper format. It's far too easy for someone to make adjustments to the HTML that allow them to bypass the validation, or to remove it en...
<menuitem> - HTML: Hypertext Markup Language
ext menus, as well as menus that might be attached to a menu button. A command can either be defined explicitly, with a textual label and optional icon to describe its appearance, or alternatively as an indirect command whose behavior is defined by a separate element. Commands can also optionally include a checkbox or be grouped to share radio buttons. (Menu items for indirect commands gain check
boxes or radio buttons when defined against elements <input type="checkbox"> and <input type="radio">.) Content categories None. Permitted content None, it is an empty element. Tag omission Must have a start tag and must not have an end tag. Permitted parents The <menu> element, where that element is in the popup menu state. (If specified, the type attri...
HTML documentation index - HTML: Hypertext Markup Language
s of type button are rendered as simple push buttons, which can be programmed to control custom functionality anywhere on a webpage as required when assigned an event handler function (typically for the click event). 120 <input type="checkbox"> Element, HTML, HTML forms, Input, Input Types, Reference, checkbox, form <input> elements of type checkbox are rendered by default as
boxes that are checked (ticked) when activated, like you might see in an official government paper form. The exact appearance depends upon the operating system configuration under which the browser is running. Generally this is a square but it may have rounded corners. A checkbox allows you to select single values for submission in a form (or not). 121 <input type="color"> Color Picker, ...
CSS and JavaScript animation performance - Web Performance
FPS tools Before going through the example, please enable FPS tools first to see the current frame rate: In the URL bar, enter about:config; click the I'll be careful, I promise! button to enter the config screen. In the search bar, search for the layers.acceleration.draw-fps preference. Double-click the entry to set the value to true. Now you will be able to see three little purple
boxes at the upper left corner of the Firefox window. The first box represents FPS. Running the performance test Initially in the test seen below, a total of 1000 <div> elements are transformed by CSS animation. The animation can be switched to requestAnimationFrame() by clicking the toggle button. Try running them both now, comparing the FPS for each (the first purple box.) You should see t...
Populating the page: how browsers work - Web Performance
To determine the exact size and location of each object, the browser starts at the root of the render tree and traverses it. On the web page, most everything is a box. Different devices and different desktop preferences mean an unlimited number of differing viewport sizes. In this phase, taking the viewport size into consideration, the browser determines what the dimensions of all the different
boxes are going to be on the screen. Taking the size of the viewport as its base, layout generally starts with the body, laying out the dimensions of all the body's descendants, with each element's box model properties, providing placeholder space for replaced elements it doesn't know the dimensions of, such as our image. The first time the size and position of nodes are determined is called layout. S...
Graphic design for responsive sites - Progressive web apps (PWAs)
Web would have laughed at you if you had told them that less than 20 years in the future we would be developing web sites that worked well on mobile phones, tablets, TVs, even cars and home lighting. But today it is very much a reality. This article provides a high level discussion aimed at helping you to choose the best option for your graphical needs. ...
dominant-baseline - SVG: Scalable Vector Graphics
It is used to determine or re-determine a scaled-baseline-table. A scaled-baseline-table is a compound value with three components: a baseline-identifier for the dominant-baseline, a baseline-table, and a baseline-table font-size. Some values of the property re-determine all three values. ...
SVG documentation index - SVG: Scalable Vector Graphics
the kernelMatrix of a <feConvolveMatrix> element to the input image color value is divided to yield the destination color value. 61 dominant-baseline Reference, SVG, SVG Attribute The dominant-baseline attribute specifies the dominant baseline, which is the baseline used to align the box's text and inline-level contents. It also indicates the default alignment baseline of any
boxes participating in baseline alignment in the box's alignment context. 62 dur SVG, SVG Attribute The dur attribute indicates the simple duration of an animation. 63 dx SVG, SVG Attribute The dx attribute indicates a shift along the x-axis on the position of an element or its content. 64 dy SVG, SVG Attribute The dy attribute indicates a ...
Tutorials
nd italics, line and letter spacing, and drop shadows and other text features. We round off the module by looking at applying custom fonts to your page, and styling lists and links. Common CSS Questions Common questions and answers for beginners. Intermediate level CSS layout At this point we've already looked at CSS fundamentals, how to style text, and how to style and manipulate the
boxes that your content sits inside. Now it's time to look at how to place your
boxes in the right place in relation to the viewport, and one another. We have covered the necessary prerequisites so can now dive deep into CSS layout, looking at different display settings, traditional layout methods involving float and positioning, and new fangled layout tools like flexbox. CSS reference Complete refer...
onunload - XUL
<< XUL Reference home onunload Type: script code Specifies a set of scripts to execute when the browser window is closed by the user. This code is used by some programmers to annoyingly pop up alert
boxes preventing the users from leaving the page. Closing the window calls this eventhandler on the prefwindow. ...