English isn't my first language so I find it hard to learn from MDN.
I think from what i read a specified value is a style that was specified in a style sheet or a style that was inherited from a parent element.
I dont really know what a computed value is
An actual value is the value that is actually used
It can look as if those values are all the same; i.e. specified, computed and actual values all being 1px, and you can't see any differences and you wonder why there are so many phrases to describe the same thing!
So maybe some examples will make it clear.
The specified value is whatever you specify. For instance, if you write p {font-size:2rem; in your stylesheet, then the specified value for p is 2rem, obviously.
Then the browser computes what that is in pixels, which is (at least if 1rem is 16px) 32px. That is the computed value, which is used for display (so it's also the used value, and in most cases also the actual value).
However, there are some circumstances where 32px is not possible. For example if this particular font is a bitmapped font, and a 32px version is not available. If there is only a 30px version, then that is what is actually put on the display as the actual value.
The used value can also differ from the computed value. For example, if you have p {width:600px; max-width:400px;} in your stylesheet, then the computed value will be still be 600px, but the used value (and therefore the actual value) will be 400px.
Hope this helps. If you need more examples, just ask.
Specified value:
Specified values are values which are provided and not generated.
For example
Inheriting from external css file
Inheriting the value of the parent element
Using the initial value of property
Computed Value:
Computed values are the values which are calculated when relative positioning or values are used. For ex width:20% is to be calculated in reference to the parent .
Actual Value:
Ready to be used values are actual values.Absolute values like font:10pt is an actual /absolute value it doesn't depend on other values.
The computed value is the value inherited from another element.
https://developer.mozilla.org/en-US/docs/Web/CSS/computed_value
Related
How to get the sill height (height above the floor) of a Ifcwindow in ifc file
There is no solution to get the height above the floor directly. This is because the height above for depends on several factors, like how the wall is created in which the window resides, etc.
It could be that the sillHeight is exported by the original modelling software to a custom IFC property. You could check for that, but since there is no common standard for it, it's risky.
Your best bet is to look into the ObjectPlacement property which IfcWindow inherits from IfcProduct. The ObjectPlacement defines how a product is placed either in world space or relative to its host. See https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD2/HTML/schema/templates/product-local-placement.htm for details.
You need to read the ObjectPlacement property, and check if there is a RelativeTo property, if so, you need to fill into that property as well, and check if it's the placement of a floor. If so, you can stop the looping, and perform a matrix calculation on all the placements you harvested to calculate the placement of window relative to floor.
(Maybe even more simple: calculate world placement of window and floor separately, than subtract the two vector z values to get the height of window from floor)
All:
Right now, I want to make a table which has spec like:
I. Table has table header and body. Table width is fixed to 800px; height is 500px; Each row is 20px high. 100% width; The header is fixed position, the body can scroll if overflow. The whole table is mapped to an array of objects, each object has a field called "name" and several attrs(all 4 digits number).
II. The first column from left is called "name", rest columns are sub attributes of the object with that name. The number of columns is dynamic depends on the object. All columns have text-flow:ellipsis to crop overlong text
III. The layout rule is(It actually requires very complex rule, but I think if anyone could just help me with the most basic, then I probably can figure out rest myself):
[1]. When show the attributes name. Make the attribute name not be cropped as possible as we can. But must guarantee the "name" column must no smaller than 300px(the name column can be cropped too); If the attribute name has to be cropped, try to make all columns same width;
[2] If no attribute name and name cropped, and there is still space, assign the space to name column.
I am thinking using div and css to build this rather than table tr td(cos I think it could be harder to me to understand and control)
Thanks
I haven't been able to find the answer to this question: Where in the spec or in UA documentation is the default width of a <td> defined?
I've searched the HTML Living Standard, the HTML5 Recommendation, and various other sources.
My understanding (based on usage and observation) is that a table cell will, by default, occupy the full width of the column in which it lives. And the cell cannot be given a different width than the column if other cells exist in the column.
I'm looking for official confirmation of this behavior, preferably in W3C or user agent documentation. But any authoritative reference is acceptable.
The physical/visual width of a table cell is defined not by HTML, but by CSS. The CSS 2.1 specification has an entire section dedicated to table layout that complements HTML's description of tabular data.
Furthermore, CSS itself does not fully define how the width of a cell is calculated. It does with the fixed table layout algorithm:
In the fixed table layout algorithm, the width of each column is determined as follows:
A column element with a value other than 'auto' for the 'width' property sets the width for that column.
Otherwise, a cell in the first row with a value other than 'auto' for the 'width' property determines the width for that column. If the cell spans more than one column, the width is divided over the columns.
Any remaining columns equally divide the remaining horizontal table space (minus borders or cell spacing).
The width of the table is then the greater of the value of the 'width' property for the table element and the sum of the column widths (plus cell spacing or borders). If the table is wider than the columns, the extra space should be distributed over the columns.
but it doesn't give anything beyond a rough guideline for auto table layout, which user agents are free to follow or deviate from (it lists a step-by-step procedure not unlike that of fixed table layout, but that entire list is non-normative). Generally you can expect consistent behavior from UAs in the most common scenarios — as you observe, an auto-sized table cell generally takes up as much space as required by its content, and no more. But dig into edge cases, and you'll find all sorts of crazy.
Here's the W3C standards on calculating the width of table columns. Basically it is left up to the implementing browser/agent.
If an author specifies no width information for a column, a user agent
may not be able to incrementally format the table since it must wait
for the entire column of data to arrive in order to allot an
appropriate width.
If column widths prove to be too narrow for the contents of a
particular table cell, user agents may choose to reflow the table.
Source: http://www.w3.org/TR/html401/struct/tables.html#h-11.2.4.4
Note: this is HTML4 docs.
A table cell's minimum width is 0 or the size of the largest word or image within that cell.
Table Sizing Algorithm
The default sizing algorithm requires two passes through the table data. In the first pass, word wrapping is disabled, and the user agent keeps track of the minimum and maximum width of each cell. The maximum width is given by the widest line. As word wrap has been disabled, paragraphs are treated as long lines unless broken by elements. The minimum width is given by the widest word or image etc. taking into account leading indents and list bullets etc. In other words, if you were to format the cell's content in a window of its own, determine the minimum width you could make the window before things begin to be clipped.
The minimum and maximum cell widths are then used to determine the corresponding minimum and maximum widths for the columns. These in turn, are used to find the minimum and maximum width for the table. Note that cells can contain nested tables, but this doesn't complicate the code significantly. The next step is to assign column widths according to the current window size (more accurately - the width between the left and right margins).
The table borders and intercell margins need to be included in the assignment step. There are three cases:
The minimum table width is equal to or wider than the available space. In this case, assign the minimum widths and allow the user to scroll horizontally. For conversion to braille, it will be necessary to replace the cells by references to notes containing their full content. By convention these appear before the table.
The maximum table width fits within the available space. In this case, set the columns to their maximum widths.
The maximum width of the table is greater than the available space, but the minimum table width is smaller. In this case, find the difference between the available space and the minimum table width, lets call it W. Lets also call D the difference between maximum and minimum width of the table.
For each column, let d be the the difference between maximum and minimum width of that column. Now set the column's width to the minimum width plus d times W over D. This makes columns with lots of text wider than columns with smaller amounts.
This assignment step is then repeated for nested tables. In this case, the width of the enclosing table's cell plays the role of the current window size in the above description. This process is repeated recursively for all nested tables.
If the COLSPEC attribute specifies the column widths explicitly, the user agent can attempt to use these values. If subsequently, one of the cells overflows its column width, the two pass mechanism may be invoked to redraw the table with more appropriate widths. If the attribute specifies relative widths, then the two pass model is always needed.
The column width assignment algorithm is then modified:
Explicit widths from the COLSPEC attribute should be used when given, provided they are greater than the minimum column width, otherwise the latter should be used.
For relative widths, the surplus space W, as defined above, is divided up between the columns appropriately, ensuring that each column is given at least its minimum width. If W is zero or negative, column widths should be increased over the minimum width to meet the relative width requirements.
If the table width is specified with the WIDTH attribute, the user agent attempts to set column widths to match. The WIDTH attribute should be disregarded if this results in columns having less than their minimum widths.
A simple question as i am developing a java application based on dcm4che ...
I want to calculate/find the "position" of a dicom image into its sequence (series). By position i mean to find if this image is first, second etc. in its series. More specifically i would like to calculate/find:
Number of slices into a Sequence
Position of each slice (dicom image) into the Sequence
For the first question i know i can use tag 0020,1002 (however it is not always populated) ... For the second one?
If you are dealing with volumetric image series, best way to order your series is to use the Image Position (Patient) (0020, 0032). This is a required Type 1 tag (should always have value) and it is part of the image plane module. It will contain the X, Y and Z values coordinates representing the upper left corner of the image in mm. If the slices are parallel to each other, only one value should change between the slices.
Please note that the Slice Location (0020, 1041) is an optional (Type 3) element and it may not exist in the DICOM file.
We use the InstanceNumber tag (0x0020, 0x0013) as our first choice for the slice position. If there is no InstanceNumber, or if they are all the same, then we use the SliceLocation tag (0x0020, 0x1041). If neither tag is available, then we give up.
We check the InstanceNumber tag such that the Max(InstanceNumber) - Min(InstanceNumber) + 1 is equal to the number of slices we have in the sequence (just in case some manufacturers start counting at 0 or 1, or even some other number). We check the SliceLocation the same way.
This max - min + 1 is then the number of slices in the sequence (substitute for tag ImagesInAcquisition 0x0020, 0x1002).
Without the ImagesInAcquisition tag, we have no way of knowing in advance how many slices to expect...
I would argue that if the slice location is available, use that. It will be more consistent with the image acquisition. If it is not available, then you'll have to use or compute from the image position (patient) attribute. Part 3 section C.7.6.2.1 has details on these attributes.
The main issue comes when you have a series that is oblique. If you just use the z-value of the image position (patient), it may not change by the slice thickenss/spacing between slices attributes, while the slice location typically will. That can cause confusion to end users.
I've done a bit of a search but couldn't find an answer to this question.
For example:
sampleComponent.explicitMinWidth = 500;
sampleComponent.explicitWidth = 10;
Sets the width of the sampleComponent to 10, even though I've set the minimum width to 500.
The same thing seems to happen with width. In Adobe's documentation, it states that 'measuredMinWidth - Specifies the default minimum height and minimum width of the component, in pixels. Flex cannot set the size of a component smaller than its specified minimum size.'
I've tried setting the measuredMinWidth as well, same result.
Eventually, I tried every combination of minimum width settings I could, but they were all ignored when I set the width (or explicit width).
sampleComponent.measuredMinWidth = 300;
sampleComponent.minWidth = 300;
sampleComponent.explicitMinWidth = 300;
sampleComponent.width = 10;
Additionally, what is the difference between width and explicitWidth, in every case I've tried, they have performed identically (couldn't find any help on this either)
The min/max values are considered only when flex is calculating the size of the component. If you explicitly set values to width/height yourself those values will be ignored.
Which brings us to the issue of explicit: size of a component may be set by either specifying a fixed value, or a percentage. When setting a fixed value (in mxml) for width/height, that value gets saved in explicitWidth, explicitHeight etc, while percentages get stored in percentageWidth, percentageHeight and so on...
More info about this can be read on the adobe livedocs.