Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 # Property APIs | |
| 2 | |
| 3 This directory contains implementations for CSS property APIs, as well as Utils | |
| 4 files containing functions commonly used by the property APIs. | |
| 5 | |
| 6 A CSS property API represents a single CSS property or a group of CSS | |
| 7 properties, and defines the logic for that property or group of properties. | |
| 8 | |
| 9 Examples: | |
| 10 | |
| 11 * A single property API: the `CSSPropertyAPILineHeight` class is used only by | |
| 12 the `line-height` property | |
| 13 * A group of properties that share logic: the `CSSPropertyAPIImage` class | |
| 14 is shared by the `border-image-source` and `list-style-image` properties. | |
| 15 | |
| 16 Status: Eventually, all logic pertaining to a single property should be found on ly | |
|
alancutter (OOO until 2018)
2017/03/13 04:53:01
We should have a timestamp attached to the status
Bugs Nash
2017/03/15 22:37:28
Done.
| |
| 17 within its CSS property API. Currently, the code base is in a transitional state | |
| 18 and property specific logic is still scattered around the code base. See Project | |
| 19 Ribbon | |
| 20 [tracking bug](https://bugs.chromium.org/p/chromium/issues/detail?id=545324) and | |
| 21 [design doc](https://docs.google.com/document/d/1ywjUTmnxF5FXlpUTuLpint0w4TdSsjJ zdWJqmhNzlss/edit#heading=h.1ckibme4i78b) | |
| 22 for details of progress. | |
| 23 | |
| 24 ## How to add a new property API | |
|
alancutter (OOO until 2018)
2017/03/13 04:53:01
Is there an example CL we can link to that follows
Bugs Nash
2017/03/15 22:37:28
Hm. All the CLs we've written are to create APIs f
alancutter (OOO until 2018)
2017/03/15 23:44:33
Yes, I think a concrete CL showing places in the c
| |
| 25 | |
| 26 1. Add a .cpp file to this directory named | |
| 27 `CSSPropertyAPI<Property/GroupName>.cpp` | |
| 28 2. Implement the property API in the .cpp file | |
| 29 1. Add `#include "core/css/properties/CSSPropertyAPI<Property/GroupName>.h" ` | |
| 30 (this will be a generated file) | |
| 31 2. Implement the required methods on the API, e.g. `parseSingleValue` | |
| 32 3. If logic is required by multiple property APIs you may need to create a new | |
| 33 Utils file. | |
| 34 4. Add new property to `core/css/CSSProperties.json5` (see | |
| 35 [CSSProperties.json5](https://cs.chromium.org/chromium/src/third_party/WebKi t/Source/core/css/CSSProperties.json5) | |
| 36 for details) | |
|
alancutter (OOO until 2018)
2017/03/13 04:53:01
This doc ought to mention the api_class flag as a
Bugs Nash
2017/03/15 22:37:28
I have added a mention that api_class and api_meth
| |
| 37 5. Add new files to BUILD files | |
| 38 1. Add the new .cpp file to | |
| 39 [core/css/BUILD.gn](https://codesearch.chromium.org/chromium/src/third_p arty/WebKit/Source/core/css/BUILD.gn) | |
| 40 in the `blink_core_sources` target's `sources` parameter | |
| 41 2. Add the generated .h file to | |
| 42 [core/BUILD.gn](https://codesearch.chromium.org/chromium/src/third_party /WebKit/Source/core/BUILD.gn) | |
| 43 in the `css_properties` target's `outputs` parameter | |
| OLD | NEW |