Bug 966591 - Part 1: Put very basic hit region interface in + add runtime flag. r=roc

This commit is contained in:
Rik Cabanier 2014-02-21 08:35:14 -05:00
Родитель 9eb3dbf7f6
Коммит 5cad2c4200
4 изменённых файлов: 18 добавлений и 3 удалений

Просмотреть файл

@ -2355,6 +2355,13 @@ CanvasRenderingContext2D::MeasureText(const nsAString& rawText,
return new TextMetrics(width);
}
void CanvasRenderingContext2D::AddHitRegion(const HitRegionOptions& )
{}
void CanvasRenderingContext2D::RemoveHitRegion(const nsAString&)
{}
/**
* Used for nsBidiPresUtils::ProcessText
*/

Просмотреть файл

@ -186,6 +186,9 @@ public:
TextMetrics*
MeasureText(const nsAString& rawText, mozilla::ErrorResult& error);
void AddHitRegion(const HitRegionOptions& options);
void RemoveHitRegion(const nsAString& id);
void DrawImage(const HTMLImageOrCanvasOrVideoElement& image,
double dx, double dy, mozilla::ErrorResult& error)
{

Просмотреть файл

@ -11,8 +11,6 @@
* and create derivative works of this document.
*/
interface HitRegionOptions;
enum CanvasWindingRule { "nonzero", "evenodd" };
dictionary ContextAttributes2D {
@ -20,6 +18,11 @@ dictionary ContextAttributes2D {
boolean willReadFrequently = false;
};
dictionary HitRegionOptions {
DOMString id = "";
Element? control = null;
};
interface CanvasRenderingContext2D {
// back-reference to the canvas. Might be null if we're not
@ -113,7 +116,8 @@ interface CanvasRenderingContext2D {
void drawImage((HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) image, double sx, double sy, double sw, double sh, double dx, double dy, double dw, double dh);
// hit regions
// NOT IMPLEMENTED void addHitRegion(HitRegionOptions options);
[Pref="canvas.hitregions.enabled"] void addHitRegion(optional HitRegionOptions options);
[Pref="canvas.hitregions.enabled"] void removeHitRegion(DOMString id);
// pixel manipulation
[NewObject, Throws]

Просмотреть файл

@ -432,6 +432,7 @@ pref("accessibility.tabfocus_applies_to_xul", true);
// provide ability to turn on support for canvas focus rings
pref("canvas.focusring.enabled", false);
pref("canvas.customfocusring.enabled", false);
pref("canvas.hitregions.enabled", false);
// We want the ability to forcibly disable platform a11y, because
// some non-a11y-related components attempt to bring it up. See bug